Skip to content

Make zero-seed Sobol sequences reproducible - #2733

Open
AIM-IT4 wants to merge 1 commit into
lballabio:masterfrom
AIM-IT4:codex/fix-burley-sobol-reproducibility
Open

Make zero-seed Sobol sequences reproducible#2733
AIM-IT4 wants to merge 1 commit into
lballabio:masterfrom
AIM-IT4:codex/fix-burley-sobol-reproducibility

Conversation

@AIM-IT4

@AIM-IT4 AIM-IT4 commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make a zero Sobol seed deterministic when high-dimensional direction integers must be generated
  • preserve the existing sequence for every nonzero seed
  • add a regression for the reported Burley 2020 dimension-33 case

Fixes #2732.

Root cause

Jaeckel direction integers are tabulated through dimension 32. Starting at dimension 33, SobolRsg initializes the remaining direction integers with MersenneTwisterUniformRng(seed). That constructor treats 0 as a request for a clock-based random seed, so otherwise identical Burley2020SobolRsg instances diverged only after crossing the tabulated boundary.

For the zero case only, the fallback now uses the Mersenne Twister seed-array constructor with an explicit zero. Nonzero seeds continue through the existing constructor, so their streams are unchanged.

Validation

  • before the production change, the regression failed at coordinate 33 (4269245144 != 482177224)
  • focused regression: passed (1/1 test case, 2/2 assertions)
  • complete LowDiscrepancyTests suite: passed (21/21 test cases, 31/31 assertions)
  • complete QuantLib test suite: passed (1,441/1,441 test cases, 13,366/13,366 assertions; 11m16s)
  • git diff --check: passed

@AIM-IT4
AIM-IT4 marked this pull request as ready for review August 16, 2026 11:45
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 75.288% (+0.001%) from 75.287% — AIM-IT4:codex/fix-burley-sobol-reproducibility into lballabio:master

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.

Sobol' not always reproducible

2 participants