Skip to content

compiler: make composite map hashes order dependent - #5639

Merged
deadprogram merged 2 commits into
tinygo-org:devfrom
jakebailey:compiler-order-dependent-composite-hashes
Aug 31, 2026
Merged

compiler: make composite map hashes order dependent#5639
deadprogram merged 2 commits into
tinygo-org:devfrom
jakebailey:compiler-order-dependent-composite-hashes

Conversation

@jakebailey

Copy link
Copy Markdown
Member

Like #5581 but for the compiler hashes.

Use the same multiply-and-XOR combination as the runtime interface hash for generated struct and array key hashes. This avoids systematic collisions when components are permuted.
@jakebailey
jakebailey force-pushed the compiler-order-dependent-composite-hashes branch from e935092 to c306bb1 Compare August 31, 2026 15:35
@deadprogram deadprogram added this to the 0.42.0 milestone Aug 31, 2026

@dgryski dgryski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@deadprogram deadprogram left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the improvement @jakebailey and to @dgryski for review. Now merging.

@deadprogram
deadprogram merged commit 2761414 into tinygo-org:dev Aug 31, 2026
24 checks passed
@jakebailey
jakebailey deleted the compiler-order-dependent-composite-hashes branch September 4, 2026 15:17
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