Repository navigation
recipes: compile structural schema validators once - #1097
Conversation
There was a problem hiding this comment.
Verdict: CLEAN: No must-fix finding remains in the compiled-validator change.
Non-blocking
⚠ Timing evidence: tools/bloomery/reach_cache.py:240. The PR's A/B names b8a8dcc/397730a; this review covers cd7d880/019e5f1.
Confirm that the measured revisions contain the same validator change, or attach output for the reviewed pair so the speed claim can be tied to this change.
Checked
Duplicates: _schema_shape is removed; its annotation analysis is folded into _typed. No new types or constants.
Complexity: no Rust functions changed; no crapper results.
Silent failure: the 3 changed validation conditions still raise ValueError before hydration; prepare catches malformed-cache errors and recomputes.
Tests: no tests changed. The PR reports four cache regressions passing; the validator did not rerun them.
Gates: no tests, cases, thresholds or pins changed.
Escape catalog: no patterns matched.
Notes
Dryer and crapper did not run because no Rust file changed.
🔨 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. |
기록 검사기가 구조 스키마를 값마다 다시 해석하던 것을 한 번만 해석하도록 바꿔, 기존 key inputs 검사 시간을 약 4.4% 줄였습니다.
What and why
tools/bloomery/reach_cache.pyvalidated every structural cache field by walking the annotation again for each value (_typed(value, annotation)). Therecipeskey self test runs that check very many times, and the annotation analysis (origin, args, dataclass lookup) was repeated on each call._typed(annotation)now builds a checking closure once per annotation and caches it. Every value, field and element is still checked on each call with the same exact-type rules and the same order, and nothing about a value or its result is cached._schema_shapeis folded into_typedand removed. No test, case, assertion, gate or tolerance changed.On the same machine and the same existing
key inputssection, the median goes from 200.562 s to 191.761 s (4.388% shorter), and the base and head ranges do not overlap (table below).Release notes: Under the hood: the recipe key analysis checks its cached structural graph faster, which shortens the
just contrib-checkt0 run.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._schema_shapeintools/bloomery/reach_cache.pyis removed.What I ran
Base
b8a8dcc4de75239bcca63563fdc7931c8750f336(upstream/main), head397730aa96b0a590771d6ac52bfbbcbe59bdcff2. CPU only, Python 3.14, no profiler. The change does not reach a GPU gate or the engine binary.The A/B runs the existing
key_self_test(..., "inputs")section (24 checks) in a fresh Python process per arm, base and head alternating, three rounds each, then four existing regression tests for the structural cache.NR_BASE_WTis a checkout of the base commit; the working directory is the head checkout.Output:
key inputssection, median of 3AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.