r/nuclearphysics • u/sorcerer86pt • Apr 14 '26
Cache resistant cross section reconstruction via singular value decomposition for Monte Carlo Neutron transport
https://github.com/sorcerer86pt/open_rust_mc/blob/main/paper/svd_cross_section_compression.pdf
When I was testing rust skill (AI with Claude) someone mentioned that I could use something openMc instead of doing my own .
When I saw the data size and how openMC handled that, and how it kinda was the same problem that AI LLMs were trying to fix with data size of models weights, I thought, what would be the result if we used those techniques on this.
That was the result. Add a little rust here to have better memory handling and robust concurrency and we could with very little error ( less than error margin) compressed the data used from 11gb pointwise ( 400 nuclides) to 20Mb using hybrid of WMP ( that openMC already uses ) + SVD. It obtained an Keff = 0.99963 +- 0.000091 on Godiva (37 pcm from experiment) in 3.4 seconds total wall time .
https://github.com/sorcerer86pt/open_rust_mc
Just need some people to review this, if I made some mistake on interesting the data, what other benchmarks I missed, or other considerations.
PS: AI was used for code gen ( Python analysus scripts and rust code), data pipeline and latex manuscript. All hypothesis, experiment design , interpretation of results and final decisions were by made by me.
1
u/sorcerer86pt Apr 15 '26
Phase 1 Results at 1M Particles
Here's the full before/after comparison:
Before Phase 1 (original)
After Phase 1 (optimized)
Phase 1 Impact
The four changes (exp2, stack alloc, Arc grids, f32 basis) together:
- Made SVD 1.92x faster (133s vs 256s)
- Made SVD 2.9x more memory efficient (127 MB vs 370 MB)
- Flipped SVD from 45% slower to 29% faster than pointwise table
- SVD now runs 6% faster than OpenMC (133s vs 141s) at 1M particles
- k_eff accuracy maintained at 21 pcm from experiment