Skip to content

Convert metadata table to use FxIndexMap to ensure stability across machine architectures - #164443

Closed
Daniel-B-Smith wants to merge 1 commit into
rust-lang:mainfrom
Daniel-B-Smith:smithdb/164379
Closed

Daniel-B-Smith wants to merge 1 commit into
rust-lang:mainfrom
Daniel-B-Smith:smithdb/164379

Conversation

@Daniel-B-Smith

@Daniel-B-Smith Daniel-B-Smith commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

The iteration ordered of HashMap is not stable, so the encoding can happen in a different order leading to a different hash. This was first noticed across x86_64 vs aarch64. This PR changes the HashMaps on the encoder table to be IndexMaps.

There isn't a test because I don't know how to inject randomness in the iteration order within a single test run.

I made the type change by hand and AI assisted in getting everything to type check (eg changing the types in the query).

Fixes #164379

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 16, 2026
@Kobzol

Kobzol commented Oct 18, 2026

Copy link
Copy Markdown
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 18, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 18, 2026
Convert metadata table to use FxIndexMap to ensure stability across machine architectures
@rust-bors

rust-bors Bot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 0674054 (06740546cfaf1f4efec338d45578021361fe6a56)
Base parent: 15c1044 (15c10447a46529b68e38c7f138aeb95240e4d7d6)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (0674054): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary -3.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.9% [-3.9%, -3.9%] 1
All ❌✅ (primary) - - 0

Cycles

Results (primary 2.9%, secondary -2.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.9% [2.9%, 2.9%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.9% [-2.9%, -2.9%] 1
All ❌✅ (primary) 2.9% [2.9%, 2.9%] 1

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 490.17s -> 489.887s (-0.06%)
Artifact size: 408.94 MiB -> 409.05 MiB (0.03%)

@rust-bors

rust-bors Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #164788) made this pull request unmergeable. Please resolve the merge conflicts by rebasing.

@Daniel-B-Smith

Copy link
Copy Markdown
Contributor Author

Closing since the proper fix has landed.

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 23, 2026
@Daniel-B-Smith
Daniel-B-Smith deleted the smithdb/164379 branch October 23, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crate metadata and crate hash depend on the host CPU

4 participants