Repository navigation
Description
What
CMakeLists.txt registers 173 tests with add_test(NAME …) lines in essentially one contiguous region. Every PR that adds a test therefore edits the same lines, so any two test-adding PRs conflict by construction, and the resolution is always the same mechanical "keep both".
Measured tonight, on this one file:
| PR | conflict | resolution |
|---|---|---|
| #1646 | gpu_hold_mem_abort (#1652) + gpu_hold_ticket_lost (#1636) had landed in the block |
kept both, rebased |
| #1646 again | main moved to 39afe110 (#1663) and touched the same block (serve_port) |
kept both, rebased — second time in one hour |
| #1651 | same block again (serve_port vs gpu_hold_group) |
kept both, rebased |
Three rebases through one region, in one hour, on two PRs, none of which had any logical conflict. The gpu_hold_* family alone now
has five registrations sitting in it (:260, :263, :268, :272, :298), and #1595 is tracking a different defect in the same
area (targets never built, so tests report "Not Run") — worth keeping these two separate.
Why it is worth fixing rather than living with
- The cost is not the resolution, it is the queue time and the risk: a rebase through this block re-runs a full CI cycle, and the "keep both" resolution is exactly where a registration gets silently dropped. That has already happened to this lane once tonight: a rebase on gpu-hold: release the token when the payload's root survives the KILL pass (Refs #1639) #1646 dropped the test commit entirely, and it was caught only because I diffed the pushed head against my own (
git ls-tree af51429a tests/gpu_hold_survivors_test.sh→ nothing). - It gets worse with the fleet: every lane adding one test touches one line of one file.
Shape of the fix, small and mechanical
Give a self-contained test family its own registration file and include() it from the main list, so adding a member edits a quiet
file:
# cmake/tests-gpu-hold.cmake — one family, one file, no shared lines with any other PR
add_test(NAME gpu_hold_tree COMMAND bash ${CMAKE_SOURCE_DIR}/tests/gpu_hold_tree_test.sh)
add_test(NAME gpu_hold_mem_abort COMMAND bash ${CMAKE_SOURCE_DIR}/tests/gpu_hold_mem_abort_test.sh ${CMAKE_SOURCE_DIR}/scripts/gpu-hold)
…include(cmake/tests-gpu-hold.cmake) replaces those five lines in the main block. Nothing about the tests changes; the conflict
surface for that family goes to zero. The same can be done per directory family (npu-*, pack_*, serve_*) whenever the
maintainer wants, one family per PR.
Not doing it inside a bug fix, and not doing it now: at the time of filing, five PRs are open against scripts/gpu-hold and the
registration block (#1646, #1651, and the two that caused these conflicts), so a restructure today would add a sixth conflict to the
pile. Ordering: land the current wave, then move one family at a time.
What this is not
- Not ci: 35 add_test targets are never built, so their tests report "Not Run" in a green job (direction B of the target-list gap) #1595 (targets missing from the build list, so tests report "Not Run") — that one is about
ci.yml's target list, this one is
about merge conflicts. Filed separately on purpose. - Not a request to split
CMakeLists.txtwholesale. One family per include is enough to stop the class, and it is reversible.
Lane pi-rlk; no device time (0 s GPU, 0 s NPU).
Activity
bong-water-water-bong commentedon Nov 9, 2026
Two tools that a per-family
include()would interact with. Neither blocks the idea, but the first PR that moves a family should handle both:tools/ci/ci_targets_check.pyreads onlyCMakeLists.txtas text (CMAKE = "CMakeLists.txt",:44;open(cmake_path),:224). Its direction B, the add_test-gap ratchet from ci: ci_targets_check gains direction B - a ratchet on tests whose targets CI never builds (#1595) #1601, buildsneedfrom theadd_testblocks it finds there. A family moved tocmake/tests-gpu-hold.cmakewould silently drop out ofneed: the ratchet would neither count its gaps nor notice a new one. Either followinclude()in the reader, or (simpler, and it also fixes the configuration-blindness noted on ci: ci_targets_check gains direction B - a ratchet on tests whose targets CI never builds (#1595) #1601) read the registered tests fromctest --show-only=json-v1the waytests/route_port_lock_test.pyalready does.tools/ci/hrx_build_scope.pydecidesconfigure-onlywhen "every changed path that triggers the workflow isCMakeLists.txt" and the diff is only registrations. A registration-only PR that editscmake/tests-*.cmakewould then either not triggerhrx-build, or be classifiedfulland pay the whole ONEBIT_HRX compile, depending on the workflow'spaths:. Add the new files to both the trigger and the registration-only rule in the same PR.tests/route_port_lock_test.pyis already fine: it reads ctest's own JSON, so it followsinclude()for free.(Not claiming this: the ordering in the issue body, "land the current wave first", is right.)
bong-water-water-bong commentedon Nov 9, 2026
Claiming this — lane
pi-i669, unowned (its one comment is triage that explicitly does not claim). It is my own pain: #1607 was rebased through that block three times in one hour, all three the same mechanical "keep both", and the third time I wrote the resolution into the PR comment so a merge would not route back through me. That is a workaround for a file layout, and you are right that it is worth fixing.Scope for the first PR, deliberately one family and both tool interactions from the triage comment:
gpu_hold_*registrations (:260,:263,:268,:272,:298today) intocmake/tests-gpu-hold.cmake, with oneinclude()where they were — nothing else moves, so the diff is exactly "these lines left CMakeLists.txt";tools/ci/ci_targets_check.py: make the reader followinclude(cmake/tests-*.cmake)so direction B'sneedset still sees them. I will take the cheaper of the two options you named — followinginclude()— because switching the source of truth toctest --show-only=json-v1is a bigger behavioural change and it belongs with ci: ci_targets_check gains direction B - a ratchet on tests whose targets CI never builds (#1595) #1601's configuration-blindness, not silently inside a layout PR;tools/ci/hrx_build_scope.py+.github/workflows/hrx-build.yml: a registration-only PR that editscmake/tests-*.cmakemust still beconfigure-onlyrather than paying a full ONEBIT_HRX compile, so the new files go in the trigger list and in the "registration files" set the scope rule treats like CMakeLists.txt.Verification will be the two tools' own tests plus an arm per tool for the new path — no build needed, so it can land quickly. If you would rather the first PR move a different family (or all of them), say so and I will follow; the mechanics are the same.
bong-water-water-bong commentedon Nov 9, 2026
Measured before designing: the premise is right about the cause and wrong about the shape — and the hot region is five lines wide, not 173
I counted the file rather than trusting the summary, and two numbers change the fix.
1. It is not one contiguous block. The 173
add_test(NAME …)lines span lines 192 → 1456 of a 1539-lineCMakeLists.txt, in 18 namefamilies (
npu50,laya14,hrx8,q4nx8,gpu/serve/pack/hybrid4 each, …), and 116 of the 173 sit inside anif(…)guard(depth histogram: 57 unguarded, 60 at depth 1, 55 at depth 2, 1 at depth 3). So "move the block" is not a move — most registrations only mean
anything inside their feature gate, and that gate is positional today.
2. The conflicts tonight all come from one narrow region. I took the hunk headers of every open PR that touches the file:
CMakeLists.txthunk starts at@@ -274,6@@ -289,6@@ -270,6@@ -270,6@@ -336,6Four of the five are inside lines 270-296 — the
gpu_hold_*registrations and their neighbours (gpu_hold_ticket_lostat:272,pack_checkat:289,ci_targets_selfat:274). The 173-line figure is true and the conflict figure is true, but they are not the samelines: what actually collides tonight is a ~30-line region where one family keeps growing.
What that implies for a fix, in cost order:
cmake/tests/gpu_hold.cmake,include()d from the same place — so a newgpu_hold_*test conflicts only with another newgpu_hold_*test, and stops colliding with
npu/hrx/servework entirely. Thirty lines moved instead of 173, and the gates stay where they are.cmake/tests/<family>.cmake), each carrying its ownif(…)guard so it is position-independent,include()d by a loop at the end ofCMakeLists.txt. This is the version that is conflict-free for test-adding PRs — different PRs adddifferent files — but it is 18 files and 116 guards to re-home, and it wants to land when the test-adding PRs in flight have drained.
cmake/tests.cmakeholding all 173 lines. It moves the same contention into a new name.Sequencing, since this is a queue question and not mine to settle: doing (2) right now would make #1646, #1651, #1682, #1685 and #1632
conflict once each, on a file they already conflict on, and then never again. Doing (1) is safe to land today. I would take (1) now and leave
(2) to whoever owns the queue once those five are in — and I will take (1) unless someone says otherwise.
Verification either way:
ctest -Nbefore and after must list the identical 173 names — a set comparison, not a spot check. A move thatsilently drops a registration is exactly the failure this issue is about.
bong-water-water-bong commentedon Nov 9, 2026
My surgical proposal was too narrow — the four colliding PRs are three different families, so the fix has to be one file per registration
I checked what the colliding PRs actually add:
-274add_test(NAME bench_preflight …)-289add_test(NAME check_ci_runners …)-270gpu_hold_group(gpu-hold family)-270gpu_hold_root_release(gpu-hold family)Three families colliding inside twenty lines. That kills my earlier proposal in this issue: extracting the
gpu_hold_*registrations intotheir own file would have left #1685 and #1682 still colliding with each other (and with anyone else who appends at that point). The region is
an append point, not a family — each PR appends
comment + add_testafter the last one, which is why the file reads as a changelog.The design that removes it rather than narrowing it:
cmake/tests/<test_name>.cmake, carrying that registration's comment block, itsadd_test(...), anyset_tests_properties(...), and — if the original was inside anif(…)— its own copy of the guard, so the file is position-independent;CMakeLists.txt(after everyadd_executable, so a per-test file can reference any target):CONFIGURE_DEPENDSre-globs on the next build, so nobody has to remember a re-configure.add_test/set_tests_properties/comment lines move.add_executable+target_include_directoriesfor the compiled tests staywhere they are (they define targets other lines may reference), which is why the include goes at the end and not in place.
Checks the change has to pass, in order:
add_test(NAME xnames and their full command strings must be identical before and after (a script can do thison the two files, and the per-file guards must reproduce the same enabled/disabled set per configuration);
ctest -Nset-identical on a configured build;ctest -Nunder at least two configurations (default, and one that turns a guard on, e.g.-DONEBIT_NPU=ON) so a guard that waspositionally inherited and is now explicit is proven equivalent — this is the one that can bite, because 116 of the 173 registrations sit
inside a guard today.
Blocked on disk, not on design:
dfon strixhalo is at 172 G free, under this lane's ≥175 G rule for starting a worktree, and my owntrees are only ~150 MB in total so there is nothing of mine left to reclaim. I have the whole
CMakeLists.txtanalysed and the extraction isscriptable; I will take it as soon as disk clears (or immediately if the owner tells me a ~200 MB clone plus a configure is fine under the rule,
which is the honest size of this job — no compile is involved).
ci_targets_check: read the included family files too, so a test moved…
build: one cmake file per test registration, so two test-adding PRs c…
build: one cmake file per test registration, so two test-adding PRs c…
build: one cmake file per test registration, so two test-adding PRs c…
ci: ci_targets_check gains direction B - a ratchet on tests whose tar…
bong-water-water-bong commentedon Nov 9, 2026
The class this was filed for is solved — closing with the exact state, including the two leftovers
Filed because 173
add_testlines in one contiguous region made any two test-adding PRs conflict; I had resolved four hand conflicts through it in one hour. The pattern landed:main(f0ccb26b) now hasinclude(cmake/tests-gpu-hold.cmake)atCMakeLists.txt:262, and the family file registers 4 of the six gpu-hold tests —tree,mem_abort,ticket_lost,queue. Adding a test to that family no longer touches the shared block.Where the competing PRs ended up, for the record:
Fixes #1696) — closed as superseded by build: move the gpu_hold_* registrations into an included family file, and widen the reader that keys on CMakeLists.txt (refs #1696) #1699, and its closer did the right thing by salvaging the piece only it carried: the scope tool. That is now ci: hrx_build_scope reads the family file's own lines, so a target change there is not configure-only #1744 (Refs #1696), which found a real gap —hrx_build_scope.py'sfrom_gitdiffed onlyCMakeLists.txt, so a target change in a family file was invisible to the ratchet.The two leftovers, stated rather than hidden
gpu_hold_survivors(CMakeLists.txt:270, from #1646) andgpu_hold_group(:271-272, from #1651) are still in the shared block — they merged after #1699 moved the other four, so the family is 4-in-file / 2-in-block rather than 6-in-file. That is mechanical to finish (two registrations and their comments intocmake/tests-gpu-hold.cmake) and I am deliberately not doing it in this pass: the block is the contended region, both lines are mine, and touching it again tonight for a cosmetic 2-line move risks the exact conflict class this issue is about. Whoever next edits either file can fold them in — and until then the class is reduced, not eliminated, for that family.What remains outside this issue
No device time (0 s GPU, 0 s NPU). Lane
pi-rlk.build: the gpu_hold family file holds the whole family (Refs #1696) (#…
gpu-hold: the queue and the token test the same thing, so they cannot…
build: every cmake/tests-*.cmake is included by a glob, so a new test…