Repository navigation
Preserve path errors in snapshot resolution - #1099
Conversation
There was a problem hiding this comment.
Verdict: CLEAN: No merge-blocking defect found in the snapshot, graph-edge or encoding changes.
Non-blocking
⚠ Complete the timing conditions: tools/recipes.py:5315. The PR reports tooling speedups without the host, Python version or a runnable A/B driver. Add these beside the existing commit hashes and samples; mark card/model fields as inapplicable.
Checked
Duplicates: snapshot callers share _paths; no dryer pairs were available.
Complexity: only Python tooling changed; no Rust functions were reported.
Silent failure: 1 new exception default followed through snapshot consumers. Failed reads still raise; missing probes remain false; NUL and encoding errors propagate.
Tests: the new test asserts symlink referent parity, changed-parent rejection and invalid-path errors. The PR reports fail-first results for these cases; validator checks were static.
Gates: no existing tests, thresholds or pins moved.
Escape catalog: no C1–C4 patterns matched.
Notes
dryer and crapper did not run because no Rust file changed. The validator did not rerun the CLI suite.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
check-recipes의 공용 구조 분석에서 반복되던 경로 해석, edge 설명 구성, 구조 인코딩을 줄여 같은 결과를 9.2% 더 빨리 얻습니다.
What and why
The structural recipe analysis (
Reach) resolves the same parent directories withos.path.realpathmany times per snapshot, rebuilds the same edge descriptions for every hit, and walks scalar values recursively when it encodes the cached state. This PR resolves each parent once per snapshot and checks every shared parent again before the result is used. It also sorts and describes each site once inReach.edges, and applies the scalar fast path of_encodeto dicts and the fixed record fields. Check selection, assertions, key inputs and the cache format stay as they were. A symlinked last component,..and invalid paths (embedded NUL, unencodable characters) still go through the originalrealpathand raise the same errors.On the key-inputs self-test the median wall time goes from 131.828 s to 119.661 s (9.229% faster), the 24 existing assertions all pass, and the structural graph is identical.
Release notes: Under the hood:
check-recipesspends about 9% less time in the shared structural analysis; results and cache keys are unchanged.Code shape
The review reads these first. A box left unticked needs one line of why.
copying it (
AGENTS.md"Common code first",docs/rust-quality.mdR14). Where I found an existing copy, Inamed it below.
(tensor shapes, the attention kind, the quant). A common owner gained no per-model branch, flag or trait method.
tools/check-comments.sh).PIN(YYYY-MM-DD):and its reason.
cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line), or "none": none. The three snapshot callers intools/bloomery/reach_cache.py(_corpus,_observed,_holds) share one path owner,_paths.What I ran
Upstream base
e9f238b0d53e12f8a5e75d89450b59fd0c6a2b11, PR heade051018224f7d417002067abefb3ab8f454113b3.Speed,
Reachkey inputs, base against head, three rounds alternating the order (base/head, head/base, base/head), one fresh Python process per round,PYTHONHASHSEED=0. Each process runs:Output:
Structural graph of both trees, dumped after
r.reach_of(side.tree).prepare()(109,344 nodes, 472,379 edges), identical:Tests:
python3 tools/recipes-key-test.py --self-testruns the 26 existing cases plus the newtest_snapshot_paths_keep_symlink_referents_and_recheck_parents.The new test fails when the behaviour it protects is removed. Each mutant copy of
reach_cache.pyis passed with--source-rootandRECIPES_KEY_TEST_FILTER=snapshot_paths:Invalid paths (
'bad\x00.rs') must raise likerealpathdoes. The same test run against the version without that handling, then against the PR head:Clippy on the PR head, as the ratchet lint runs it (
python3 tools/recipes.py box-command lint):AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.