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
trace: recheck physical store availability for locked fetchurl - #752
A hash-pinned builtins.fetchurl first checks its physical fixed output, then its verified managed input, then the origin. The result cache must replay the same choice when the physical path, daemon registration or file contents change.
Record physical absence before using a managed file. For a present candidate, recheck local daemon registration or the original flat hash on replay. This allows an unchanged registered file to retain whole-command cache hits. A cold miss can wait for a producer or report a new download failure, so its evaluation declines a cache write.
The tests cover changing bytes with an unavailable origin, a managed cache hit followed by physical appearance and a private daemon whose registration changes with identical restored bytes. #751 shares the fixed-output observation and validator.
For a registered physical file, all seven x86-64 fold runs reused the result. Rechecking registration used about 5.2% more client instructions than main’s unchecked hit. The native x86 suite passed 2,127 tests. Both this PR and #751 contain the same validator commit and merge cleanly in either order.
AI assistance from OpenAI Codex.
Summary by CodeRabbit
Bug Fixes
Flat fetchurl results are now checked against the current store state before cached results are reused. Invalid or unregistered files no longer pass as valid, and files with incorrect pinned hashes trigger a download attempt.
Cached evaluations are skipped when a fetch is still required, helping prevent stale results.
Documentation
Clarified how locked fetchurl checks verified files and handles cached results.
Draft PRs are not automatically reviewed by default.
Trigger a manual review
To automatically review draft PRs, update your CodeRabbit configuration:
reviews:
auto_review:
drafts: true
No actionable comments were generated in the recent review.
Walkthrough
Locked flat builtins.fetchurl checks cached fixed-output paths against store registration or content and records that validity in trace observations. Trace serialization and validation now preserve and recheck those observations. Cache misses that require a fetch mark the evaluation uncacheable.
Trace observations now store fixed-output entry, hash, mode, and validity. Wire encoding and decoding support the observation, and cache dumps display its entry and validity.
Store validity and fetch cache checks src/source/remote.rs, src/source/mod.rs, docs/explanation/caching.md
Flat fetches check cached paths through store registration or content hashing. If neither the store nor input store provides the file, the evaluation becomes uncacheable before fetching. The documentation describes this cache flow.
Trace revalidation and fetch tests src/trace/validate.rs, tests/e2e_daemon.rs, tests/fetchurl.rs
Trace validation rechecks recorded fixed-output validity. Tests cover daemon registration, physical-file content, and managed input reuse.
Locked flat fetchurl results now recheck whether the physical store file is still registered or valid before reusing a cached result. Evaluations that still need a download skip the cache write. The change is well covered by the supplied tests and shows no remaining concrete merge risk.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "trace: recheck physical store availability for locked fetchurl" matches the main change. The changeset adds a fixed-output trace observation (Obs::FixedOutput) and a recheck of the physical…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "trace: recheck physical store availability for locked fetchurl" matches the main change. The changeset adds a fixed-output trace observation (Obs::FixedOutput) and a recheck of the physical store path during replay (recheck_fixed_output, valid_expected). The fetch_file cache path now declines cache writes on misses. Tests cover the physical-store recheck for flat fetches. The title names the trace recheck and the locked fetchurl scope, and it omits the cache-write change, which is an expected omission.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 5103aa05-bcf2-4f9f-8434-080da1e771ae
Commits
Reviewing files that changed from the base of the PR and between 140a202 and 733b33d.
Files selected for processing: 9
docs/explanation/caching.md
src/cli/cache_dump.rs
src/source/mod.rs
src/source/remote.rs
src/trace/mod.rs
src/trace/validate.rs
src/trace/wire.rs
tests/e2e_daemon.rs
tests/fetchurl.rs
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
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.
A hash-pinned
builtins.fetchurlfirst checks its physical fixed output, then its verified managed input, then the origin. The result cache must replay the same choice when the physical path, daemon registration or file contents change.Record physical absence before using a managed file. For a present candidate, recheck local daemon registration or the original flat hash on replay. This allows an unchanged registered file to retain whole-command cache hits. A cold miss can wait for a producer or report a new download failure, so its evaluation declines a cache write.
The tests cover changing bytes with an unavailable origin, a managed cache hit followed by physical appearance and a private daemon whose registration changes with identical restored bytes. #751 shares the fixed-output observation and validator.
For a registered physical file, all seven x86-64 fold runs reused the result. Rechecking registration used about 5.2% more client instructions than main’s unchecked hit. The native x86 suite passed 2,127 tests. Both this PR and #751 contain the same validator commit and merge cleanly in either order.
AI assistance from OpenAI Codex.
Summary by CodeRabbit
Bug Fixes
fetchurlresults are now checked against the current store state before cached results are reused. Invalid or unregistered files no longer pass as valid, and files with incorrect pinned hashes trigger a download attempt.Documentation
fetchurlchecks verified files and handles cached results.