Skip to content

engine: a conveyor leak fraction given as a graphical function is ignored #865

Open

Description

@bpowers

A conveyor leak flow whose fraction is a graphical function (the flow has a <gf> and its <eqn> is the lookup input) simulates with the wrong fraction and no warning.
Conveyor expansion copies the flow's equation into a hidden fraction variable but not its graphical function, so the leak fraction becomes the raw lookup input instead of the table's output.
A per-element <gf> on an arrayed leak flow is carried over; only a whole-variable <gf> is lost.

Example

A leak flow with <leak/>, <eqn>TIME</eqn>, and a <gf> mapping 0..10 to 0..0.1: at TIME = 5 the leak fraction used is 5 (clamped to 1 on a linear-leak conveyor, so the whole zone drains), not the table's 0.05.

Why it matters

Silent wrong numbers.
Stella lets any flow be a graphical function, so this is a plausible way to write a time- or state-dependent leak fraction, but we have not seen it in a real model.

Fix

In leak_fraction_equation's flow-equation case, copy the flow's gf onto the synthesized fraction aux; this is a few lines plus a test.
When an explicit <leak>expr</leak> fraction is present the flow's <gf> does not apply to it; reject that combination rather than guess.

Related

Pointers

  • src/simlin-engine/src/conveyor_compile.rs: leak_fraction_equation, make_aux_eqn, and the driven-flow pass that sets f.gf = None

Activity

  1. bpowers commented on Jul 11, 2026

    @bpowers
    OwnerAuthor

    Cross-reference: #944 tracks the case item 2 above explicitly carves out -- a same-step direct read of a conveyor-driven leak flow. That rule (not just the PREVIOUS() variant) blocks the checked-in Stella fixture test/conveyors/covid19_severity.stmx, whose death rate aux sums four conveyor leak flows. A design that permits the direct read subsumes item 2, so the two are best resolved together.

  2. changed the title [-]Conveyor engine: deferred edge-case limitations (GF leak fraction, PREVIOUS(driven_flow), JSON serialization)[/-] [+]engine: a conveyor leak fraction given as a graphical function is ignored[/+] on Oct 12, 2026
  3. added
    engine
    bug
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugengine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions