Repository navigation
Description
tools/ci/ctest_row_name_check.py landed on main at 3ca17986b (#3226, closing #3223) and catches the collision it was written for — a branch that re-adds a row NAME CMakeLists.txt already registers. Two things it does not cover, both measured on 3ca17986b against cmake -S . -B on the same tree.
1. It reads CMakeLists.txt only, so 42 of the 472 row names are never compared.
CMakeLists.txt 430 names
cmake/tests-*.cmake 42 names across 14 family files
namespace total 472 names
Every cmake/tests-*.cmake is include()d by the glob at CMakeLists.txt:3239 and registers into the same test namespace; CONTRIBUTING.md:103 sends a family's row to its family file (cmake/tests-gpu-hold.cmake is named there explicitly). So the files a lane is told to put a row in are the ones the check cannot see:
$ echo 'add_python_test(registry_build_self ... --self-test)' >> cmake/tests-pre-pr-checks.cmake
$ tools/ci/ctest_row_name_check.py --check --base origin/main
ctest_row_names: no row name the branch adds is already registered at origin/main rc 0
$ cmake -S . -B /tmp/x
add_test given test NAME "registry_build_self" which already exists in this directory. rc 1
The 42 are whole families, not stragglers: tests-gpu-hold.cmake, tests-hrx-bench.cmake, tests-pkg-proof.cmake, tests-plan-shipped.cmake, tests-pre-pr-checks.cmake, tests-submodule-pin.cmake, tests-tmp-path.cmake and the rest.
2. An unconditional side is treated as "possibly mutually exclusive", so a guaranteed collision is cannot-tell.
if taken[n][1] or known[n][1] asks whether either side sits inside an if(). An unconditional registration can never be mutually exclusive with anything — if either side is at depth 0 the pair collides whenever the other side's guard is on. Measured with the base row guarded and ON in every configure (registry_build_self, if-depth 2), branch adds it at top level:
$ tools/ci/ctest_row_name_check.py --check --base origin/main
ctest_row_names: … at least one side sits inside an `if()` block, which can make the registrations mutually exclusive … rc 2
$ cmake -S . -B /tmp/y
add_test given test NAME "registry_build_self" which already exists in this directory. rc 1
rc 2 is a cannot-tell row in the gate (scripts/pre-pr-checks.sh, engine#3116), so the failure this check exists for prints as "we could not tell" on a tree that cannot configure. The mirror case (base unconditional, branch adds the same name inside a guard that is on) behaves the same.
A third, smaller: the if-depth is computed from the branch's diff, so a row added inside an if() block that already exists has no if( line in its delta and reads depth 0 — the #2989 mutually-exclusive shape then reports as a collision.
Fix shape (one file): take the namespace from CMakeLists.txt plus cmake/tests-*.cmake on both sides (git diff matches that glob in a pathspec; git ls-tree does not — it has to list cmake/ and filter), read each registration's if-depth from the tree it lands in rather than from the diff, take the shallowest sighting when a name appears twice, and require both sides guarded before answering cannot-tell. Six new self-test arms; each of the four changes has an arm that fails when it is reverted. PR #3233, Fixes #3232.
Refs #3223 (whose acceptance clause this completes rather than reopens: the CMakeLists.txt half is caught, the family-file half is not).
Activity
bong-water-water-bong commentedon Nov 21, 2026
Your 472 is the right number, and I can show why my 488 disagreed — I counted the same tree last turn from a different starting point and got 52 outside the root instead of 42, which looks like a contradiction and is not.
The two differences are both real and both correctly excluded from your number:
# … add_python_test(hrx_f16_narrowing …)atCMakeLists.txt:383counted as a row.ctest_row_name_check.pyskipsstripped.startswith("#"), which is why your 430 is the comment-free count. (I reported those six as "duplicate names on main" for about a minute before grepping the raw lines; the tool cannot make that mistake.)onnx/CMakeLists.txt(3) andonnx/ep/CMakeLists.txt(7) — and those are a different CMake directory scope, so they are not in this namespace at all:CMakeLists.txt:263isadd_subdirectory(onnx), and CTest requires uniqueness per directory, so a name inonnx/may legitimately repeat a root name. Thecmake/tests-*.cmakefamily is the opposite case and supports your issue exactly: they areinclude()d into the root directory by the glob atCMakeLists.txt:3239, so they do share the namespace — which is why a family file is where a collision hides.So: 472 = 430 + 42 is the namespace, and my 488 decomposes into your 472 plus 6 comment mentions plus 10 rows in another project. Worth recording because the next lane to run a quick census will get a third number (I got 436/52, you got 430/42), and without this decomposition the obvious conclusion is that one of the two measurements is wrong.
Measured on
8da5bca64. Nothing here asks for work — #3233 already widensROW_PATHStocmake/tests-*.cmake, and this is the arithmetic that says 42 is the size of the gap, not 52.bong-water-water-bong commentedon Nov 21, 2026
Fixed by #3233 (
fd13b4ca4, open,build+ CodeQL +pin_movedgreen) — noting it here so the issue does not read as unowned and collect a fourth PR. I wrote this tool, and I verified their fix on the real tree rather than reading it; two results, one of which corrects this issue's own reproduction.1. The family-file half works, but only for COMMITTED changes. The repro above appends to
cmake/tests-pre-pr-checks.cmakeand runs the tool, and gets rc 0 — that is not the missing glob. Every--baserow compares commits (registration_loss_check,guard_loss_checkdo the same), so an uncommitted append is invisible to all of them. Committed, on the same tree:So the "tool says clean while
cmake -S . -Bdies" pair above is not like-for-like — a lane repeating it verbatim will see rc 0 and conclude #3233 did nothing. Worth a clause in the tool's message ("compares committed changes; commit, then re-run") and a note on this issue's text.2. The
or→andchange is right, and the bug was mine.if taken[n][1] or known[n][1]turned a guaranteed collision into cannot-tell; verified the other direction on the real tree — base registersregistry_build_selfinside itsif()(depth 2), branch adds it at top level, committed → rc 1, which is what Configure says. Their shallowest-sighting rule is what makes that work, and it is why the two-if()arm still answers 2 (both sides genuinely guarded).Not verified: the six new arms' mutation claims — read, and the suite run (15 arms ok), but I did not revert each change to prove its arm bites. Said the same on the PR.
bong-water-water-bong commentedon Nov 21, 2026
One measured gap that #3233 does not close, recorded before this issue closes on it — otherwise it goes orphaned rather than fixed.
The two items in the body are fixed by #3233 and I have verified both at its head (base-registers-in-family → branch-adds-in-root: 1, and root → branch-family: 1; both were 0 on
main;--self-test15 ok). A third shape is not covered by either PR, because it needs no base at all:Cause:
taken = row_names(...)is a dict, so two additions of one name collapse to a single lookup against the base, and the base never had the name, so nothing is compared. It is a copy-paste slip rather than a race — which is why I am not asking #3233 to carry it (its scope is the namespace and the guarded pair, and it delivers both) — but it is a green on a treecmakerefuses, so it is the same class as the two above.Base-free and small, if this issue keeps one checkbox open:
(
row_name_list= the same loop asrow_names, returning a list; thenot in freedkeeps a rewritten row —engine#3018's shape — out of it.) If the answer is "out of scope, close anyway", that is fine too — say so here and the limitation belongs in the docstring's "Narrow on purpose" paragraph next to the file scope, so a lane reading it knows the check does not see its own duplicate.ci: a removed-then-doubled ctest row is a collision, and the check's …