Skip to content

engine: repeated systems flows like A > B twice collide on one name #399

Closed

Description

@bpowers

Two flows with the same source and destination (A > B @ 3 and A > B @ 5) used to produce two variables with the same generated name.
The translator now numbers the repeats: the first is a_to_b, the second a_to_b_2, and the module names get the same suffix.

Example

A(10) > B @ 3
A > B @ 5

This translates, compiles and simulates; duplicate_parallel_flows_simulate_correctly checks it.

Remaining gap

The numbered names can still collide with a name the user wrote.
Adding a third flow A > B_2 @ 1 to the model above also generates a_to_b_2.
The engine rejects the result as a model with two variables of one name, so the run fails loudly rather than giving a wrong number, but the error names a variable the user never wrote.
That general problem (generated names colliding with user names) is tracked in #438.

Pointers

Activity

  1. added
    engine
    on Jun 8, 2026
  2. added
    bug
    on Oct 12, 2026
  3. changed the title [-]Systems format translator: duplicate source/dest flow pairs produce colliding identifiers[/-] [+]engine: repeated systems flows like A > B twice collide on one name[/+] on Oct 12, 2026
  4. bpowers commented on Oct 12, 2026

    @bpowers
    OwnerAuthor

    Closing: already fixed on main.

    translate() numbers repeated (source, dest) pairs via flow_suffixes (src/simlin-engine/src/systems/translate.rs:110-134), applied to the module, flow and waste idents (lines 154-158, 248, 275), from #398 (14c4653). duplicate_parallel_flows_produce_distinct_idents and duplicate_parallel_flows_simulate_correctly (translate.rs:1560, 1623) pin distinct names and a compiled run moving 1+2 per step.

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