Skip to content

engine: wasm backend refuses conveyor inflows with a spread placement #946

Open

Description

@bpowers

The wasm backend refuses a conveyor inflow whose isee:spreadflow placement is even, dest, dist or source.
It only supports the default beginning, where the whole inflow lands on the entry slat.
The bytecode VM simulates all five, so these models run on the VM but fail if a caller asks for the wasm engine (there is no automatic fallback).

Example

test/conveyors/sir_social_distancing_mixnot.stmx (a vendored Stella model) has a dist inflow.
It cannot reach the wasm backend yet anyway: its conveyors live in a sub-model, which no backend supports (#941).

Why it matters

Only wasm users of spread-inflow models are affected, and the refusal is a clear error, not a wrong number.
No model in the repo can hit it until #941 is fixed.
Low priority.

Fix

Port the VM's per-slat placement to the wasm belt pass:

  • a per-belt scratch buffer of per-slat shares that grows with the belt and is reset with it;
  • the leak-window bookkeeping at insertion done slat by slat, transcribed from ConveyorState::insert (today it is folded into a single-slat shortcut that is only exact for beginning);
  • for dist, a weight vector recomputed each step, since a sampled transit time changes the belt length;
  • for source, a copy of the upstream belt's per-slat leak amounts taken before the upstream belt admits its own inflow, kept until the downstream belt inserts.

source is the hardest; even, dest and dist could land first.

Pointers

Activity

  1. added
    engine
    enhancement
    on Oct 12, 2026
  2. changed the title [-]wasmgen: conveyor inflow spreadflow placements (even/dest/dist/source) are rejected, not lowered[/-] [+]engine: wasm backend refuses conveyor inflows with a spread placement[/+] 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

    engineenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions