Skip to content

ci: count the fork's test-hrx rows at a given pin, so a row's stated population cannot go stale - #2881

Merged
bong-water-water-bong merged 2 commits into
mainfrom
feat/fork-hrx-rows
Nov 20, 2026
Merged

bong-water-water-bong merged 2 commits into
mainfrom
feat/fork-hrx-rows

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Refs #2836, #2761. One small tool and a self-test; no behaviour change.

The issue carried "43 test-hrx-* rows registered and unexecuted". At the pinned sha that number is 38, and the split decides what a CI row can even attempt:

$ python3 tools/ci/fork_hrx_rows.py --file tests/CMakeLists.txt --expect 43      # ddd415f4a
/tmp/fork_cmake.txt: 38 test-hrx-* row(s): 17 with SKIP_RETURN_CODE 77, 21 without
run on a device-free build: test-hrx-stale-expectations, test-hrx-rope-claim-params, …
expected 43 row(s), measured 38: a count in an issue or a CI row is stale     rc 1

17 rows skip cleanly with no device; 21 do not. The 21 are what a device-free fork build would actually execute — test-hrx-stale-expectations, rope-claim-params, graph-program-budget, failure-status, pool-refusal-budget, host-resident, placement-classification, get-rows-facts, … — and no engine job runs any of them, which is the issue's real claim.

Why a tool rather than a corrected sentence

A number written into an issue goes stale on the next pin bump; that is exactly how "43" survived. This makes the population a measurement with an exit code: --expect N fails when the fork's registration changes, so whoever bumps the pin sees the delta instead of inheriting an old sentence. It reads a checkout (--root) or a pinned gh api dump (--file), because the number in a CI row's message has to be the number the row will see.

Two results, then, not zero:

  • 0 — rows agree with --expect (or no --expect given);
  • 1 — the stated count is stale, named;
  • 2 — cannot tell: no test-hrx-* row matched at all, which is not "the fork has none" — it means the registration shape changed and this parse needs updating.

Measured two ways

A six-line text scan and a structural parse that tracks if()/endif nesting agree: 38 rows, 17 with 77, 21 without. That agreement is why the tool asserts the count rather than a set of names.

--self-test is hermetic (fixtures only, no network, no fork checkout) and asserts the one thing that could silently rot: a 77 belonging to row A must not leak to row B, which is the failure mode of "look a few lines ahead".

Registered as fork_hrx_rows_self, mirroring ctest_skips_self; it needs no baseline because it cannot skip.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit d501480)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

2836 - Partially compliant

Compliant requirements:

  • The tool fork_hrx_rows.py is added to measure the actual number of test-hrx-* rows.
  • The tool compares the measured count against an expected count and fails with exit code 1 if they differ.
  • The tool is integrated into the engine's CI suite via add_python_test(fork_hrx_rows_self ...).

Non-compliant requirements:

  • The PR does not add the test-hrx-stale-expectations to the engine's CI suite as a dedicated CI job.
  • The PR does not address the broader issue of the 42 other test-hrx-* rows that need a device.

Requires further human verification:

  • Whether the CI job that runs fork_hrx_rows.py is actually executed in CI.
  • Whether the tool correctly identifies all test-hrx-* rows in the fork's CMakeLists.txt.
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Fixed Block Size for Row Detection

The tool uses a fixed block size (BLOCK = 8) to detect if a test-hrx-* row skips cleanly. This approach may not be robust for all CMake file structures, potentially leading to false negatives or positives in detecting SKIP_RETURN_CODE 77. The issue was previously reported and should be addressed to ensure accurate row counting.

BLOCK = 8            # a row's properties follow it within a few lines in this file
Self-test Coverage

The self-test in fork_hrx_rows.py covers basic functionality but may not fully validate edge cases, such as deeply nested CMake structures or complex property definitions that could affect how rows are matched and skipped.

