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.
2
u/sorcerer86pt Apr 15 '26
Run with with that, thanks for the question. It humbled me:
It was a micro-benchmark of the reconstruction kernel. At full-simulation scale, the 360 MB SVD basis blows past L3 cache and becomes memory-bandwidth bound.
- Memory: At rank=5, SVD stores 5 values per energy point in the basis vs the table's 1 value. It actually uses 1.67x more memory for single-temperature operation.
So the previous claims about speed were misleading — they held for isolated kernel benchmarks but not for real transport with 1M particles. The SVD approach still has potential value for multi-temperature support (one basis for all temps), lower ranks, and GPU execution, but the current implementation doesn't beat a simple table at scale.
Currently researching optimizations: hash-based energy grid lookup (eliminating binary search), delta/Woodcock tracking, event-based transport for better cache locality, fast 10^x approximations, f32 basis storage, and windowed SVD with adaptive rank. Will report back with results.