Skip to content

conveyor-engine: per-element explicit init lists on arrayed conveyors are rejected, not supported #889

Closed

Description

@bpowers

Problem

The implementation of #874 (spec 7.2 explicit per-slat conveyor initialization, docs/design/conveyors.md section 7.2) supports the comma-separated <eqn> init list on arrayed conveyors only in the scalar / shared apply-to-all form: a single Equation::Scalar-style list that every element belt shares, matching the one-expression-per-attribute rule of the conveyor block (conveyors.md section 10).

A per-element DISTINCT list -- a datamodel::Equation::Arrayed element (or default) equation whose text parses as a comma list, e.g.

<stock name="oven">
  <dimensions><dim name="line"/></dimensions>
  <element subscript="a"><eqn>10, 20</eqn></element>
  <element subscript="b"><eqn>5, 5</eqn></element>
  <conveyor><len>2</len></conveyor>
</stock>

is deliberately rejected loudly with ErrorCode::ConveyorInitListUnsupported rather than supported. The rejection happens at expansion time in explicit_init_list in src/simlin-engine/src/conveyor_compile.rs.

Why it matters

Completeness / user experience: a modeler with an arrayed conveyor may reasonably want different initial slat contents per element, and today the only recourse is total-value initialization (uniform spread) or restructuring the model. The failure mode is a clear diagnostic rather than silent misbehavior, so this is a nice-to-have, not a correctness bug. Neither the XMILE spec nor isee's documentation describes the arrayed-per-element-list combination, so this is not a spec gap.

Component

src/simlin-engine -- conveyor_compile.rs (explicit_init_list, ConveyorMeta.init_values), ConveyorPlan.init_values, ConveyorState::init_explicit / init_belts.

Possible approach

Make init_values on ConveyorMeta per-element: a vector aligned with element_subscripts in row-major order, with canonical element-subscript matching between Equation::Arrayed elems keys and the element_subscripts_for_dims output (fall back to the arrayed equation's default expression for unmatched elements, and to the shared list when only one expression is given). Each element belt then initializes from its own list in init_belts.

Context

Identified as a deliberate scope limitation while implementing #874 on the conveyor-engine branch (PR #869 line of work).

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions