Skip to content

contrib-check: run the Python self-tests once, inside check-recipes - #681

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:contrib-check-t0-speed
Oct 22, 2026
Merged

juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:contrib-check-t0-speed

Conversation

@juliankang4

Copy link
Copy Markdown
Collaborator

contrib-check의 T0 단계가 같은 Python self-test를 두 번 돌리던 중복을 없애서 T0를 더 빠르게 만드는 변경입니다.

What and why

just contrib-check --tier t0 ran the Python self-tests twice. It added recipes-self-test and one unit for each self-test in the selftests=( array of tools/check-recipes.sh, 69 units in all (tools/contrib-check.sh:194 to :199), and ran them one after another. The check-recipes unit, which T0 also runs, calls the same commands: blk_selftest runs python3 tools/recipes.py --self-test (tools/check-recipes.sh:79) and blk_pytools runs each tool of that array (tools/check-recipes.sh:439).

In two public CI runs of T0, the 69 duplicate units took 230 s of a 944 s run and 338 s of a 1441 s run, about 24% of the wall time each.

T0 no longer adds those units. check-recipes runs the same commands, so the checks are the same and no tool loses its self-test. If a self-test fails, blk_pytools names the tool and prints its output. T1 skips recipes-self-test from host-nightly, because check-recipes already ran it in T0. The header comment and docs/contrib/local-check.md describe the new split. The comment in tools/check-recipes.sh that said contrib-check.sh reads the same list is removed, since it no longer does.

Release notes: Under the hood: contrib-check --tier t0 runs the Python self-tests once, inside check-recipes, and finishes sooner.

Code shape

  • No second copy. The self-test list has one owner, the selftests=( array in tools/check-recipes.sh. tools/contrib-check.sh no longer parses it, so the second run path is gone.
  • Model code holds only architecture facts. No model or engine code changes.
  • Dead code is gone. The add lines, the sed that read the array and the branch that stopped on an empty array are removed, along with the stale comment in tools/check-recipes.sh and the header text that named the self-tests.
  • No silent failure. A failing or missing self-test module is reported by blk_pytools with the tool name and its output.
  • Comments state what is true now.
  • No relaxed gate. No check was removed: every command the dropped units ran still runs inside check-recipes.
  • cargo fmt and cargo clippy: no Rust changes (shell and Markdown only).

Duplication found or removed (path:line), or "none": the Python self-test commands ran from both tools/contrib-check.sh:194 to :199 and tools/check-recipes.sh:79 and :439. They now run only from tools/check-recipes.sh.

What I ran

Head bc95e3c0068aa31982da4686cc9d5ad046df0b0e, base 40fec962613b9f08e8318f7a53c133d4f58e65e8 (main). Main and then the head ran just contrib-check --tier t0 on one Linux x86_64 machine, one run each.

Arm Commit Units Red Wall
main 40fec96 107 0 623 s
head bc95e3c0 38 0 440 s
  • The 69 dropped units all passed on main, 190 s in total on this machine [derived].
  • The 38 remaining units passed on both arms, 433 s on main and 440 s on the head [derived]. check-recipes took 185 s on main and 188 s on the head and passed on the head, so every self-test it runs passed.
  • This is one pair of runs, so I make no claim about run-to-run noise. The CI saving is an estimate [derived]: subtracting the 230 s and 338 s above gives about 714 s and 1103 s instead of 944 s and 1441 s.

What I ran into

None of this blocks the PR.

  • The two CI runs differ a lot in wall time (944 s and 1441 s) for the same set of units. The log of the slower run lists a CPU feature set without AVX-512, and the faster run lists AVX-512 (avx512f, avx512_bf16 and others). Every unit is about 1.5 to 2 times slower on the slower run, which points to the runner CPU. This PR does not change that.

Hardware (if the change is for a machine)

One Linux x86_64 machine with an AMD Ryzen 5 PRO 6650H, no GPU, running only just contrib-check --tier t0.

AI help

AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.

@github-actions github-actions Bot added documentation Improvements or additions to documentation tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo labels Oct 22, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: CLEAN: The removed self-test invocations remain covered by check-recipes, and their failures still fail the contributor check.

Checked

Duplicates: 0 new functions, types or constants. All 69 removed standalone invocations map to unchanged self-test commands in check-recipes.
Complexity: one explicit T1 skip added to plan construction; no Rust functions changed.
Silent failure: followed both retained wrapper paths through scheduler result files, report, and the contributor's red-unit count. Failures remain visible and nonzero.
Tests: both changed shell scripts pass bash -n. Static comparison confirms the 68 listed tool commands are unchanged; recipes.py --self-test is the 69th command. No tests changed; mutation review is not applicable.
Gates: no thresholds or test clauses changed. The deleted invocations duplicate retained checks.
Escape catalog: no matching defects; the plan-filter pipeline retains pipefail.

Notes

No Rust files changed. Full T0/T1 runs and the reviewer's isolated runtime checks were not repeated during validation.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

Filed outside this PR: #683

@juliankang4

Copy link
Copy Markdown
Collaborator Author

The review is done and the contribution check passed, so I'm merging this.

@juliankang4
juliankang4 merged commit 31b5be4 into midagedev:main Oct 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant