You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: news/posts/2025-09-01-GSoC-Report-DoodleBUGS/index.qmd
+52-29Lines changed: 52 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
---
2
2
title: "GSoC Report for DoodleBUGS: a Browser-Based Graphical Interface for Drawing Probabilistic Graphical Models"
3
3
description: "Shravan Goswami's GSoC 2025 final report: goals, architecture, progress vs proposal, and how to try it."
4
+
toc: true
4
5
categories:
5
6
- GSoC
6
7
- Blog
@@ -9,7 +10,7 @@ author:
9
10
url: https://shravangoswami.com/
10
11
date: 2025-09-01
11
12
aliases:
12
-
- /GSoC-2025-Report-DoodleBUGS # submitted this to GSoC
13
+
- /GSoC-2025-Report-DoodleBUGS # submitted this to GSoC so please remember to update incase moving this page somewhere else
13
14
bibliography: references.bib
14
15
csl: university-of-york-ieee.csl
15
16
link-citations: true
@@ -19,15 +20,14 @@ nocite: |
19
20
20
21
## TL;DR
21
22
22
-
-DoodleBUGS is a browser-based graphical editor for Bayesian models that utilize JuliaBUGS for BUGS model compilation and connect to Julia inference backends (e.g., AdvancedHMC via AbstractMCMC).
23
+
-BUGS (Bayesian Inference Using Gibbs Sampling) is a probabilistic programming language for Bayesian models, and JuliaBUGS is its modern implementation in Julia. DoodleBUGS is a browser-based graphical interface for JuliaBUGS, allowing users to draw probabilistic graphical models and generate BUGS code.
23
24
- Implemented: visual editor (nodes, edges, nested plates), legacy BUGS code generation that compiles with [JuliaBUGS](https://github.com/TuringLang/JuliaBUGS.jl)[@JuliaBUGS; @bugs-book], local execution via a Julia backend, unified standalone script generation (frontend), timeouts, multiple layouts, and extensive cleanup/typing.
24
25
- Changed from proposal: frontend implemented in Vue 3 (instead of React); backend simplified (frontend is the single source of truth for standalone scripts).
25
-
- Status: Working application. Live demo (static UI) available; for running inference locally, use the backend server.
26
+
- Status: Working application. Try it here (static UI): [https://turinglang.org/JuliaBUGS.jl/DoodleBUGS/](https://turinglang.org/JuliaBUGS.jl/DoodleBUGS/). For local inference, run the backend server.
[JuliaBUGS](https://github.com/TuringLang/JuliaBUGS.jl) is a modern Julia implementation of the BUGS language [@bugs-rjournal; @bugs-book; @bugs-project]. DoodleBUGS revives the original visual modeling concept with a modern stack so users can:
62
+
[JuliaBUGS](https://github.com/TuringLang/JuliaBUGS.jl) is a modern Julia implementation of the BUGS language [@bugs-rjournal; @bugs-book; @bugs-project]. DoodleBUGS revives the original visual modelling concept with a modern browser-based stack so users can:
- Frontend POSTs to `/api/run` with body: `model_code` (BUGS), `data` and `inits` (JSON), `data_string` and `inits_string` (Julia NamedTuple literals), and `settings``{ n_samples, n_adapts, n_chains, seed, timeout_s }`. If `/api/run` returns 404, it falls back to `/api/run_model`.
80
+
- Backend creates a temp dir, writes `model.bugs` and `payload.json`, generates an ephemeral `run_script.jl`, compiles with `JuliaBUGS.@bugs`, wraps with `ADgradient(:ReverseDiff)`, and samples via `AdvancedHMC.NUTS` through `AbstractMCMC` (Threads or Serial). It writes summaries (incl. ESS, R-hat) and quantiles to JSON and returns `{ success, summary, quantiles, logs, files[] }`, where `files` includes `model.bugs`, `payload.json`, `run_script.jl`, and `results.json`.
81
+
- Frontend also generates a `standalone.jl` script locally (mirrors backend execution) and shows it alongside the backend files; the backend does not attach a standalone script.
82
82
- Timeouts/resilience
83
83
- Configurable timeout (frontend); enforced in backend worker
84
84
- Safe temp directory cleanup on Windows with retries
85
85
- Cleanup/typing
86
-
- TypeScript fixes in `DoodleBUGS/src/components/right-sidebar/ExecutionPanel.vue`
86
+
-Strong, project-wide TypeScript typing across stores, components, and composables
87
87
- Removal of unused backend code; consistent naming and logs
- Mature ecosystem and performance characteristics for medium-sized graphs
139
139
-[Vue 3](https://vuejs.org/) (vs React) for this project:
140
140
- Composition API made integrating an imperative graph library (Cytoscape) straightforward via composables and lifecycle hooks
@@ -146,17 +146,23 @@ The proposal planned React; we chose Vue 3 after evaluating the graph layer and
146
146
147
147
## Comparison to Legacy DoodleBUGS
148
148
149
-
The legacy tool was a desktop application driving WinBUGS [@winbugs]; the new DoodleBUGS is a browser-based editor targeting JuliaBUGS [@JuliaBUGS]. Key differences:
149
+
The legacy tool was a windows desktop application driving WinBUGS [@winbugs]; the new DoodleBUGS is a browser-based editor targeting JuliaBUGS [@JuliaBUGS].
150
+
151
+

152
+
153
+

154
+
155
+
Key differences:
150
156
151
157
- Platform and backend
152
158
- Legacy: Desktop UI, WinBUGS execution pipeline
153
159
- New: Web UI, Julia backend via `JuliaBUGS.@bugs`, sampling with `AdvancedHMC.NUTS` through `AbstractMCMC`
154
160
- Graph engine and plates
155
161
- Legacy: Bespoke graph handling with limited nesting semantics
156
-
- New: [Cytoscape.js](https://js.cytoscape.org/) with compound nodes for robust nested plates; custom DnD for drag-in/out and creating inside plates
162
+
- New: [Cytoscape.js](https://js.cytoscape.org/) with compound nodes for robust nested plates; custom drag-and-drop for drag-in/out and creating inside plates
157
163
- Layouts and interactions
158
164
- Legacy: Limited auto-layout support
159
-
- New: Multiple layout engines (Cola, Klay) and stable interactions; positions updated after `layoutstop`[@webcola; @elk]
165
+
- New: Multiple layout engines (Dagre, fCoSE, Cola, KLay) and stable interactions; positions updated after `layoutstop`[@webcola; @elk]
160
166
- Code generation
161
167
- Legacy: Export to BUGS without strong ordering guarantees
162
168
- New: Deterministic topological + plate-aware traversal; parameter canonicalization and safe index expansion
@@ -169,21 +175,21 @@ The legacy tool was a desktop application driving WinBUGS [@winbugs]; the new Do
169
175
## Progress vs Proposal
170
176
171
177
- Implemented
172
-
- Visual editor with nested plates and robust DnD
178
+
- Visual editor with nested plates and robust drag-and-drop
173
179
- BUGS code generator (topological + plate-aware)
174
180
- Local execution + summaries/quantiles
175
181
- Unified standalone script generation (frontend)
176
182
- Timeouts/resilience
177
183
- Multiple layouts and interactions
178
184
- Extensive cleanup/typing
179
185
- Execution timeout (end-to-end)
180
-
- Layout options (Dagre (Hierarchical), fCoSE (Force-Directed), Cola (Physics Simulation), KLay (Layered)) and interactions
186
+
- Layout options (Dagre (default, layered), fCoSE (force-directed), Cola (physics simulation), KLay (layered)) and interactions
181
187
- Cleanup and stronger typing
182
188
- Changed
183
189
- Vue 3 instead of React
184
190
- Backend responses smaller; no standalone script attachment
- Diagnostics/visualization: integrate with MCMCChains.jl for plots (trace, density, PPC, diagnostics). ESS and R-hat already available in summary stats.
233
240
- UX: richer node templates, validation, distribution hints
234
-
-Persistence/sharing: save/load and shareable links
0 commit comments