Skip to content

engine: World3 unit-alias test passes or fails depending on test order #474

Closed

Description

@bpowers

wrld3_resource_unit_alias_should_not_conflict sometimes failed when run with the rest of the suite and passed when run alone.
World3 declares Resource unit and Resource units as aliases, and the test checks that no unit diagnostic names both.
The cause was unit inference visiting constraints in HashMap order, so which variable a conflict was reported against changed from run to run.

This looks fixed: unit inference now sorts variables before generating constraints (src/simlin-engine/src/units_infer.rs, around line 981, from #1003, which closed #999), and the test runs un-ignored in every cargo test.

The alias bug the test guards against is #454, still open.
The test's doc comment still says it "currently FAILS", which is stale.

Pointers

Activity

  1. added
    engine
    ci
    on Jun 8, 2026
  2. added
    bug
    on Oct 12, 2026
  3. changed the title [-]engine: wrld3_resource_unit_alias_should_not_conflict is order-dependent / flaky[/-] [+]engine: World3 unit-alias test passes or fails depending on test order[/+] on Oct 12, 2026
  4. bpowers commented on Oct 12, 2026

    @bpowers
    OwnerAuthor

    Closing: already fixed on main.

    Unit inference sorts variables before generating constraints (src/simlin-engine/src/units_infer.rs:981-994, #1003) and the checker sorts too (units_check.rs:596-600), so the reported variable no longer depends on HashMap order. The underlying alias conflict is also gone (8bc2660, see #454), and wrld3_resource_unit_alias_should_not_conflict runs un-ignored in the default suite.

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

    bugciengine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions