Repository navigation
tri gates: stop two different inputs from sharing one cache key (Refs #2559) - #2560
Merged
Merged
Conversation
sha_of built the mutation cache key two ways that map DIFFERENT inputs
onto the SAME key -- the direction that hurts, since a shared key serves
a row measured against one input when asked about another.
* read(p).unwrap_or_default() made an unreadable file hash as the
empty string: "gone" and "empty" collide, and so do any two
unreadable paths.
* Contents were concatenated with no separator, so the boundary could
move: ["ab", "c"] and ["a", "bc"] hash identically. `judges` is a
list, so any gate with more than one control could reach this.
Both close with a length-prefixed record per file: path, read status,
bytes. The new test fails against the old function -- verified by
reverting it and watching the assertion go red.
Also: the interrupt marker write was `let _ = fs::write(...)`. On
failure the run mutated anyway with nothing on disk to say so, which
disarms the guard exactly when it is needed. It now refuses to mutate,
verified with target/ made read-only: the run errors and leaves the
tree untouched.
Refs #2559
Contributor
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
PR DashboardGenerated at: 2026-08-23 14:52:40 UTC
Summary
Seal Status
|
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
PR DashboardGenerated at: 2026-08-23 15:04:31 UTC
Summary
Seal Status
|
Contributor
PR DashboardGenerated at: 2026-08-23 15:13:21 UTC
Summary
Seal Status
|
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
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.
sha_ofmapped different inputs onto the same mutation-cache key in two ways. A shared key is the harmful direction: it serves a row measured against one input when asked about another.read(p).unwrap_or_default()["ab","c"]==["a","bc"]— reachable for any gate with >1 controlClosed with a length-prefixed record per file (path, read status, bytes).
Negative control. The new test was run against the old
sha_ofand went red on the boundary case (ba7816bf8f01cfeaon both sides); green against the new one. A test that passes on the broken version tests nothing.Second fix. The interrupt-marker write was
let _ = fs::write(...); on failure the loop mutated anyway with nothing on disk to tell the next run. It now refuses. Verified withtarget/at mode 555: the run errors andgit status -- tools/stays empty.Gates run:
cargo build -p tri --all-targetsclean,cargo test -p tri193 passed. M5 freeze intact (sha256(compiler.rs)==FROZEN_HASH).Refs #2559