Skip to content

fix(compiler): make loop binding-type inference deterministic#69

Merged
skydread1 merged 2 commits into
developfrom
fix/loop-inference-candidate-order
Jul 21, 2026
Merged

fix(compiler): make loop binding-type inference deterministic#69
skydread1 merged 2 commits into
developfrom
fix/loop-inference-candidate-order

Conversation

@skydread1

@skydread1 skydread1 commented Jul 21, 2026

Copy link
Copy Markdown
Member

Closes #68

  • Sort loop-binding candidate type sets and best-type's common-ancestor seqs with an ordinal comparator before reducing, so inference no longer depends on hash-set iteration order
  • Refresh the two recompiled compiler DLLs and re-record dll-sources.edn

Candidate types for loop bindings were reduced in hash-set iteration
order, and best-type breaks ties by keeping the argument it saw first,
so a tie-prone loop could infer different binding types across
processes and emit different bytes from unchanged sources. Sort the
candidate sets and best-type's common-ancestor seqs with an ordinal
comparator before reducing, the same shape as reusable-type selection.
@skydread1 skydread1 self-assigned this Jul 21, 2026
@skydread1
skydread1 merged commit 4f50402 into develop Jul 21, 2026
1 check passed
@skydread1
skydread1 deleted the fix/loop-inference-candidate-order branch July 21, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Loop binding-type inference picks candidate types in hash-set order

1 participant