Repository navigation
tests: profile run.sh sections and inventory every suite call - #904
pithead-developer[bot] wants to merge 11 commits into
Conversation
…t of #875) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
FAIL What I investigatedIssue #875 requires opt-in section timing with unchanged suite output and pass totals, a three-run whole-suite and per-section baseline on the CI runner type, and an accurate inventory that detects added, removed, or repeated calls. Head 7d47f86 has green GitHub checks, but the baseline omits part of the suite, the inventory accepts lost and duplicated calls, and regeneration can damage files.
Reviewed head: What are the gaps
Models: gpt-6.2-astra (reviewer); gpt-6.2-sol x3 (angles) |
…y, profile in CI (part of #875) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…xes (part of #875) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
FAIL What I investigatedIssue #875 requires opt-in timing with unchanged suite output, a three-run CI baseline, and an inventory that counts each unit and detects missing or repeated calls. I reproduced the timing baseline at c3a1bfb, but the inventory accepts duplicate execution, misassigns passes, and can overwrite caller-owned configuration during regeneration.
Reviewed head: What are the gaps
Models: gpt-6.2-astra (reviewer); gpt-6.2-sol x3 (angles) |
… masked headers, count result records (part of #875) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
FAIL What I investigatedRe-review of c3a1bfb..509bf48 against issue #875 (opt-in per-section profile, three-run CI baseline, an inventory of every section and suite call with counts, a selftest that fails on any gained, lost or repeated call, unchanged suite behaviour). F904-12 to F904-17 are fixed and each fix is test-backed, but F904-3 still stands on the reviewer's round-2 reproduction (a blank or comment line inside the
Reviewed head: What are the gaps
Models: claude-fable-5-2 (reviewer); gpt-6.2-sol x3 (angles) |
…nk lines, refuse short or ambiguous output (part of #875) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
FAIL What I investigatedRe-review of 509bf48..763101e (one worker commit, 8 files) against issue #875: opt-in per-section profile, three-run CI baseline, an inventory of every section and suite call with counts, a selftest that fails on any gained, lost or repeated call, unchanged suite behaviour. F904-3, F904-21, F904-22 and F904-23 are fixed and each fix goes red under a mutation I ran, but the recipe scanner still accepts two commands on one recipe line (an uninventoried suite, or tests/run.sh twice, passes
Reviewed head: What are the gaps
Models: claude-fable-5-2 (reviewer); claude-sonnet-5-5 x3 (angles) |
|
FAIL What I investigatedRe-review of
Reviewed head: What are the gaps
Models: claude-fable-5-2 (reviewer); claude-sonnet-5-5 x3 (angles) |
…prerequisite-carrying test-suite rule (part of #875) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
PASS What I investigatedRe-review of 445e3b8..f8c1984 (one worker commit, five files under tests/ and docs/dev/) against issue #875: opt-in per-section profile with an unchanged default path, a three-run CI baseline, an inventory of every section and suite call with counts, a selftest in
Reviewed head: Models: claude-fable-5-2 (reviewer); claude-sonnet-5-5 x1, gpt-6.2-sol x2 (angles) |
Owner brief for
|
What's the problem
Part of #875
tests/run.shwas never profiled, and the standalone suites run from it and frommake test-suitewere not inventoried, so the isolation and parse-reuse work in #624 had no "before" and could silently drop or double-run assertions.How I fixed it
RIGFORGE_SUITE_PROFILE=1 make test-suiterunstests/run.shthroughtests/suite-profile.py, which passes stdout through untouched and prints per-section seconds, tick counts and the total to stderr. Unset, the recipe is the samebash tests/run.sh.tests/run.shis not edited (its line count is pinned). The CITest suitejob sets the variable so every CI run logs its profile;suite-profile.py --aggregateturns such logs into per-section median/p90.docs/dev/suite-inventory.tsvlists every section (190), sourced suite (11), chained suite (48) andmake test-suitesuite (34), with call site, stream passes and standalone passes.tests/suite-inventory.py --checkfails on a missing or stale row, a suite called twice (also twice in one section), a suite in both run.sh and the Makefile in any recognised invocation form, atest-suiterecipe that does not runtests/run.shexactly once, an unrecognised recipe line (one command per line, plainPYTHON*/LC_*/LANG/TZsettings only, no conditional wrapping a recipe line), a Makefile with other than onetest-suiterule or with prerequisites on it, and any difference between the recipe it read and whatmake -n test-suiteruns on the checkout, withRIGFORGE_SUITE_PROFILEunset and set to 1.0 failedand every run.sh header printed, else nothing is written): sourced suites keep only their own assertions, expanded headers match their literal key, and GitHub-masked (***) headers match exactly one unit or stop the generation. Regeneration never launches a sourced fragment; chained suites get the arguments run.sh passes them ($SCRIPT,$ROOTresolved, anything else is-); every measured suite runs in its own process group with scratchHOME/TMPDIR, inheritedRIGFORGE_*removed and the group killed at exit or timeout; standalone counts use a summary line or leading result records, not a footer. The new file is published atomically after its own selftest and--check. Counting and isolation live intests/suite_counts.pyto keeptests/suite-inventory.pyunder the 400-line budget.tests/test-suite-inventory.sh(38 cases: the committed inventory on the checkout, settings inherited from an outer make, a suite appended with its inventory row, a commented-out call, blank/comment recipe lines, a conditional around another target, and mutations each shown red; every recipe line, thetests/run.shline, sourced suite and section header it mutates is read from the checkout, not a constant),tests/test-suite-inventory-generate.sh(fixture regeneration) andtests/test-suite-profile.sh(wrapper, make recipe, aggregate) run inmake test-suite; all three plus the wrapper are registered intests/manifest.json.docs/dev/suite-profile.mdrecords the CI baseline and the definitions;docs/dev/suite-profile-baseline.tsvholds all 239 per-section rows.read-unpacked loop in run.sh through a fixed alias and does not follow suites that suites call; upgrade when a second such loop appears.Here is the proof
Baseline: three runs of the CI
Test suitejob onubuntu-24.04(head f989d68, one run and two reruns), profile on. Each endedrigforge tests: 2858 passed, 0 failedwith 239 sections; the unprofiled run of the sametests/run.sh(job 145314443337, head 7d47f86) ended with the identical summary.tests/run.shsmake test-suitestep sPer-section median/p90 for all 239 sections are in
docs/dev/suite-profile-baseline.tsv; the top three (appliance mode 264 s, msr-apply 55 s, e2e-real watchdog 34 s) are 60% of the section time. Onesource rigforge.shcosts 25 ms locally; the parse cost is not the dominant one.bash tests/test-suite-profile.sh: stdout identical, exit status kept, make recipe with and without the variable)docs/dev/suite-profile.md, with the named parse hotspotmake test-suitegit diff origin/develop -- tests/run.shis empty; profiled and unprofiled summaries identical (2858 passed, 0 failed)Second review round (head 509bf48; GitHub checks re-read after push):
tests/suite_counts.pychild_environment/run_isolated;bash tests/test-suite-inventory-generate.sh->PASS: measured suites write neither the caller state folder nor the checkout(externalRIGFORGE_STATEsentinel kept, checkout file list unchanged).tests/test-state-lib.shstill counts 70 because make suites get no revision key, as undermake.suite_counts.Matcher.masked_header; regenerated from job 145338863771:_wait_miner_live (#95)8 -> 2,#1250 -> 6; fixture asserts both sections around a***header.call_argumentskeeps"$ROOT/tests/contract/v1/feed.json"; footer no longer counted:test-pool-fields.shnow66(also liveness 7, stress 21, root-guard 38 from itspassed 38line).1 failedor partial output stops before writing; fixture checks both keep the bytes; documented recipe runs the generator only whentests/run.shexits 0.MAKEFLAGS/MFLAGS/MAKELEVEL; the default probe runs under a poisonedMAKEFLAGS=' -- RIGFORGE_SUITE_PROFILE=1'(which selects the profiler without the fix) and the command-line formmake -n test-suite RIGFORGE_SUITE_PROFILE=1is asserted.sleep 300 &and runs past a 3 s timeout; its child is gone afterwards.== headed fragment ==followed directly by a fully dynamic tick (see F904-23).--aggregateescapes control bytes; fixture with a BEL in a label.statistics.median.checkrequires exactly onetests/run.shrecipe, two selftest cases).suite-inventory.py:FAIL: a failed suite output was accepted.Third review round (head 763101e):
make_unitsskips blank and comment lines inside the recipe instead of ending it; new cases (blank,#line, tab-#line) keep every call green and red a suite dropped after them. Red on 509bf48:FAIL: a [] line inside the recipe hid later calls.\033bytes; a second pass feeds the same stream ingh run view --logcaret form and must give identical rows. With raw-ESC stripping removed the selftest fails (does not end in a passing ... summary).run_isolatedkills and reaps the process group in afinally; fixture interrupts--generatewith SIGINT while the slow suite runs and asserts its shell andsleep 300child are gone and the bytes are kept. With the kill outsidefinallyit fails (process ... of the interrupted suite is still running).section first section: expected 1/-, got [2/-]).matches 2 units); withlen(hits) < 1it fails.7 tick lines for 9 passes); with the check disabled it fails.gh run view --logof job 145338863771 has 2907 caret^[[sequences and no raw ESC, and the documented recipe accepts such a log; the fixture now covers both forms.suite-profile.py -- bash -c 'kill -TERM $$'exits 143 (selftest).tests/path is recognised;bash "tests/test-doctor-json.sh"in run.sh is refused. Red on 509bf48:FAIL: a quoted repository-relative call to a make suite is refused: the check passed.Fourth review round (heads 9213f31 and 445e3b8; old = the 763101e scanner, new = this head; reproduced with a throwaway copy of the tree):
MAKE_COMMANDallows only option flags between the interpreter and the onetests/path, and only plainPYTHON*/LC_*/LANG/TZsettings before it.bash tests/test-new.sh && bash tests/test-doctor-json.sh, the;form andbash tests/run.sh && bash tests/test-doctor-json.sh: old green, new red (unrecognised test-suite recipe line);BASH_ENV=tests/test-new.sh bash tests/test-doctor-json.shalso refused.check()also requiresmake -n test-suite(unset andRIGFORGE_SUITE_PROFILE=1, outerMAKEFLAGS/MAKELEVEL/MAKEFILEScleared) to run exactly the recipe lines read: a prerequisite runningtests/test-new.sh, a prerequisite runningtests/run.shagain, a profile-only prerequisite and a second overridingtest-suiterule are all refused; old green on the first and the override.$'\033[1;32m✓\033[0m'); no\uescape and no GNU-sed\t/\nreplacement is left in the three selftests (mutations now use awkENVIRONhelpers). Not run under bash 3.2 or GNU make 3.81 here: neither is installed and CI runs Linux only.tests/README.md;git diff origin/develop -- tests/README.mdadds only that paragraph.ifdef EXTRA/ tab line /endifafter the last recipe line: old green, new red); a conditional below the recipe that wraps another target is accepted.bash tests/test-suite-inventory.sh: noMAKEFLAGSclearing, set instead of ordered comparison, no profiled dry run, refusing every conditional.Fifth review round (head f8c1984; reproduced on throwaway copies of the working tree):
tests/test-suite-inventory.shreads thetests/run.shrecipe line, the first and last suite lines, the last recipe line and the recipe size from the Makefile (awkrecipe_pick), and the sourced line and first section header fromtests/run.sh; the run.sh-twice-through-a-prerequisite case expectsruns $((RECIPE_COUNT + 1)) commands, the test-suite recipe lists $RECIPE_COUNT. New casea suite appended to the recipe together with its inventory row is accepted. Reviewer scenario (suite appended after the last recipe line plus its tsv row):--check284 units match; this head'stest-suite-inventory.shrc=0 andtest-suite-profile.shrc=0;--generateover the job 145338863771 log rc=0 (new suite counted, selftest row 38); the 445e3b8 selftest rc=1 in the same copy. A suite inserted beforetests/run.sh: this head's selftests rc=0, the 445e3b8 profile selftest rc=1 (the default recipe is [bash tests/test-new-first-suite.sh]), fixed by picking the line that ends intests/run.shfrom the dry run instead of line 1.check()now refuses a Makefile with other than exactly one rule namingtest-suiteas a target, or with any other target or prerequisite on that rule line.ifdef EXTRA/test-suite: extra-suites/endifandtest-suite: $(EXTRA_SUITES): 445e3b8 green, this head red (the Makefile has 2 rules for test-suite,has other targets or prerequisites), andmake -n test-suite EXTRA=1 EXTRA_SUITES=extra-suitesshows the extra suite they would run. With the rule check removed the selftest fails (a test-suite prerequisite gated on a make variable is refused: the check passed). docs/dev/suite-profile.md states that a variable-gated prerequisite in an included makefile or under a variable target name is outside the check.Ponytail pass: cut nothing further; each piece answers a finding. No tier-4 job: no worker-to-Pithead contract change.
🤖 Generated with Claude Code