Skip to content

docs(geant4): document parallel multi-worker Geant4 Wasm execution - #118

Draft
DariuszRozmus wants to merge 1 commit into
mainfrom
2526-geant4-multiworker-simulation
Draft

DariuszRozmus wants to merge 1 commit into
mainfrom
2526-geant4-multiworker-simulation

Conversation

@DariuszRozmus

Copy link
Copy Markdown

Summary

Updates developer documentation in for_developers to reflect parallel multi-worker execution for in-browser Geant4 WebAssembly simulations (companion to yaptide/ui#2526, branch 2526-geant4-multiworker-simulation).

Changes

  • src/content/docs/frontend/geant4-wasm.md:
    • Updated architecture diagram to show macro partitioning, parallel Geant4 Wasm workers, and scorer result merging.
    • Documented worker count determination (determineWorkerCount, navigator.hardwareConcurrency - 1, capped by MAX_LOCAL_GEANT4_WORKERS = 3), primary particle splitting (distributePrimaries), and unique cryptographic RNG seeding (/random/setSeeds via prepareWorkerMacro).
    • Documented Partial (Lazy) vs Full dataset loading trade-offs under the Shared-Nothing Web Worker memory model.
    • Updated progress reporting & state aggregation (getJobTasksStatus, getJobCombinedState, getJobStartTime / getJobEndTime, taskTotals()).
    • Documented cell-by-cell scorer merging (mergeGeant4ResultFiles) before Geant4ResultsFileParser normalization and worker termination (markSafeForTermination).
    • Updated Limitations and Troubleshooting to explain the per-worker -s TOTAL_MEMORY=512MB memory constraint (RangeError: Array buffer allocation failed), the additive-scorer merging assumption, and scaling paths (INITIAL_MEMORY + ALLOW_MEMORY_GROWTH or Emscripten pthreads).
  • src/content/docs/frontend/simulation-services.md:
    • Updated the Local Simulation Service (Geant4 Wasm) flow diagram and Progress Tracking section for multi-worker execution and jobTasksStatus aggregation via taskTotals().
  • src/content/docs/architecture/data-flow.md:
    • Updated Step 3c: Local Execution (Geant4 Wasm) to describe parallel worker partitioning, RNG seeding, and result merging.

Notes

  • Intended to be merged alongside or after the corresponding yaptide/ui PR for #2526.

This branch was previously deployed

1 inactive deployment
github-pages — e9edf815 Deployed Dec 2, 2026 by DariuszRozmus via deploy #276
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant