A WebGPU port of Geant4-DNA — the CNRS/IN2P3-coordinated Monte Carlo track-structure toolkit for radiobiology. One GPU thread per primary electron, the full particle history in a single fused compute dispatch, Karamitros 2011 IRT chemistry in a worker, and SSB / DSB damage scoring on a 21×21 B-DNA fiber grid. No server, no install, no download.
dom.webgpu.enabled. Full matrix: caniuse.com/webgpu. A discrete or Apple-silicon GPU is recommended at N ≥ 4096 primaries.
Same physics, radically different access. The table below is the before / after — traditional Geant4-DNA the way medical physicists and radiobiology labs have run it for two decades, vs. this WebGPU port.
| Traditional Geant4-DNA | WebGPU-DNA (this project) | |
|---|---|---|
| Install | 50+ GB toolkit · 2–4 hr C++ compile · CMake, ROOT, Xerces, GDML dependencies · data files from CERN | None. Open a URL. 94 KB of JavaScript, 1.3 MB of cross-section data, served over CDN. |
| Hardware | Linux workstation or HPC cluster · typically 16–64 CPU cores to be usable | Any laptop or phone with a WebGPU-capable browser. Tested down to Apple M1 and Intel integrated graphics. |
| Time to first result | Hours of setup, then minutes to hours per 10 keV run depending on primaries & core count | ~10 seconds from page load to full 8-energy validation sweep at 4096 primaries. |
| Physics fidelity @ 10 keV | Reference (by construction) | CSDA 0.985× · energy conservation 100.0% · ions/primary exact match · chemistry within textbook tolerances Verified side-by-side against a Geant4 11.4 dnaphysics ntuple |
| Reproducibility | Depends on your Geant4 build, compiler, OS, library versions, random seed — "works on my cluster" is a real problem | Same URL, same bundle hash, same WGSL shader — same numbers everywhere |
| Access cost | Institutional cluster time, or a workstation admin who lets you install Geant4 | $0. No account, no sign-in, no API key, no rate limit. |
| Who can use it | Graduate students and staff in labs with the infrastructure — effectively gate-kept behind institutional access | Anyone — med students, high-schoolers, independent researchers, developers curious about WebGPU. |
| Intended scope | Production radiation-therapy planning, space-mission dosimetry, published radiobiology research | Education, rapid prototyping, teaching, method exploration. Not a replacement for clinical Geant4-DNA. |
Bottom line: a faithful-enough version of the tool that used to require a PhD and a compute cluster, now one click away from anyone.
Data-driven cross sections from G4EMLOW, the full 9-reaction IRT chemistry table from Karamitros 2011, and event-level DNA damage scoring — all ported from Geant4 source and validated against a direct dnaphysics ntuple.
Born ionization across 5 shells with paired CDF / E-transfer tables (binary search, 58 energies × 100 breakpoints), Emfietzoglou excitation with level-dependent dissociative branching, Champion tabulated elastic below 200 eV, Sanche 9-mode vibrational.
Full 9-reaction Independent Reaction Times table from G4EmDNAChemistry_option1. Runs in a dedicated Web Worker so the main thread stays responsive. Includes pre-chemistry: 2.0 nm mother displacement, species-specific product displacement, e⁻aq thermalization at 1.7 eV.
Direct SSB from rad_buf ionization sites (nm-scale spatial correlation), indirect SSB from diffused OH at 1 μs, greedy ±10 bp DSB clustering. A kernel-level backbone hit counter cross-checks the JS post-processing — kernel_hits == reach_dir, exactly.
The core trick: invert Geant4's sequential tracking loop. Phase A dispatches one GPU thread per primary and runs the full particle history in a WGSL loop — no per-step dispatch overhead. Phase B wavefront-steps secondaries. Phase C is 133 chemistry ticks × 4 dispatches (diffuse → hash → react). Everything writes to a shared 128³ atomic voxel grid and a 16M × 16 B radical buffer.
That “one dispatch, full history” shape is the same single-kernel fusion pattern that has given 3–4 orders of magnitude of speedup on other GPU workloads dominated by launch overhead — here it is what makes the entire electron history cheap enough to run live in a browser tab.
Full pipeline diagram, buffer sizing, and WGSL constraints are in ARCHITECTURE.md. Physics provenance and known gaps are in CLAUDE.md.
Runs the full 8-energy ESTAR sweep. Chemistry + DNA damage scoring fire at 10 keV. 4096 primaries takes about 6–10 seconds on an M-series laptop GPU.
dom.webgpu.enabled in Firefox.| Energy | Therm | Esc | CSDA Total (nm) | ESTAR CSDA | Ratio | Prod (nm) | dE/dx (eV/nm) | ESTAR SP | Ratio | Ions/pri | Sec/pri | E cons | G(OH) | G(e⁻aq) | G(H) | SSB dir | SSB ind | DSB | DSB/Gy/Gbp | Total ms |
|---|