You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
audio_noise draws rand() seeded by srand(time(NULL)) and is not taped, so EIGS_REPLAY re-draws different samples #1803
Found by the #1758 R1.1 round-2 blind critic (PR #1776), 2026-10-15. Pre-existing on main: measured on 0740af0; the code is unchanged on e48c4a0.
audio_noise draws its samples from libc rand() (src/ext_gfx.c:2084), which main seeds with srand(time(NULL)) (src/main.c:279 and 340). The builtin has no TRACE_NONDET_* wrapper, so the tape records nothing for it, and EIGS_REPLAY re-draws live samples from a clock seed. This breaks docs/PRINCIPLES.md 3 ("every source of nondeterminism is either recorded on the tape or visible in the source; no capability bypasses the tape"). seed_random cannot pin it either, because it seeds the drand48 stream, not rand(). #960 moved random_normal off rand() for exactly this reason.
A test records the program above, then replays it twice across a one-second boundary, and requires all three outputs to be byte-identical. It fails on the current code.
grep -n '\brand()' src/*.c lists no hosted-build caller (src/freestanding excepted).
Activity
replay_diff: the ledger carries reasons; ledger test_audio.eigs (#1803)…
tests: AN10, a refused audio_noise duration consumes no tape record (#…