Skip to content

fix(runtime): one deterministic PRNG sequence per seed across native JIT, native AOT and the VM (SW-113) - #554

Open
tsotchke wants to merge 3 commits into
masterfrom
fix/issue-553-rng-seed-parity
Open

fix(runtime): one deterministic PRNG sequence per seed across native JIT, native AOT and the VM (SW-113)#554
tsotchke wants to merge 3 commits into
masterfrom
fix/issue-553-rng-seed-parity

Conversation

@tsotchke

Copy link
Copy Markdown
Owner

Fixes #553. Native code emitted libc drand48/srand48 while the JIT and runtime used the Eshkol wrappers, and an explicit srand48 did not suppress time-based reseeding, so a fixed seed produced different sequences under AOT and JIT. All three engines now share the canonical runtime PRNG; the VM gains random, srand48, set-random-seed! and tensor rand. Cross-engine tests pin the first eight outputs per seed, reseeding, negative and low-32-bit seeds, and the reported reproducer. Documentation and the VM parity manifest updated; ledger SW-113 closed.

@tsotchke
tsotchke enabled auto-merge (squash) August 29, 2026 01:31
@tsotchke
tsotchke force-pushed the fix/issue-553-rng-seed-parity branch 3 times, most recently from b6f2853 to 50c916b Compare August 30, 2026 03:13
…JIT, native AOT and the VM (SW-113)

Fixes #553. Native code emitted libc drand48/srand48 while the JIT and runtime used the Eshkol wrappers, and an explicit srand48 did not suppress time-based reseeding, so a fixed seed produced different sequences under AOT and JIT. All three engines now share the canonical runtime PRNG; the VM gains random, srand48, set-random-seed! and tensor rand. Cross-engine tests pin the first eight outputs per seed, reseeding, negative and low-32-bit seeds, and the reported reproducer. Documentation and the VM parity manifest updated; ledger SW-113 closed.
@tsotchke
tsotchke force-pushed the fix/issue-553-rng-seed-parity branch from 7a0054e to a35d822 Compare August 30, 2026 09:01
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.

[v1.3.4-evolve] fixed seed produces different AOT and JIT random sequences

1 participant