Repository navigation
recipes: fork independent key self-test sections - #789
Merged
juliankang4 merged 2 commits intoOct 24, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Verdict: CLEAN: The four section jobs retain the existing assertions and propagate failures through _forked.
Checked
- Duplicates: 0 new functions, types or constants. The change reuses
_forked; no dryer pairs were reported. - Complexity: no Rust functions changed. Python growth adds four section-selection branches to the existing test.
- Silent failure: 3 cached skip-reason sites followed to their assertions; no new error suppression.
- Tests: all 94 key and 6 reach assertion conditions match after expanding cached expressions. The dispatch expression, evaluated with a stubbed section test, invokes inputs, fixtures, variants and scope exactly once with the intended bindings.
_forkedcollects job failures and exceptions;self_testreturns 1 when failures remain. - Gates: no assertion, tolerance or pin was removed or relaxed.
- Escape catalog: C1–C4 do not match. Separate scratch trees and temporary homes prevent cross-job mutation;
section=Noneretains the sequential path.
Notes
Dryer and crapper did not run because no Rust file changed. Validation used syntax-tree comparison and the stubbed dispatch check; the full recipes suite was not rerun.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
Collaborator
Author
|
The review is done and the contribution check passed, so I'm merging this. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
check-recipes의 입력 key self-test를 독립 구간으로 나눠 병렬로 실행해 전체 시간을 줄입니다.What and why
tools/check-recipes.shspends most of its wall time inkey_self_testintools/recipes.py. That test runs four independent contracts one after another in a single job: the input classes, the fixture tier, the variants and the model scope. Each contract already works on its own scratch tree and manifest, so nothing forces them to run serially.This PR registers them as four separate jobs in the existing
_forkedrunner (key inputs,key fixtures,key variants,key scope). Each job gets its own scratch tree, manifest and temporaryHOME, so the Reach cache it writes disappears with it.section=Nonestill runs the old sequential order for diagnosis. The self-test also prints a time per key section next to the existing slowest-section line. A first commit reuses probe results the test had already computed instead of recomputing them in later assertions.No assertion was dropped. The
expectcalls insidekey_self_testare the same 94 before and after, compared as syntax trees. The product code that computes and verifies keys is unchanged.Release notes: internal | the recipes check finishes sooner because its key self-test sections run in parallel.
Code shape
_forkedandunittest.mock.patch._forkedcollects each job's failures as before.cargo fmtandcargo clippy: no Rust is touched, so I did not run them.Duplication found or removed (
path:line), or "none": none.What I ran
The check ran on a four-core x86 Linux box (AMD Ryzen 5 PRO 6650H), pinned to four logical CPUs, with CPython 3.12.15 and
RUSTFLAGS='-C target-cpu=x86-64-v3'. Both arms ran back to back in one sitting: this branch first, then upstreammain. Each arm was:Wall time of
check-recipeson one run per arm:mainwall= 770.03and themainrun reportswall= 971.40.The saving comes from running the sections in parallel. The work itself is the same, and the extra jobs compete for the same four CPUs. On an earlier comparison of the same change the key reach section grew from 362 s to 557 s. The check is still shorter overall, but it is one run per arm on one machine, so I make no claim about significance or about other CPU counts. The next candidates are listed below.
I also compared the
expectcalls ofkey_self_testbefore and after as syntax trees (94 identical), ran the real dispatch to confirm each of the four sections is called exactly once, and checked three source mutants against that test: dropping a section, losing thesection=sectionbinding, and deleting a base assertion. All three were rejected.This is Python tooling for the check only, so the GPU path is untouched. Anything beyond the runs above is left to CI.
Hardware (if the change is for a machine)
Not applicable. CPU-only tooling change. The timing conditions are listed above.
What I ran into
This does not block the PR; these are candidates for follow-up work.
key inputs. Its global-input loop prepares the analysis five times in one place. Splitting that loop from the rest keeps every assertion, but it adds fixture setup and more CPU contention, so it needs its own full-check measurement.AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.