Skip to content

test: diagnose Windows refinement cache lifecycle - #11110

Closed
Xuanwo wants to merge 5 commits into
mainfrom
xuanwo/diagnose-quantized-cache-windows-20261115
Closed

Xuanwo wants to merge 5 commits into
mainfrom
xuanwo/diagnose-quantized-cache-windows-20261115

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Diagnostic only — do not merge.

The Windows nightly fails all three dataset_scanner_knn::test_quantized_refinement_cache_snapshot_lifecycle cases at 3c570b969c88fa2ad29f18199a3886ec4de3f8be (run 43657826113 / job 132640223080). The phase run (43706516887 / job 132788681378) localized all three failures to checkout_original_hit: hits 8→8, misses/loads_started/loads_succeeded 14→16, with the 10 preceding phases passing. The identity probe showed the writer reporting no manifest e_tag while the checkout resolved one, so caches keyed on that token split one published snapshot.

This PR carries a pull-request-scoped diagnostic workflow and two saved patch products: the reviewed identity-probe patch and the exact production hunk of the published-e_tag repair from #11111 (source commit da8d069191ab8e08b948019079ee947a84be27ea, blob 518f98579269 → 4c8e3710ad24). The job builds the exact red head in a second checkout, applies the probe first and the repair second to the runner checkout only, and hash-guards both patches and the resulting blobs. It runs the three lifecycle cases on windows-latest with RUST_BACKTRACE=1. The probe prints every hashed identity component, the 16-byte base identity, the post-controls per-partition entry identity, a non-counting residency peek, and type-scoped cache occupancy. No repository Rust source, manifest, or lockfile changes, and no assertion, fixture, capacity, feature, or retry is modified.

The expected measurement, if the repair addresses this path, is checkout_original_hit at hits 8→10 with misses/loads_started staying at 14 and the cached-vs-uncached-vs-original assertions actually running. That expectation is not a result; the Windows run remains pending. The production fix is #11111; this PR is never merged.

The Windows nightly fails all three quantized refinement cache
snapshot-lifecycle cases at 3c570b9 with "assertion failed: after.hits >
before.hits", but the shared assertion at dataset_scanner_knn.rs:3138 does
not identify which lifecycle phase misses.

This adds a pull-request-scoped diagnostic that builds the exact red head in
a separate checkout, applies the reviewed phase-instrumentation patch to the
runner checkout only, and runs only the three lifecycle cases with
RUST_BACKTRACE=1.

Diagnostic only. Not a fix, not a merge candidate.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@github-actions github-actions Bot added A-ci CI / build workflows chore labels Nov 15, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Nov 15, 2026
@lance-gatekeeper lance-gatekeeper Bot removed K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Nov 15, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Nov 15, 2026
A Windows checkout can leave CRLF bytes in the worktree, and
`git checkout -- <path>` may skip a path whose index stat data still
looks clean. Read the committed blob with `git cat-file` instead so the
reproduction tree is byte-identical to HEAD before the patch applies.
@lance-gatekeeper lance-gatekeeper Bot removed K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Nov 15, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Nov 15, 2026
Carry the exact production hunk of the published-e_tag repair as a patch
product and apply it to the pinned red checkout after the identity probe.
The workflow checks the patch sha256, the production file blob before and
after, that the patch touches only the commit handler, and that the final
tree is red plus probe plus repair with no unrelated change.

This makes the next Windows run exercise the original lifecycle path with
the production repair instead of a test-side substitute.
@lance-gatekeeper lance-gatekeeper Bot removed K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Nov 15, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-changes Latest Gatekeeper recommendation requests changes. label Nov 15, 2026
Xuanwo added a commit that referenced this pull request Nov 15, 2026
`RenameCommitHandler` publishes the staging manifest with
`rename_if_not_exists` and then returned `e_tag: None`. When a store
implements rename as copy plus delete, the published object carries a
different generation token, so the writer's `ManifestLocation` did not
describe what a reader resolves by HEAD for the same version. Consumers
that key caches on that token (manifest and index metadata caches,
refinement cache identity, `already_checked_out`) could then disagree
about one published snapshot.

This observes the final path after a successful rename and returns the
token reported there, matching the existing external-manifest
publication path. It costs one metadata read per commit on this handler
and adds a regression test that writes through an explicit
`RenameCommitHandler` and resolves the version as a reader does.

The Windows diagnostic in #11110 applies this hunk to the pinned red
head; this PR does not claim a Windows result.
The Windows runner image sets core.autocrlf=true globally, so the red
checkout carried CRLF bytes. The verify step flips core.autocrlf to false
after checkout, and the whole-tree `git diff --name-only` guard then
re-reads those files against LF blobs and reports every converted file as
an unrelated change before any build runs.

Disable CRLF conversion on the ephemeral runner before the second
checkout so the reproduction tree is LF from the start. The whole-tree
guard and its byte-exact patch/blob checks are unchanged.
@lance-gatekeeper lance-gatekeeper Bot removed the K-changes Latest Gatekeeper recommendation requests changes. label Nov 15, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Gate recommendation: approve with a non-blocking risk.

The CRLF preparation issue is fixed, and the pinned probe plus the repair from #11111 preserves the lifecycle assertions. Windows behavior remains unverified, so the expected cache-hit improvement is still a hypothesis. Retain the diagnostic-only, do-not-merge scope.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 15, 2026
@lance-gatekeeper lance-gatekeeper Bot added the K-risk Latest Gatekeeper recommendation includes a non-blocking risk. label Nov 15, 2026
@Xuanwo Xuanwo closed this Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ci CI / build workflows chore K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant