Skip to content

engine: collect_all_diagnostics is not reproducible run-to-run (unit pass names a different variable each run) #999

Closed

Description

@bpowers

Summary

Two runs of the same binary over the test/ corpus produce diagnostic sets differing by ~184 lines. All the differences are unit warnings, differing both in which variable is named and in row count.

Example: scirev8.mdl names ada_average_difficulty_of_anomalies on one run and ardp_anomalies_relative_to_dominant_paradigm on the next.

Found incidentally while measuring the blast radius of #994's codegen-diagnostic change — the sweep had to be run twice to notice that the baseline itself moved. Not caused by that change.

Why it matters

Not currently user-visible in a damaging way: libsimlin's collect_models_with_unit_warnings already works around it by keying on model name rather than on the reported variable. But:

The likely cause is the same: an unordered collection somewhere in unit inference or its conflict reporting, whose iteration order decides which member of a conflicting set gets named. units_infer's find_constraint_mismatches and the conflict-clarification path are the places to look first.

Reproduce

Run whole-corpus diagnostic collection twice in the same binary (or two invocations) and diff the output. Every test/ model that produces a unit warning with more than one candidate variable in its conflict set is a potential differ.

Related: #595, #633, #613.

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