Optional session seed, chosen at the boundary, for across-session variation #7

Closed
opened 2026-08-18 01:34:39 +00:00 by bcox · 0 comments
Owner

Every load of a patch currently produces identical randoms, because the voice
seeds are a pure function of the voice index. A chord sounds the same today as
it will next week.

That is deliberate and load-bearing, not an oversight. .bazelrc forbids FMA
contraction and fast-math reassociation specifically so a float reference stays
a usable oracle for the fixed-point implementation, and tests assert on
concrete rendered values. A nondeterministic source would make that strategy
impossible — you could assert statistics, not behaviour.

If across-session variation is ever wanted

The architecturally right shape is a single seed chosen at instrument
construction
, on the host side, outside dsp/, and injectable so tests can
pin it to a constant. Voices would derive from it exactly as they derive from
the index today.

Entropy at the boundary, determinism everywhere inside. That keeps dsp/
translatable — no clock reads, no OS calls on the synthesis path — and leaves
every existing test meaningful, because the test harness supplies a fixed seed.

Explicitly not this

Hardware entropy on the synthesis path — ring-oscillator TRNGs on the FPGA,
rdtsc on the CPU — is a separate issue and was rejected.

Nobody has asked for this. Filed so the shape is recorded rather than
re-derived.

Every load of a patch currently produces identical randoms, because the voice seeds are a pure function of the voice index. A chord sounds the same today as it will next week. That is deliberate and load-bearing, not an oversight. `.bazelrc` forbids FMA contraction and fast-math reassociation specifically so a float reference stays a usable oracle for the fixed-point implementation, and tests assert on concrete rendered values. A nondeterministic source would make that strategy impossible — you could assert statistics, not behaviour. ## If across-session variation is ever wanted The architecturally right shape is a **single seed chosen at instrument construction**, on the host side, outside `dsp/`, and injectable so tests can pin it to a constant. Voices would derive from it exactly as they derive from the index today. Entropy at the boundary, determinism everywhere inside. That keeps `dsp/` translatable — no clock reads, no OS calls on the synthesis path — and leaves every existing test meaningful, because the test harness supplies a fixed seed. ## Explicitly not this Hardware entropy on the synthesis path — ring-oscillator TRNGs on the FPGA, `rdtsc` on the CPU — is a separate issue and was rejected. Nobody has asked for this. Filed so the shape is recorded rather than re-derived.
bcox closed this issue 2026-08-28 18:48:23 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bcox/tymbal#7
No description provided.