Repository navigation
test(native-proof): compare the held worktree's own charge across its refused release (#2819) - #4040
Merged
Merged
Conversation
… refused release (#2819) Case 17 compared the pool's aggregate allocation before and after the refused release of a held worktree. Earlier releases in the same proof still reclaim in the background, so the aggregate can drop between the two readings while nothing about the held worktree changed; loaded hosts failed 2 of 6 runs on that field alone. Compare the worktree's own simple-quota owner charge instead, read from the manager's live measurement through an idempotent retry of its create. Both readings precede the worker's read, and a refused retry reaches the named assertion rather than throwing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…edback Reverted before the PR is marked ready; never proof. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Collisions at head Draft heavy feedback with the temporary receipt driver: https://github.com/schlessera/brain-kit/actions/runs/43756278174 |
…aded held-release runs) Reverted before the PR is marked ready; never proof. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 15, 2026
native-proof: reference efficiency worktree release hits the manager client timeout under load
#4048
Open
Merged
Closed
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 #2819
What changed
Native case 17 now checks that a refused
poolReleaseof a held worktree frees nothing of that worktree by comparing the worktree's own simple-quota owner charge before and after, not the pool's aggregatechargedBytes. The manager reports that charge from its live measurement through an idempotent retry of the worktree'spoolCreate(create,packages/ui-sdk/src/server/native-reference-pool.ts:618-627). Both readings come before the worker'sread, whose atime update could dirty the worktree's metadata. If the release went through, the retry refuses withreleased, and that code reachesREFERENCE_ACCESS_HELD_NOT_RELEASEDas a value instead of being thrown. A newREFERENCE_ACCESS_HELD_CHARGEDcheck makes sure the compared charge is not a trivial zero. The only file changed isscripts/native-proof/reference-pool.native.ts.Why this shape
The issue offered two options: settle earlier reclamation before the first reading, or compare the worktree's own owner bytes. Settling would only make a race less likely, because any earlier release can still be reclaimed between the two readings. The owner charge is exactly what the assertion claims to measure, and background reclamation of other roots cannot move it. Release semantics, the #2729 refusal and the other cases are unchanged.
Proof
Native runs need loop devices and root, which the local host does not have, so the native receipts come from draft heavy feedback. Two temporary commits added a receipt driver (
scripts/native-proof/receipt-2819.ts) and a two-lineruntime_hostoverride inscripts/ci-proof.tsthat ran it instead of the three native suites. Both are reverted here (c0081e95b,bfdb0d811), and the final tree is byte-identical to the fix commit8e14d9f41(git diff 8e14d9f41 HEADis empty). Each driver run is the realbun scripts/prove-reference-pool.ts. Values come from each run'scommand-09.login theruntime-host-proofartifact.Round one (run 43756278174,
runtime_hostjob 132945961843, headf77a2dde7):old-aggregate+reclaim(failing-first: the pre-fix aggregate comparison, with an unrelated 4 MiB staging root released and reclaimed between the readings)REFERENCE_ACCESS_HELD_NOT_RELEASEDonchargedonly:- 4849664/+ 622592; code, state, access and read all heldowner+reclaim(the fix under the same reclamation)owner+no-held-refusal(mutation: #2729's refusal atpackages/ui-sdk/src/server/native-reference-pool.ts:718-719removed)REFERENCE_ACCESS_HELD_NOT_RELEASED:code: "none",state: "reclaimed",access: null,read: "MISSING",charged: "refused: released"clean+load×6 (two niced CPU spinners and a continuous 256 MiBdd conv=fsyncwriter)REFERENCE_ACCESS_HELD_NOT_RELEASED(held charge 16384 each). Each then failed a later, unrelated load-sensitive assertion: 5 ×REFERENCE_EFFICIENCY_LOCAL_COMMIT(manager client 30 s timeout, #4048) and 1 ×REFERENCE_ACCESS_CRASH_RECONCILED(transientchangingrefusal, #4047).Round two (run 43778088516,
runtime_hostjob 133009087646 passed, checkoutee73f2d62ffe834c533a4fff67055a9056b16d7f): ten consecutive clean runs of the fixed proof under the same parallel load, each stopped by a marker thrown right after the held-release assertion so all ten fit the step. 10 of 10 passedREFERENCE_ACCESS_HELD_NOT_RELEASED(35-41 s each;RECEIPT_2819_SUMMARY {"heldPassed":10,"attempted":10}). Two earlier requests for this round (43760600001, 43766206100) timed out in admission with the heavy-feedback slots full, so they ran nothing.Acceptance criteria: (1) 16 loaded native runs across the two rounds, including 10 consecutive in round two, passed the assertion. (2) The mutation that removes the held-worktree refusal still fails
REFERENCE_ACCESS_HELD_NOT_RELEASED.Other jobs in those draft runs: every category in round two passed except
unit (2). Its only failures, in both rounds, weretests/hosted-proof.test.ts(hosted global commands retain the full local inventory…andnative runtime split requires both selected jobs…). Those check theci-proofcommand inventory that the temporary override replaced, and that file passes 12/12 locally at the reverted head. Round one'sunit (4)failure inpackages/ui-sdk/tests/egress-worker-runtime.test.ts:70is unrelated to this change (#4049).Local at the final head
bfdb0d811:bun run check:pr --base origin/mainpassed (receipt below);tsc --noEmit -p .passed on the fix commit. Collisions atbfdb0d811(bun scripts/collisions.ts --json --pr 4040): no path or textual collisions, only 33 closure-only category and workspace overlaps.{"version":1,"kind":"brain-check-pr-receipt","head":"bfdb0d8112c7410ae3d86306d509a22f6e5a7ff2","base":"origin/main","mode":"focused","startedAt":"2026-11-16T01:23:15.296Z","finishedAt":"2026-11-16T01:24:41.390Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":12382.498636999999},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":130.52030100000047},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":111.86908500000027},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":17.562321000001248},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":73425.916032}]}Checklist
docs/reflect the change, or nothing documented moved.docs/decisions/provider-history.md): the provider-history guard passes, or nothing on a turn's path changed.Anything left open
Nothing for #2819. The load runs turned up three follow-ups, filed with no milestone: #4047 (case 17 crash-adoption status read refuses a changing pool), #4048 (reference efficiency release hits the client timeout) and #4049 (egress worker runtime test misses its CONNECT record).
🤖 Generated with Claude Code