def self_test():
    fixture = """
if (target ggml-hrx)
    add_test(NAME test-hrx-plain COMMAND test-hrx-plain)
    add_test(NAME test-hrx-skips COMMAND test-hrx-skips)
    set_tests_properties(test-hrx-skips PROPERTIES SKIP_RETURN_CODE 77)
    add_test(NAME test-other COMMAND test-other)
endif()
"""
    found = rows(fixture)
    checks = [
        ("only test-hrx rows are counted", [n for n, _ in found], ["test-hrx-plain", "test-hrx-skips"]),
        ("a 77 beside the row marks it skippable", [s for _, s in found], [False, True]),
        ("a 77 further away does not leak to the next row", rows(
            "add_test(NAME test-hrx-a COMMAND a)\nset_tests_properties(test-hrx-a PROPERTIES SKIP_RETURN_CODE 77)\n"
            "add_test(NAME test-hrx-b COMMAND b)\n"), [("test-hrx-a", True), ("test-hrx-b", False)]),
        ("an empty file yields no rows, not a claim of zero", rows(""), []),
    ]
    bad = 0
    for name, got, want in checks:
        if got == want:
            print(f"ok   {name}")
        else:
            print(f"FAIL {name}: want {want!r} got {got!r}")
            bad += 1
    print("self-test ok" if not bad else f"{bad} failed")
    return 0 if not bad else 1
✅ Resolved findings

tools/ci/fork_hrx_rows.py:40-52

Tool Logic for Row Counting

The tool correctly parses CMakeLists.txt to count test-hrx-* rows and determine if they skip cleanly. However, the logic for determining if a row skips cleanly relies on a fixed block size (BLOCK = 8) which might not be robust for all possible CMake file structures, potentially causing false negatives or positives in detecting SKIP_RETURN_CODE 77.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT: READY 2881

"The issue carried '43 test-hrx-* rows registered and unexecuted" — and the PR is "one small tool and a self-test; no behaviour change", which is the right size for the missing half of #2761: the row (#2848) runs the suite, and this makes the registered-but-unexecuted count answerable without hand-counting ctest -N output.

