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: a conveyor step error leaves the VM half-advanced #938
When the conveyor step pass fails partway, the VM is left half-advanced. run_phase_a checks each belt's slat-count bound just before advancing that belt, so if belt i fails with ConveyorTransitTooLong, belts 0..i have already moved their slats and written their outflow and leak rates into the current-step buffer. Vm::run_to then returns the error without undoing anything, and its comment ("so the Vm stays reusable") suggests otherwise.
Example
Two conveyors whose <sample>-latched transit times are re-read mid-run; the second grows past the slat-count bound. run_to returns ConveyorTransitTooLong.
Calling run_to again (for example after set_value lowers the transit time) re-runs the same step, and the first belt advances a second time. get_value after the error also reads the half-written driven-flow rates.
Why it matters
Narrow: it needs a host that keeps using the VM after this error, and a transit time large enough to hit the bound.
Constructed, not seen in a real model.
The wasm backend already avoids it: its runtime error stays set until reset.
Fix
Make the VM refuse to continue after a step-pass error until it is reset, the same as wasm.
One flag, and it also covers any future pass that cannot be checked up front.
Alternative: check every belt's bound before advancing any (the check depends only on the transit time and DT), making the pass all-or-nothing.
Either way, fix the misleading comment.
Test with the test-only SlatBoundGuard override and a tiny two-belt model, not a model big enough to trip the real bound.
changed the title [-]conveyor-engine: a mid-pass ConveyorTransitTooLong leaves belts 0..i already phase_a-advanced; run_to restores nothing[/-][+]engine: a conveyor step error leaves the VM half-advanced[/+]on Oct 12, 2026
Activity
engine: give the wasm blob a runtime error channel
engine: give the wasm blob a runtime error channel
[-]conveyor-engine: a mid-pass ConveyorTransitTooLong leaves belts 0..i already phase_a-advanced; run_to restores nothing[/-][+]engine: a conveyor step error leaves the VM half-advanced[/+]