You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Verify cold and warm index pages in the opt-in PyTorch loader - #476
Stacked on #458. Implements C-137 and C-138 from #353.
Summary
--cold-warm-cache makes the existing 33-anchor loader verify Linux page residency before each epoch. It conditions the same base index for fresh and reloaded fits, records the selected files and residency in each worker report, and lists files created later by materialization or iteration separately. Epoch timing starts after verification. An unmet condition fails the requested run and retains the observations.
Testing Done
Validation ran from the PyTorch package directory on disk-backed Linux scratch.
The Linux validator module passed all five tests. The four-page validation file had 4, 0 and 4 resident pages in its warm/cold/warm cycle. All three loader workers completed two epochs for each fit, delivering 33 anchors per epoch across 84 batches. Each worker used the same 18 base-index files across both fits. All six cold boundaries had 0/18 resident pages and all six warm boundaries had 18/18. The one-worker control completed four epochs and recorded no cache measurements. With the flag omitted, the validator skipped. Ruff lint and formatting passed.
CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.
Parsing warnings: 1
Validation error: Unrecognized key: "tone_instructions" at "reviews"
If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
No actionable comments were generated in the recent review.
Walkthrough
Adds an optional Linux file-page cache check to loader timing runs. The check snapshots regular index files, then verifies that their pages are cold before epoch 0 and warm before epoch 1. It records per-file and aggregate cache data in epoch results and adds cache metadata to timing reports. Tests cover residency, file changes, writable mappings, and the loader test’s epoch cache modes.
Sequence Diagram(s)
sequenceDiagram
participant TimingCLI
participant Campaign
participant PytestWorker
participant LoaderTest
participant TimeLoader
participant IndexPageCache
participant LinuxKernel
TimingCLI->>Campaign: Enable cold_warm_cache
Campaign->>PytestWorker: Pass --cold-warm-cache
PytestWorker->>LoaderTest: Enable cache checks
LoaderTest->>IndexPageCache: Snapshot index files
LoaderTest->>TimeLoader: Pass cache
loop Before each epoch
TimeLoader->>IndexPageCache: Condition cold or warm
IndexPageCache->>LinuxKernel: Apply conditioning and measure residency
IndexPageCache-->>TimeLoader: Return cache record
end
Loading
Merge Risk: Minimal · up to dbdac
This adds an opt-in Linux page-cache check to the loader timing tests. Default behavior is unchanged, and no merge-blocking risk was identified.
Security architecture risk: Minimal · up to dbdac
The new behavior is opt-in and targets index files created for the benchmark. If residency cannot be verified, the epoch is not timed and the run fails. The review found no material increase in security or failure-containment risk.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — Normal benchmark runs use separate temporary fixture indexes. The operator-supplied report directory does not choose files to condition. File-cache effects are shared by inode, so another process using the same selected inode could observe a residency change; no such sharing was established for the normal benchmark path.
Trust Boundaries and Controls
observed — Selection uses regular-file metadata and deduplicates by device and inode. Each file open rechecks identity and ownership, and mapping advice is limited to matching entries in the current worker's mapping table. A writable matching mapping causes the check to fail.
Resilience and Maintainability Implications
observed — A failed check leaves the epoch incomplete and propagates the error after task cleanup and an attempt to write partial results. The campaign excludes failed workers from aggregation and exits unsuccessfully. It does not restore prior page residency or guarantee a report after abrupt process termination.
Pre-merge checks: 2 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Change Map Design Review
(previously flagged, unaddressed)
Details from the previous assessment are unavailable.
Passed checks: 2 passed
Check name
Status
Explanation
Pr Size
The PR changes 5 files, below the failure threshold of 40. The changed-file inventory from git diff --name-status between the review-scoped base and head refs lists: - M packages/experimental/kumo-p…
Public Resource Access
The pull request changes five files under packages/experimental/kumo-pytorch/tests/ (conftest.py, e2e/file_cache.py, e2e/runs.py, e2e/test_runs.py, test_native_anchor_handoff.py). Scanning every added…
Full details: Pr Size
Explanation
The PR changes 5 files, below the failure threshold of 40. The changed-file inventory from git diff --name-status between the review-scoped base and head refs lists: - M packages/experimental/kumo-pytorch/tests/conftest.py - A packages/experimental/kumo-pytorch/tests/e2e/file_cache.py - M packages/experimental/kumo-pytorch/tests/e2e/runs.py - M packages/experimental/kumo-pytorch/tests/e2e/test_runs.py - M packages/experimental/kumo-pytorch/tests/test_native_anchor_handoff.py --name-only confirms the count of 5. There are no renames or deletions. Line counts were ignored, as the check requires.
Full details: Public Resource Access
Explanation
The pull request changes five files under packages/experimental/kumo-pytorch/tests/ (conftest.py, e2e/file_cache.py, e2e/runs.py, e2e/test_runs.py, test_native_anchor_handoff.py). Scanning every added line of the committed diff for URLs, git or package sources, registries, and file:// or ssh:// locations found none. The added imports (ctypes, mmap, os, stat, sys, pathlib, time) are standard library, and the other references are local repository paths. The only new external URL is in the PR description: a link to a comment on this PR (github.com//pull/476#issuecomment-7074739670). The check covers references needed to understand, build, test, use, or contribute to the changed code. The description is not part of the changed code, so this link does not fall under the check. Even so, an unauthenticated request returned HTTP 200 for that link, for the PR page, and for the repository root, so it is publicly reachable. No added or modified external resource reference fails to resolve publicly, so the check passes.
Latest assessment: Change Map Design Review
Latest assessment: The latest assessment was inconclusive; the previous failure remains unresolved.
Latest explanation: The check reviews the PR conversation comment that starts with <!-- kumo-pr-change-map -->. That comment body is not in the repository checkout, and no tool returns PR conversation comments. A search of the working tree and git history found only the marker text in docs/development/review.md, .github/PULL_REQUEST_TEMPLATE.md, .coderabbit.yaml, and .github/scripts/pr-change-table.cjs. The PR description links to the comment (#issuecomment-7074739670) but does not reproduce its table. The pr_objectives section paraphrases the author's comments. It is not the Change map table, so it cannot show each row's rationale, existing-behavior inspection, or stopping condition. The repository diff is available and was inspected. It changes 5 files: tests/conftest.py, tests/e2e/file_cache.py (new), tests/e2e/runs.py, tests/e2e/test_runs.py, and tests/test_native_anchor_handoff.py. In file_cache.py, the cold path uses madvise(MADV_DONTNEED) on matching read-only worker mappings, then posix_fadvise(DONTNEED). The warm path reads the files. Verification uses mincore on a private ACCESS_COPY mapping and requires zero resident pages for cold and all pages resident for warm. This code is consistent with the paraphrased claims. The code does not, by itself, validate the table's design claims. Per the author's own notes, advisory eviction alone cannot prove a cold state. That is why residency verification exists, and the code implements it. Design questions I could not settle without the table: - Whether each row names the observed failure (#458 uncontrolled page residency, or C-137/C-138 requirements) and the smallest sufficient change. - Whether the conftest.py opt-in and the runs.py and test_native_anchor_handoff.py edits are each necessary, or whether the table justifies them. - Whether the table omits material behavior, such as the cold path changing shared mappings of the same inode outside the index, or the pass/fail effect on the existing results.json report. No proven defect was found in the diff. The earlier standing FAIL has no details, so I could not confirm or refute its claims. I did not issue a PASS over it.
Latest resolution: Provide the body of the PR conversation comment that starts with <!-- kumo-pr-change-map --> (comment issuecomment-7074739670, or the current marked comment) to the reviewer, or make it readable to this check. Re-run the check. The table must follow the template in .github/PULL_REQUEST_TEMPLATE.md. Each row should state: the observed failure or requested requirement, the inspected existing behavior, the smallest sufficient change, the focused verification, and the stopping condition. Optional refinements belong in a separate section. The previous FAIL explanation was unavailable. Its claims should be restated so the re-run can address them.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 5 remain after this review.
#458 reports loader timings with uncontrolled file-page residency. C-137–138 require an explicit, verified cold/warm pair on Linux. Acceptance uses the four-page validator and the original 33-anchor loader.
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
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.
Stacked on #458. Implements C-137 and C-138 from #353.
Summary
--cold-warm-cachemakes the existing 33-anchor loader verify Linux page residency before each epoch. It conditions the same base index for fresh and reloaded fits, records the selected files and residency in each worker report, and lists files created later by materialization or iteration separately. Epoch timing starts after verification. An unmet condition fails the requested run and retains the observations.Testing Done
Validation ran from the PyTorch package directory on disk-backed Linux scratch.
The Linux validator module passed all five tests. The four-page validation file had 4, 0 and 4 resident pages in its warm/cold/warm cycle. All three loader workers completed two epochs for each fit, delivering 33 anchors per epoch across 84 batches. Each worker used the same 18 base-index files across both fits. All six cold boundaries had 0/18 resident pages and all six warm boundaries had 18/18. The one-worker control completed four epochs and recorded no cache measurements. With the flag omitted, the validator skipped. Ruff lint and formatting passed.
Change map
File-by-file changes and rationale