🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

Allow overlap of term+type references during canonicalization - #6176

Merged
aryairani merged 3 commits into
trunkfrom
fix/canonicalizer-corner-case
Feb 26, 2026
Merged

Allow overlap of term+type references during canonicalization#6176
aryairani merged 3 commits into
trunkfrom
fix/canonicalizer-corner-case

Conversation

@dolio

@dolio dolio commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Previously, the canonicalizer was written assuming that there would never be Reference values used for both terms and types, and would fail out if that happened. This is a safe assumption in actual practice, since it would involve either a hash collision or reused builtin references (which we don't have). However, test cases were sometimes being generated that violated this assumption.

The new implementation instead behaves similarly to a completely new reference in these cases, adding to the tracked term/type maps. This means the function never fails.

This should fix the occasional test failures. I'm actually surprised we didn't encounter one earlier, because it happened relatively often when I ran the specific test locally (and the fixed seed didn't seem to work, so I don't think it was that).

Previously, the canonicalizer was written assuming that there would
never be `Reference` values used for both terms and types, and would
fail out if that happened. This is a safe assumption in actual
practice, since it would involve either a hash collision or reused
builtin references (which we don't have). However, test cases were
sometimes being generated that violated this assumption.

The new implementation instead behaves similarly to a completely new
reference in these cases, adding to the tracked term/type maps. This
means the function never fails.
@aryairani

Copy link
Copy Markdown
Contributor

@dolio Try and push those attestations/proofs when you have a chance.

@aryairani
aryairani requested a review from a team as a code owner February 26, 2026 19:11
@aryairani
aryairani added this pull request to the merge queue Feb 26, 2026
Merged via the queue into trunk with commit a7d22ae Feb 26, 2026
5 checks passed
@aryairani
aryairani deleted the fix/canonicalizer-corner-case branch February 26, 2026 19:13
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.

3 participants