Repository navigation
Look for new bugs with a wider fixture - #13
Merged
Merged
Conversation
zmaril
added this pull request to stack #19
October 7, 2026 20:17
fixtures/wide adds a proc-macro crate, a build script, derives, const generics, a GAT, impl Trait and async fn in traits and an exported macro, with ten edits. rustc/hunt.sh builds a fixture repeatedly with -Zthreads=8 and checks P6 after each edit, with -Zincremental-verify-ich, single-threaded and threaded. docs/hunt.md has what it found in the unmodified compiler, each reduced and reproducible with the official nightly by docs/hunt/repro.sh: incremental rebuilds encode Generics::param_def_id_to_index in a different order from clean builds (docs/hunt/generics-index-map.patch fixes it); incremental rebuilds of a crate using a proc-macro derive encode hygiene data clean builds do not (not root-caused); and two RPITIT traits are not reproducible under -Zthreads (known, #162202). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Mnrg9JXj9X1ht6Qkz2ybh
Finding 1: HashMap's Encodable writes iteration order and Decodable collects in that order, so Generics::param_def_id_to_index rotates every time generics_of goes through the incremental cache when its keys collide. A standalone program with std HashMap and rustc-hash reproduces rustc's sequence exactly. Four real crates show it; FxIndexMap fixes all four. Finding 2 was not hygiene data. String literals share an AllocId through allocate_bytes_dedup, but decoding a memory allocation from the cache always reserves a fresh one, so a rebuild encodes the literal twice. Reduced to two lines; regression from #116707, bisected between nightly-2025-07-24 and nightly-2025-07-26. docs/hunt/issue-*.md are draft reports. Each fix has a run-make style test that fails before it and passes after, and with both fixes P6 holds for all ten single-threaded edits while rustc's incremental, metadata UI and run-make, consts/statics/const-generics UI and codegen-llvm tests pass. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Mnrg9JXj9X1ht6Qkz2ybh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #12.
I ran mirth against the unmodified pinned compiler with a wider fixture, to see whether it finds bugs nobody planted. It found two single-threaded incremental bugs that look new, and rediscovered one known parallel-front-end bug. All three reproduce on the official
nightly-2026-10-06without mirth: rundocs/hunt/repro.sh. The write-up isdocs/hunt.md; draft upstream reports aredocs/hunt/issue-*.md.Generics::param_def_id_to_indexencoded in a different orderHashMapencodes in iteration order and decodes by inserting in that order. With colliding keys, every round trip through the incremental cache rotates the map.FxIndexMapallocate_bytes_dedup), but decoding from the cache always makes a freshAllocId. Regression from rust-lang/rust#116707 (1.90).-Zthreads=8Finding 1:
either,smallvec,memchrandarrayvecall show it after a one-line comment edit. The fix makes all four identical.HashMap+ rustc-hash program reproduces rustc's exact sequence. It's a 3-cycle across incremental sessions.Finding 2:
nightly-2025-07-24is fine andnightly-2025-07-26is affected; #116707 is between them.docs/hunt.mdis now corrected.Verification:
tests/run-makestyle (docs/hunt/tests/). Each one fails on the pinned compiler, still fails with only the other fix, and passes with its own fix.tests/incremental(180), the metadata UI (532) and run-make (46) tests,tests/ui/{consts,statics,const-generics}(1844) andtests/codegen-llvm(1122). The full test suite was not run.Not filed upstream. That's your call. Fix 2 dedups more than strictly needed, and its semantics should be checked by someone who knows the const-eval memory model. The report says so.
🤖 Generated with Claude Code
https://claude.ai/code/session_018Mnrg9JXj9X1ht6Qkz2ybh