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
engine: integer leakage is ignored on an exponential-leak conveyor #942
On a conveyor with exponential_leak="true", a leak flow marked <leak_integers/> still leaks fractional amounts.
The exponential branch of ConveyorState::leak_step returns before the whole-unit rounding that the linear branch applies, so the flag is silently ignored.
The wasm backend copies this behavior on purpose, to match the VM.
Example
An exponential-leak conveyor carrying people, with a leak flow marked <leak_integers/> and fraction 0.1/time unit, reports a leak rate like 0.37 people per DT instead of whole people.
No error or warning is produced.
Why it matters
Integer leakage exists for belts of discrete entities, where a fractional leak is simply wrong.
Constructed: no model we have combines the two (none of the test/conveyors/ files uses <leak_integers/>).
The XMILE spec (section 3.7.2) does not restrict integer leakage to the linear model; what Stella does is unverified.
Fix
Reject the combination with a clear compile error in conveyor_compile::expand_conveyors, and scope docs/design/conveyors.md §5.4 to linear leakage.
Then update the comments in wasmgen/belt.rs and src/simlin-engine/CLAUDE.md that describe the wasm side as mirroring the VM's silent drop.
Alternative: define and implement integer rounding for exponential leaks in both backends, plus a parity test.
That needs answers the spec does not give (round before or after the overdrain scale-down; how whole-unit removal fits the rule that overlapping exponential rates add), so it is only worth doing if a real model needs it.
changed the title [-]engine: <leak_integers/> is silently ignored on an exponential-leak conveyor[/-][+]engine: integer leakage is ignored on an exponential-leak conveyor[/+]on Oct 12, 2026
Activity
engine: lower the full conveyor pass to wasm and gate it on corpus pa…
engine: lower the full conveyor pass to wasm and gate it on corpus pa…
[-]engine: <leak_integers/> is silently ignored on an exponential-leak conveyor[/-][+]engine: integer leakage is ignored on an exponential-leak conveyor[/+]