Feature egspp xoshiro256pp - #1433
Open
mainegra wants to merge 1 commit into
Open
Conversation
Implements the Blackman & Vigna xoshiro256++ generator (2019) as EGS_Xoshiro256pp, a new concrete EGS_RandomGenerator subclass. - Period 2^256-1; parallel streams separated by 2^128 states via jump(), giving provably non-overlapping sequences for parallel jobs - fillArray() produces 53-bit doubles (tau_max = 53*ln2 ~ 36.7 mfp), compared to 24-bit (16.6 mfp) and 48-bit (33.3 mfp) for ranmar - getUInt64() exposes the raw 64-bit integer output; callers can compute free paths as -log((double)r) + 64*log(2) for tau_max ~ 44.4 mfp - Seeds expanded from two ints to 256-bit state via SplitMix64 - Full state serialization (storePrivateState/setPrivateState) wires into the existing .egsdat checkpoint/resume and parallel job combining paths - Activated via 'type = xoshiro256++' in the rng definition input block Motivated by deep-penetration artifacts in egs_kerma buildup factor calculations traced to the 48-bit resolution limit of high-res ranmar. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mainegra
requested review from
ftessier and
rtownson
and removed request for
a team
July 10, 2026 18:19
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
● Add xoshiro256++ RNG to egs++ library
Summary
Generator properties
jump()skips 2¹²⁸ states per sequence step — provably non-overlappingfillArray(): 53-bit doubles, τ_max ≈ 36.7 mfpgetUInt64(): raw 64-bit integer, τ_max ≈ 44.4 mfpstorePrivateState/setPrivateState—.egsdatcompatibleThe
getUInt64()method is intended for free-path sampling: the caller computesdpmfp = -log((double)(uint64_t)r) + 64·ln2. User codes whose RNG does not supportthis method receive the base-class return value of 0 and can fall back to the standard
-log(1 − U)path.Motivation
The high-resolution RANMAR (48-bit, τ_max ≈ 33.3 mfp) produces an artifact in
deep-penetration calculations: photon interaction sites are capped at τ_max, potentially creating a non-physical drop in depth-dose and buildup-factor curves. xoshiro256++ extends the reliable range and provides a
higher-quality generator with better-characterised parallel-stream properties than
RANMAR's seed-increment approach.
Usage: Place the following block in the input file
Test plan
type = xoshiro256++accepted in input without errordefaultRNG()untouched).egsdatstate round-trip (store → restore → identical subsequent output)