fix(t27b): reference cache writes whole rows, keys on t27c content - #6333
Merged
Merged
Conversation
Each --reference-cache row is formatted into one buffer and written with a single write_all under one lock shared by all workers, so rows cannot interleave. The t27c part of the key is an FNV-1a hash of the binary's bytes, read once per run, instead of its size and mtime, so a byte-identical copy of t27c hits. Old caches are still read; their rows just miss. Tests in cli/t27b/tests/refcache.rs. Closes #6332 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
This was referenced Oct 5, 2026
Merged
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.
Closes #6332. Refs #6063.
What changed (cli/t27b/src/blockers.rs only; lower.rs untouched)
cache_rowformats a row (key, path, verdict) into one buffer, newline included, with tabs/newlines in the path and newlines in the reason turned into spaces.CacheWriteropens the cache once in append mode and writes each row with a singlewrite_allunder a mutex shared by every worker. Before,writeln!on a per-row handle could split a row into several writes.binary_stamp= FNV-1a over the t27c binary's bytes, computed once inRefRunner::new, replacing size+mtime. A byte-identical copy hits; a rebuilt binary misses. Old caches are still read byread_cache; their rows just never match.read_cachealso now requires a 16-hex-digit key.Tests (cli/t27b/tests/refcache.rs)
writeln!append back makes the concurrency test fail.cargo test -p t27b: all suites pass (refcache 4/4, blockers 6, differential 14, encoder 5, macho 1, memory 8, source 24, vacuous 3).🤖 Generated with Claude Code