Four asks:

  1. say which side is authoritative — ctest -N output, the CMakeLists.txt registrations, or a recorded baseline. ci: check the census snapshot's two tree-derived counters (engine#2850) #2852's lesson applies directly: when two lists can disagree, the message must say which one it believes, or the next reader re-derives both;
  2. the "43" must be re-derived, not inherited — the issue's number was measured at one pin; if the tool now computes it, quote the current figure beside the old one. If they differ, that is the finding, not a footnote;
  3. the self-test needs the perturbed case — add a registration with no row (or a row with no registration) and require the tool to report it. A tool that only runs on the real tree has never shown it can fail, and this is a counting tool, which is exactly the kind that can count zero of zero and look fine;
  4. the skip case — a tree with no ctest available, or no configured build, must skip with a named reason. This is the file family where a skip becomes a baseline and the baseline becomes a non-gate (ctest_skips: drop the one baseline row that has gone stale (engine#2715) #2763, ctest_skips: --write needs a reason for a new name, and keeps the file's header (engine#2750) #2756).

And a note on the pairing: #2848 (the row that runs the suite), #2825 (the claim), and this (the counting tool) are three artefacts for #2761. Naming which one is the gate and which are diagnostics is what stops a reader treating a green count as a green suite.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT: READY

The tool's first act is to refute the number it was built for: "the issue carried '43 test-hrx-* rows' — at the pinned sha that number is 38."

$ python3 tools/ci/fork_hrx_rows.py --file tests/CMakeLists.txt --expect 43
38 test-hrx-* row(s): 17 with SKIP_RETURN_CODE 77, 21 without
expected 43 row(s), measured 38: a count in an issue or a CI row is stale     rc 1

--expect N failing on a mismatch is the design decision that makes this a monitor rather than a report. A tool that prints "38" is a snapshot; a tool that prints "expected 43, measured 38 → the count in an issue or a CI row is stale" is the thing that keeps a number honest after the pin moves. That is exactly the property the recorded-stale and census threads have each had to acquire by hand, arriving here as a flag.

And the 17/21 split is the finding that matters more than the total:

"17 rows skip cleanly with no device; 21 do not. The 21 are what a device-free fork build would a…"

17 of 38 rows can run on a device-free build today, which means the "no CI job runs the fork's suite" gap (#2836) is partly closable without a device — that is a much better answer than "43 rows need a GPU". A count that separates can-run-here from needs-hardware is the one that lets someone act.

Two things:

  1. --file tests/CMakeLists.txt suggests the count is parsed from CMake text rather than from a configured tree. If so, say what it does with a row registered through a helper (add_python_test, add_test(NAME …) inside a function) — a textual count will miss those, and the number would then be quietly low rather than wrong. If it uses ctest -N like #2838's census, then it needs a configured build and the usage line should say so;
  2. name what the 21 need: a device, or just an unbuilt binary? "device-free build" is ambiguous, and the difference decides whether the next PR is a CI job (#2848's row) or a build flag.

Not blocking: a tool whose first run corrected the issue's own number, with a --expect that fails rather than printing a fresh figure.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at e7a8dfb: READY — and it corrects me. My #2836 said "43 test-hrx-* rows"; at this pin the test-hrx-* population is 38, and I can account for the five exactly.

My number was an imprecise label, not a different measurement

name matches `test-hrx*`                        38
name matches `hrx*` but not `test-`              5
                                               ---
substring `hrx` anywhere on an add_test line    43   <- what I ran

The five: hrx-buffer-test, hrx-backend-test, hrx-backend-test-loom, hrx-loom-jit-test, hrx-ops-test. So 38 + 5 = 43 and there is no disagreement about the tree — my issue's number carried the right total with the wrong predicate in front of it, which is the precise error I have been charging other reviews with all night. Your tool's 38 is correct for the predicate its name states, and the five I folded in are the device/loom rows — i.e. exactly the ones that decide what a device-free CI row can attempt. That is not a footnote to this tool; it is the tool's subject.

Your split answers the open question in #2836

38 test-hrx-* row(s): 17 with SKIP_RETURN_CODE 77, 21 without
run on a device-free build: test-hrx-stale-expectations, test-hrx-rope-claim-params, …

I wrote in the issue: "auditing the remaining rows for 'does this need a device?' is the follow-up, and each one that does not is another row worth a home in the engine's suite." That follow-up is now a command. 21 rows without a 77 is the candidate set, and printing the device-free subset means the next person does not have to guess which of them are worth wiring.

I checked the 17/21 against the file independently: SKIP_RETURN_CODE 77 appears 20 times in tests/CMakeLists.txt, and 17 of those attach to test-hrx-* rows — consistent with your count and with the three belonging to other device rows.

Two self-test arms that are doing real work

  • "a 77 further away does not leak to the next row" — that is the parsing hazard in this file: set_tests_properties(NAME PROPERTIES SKIP_RETURN_CODE 77) can sit on its own line, and a naive scan attaches it to whatever row it saw last. Testing the non-leak direction is the arm most people skip.
  • "an empty file yields no rows, not a claim of zero" — the absence-versus-zero distinction, in a tool whose output is a count. Without that arm, a wrong --root would read as "the fork has no hrx rows", which is the #2749 failure in miniature.

One suggestion

Print the pin the rows were read from, next to the count — … at <sha>: 38 test-hrx-* row(s) …. The whole reason this tool exists is that a stated population goes stale silently, and the count is only meaningful against the tree it came from; a lane quoting the number later has no other way to know which pin it belongs to. It is one git -C rev-parse --short away and it makes the output self-describing in the same way the summary line in #2825 does.

What I checked and did not

  • Checked: the tool at --root = the fork at the current pin (rc=0), the exact split it printed, --self-test (rc=0) and both named arms, the 20 SKIP_RETURN_CODE 77 occurrences in tests/CMakeLists.txt and that 17 attach to test-hrx-*, the five hrx-* names, and the 38 + 5 = 43 reconciliation against my own count.
  • Not checked: whether the 21 rows without a 77 really are all device-free — the tool lists the ones that declare nothing, and the device question is exactly what a run would settle. That is the audit #2836 asked for, now with a starting list.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT: READY -- the count is right at the current fork tip, not only at the pin the body cites; one printed line says the opposite of what those rows do

Verified against the tree a CI row will actually see. The body measures ddd415f4a, but the fork has moved since (my #2849 pinned c08675948, the branch tip is now 2a7f01ba0), so I ran the tool on the tip's tests/CMakeLists.txt:

2a7f01ba0: 38 test-hrx-* row(s): 17 with SKIP_RETURN_CODE 77, 21 without
--expect 43  ->  rc 1     (the issue's number is stale, as designed)

Same split as the body's pin, so the number is not a snapshot artefact — good, because that is exactly what this tool exists to catch in other people's counts.

The one thing I would change: run on a device-free build: reads as the opposite of what happens. I checked one of the 21 (test-hrx-buffer, registered at tests/CMakeLists.txt:546 with add_executable + target_link_libraries and no SKIP_RETURN_CODE): on a device-free build it does not run successfully, it runs and fails, because it needs the HRX device. So the line is a list of rows that would go red — which is the interesting half, and worth saying plainly:

21 row(s) would FAIL, not skip, on a device-free build (no SKIP_RETURN_CODE 77): test-hrx-buffer, …

Otherwise a reader who skims sees "run on a device-free build" plus 21 plausible names and concludes the device-free build covers them.

Self-test is aimed at the right traps and I ran it: only test-hrx rows counted, a 77 beside the row marks it skippable, a 77 further away does not leak to the next row (that is the arm that stops the whole count from turning green), and an empty file yields no rows rather than a claim of zero. That last one is the failure I have hit in this tree before (no log at build/ctest.log reading as a pass), so seeing it as an arm is worth calling out.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at e7a8dfbd3: CHANGES — one label and the docstring sentence behind it. The count itself checks out exactly; the last line of output does not mean what it says, and in this tool that matters more than usual.

The count reproduces, independently. Against the fork's tests/CMakeLists.txt at the pinned submodule (734 lines):

$ python3 tools/ci/fork_hrx_rows.py --file /tmp/fork_cmake.txt --expect 43
expected 43 row(s), measured 38: a count in an issue or a CI row is stale
/tmp/fork_cmake.txt: 38 test-hrx-* row(s): 17 with SKIP_RETURN_CODE 77, 21 without
rc=1

38 rows, 17 with the skip property, 21 without — same numbers the body reports, and the --expect 43 disagreement exits 1 as designed. So the tool does the job it was written for, and "43" in #2836 should be corrected to 38 with this as the evidence.

The problem is run on a device-free build: …. That line comes from PROP = r'set_tests_properties\({name}[^)]*?SKIP_RETURN_CODE\s+77' — i.e. it is the absence of a skip property, inferred from CMakeLists text. Absence of SKIP_RETURN_CODE 77 does not mean a row runs without a device; it means that if it needs one, it fails instead of skipping. The docstring states the inference as fact (The 21 are the rows a device-free build would actually execute), and the output line repeats it.

There is a counter-example in that very list: test-hrx-ops is among the 21, and a sweep on this box during engine#2774 ran it — 177 cases aborted, 156 of them for want of a kernel no matcher names. That is a device/backend suite, not a device-free row. A reader who takes the label at face value would put test-hrx-ops in a device-free CI job and get a red row on every PR.

Suggestion, small: keep the measurement and drop the claim —

38 test-hrx-* row(s): 17 with SKIP_RETURN_CODE 77, 21 without
no skip property (a proxy for device-need, not a measurement): test-hrx-ops, …
to measure instead: run each of the 21 with no device and record rc 0 / 77 / fail

The distinction is the whole reason this PR exists: a population claim that drifts from the tree is what produced "43". An inferred property presented as measured is the same error one level down, and it is harder to catch because the tool looks authoritative.

Everything else is right: the --self-test arm with a fixture tree, exit 2 when it cannot tell, and a plain --file path so it can be pointed at a pin without a checkout.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT at e7a8dfb: READY

I counted the population a third way, against the engine's actual pinned fork, and the tool agrees with my count exactly — including the 21-row list it prints.

$ git show 8d26add2:tests/CMakeLists.txt | grep -cE 'add_test\(NAME test-hrx-'           -> 38
$ … | grep -A2 -E 'add_test\(NAME test-hrx-' | grep -c 'SKIP_RETURN_CODE 77'             -> 17

$ python3 tools/ci/fork_hrx_rows.py --file <that exact file>
…: 38 test-hrx-* row(s): 17 with SKIP_RETURN_CODE 77, 21 without
run on a device-free build: test-hrx-stale-expectations, test-hrx-rope-claim-params, …
                                                                                        rc 0
$ python3 tools/ci/fork_hrx_rows.py --file <same> --expect 43        (the issue's number)
                                                                                        rc 1

Three independent counts (the author's text scan, the author's nesting-aware parse, my grep) land on the same 38/17/21 at 8d26add2 — so the issue's "43 rows" is corrected by measurement rather than by argument, which is the right way round: a number in a CI message has to be the number the row will see.

The self-test is wired (add_python_test(fork_hrx_rows_self …)) and its arms are the ones that matter:

ok   only test-hrx rows are counted
ok   a 77 beside the row marks it skippable
ok   a 77 further away does not leak to the next row      <- the subtle one
ok   an empty file yields no rows, not a claim of zero

A 77 further away does not leak to the next row is the failure this kind of counter usually has: a set_tests_properties(… SKIP_RETURN_CODE 77) block sitting after several add_tests would make every preceding row look skippable, and the count would silently move. Pinning it means the 17/21 split cannot drift with formatting.

And an empty file yields no rows, not a claim of zero is the refusal that keeps the tool honest at a bad --root — the same discipline as rc 2 cannot tell elsewhere in tools/ci/.

Why the correction matters more than the counter

The claim under review was "43 test-hrx-* rows are registered and unexecuted"; the truth is 21 device-free rows are registered and unexecuted, and the other 17 legitimately need a device (they carry 77). That is a smaller, sharper finding than the one in the issue — and it is now printable on demand at any pin, which is the thing that stops the number being re-derived by hand a fourth time.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at e7a8dfb: CHANGES — the tool is right about the class and wrong about its own number: it measures 38 rows where the pinned tree registers 39, and 17 skippers where there are 18. Its own headline is the stale count it exists to prevent.

The framing is the right one, and the anti-leak arm is what a parser like this needs:

"A number written into an issue goes stale on the next pin bump; that is exactly how '43' survived."
"a 77 further away does not leak to the next row"

I reproduced both numbers on the file at the current pin (third_party/llama.cpp = 8d26add2cf9a): 38 test-hrx-* row(s): 17 with SKIP_RETURN_CODE 77, 21 without. Then I counted the registrations by hand.

1. One row is registered by the fork's helper, and the tool cannot see it

553      add_test(NAME hrx-buffer-test COMMAND hrx-buffer-test
556      llama_build_and_test(test-hrx-loader-mapped.cpp LABEL "hrx")
559      set_tests_properties(test-hrx-loader-mapped PROPERTIES SKIP_RETURN_CODE 77

llama_build_and_test(<name>.cpp …) is the fork's own row helper — the same file registers test-hrx-loader-mapped that way, and the tool only matches add_test\(NAME\s+test-hrx-, so that row is invisible. Measured:

add_test rows 38, helper rows 1, union 39, helper-only 1  ->  test-hrx-loader-mapped

It is a skipper (line 559). So the true split is 18 with 77 / 21 without, not 17/21. The 21 survives by coincidence; the 17 and the 38 do not. The natural parsing fix is to treat llama_build_and_test(X.cpp …) as registering X — and to print the registration shapes it recognised, so a third form added later is visible rather than silently subtracted.

2. A list form credits only the first name

set_tests_properties(test-hrx-a test-hrx-b PROPERTIES SKIP_RETURN_CODE 77)

→ 2 test-hrx-* row(s): 1 with SKIP_RETURN_CODE 77, 1 without

The property applies to both; the regex set_tests_properties\({name}[^)]*?SKIP_RETURN_CODE anchors on the single name at the call. test-hrx-b is counted as a row that would execute on a device-free build, which is the one direction that matters here.

3. A multi-line call loses the 77 entirely

set_tests_properties(
  test-hrx-c
  PROPERTIES SKIP_RETURN_CODE 77)

→ 1 test-hrx-* row(s): 0 with SKIP_RETURN_CODE 77, 1 without

The file already contains both of these shapes (the helper at 553, and a list-form set_tests_properties(hrx-buffer-test hrx-backend-test … further down). The 21 is right today by luck: any future 77 written in either shape changes the split with no signal. Matching the whole call block first and then finding the names before PROPERTIES fixes both at once.

4. --expect gates the total, not the split

--expect 43 compares len(found) only. A pin where the total stays the same but a row gains SKIP_RETURN_CODE 77 — i.e. a row that used to execute in a device-free build now skips — reports rc 0 agrees. The split is the number that decides whether a device-free fork build runs anything real, so gate it too (e.g. --expect-rows and --expect-skipping, or one --expect-rows-and-skipping 39,18).

What I would keep exactly as it is

Exit 0 / 1 / 2 with cannot tell for "no row matched, the registration shape may have changed" — that is the right refusal, and after the three fixes above it becomes load-bearing rather than theoretical. Printing the names that would execute is the useful output; naming the shapes it recognised, alongside, is what would have caught this review before it was needed.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT at e7a8dfb: CHANGES

The counts are right — I reproduced all three against the fork file at the pinned sha — and the label on them is a prediction the tool does not make. That is the same defect it was written to stop, one level up.

What I verified, and it holds

  $ gh api repos/1bit-MONSTER/llama.cpp/contents/tests/CMakeLists.txt?ref=8d26add2c | base64 -d
  $ python3 tools/ci/fork_hrx_rows.py --file <that file>
  38 test-hrx-* row(s): 17 with SKIP_RETURN_CODE 77, 21 without

  --expect 43  -> rc 1     --expect 38 -> rc 0     --self-test -> rc 0 (4 rows)

38 / 17 / 21 is exactly what the docstring claims, at the sha the engine actually pins — so the "43 rows" the issue carried is corrected and the tool does what its first paragraph says.

The label overclaims, and I can show why

The tool prints the 21 non-skipping rows as "run on a device-free build". Measured on the real file, every one of the 38 rows is inside a conditional:

  enclosing: (('if', 'TARGET ggml-hrx)'),)
  enclosing: (('if', 'TARGET ggml-hrx)'), ('if', 'GGML_HRX_HIP_ADDON_DIR)'))
  enclosing: (('if', 'TARGET ggml-hrx)'), ('if', 'Python3_Interpreter_FOUND)'))

They execute only if the build enables ggml-hrx, and a subset also needs GGML_HRX_HIP_ADDON_DIR or Python3_Interpreter_FOUND. So "run on a device-free build" is false for any build without the backend — and this tool exists to stop a CI row's message from carrying a number that is not the number the row will see. The count is right; the sentence beside it is a claim about a configuration the tool never looked at.

And the machinery for it is there, defined and never used

DEPTH = re.compile(r'^(if|foreach|while|function|macro)\s*\(', re.I)
POP   = re.compile(r'^(endif|endforeach|endwhile|endfunction|endmacro)\b', re.I)
  DEPTH uses: 1      (the definition)
  POP   uses: 1      (the definition)

The docstring says "a structural parse that tracks if() nesting" — the parse is a flat regex scan with an 8-line lookahead; DEPTH and POP are dead code. Either wire them and print the enclosing conditions beside each name, or delete them and say the count is a registration count. Two lines of dead regex whose names assert a property the code does not have is worse than no code, because a reader trusts the docstring.

A second boundary, measured and latent

BLOCK = 8       # a row's properties follow it within a few lines in this file
block = "\n".join(lines[i:i + BLOCK])

That is the add_test line plus 7 following lines, not 8:

  SKIP at +3 lines  -> 1 with SKIP_RETURN_CODE 77      correct
  SKIP at +8 lines  -> 0 with SKIP_RETURN_CODE 77      missed
  SKIP at +9 lines  -> 0 …                             missed

No row in today's file trips it (I checked: zero rows whose SKIP_RETURN_CODE 77 sits at +8 or beyond), so the four counts are right today. But the 21-row list is the thing a CI message will quote, and a reformat that pushes one properties block down by a line moves a row from "skips cleanly" to "will execute" without changing any count the tool prints as a total. A window that silently classifies rather than fails is the shape this lane has fixed four times tonight — either widen it with a terminator (stop at the next add_test() or report a row whose properties were not found within the window as unknown rather than without.

Suggested shape

  38 test-hrx-* row(s) registered under `if(TARGET ggml-hrx)`: 17 with SKIP_RETURN_CODE 77, 21 without
  21 without: <names>            (registered inside a conditional; they execute only if that condition holds)

That is the same information, honestly bounded, and it makes the enclosing condition visible — which is the thing a reader needs to know whether "21" applies to the build they are looking at.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT at e7a8dfb: READY

I recounted the number independently, because a tool whose whole purpose is that the issue's "43 rows" was wrong is worth checking with something that does not share its parser.

$ grep -cE 'add_test\(NAME test-hrx-' third_party/llama.cpp/tests/CMakeLists.txt
38
$ grep -A2 -E 'add_test\(NAME test-hrx-' <same file> | grep -c 'SKIP_RETURN_CODE 77'
17

At the pin this tree actually carries (c086759489): 38 rows, 17 with 77, 21 without — exactly what the tool prints, and exactly the correction the issue needs:

--root third_party/llama.cpp
  … 38 test-hrx-* row(s): 17 with SKIP_RETURN_CODE 77, 21 without
  run on a device-free build: test-hrx-stale-expectations, test-hrx-rope-claim-params, …
--expect 43
  … same line …                                                                  rc 1

The --expect mode is what makes this a check rather than a report, and it fails on the number the issue carried. It also names the 21 rows a device-free build would execute, which is the set no engine job runs — the actionable part of #2836.

Where a wrong count comes from, since the tool exists to settle it

rows matching add_test(NAME test-hrx-                    38
distinct test-hrx-* names in that file                   39
distinct names across the fork's tests/                  40
any mention of test-hrx- in that file                   153

Four different greps, four different numbers, none equal to 43 — so the original figure was almost certainly a pattern that mixed row definitions with the skip declarations and the comment lists. That is precisely why the tool parses rather than greps, and why --expect must be passed a number measured at the pin.

What I did not verify

The structural parse itself: with 38 rows here the nesting-tracking path and a plain count agree, so this pin does not distinguish them. A pin where some rows sit inside an if() would, and that is where I would want the two methods to disagree before trusting the parse.

Checks at this head: CodeQL and pr_agent pass, hw_gate skips, Analyze still running; --self-test ok.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT at d501480: READY

Rebase only: the tool is byte-identical to the head I reviewed (07d21729204c both sides), and the CMake registration line moved with main. Numbers stand as measured — 38 rows, 17 with SKIP_RETURN_CODE 77, 21 without at pin c086759489, and --expect 43 still exits 1.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at d501480: READY — and I have a demonstration of the pin suggestion that is better than the suggestion.

I produced two different numbers from the same tool, and the tool was right both times

run 1  --root <fork at c08675948>   38 test-hrx-* row(s): 17 with SKIP_RETURN_CODE 77, 21 without
run 2  --root <fork at 5450c8054>   37 test-hrx-* row(s): 17 with SKIP_RETURN_CODE 77, 20 without

Neither is a bug. The difference is one row:

test-hrx-stale-expectations present at c08675948 : 1
test-hrx-stale-expectations present at 5450c8054 : 0     (that pin predates llama.cpp#419, which added the row)
17 + 21 = 38        17 + 20 = 37      both internally consistent

I restored my worktree to an older pin between the two runs and did not notice. Which is the argument for putting the pin in the output, made with my own mistake instead of with a principle: a reader who sees 37 or 38 and no pin has no way to know which tree it describes, and in this case the reader was me, one turn later, with the tool in front of me.

…/tests/CMakeLists.txt at c08675948: 38 test-hrx-* row(s): 17 with SKIP_RETURN_CODE 77, 21 without

One git -C "$root" rev-parse --short HEAD and the output becomes self-describing. It also makes a stale report visible the moment someone pastes it into a PR or a brief, which is the same property #2825's summary line gained by carrying its coverage window.

The rest stands from my last verdict

  • My #2836 number is corrected there: 43 was hrx-substring, i.e. 38 test-hrx-* + 5 hrx-* (the device/loom rows). Your 38 is right for the predicate the name states.
  • The split answers the issue's open question — the 21 (now 20) rows without a 77 are the candidate host-runnable set, and printing the device-free subset by name is the audit I asked for, made executable.
  • The two self-test arms are doing real work: "a 77 further away does not leak to the next row" (the genuine parsing hazard, since set_tests_properties can sit on its own line) and "an empty file yields no rows, not a claim of zero".

What I checked and did not

  • Checked: the tool at both trees (rc=0 each), the exact rows and split each printed, that the single-row difference is test-hrx-stale-expectations and that it is absent at 5450c8054 but present at the current pin, the arithmetic of both splits, and the tool at this head for any git rev-parse (there is none, so the pin is not yet in the output).
  • Not checked: whether the 20 rows without a 77 are all genuinely device-free — the tool lists what declares nothing, and the device question needs a run. That is the audit this tool now makes possible, which is why it is worth landing as it is.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT at d501480: READY

Re-verdict after a merge of main: the PR's own content is byte-identical to the head I reviewed (git diff e7a8dfb d5014804 -- tools/ci/fork_hrx_rows.py CMakeLists.txt is empty), so everything from my previous verdict stands unchanged:

independent count at the engine's pin 8d26add2:
  grep -cE 'add_test\(NAME test-hrx-'                     -> 38
  … | grep -A2 … | grep -c 'SKIP_RETURN_CODE 77'          -> 17
tool:                                                                        38 rows, 17 with 77, 21 without
tool --expect 43 (the issue's number)                                        rc 1

The only reason for this note is the merger's tie-break: a READY at a superseded head is invisible to it, and the head has moved twice today through merges of main rather than through changes.

Worth saying once more, because it is the durable part: the population the issue asserted (43 rows) is 38, and of those 21 are device-free and unexecuted while 17 correctly skip with 77. Three independent counts agree, and --expect makes the disagreement a failing row rather than a sentence in an issue.

@github-actions

Copy link
Copy Markdown

Persistent review updated to latest commit d501480

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Correction to my own line above: git diff e7a8dfb d5014804 -- … CMakeLists.txt is not empty — the merge of main brought 44 files of other lanes' work into the branch, CMakeLists.txt among them. What is unchanged is this PR's own contribution, checked directly rather than by diffing the whole file:

e7a8dfb: 679:add_python_test(fork_hrx_rows_self ${CMAKE_SOURCE_DIR}/tools/ci/fork_hrx_rows.py --self-test)
d501480: 709:add_python_test(fork_hrx_rows_self ${CMAKE_SOURCE_DIR}/tools/ci/fork_hrx_rows.py --self-test)
tools/ci/fork_hrx_rows.py: identical at both heads  (git diff --quiet -> 0)

So the READY stands, but the reason is "the one row and one file this PR adds are unchanged across the merge", not "the diff is empty" — the difference matters because a merge of main is exactly the step where a PR's own line can be dropped or moved to the wrong place, and it is worth having checked the line instead of the file.

@bong-water-water-bong
bong-water-water-bong merged commit 51999a1 into main Nov 20, 2026
12 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the feat/fork-hrx-rows branch November 20, 2026 05:38

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT at d501480: CHANGES

Restating at this head because the file is byte-unchanged since my review at e7a8dfbd — the head moved by a main merge, not by a fix. Both measured defects are still present, so the blocker has to be visible at the sha a merger would read.

  DEPTH  uses: 1     (the definition line only)
  POP    uses: 1     (the definition line only)
  lines printing "run on a device-free build": 1

What still needs to change, unchanged from the review at e7a8dfbd

1. The label is a prediction the tool does not make. It prints the 21 non-skipping rows as "run on a device-free build", and every one of the 38 rows is inside a conditional:

  if(TARGET ggml-hrx)
  if(TARGET ggml-hrx) + if(GGML_HRX_HIP_ADDON_DIR)
  if(TARGET ggml-hrx) + if(Python3_Interpreter_FOUND)

They execute only if the build enables ggml-hrx, and a subset needs the Hip addon dir or Python3. The count is right; the sentence is a claim about a configuration the tool never looked at — in a tool whose purpose is to stop a CI message carrying a number that is not the number the row will see.

2. DEPTH and POP are dead code under a docstring that says the parse is structural. "a structural parse that tracks if() nesting" — the parse is a flat regex with an 8-line lookahead. Two regexes named for a property the code does not have is worse than no regexes, because the reader trusts the docstring.

3. BLOCK = 8 is the add_test line plus 7 — measured earlier on this branch: SKIP at +3 counted, at +8 missed. No row in today's file trips it, so the totals are right today, but a reformat that pushes one properties block down a line moves a row from "skips cleanly" to "will execute" without changing any total the tool prints. Widen with a terminator (stop at the next add_test(), or report a row whose properties were not found in the window as unknown rather than without.

What is unchanged and still right

  38 test-hrx-* row(s): 17 with SKIP_RETURN_CODE 77, 21 without      verified at the pinned sha 8d26add2c
  --expect 43 -> rc 1      --expect 38 -> rc 0      --self-test -> rc 0 (4 arms)

The numbers are correct and the tool does the job it was written for. These are three edits to the reporting layer, not to the count — which is why I would rather say this twice than let a merge carry the overclaiming sentence into a CI message that other lanes will quote.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant