Repository navigation
fix: batch V-cache identity key drops ctime -- sanitizer(address) race pinned out (issue #74 image-dating companion) - #128
Merged
Conversation
… a bytes move The scheduled sanitizer(address) leg reddened 2026-11-23 (run 45200867538) on hardlinked_alias_shares_the_decoding: the VCache identity key carries a ctime whole-second stamp, POSIX link() bumps ctime, and when the link lands after the base stat crossed a second the two stats disagreed on a field no bytes move ever produced -- a spurious miss on the bridge layout itself, late-linked aliases decoding twice. This adds the deterministic probe: base decoded, forced second crossing (1.1 s, same idiom as the bytes-moved law), alias linked last. Three runs against the unfixed key: 3/3 FAILED at the ptr_eq law, right reason, timing-independent.
mtime carries the freshness law alone: any bytes move moves mtime with it, so every window ctime guarded, mtime already guarded. The extra field bought nothing and byte-less metadata events (link(), chmod) bumped it, costing shared entries -- the spurious misses that panicked the sanitizer leg. The test-file law 4 always read "length or mtime moved": the key field was unclaimed implementation drift, now pinned by the late-link twin in tests/batch_v_cache.rs. GREEN: batch_v_cache 6/6 (was 1 failed deterministic), full engine suite 335 tests 0 failed, clippy --workspace -D warnings clean.
Issue #74 image-dating ruling, same law as the valgrind arm above: sanitizer verdicts must be observed over a still environment. The 2026-11-23 race rode ubuntu-latest while the image moved underneath it; the defect itself is now pinned out by law, the pin keeps the observation window still.
ShixiangWang
force-pushed
the
fix/vcache-ctime-race
branch
from
November 24, 2026 02:28
a80994f to
4db0821
Compare
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.
What
The 2026-11-23 scheduled deep-check (run 45200867538) reddened
sanitizer(address)onhardlinked_alias_shares_the_decodingwhile the same-headrustarm and the local 60-run reproduction (40 under load) were green. Characterization (joint-witness file/tmp/p6gate/deepcheck-witness-20261123-evidence.txt, banked in the loop handoff REV41 addendum): a second-boundary race, not a regression — the VCache identity key{dev, ino, len, mtime(), ctime()}samples two whole-second clock stamps, POSIXlink()bumpsctime, so a late alias link crossing a wall-clock second between the base stat and the alias stat yields two keys for one never-moved file: a spurious miss that violates the one-decoding-per-file law.Why dropping
ctimeis the professional fixctimeguarded no window thatmtimedoes not already guard: any bytes move (truncate+write, pwrite) movesmtimewith it, and rename-over movesdev/ino; the only events that movectimealone are byte-less metadata events (link(),chmod) — i.e. the field produced only spurious misses on the bridge's own late-linked layout (R/kernel-bridge.R kp_serve_unithard-links one V grid into fifty case dirs after earlier cases may already have decoded). The test-file law 4 always read "length or mtime moved" — the key field was unclaimed implementation drift.Deterministic probe (TDD, RED witnessed first)
a_hardlink_after_a_clock_tick_still_shares_the_decodingforces the boundary instead of waiting for it: base decoded → forced second crossing (1.1 s sleep, same banked idiom asbytes_moved_under_a_name_force_a_fresh_decode) → alias linked last. Against the unfixed key: 3/3 FAILED at theptr_eqlaw, right reason, timing-independent. The old flake needs a link to land in a different second; this probe makes every run that second cross. Fail-closed non-unix twin included per the file's platform discipline.Lineage
63f3f90test: the timed law (RED attestation above)0aa34f6fix: key dropsctime; module law text amended in placea80994fci: sanitizer legs pinned toubuntu-24.04per the issue [audit] 2026-11-04 full-codebase audit — consolidated fix backlog (1×P0, 7×P1) #74 image-dating ruling (same law as the valgrind arm; deep-check legs must be observed over a still image)Local attestations
cargo test --test batch_v_cache: 6/6 (was 1 deterministic fail)cargo testfull engine: 335 tests, 0 failed (kl_bit_freeze,kl_scratch_bit_exact, bridge families included)cargo clippy --workspace -- -D warnings: cleanrustarm plus the fan-out legs as confirmation.Test plan
rustarm green (clippy + workspace tests + deny)R CMD checkfan-out legs green (kernel cdylib rebuilt from this tree; batch bridge exercises the memo)sanitizer(address)leg green twice consecutive (natural fires only — no manual dispatch; second-occurrence observation per law), plus the windowscran-shape-checkcancellation inspected at its next occurrence (separate forensics, unaffected by this change)🤖 Generated with Claude Code