Skip to content

conveyor-engine: spec 7.2 explicit per-slat conveyor initialization is implemented but unreachable #874

Description

@bpowers

Found by branch review of conveyor-engine before merge (the in-flight XMILE conveyor+queue implementation; specs docs/design/conveyors.md + docs/design/queues.md). Filed from a review report that exceeded its 15-finding cap. (This item came from the design/spec sweep, not from an evidence JSON.)

Summary

docs/design/conveyors.md section 7.2 specifies explicit per-slat / per-time-unit list initialization of a conveyor's contents. The runtime core implements it (ConveyorState::init_explicit / spread_per_time_unit, src/simlin-engine/src/conveyor.rs:527), but the code path is unreachable: init_belts always calls init_steady with the scalar stock value (src/simlin-engine/src/conveyor_compile.rs:1844-1850), and a comma-list <eqn> does not parse as a scalar equation. The spec'd initialization form therefore cannot be used.

Failure scenario / cost

A modeler who writes the section 7.2 explicit-list initial equation for a conveyor stock gets either a parse/compile error or a silently steady-state-initialized belt, never the per-slat distribution the spec describes. The implemented init_explicit/spread_per_time_unit machinery is dead code that no input can reach.

Evidence

  • implemented but unreached: ConveyorState::init_explicit / spread_per_time_unit (src/simlin-engine/src/conveyor.rs:527)
  • the only initializer wired in is steady-state: init_belts calls init_steady with the scalar stock value (src/simlin-engine/src/conveyor_compile.rs:1844-1850)
  • a comma-list <eqn> is not a scalar equation, so no valid input reaches init_explicit

Suggested direction

Either wire the explicit-list initial equation form through init_belts to init_explicit/spread_per_time_unit, or (if section 7.2 is being deferred) mark the spec section as not-yet-implemented and note the dead runtime code so it is not mistaken for reachable behavior.

Activity

  1. added
    bugSomething isn't working
    engineIssues with the rust-based simulation engine
    on Jul 8, 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

    bugSomething isn't workingengineIssues with the rust-based simulation engine

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions