Skip to content

fix(tests): key the corpus-column scratch dir per call, not per process - #2969

Closed
gHashTag wants to merge 2 commits into
masterfrom
fix/scratch-dir-pid
Closed

fix(tests): key the corpus-column scratch dir per call, not per process#2969
gHashTag wants to merge 2 commits into
masterfrom
fix/scratch-dir-pid

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

Closes #2968

tri harness scratch --gate has been red on master since 994f3c8a3.

bootstrap/tests/corpus_zig_bodies.rs:86 keyed its scratch directory by
std::process::id() — one value for the whole test binary — and the test that
uses it ends with remove_dir_all(&dir).

Measured, and stated as measured: only one of that file's three tests creates
or deletes the directory today, so nothing collides on this tree. The gate is
structural and right to be — the second test to use that key would collide, and
it would pass the first time it ran.

Fixed as the gate's own message prescribes: an AtomicUsize counter, unique per
call.

Verify

tri harness scratch --gate

none, exit 0. cargo test --manifest-path bootstrap/Cargo.toml --test corpus_zig_bodies → 3 passed.

Not mine to have written, and one line to repair — the gate caught it on new code
within an hour of being wired, which is the reading worth keeping.

🤖 Generated with Claude Code

Closes #2968

`tri harness scratch --gate` has been red on master since `994f3c8a3`.
`bootstrap/tests/corpus_zig_bodies.rs:86` keys its scratch directory by
`std::process::id()` -- one value for the whole test binary -- and the test
that uses it ends with `remove_dir_all(&dir)`.

Measured, and stated as measured: only one of that file's three tests touches
the directory today, so nothing collides on this tree. The gate is structural
and right to be: the second test to use that key would collide, and it would
pass the first time it ran.

Fixed as the gate's own message prescribes -- an `AtomicUsize` counter, unique
per call. `tri harness scratch --gate` prints `none` and exits 0; the three
tests in that file still pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-30 18:09:30 UTC

Summary

Status Count
Total Open PRs 8
PRs with Failing Checks 7
PRs with All Checks Green 1
READY 0
FAILING 7
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=4eccc2f5d228 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

Refs #2968

`git add -A` in this branch's first commit swept in 44 lines of
`bootstrap/src/compiler.rs` and its `FROZEN_HASH` that I did not write: a C
and Rust emitter fix for string literals (`extra_kind == "string"`), belonging
to another session.

How it got into a clean worktree: the stash stack is **shared across every
worktree of a repository**. An earlier command of mine ran `git stash -q -u`
on a tree with nothing to stash -- which pushes nothing -- and then
`git stash pop -q`, which popped the top of the shared stack: somebody else's
work in progress.

Both files are restored to master's version, so this branch is again the one
line it claims to be. Their work is not lost: it is the diff of this branch's
first commit `1c00afecb`, and a copy is attached to #2968.

Measured before and after: with a release build of this branch,
`tri seals drift` read 152 drifted seals; on master it reads 0. After this
revert it reads 0 -- the drift was the swept-in emitter change, not my test
file.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-30 18:18:50 UTC

Summary

Status Count
Total Open PRs 9
PRs with Failing Checks 8
PRs with All Checks Green 1
READY 0
FAILING 8
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=69d5f0a49f87 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@gHashTag

Copy link
Copy Markdown
Owner Author

Superseded by #2973, which landed the same repair (an AtomicUsize counter) from the session that owns the file. Ceding the overlap rather than resolving a conflict over one line.

tri harness scratch --gate reads none and exits 0 on master at 23b006853, so the defect this PR was opened for is closed.

The one thing here worth keeping is on #2968 and not in this diff: the 44 lines of compiler.rs that a shared git stash dropped into this branch, and the measurement that came with it — a release build carrying that swept-in change read 152 drifted seals against master's 0, which is how a one-line test fix turned seal-coverage red. Their own work has since landed properly as #2971.

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.

harness-scratch is red on master: corpus_zig_bodies.rs keys its scratch dir by pid

1 participant