Repository navigation
Description
Any equation that reads a conveyor's outflow or leak flow is refused with ConveyorDrivenFlowRead.
That blocks a real Stella model.
It should simulate, giving the same value Stella does.
Example
test/conveyors/covid19_severity.stmx (vendored from the peterhovmand COVID-19 models, written by isee/Ventana staff) has
death rate = SUM(contagious_deaths[*]) + SUM(non_contagious_deaths[*])
+ SUM(tested_contagious_deaths[*]) + SUM(tested_non_contagious_deaths[*])
where all four are leak flows off conveyors.
Compiling it fails:
variable 'death rate' references conveyor-driven flow 'contagious_deaths'; a conveyor
outflow/leak cannot be read by another equation (it is computed after the flows phase)
Why it matters
Summing a belt's leak flows to report a rate is an ordinary Stella idiom, not a corner case.
The refusal is correct for today's evaluation order: the conveyor pass runs after the flows phase and before the stocks phase, so an auxiliary computed in the flows phase would read 0 for the flow.
Refusing is better than that wrong number, but it leaves the model unsimulatable on every backend.
Fix
Evaluate auxiliaries that read a conveyor-driven flow after the conveyor pass, before stocks are integrated.
The dependency graph has to split auxiliaries into before-pass and after-pass sets and refuse a cycle that crosses the split (an after-pass value feeding something the pass reads).
This also covers PREVIOUS(driven_flow), item 2 of #865.
Validate against a trajectory not produced by the engine itself: Stella output for covid19_severity.stmx, or a small hand-worked model of the same idiom.
The model also has unrelated unit errors.
Pointers
src/simlin-engine/src/conveyor_compile.rs: the refusal,find_driven_flow_readsrc/simlin-engine/src/queue_compile.rs:compile_sim, shared by VM and wasmcovid_leak_fixture_is_blocked_by_the_driven_flow_read_ruleinsrc/simlin-engine/src/wasmgen/belt_tests.rs, and the blocked list intests/integration/simulate.rs, pin the refusal and will fail when it is fixed- engine: a conveyor leak fraction given as a graphical function is ignored #865 item 2
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: a direct read of a conveyor-driven leak flow is rejected, blocking a real Stella model (covid19_severity.stmx)[/-][+]engine: reading a conveyor's leak or outflow in an equation is refused[/+]