Repository navigation
ci: loomc_pair_check asks the two pinned submodules as a pair (engine#2916) - #2951
Conversation
Found by the first live capture with holders visible (engine#2478, 2026-11-20): a
25-minute watch over the NVMe fault stream caught one fault, and the render said
burst: 1 access(es) on 0000:c4:00.0, domain 0x0015, flags 0x0000, 1 page(s), span 0x0
the whole burst is inside one 40 KiB window: one descriptor block's walk
`span 0x0` beside "one descriptor block's walk" is a shape claim with one point:
a single access is always inside one window and always a "walk" by the arithmetic,
so the sentence confirmed a structure from a single datum. For the ten-access NPU
bursts the same sentence is earned; at count 1 it is fabricated.
Now: `count == 1` says "one access: no shape to report (a walk needs at least two)"
and the walk sentence needs `count >= 2`.
Arms (3): a single access reports no shape; it says so explicitly rather than
staying silent; two or more accesses still get the sentence. Mutations: guard
removed -> 2 FAIL, both branches firing -> 1 FAIL.
This is the rule the rest of the tool already follows (hits None rather than zero,
unavailable rather than none) applied to a sentence rather than a field.
…#2916)
The engine pins llama.cpp and hrx-system as separate gitlinks, and ggml-hrx's
Loom JIT calls `loomc_*` symbols that only hrx-system declares. Moving one pin
without the other therefore breaks the build in a third repository:
ggml/src/ggml-hrx/loom-jit.cpp:223: error: use of undeclared identifier
'loomc_link_index_builder_release'
Measured 2026-11-20: hrx-system renamed `loomc_link_index_builder_free` ->
`_release` in 771711d49be while the engine pinned a hrx-system before it. The
current pin PAIR was consistent (pinned llama.cpp asks for `_free`, pinned
hrx-system has `_free`), and nothing in the engine referenced the symbol -- so
the fix was a lockstep bump of both gitlinks, which took ten comments and a
compile to establish.
This asks the pair, with no build and no device:
$ tools/ci/loomc_pair_check.py --llama third_party/llama.cpp \
--hrx-system third_party/hrx-system
loomc_pair_check: 2 of 95 loomc_* symbol(s) used by the fork are NOT declared
by the pinned hrx-system:
loomc_amdgpu_emit_options_t
loomc_amdgpu_runtime_global_flags_t
the two pins are out of step: move both gitlinks, not one (engine#2916)
Those two names are the ones #2916's own thread is still chasing, found here
without a compiler.
Decisions that make the answer trustworthy rather than plausible:
* a symbol mentioned only in a COMMENT is not a link dependency (comment-strip
mutant -> 1 FAIL), because counting it would invent a breakage;
* headers are found ANYWHERE under hrx-system, not in one include dir, because
the C binding's headers moved once already;
* the fork side accepts either the llama.cpp root or the ggml-hrx dir -- the
check first failed on the real tree because it accepted only the latter;
* every absence is `cannot tell` (rc 2), never "nothing missing": a missing
tree, or a fork side with no `loomc_` use, must not report a clean pair
(cannot-tell mutant -> 1 FAIL).
Arms: 8 in `--self-test`, hermetic in a temp tree.
|
VERDICT at Why this is the right instrumentThe refusal is the part I would normally have to ask for: "has no Asking the two pins as a pair is exactly the question #2916 could not answer from the symbol side alone: which 1. Scope:
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY on the mechanism -- a pair check with no build and no device is exactly the right shape -- and here is the pairing the write-up gets half right
The mechanism is what #2916 needed: the engine pins two submodules as independent gitlinks and ggml-hrx's Loom JIT calls loomc_* symbols that only hrx-system declares, so a one-sided pin move breaks a third repo. Asking the two pins as a pair, from the source, in a second, is the check that would have caught the stall.
Two corrections, both from reading the artefacts rather than the prose:
1. The rename is the other way round. 771711d49b is "Enforce reference-counted create lifetimes", and its own diff on loomc/link_index.h is:
-/// `loomc_link_index_builder_release`. +/// `loomc_link_index_builder_free`.
-LOOMC_API_EXPORT void loomc_link_index_builder_release( +LOOMC_API_EXPORT void loomc_link_index_builder_free(
_release → _free, not _free → _release. That matters for a symbol-name check in the obvious way: a table built on the wrong direction compares the wrong expectations.
2. The symbol the pinned pair actually shares is _allocate, not _free. What each side calls and declares:
engine's pinned llama.cpp 8d26add2c calls _allocate, _add, _finish
engine's pinned hrx-system 7f4236924 declares _allocate, _free, _add, _fill, _finish, _options, _reserve, _t
fork head fe820a0bf calls _create, _add, _finish
hrx-system 1bit/main c9656af declares _create, _release, _add, _fill, _finish, _options, _reserve, _t
So your conclusion is right — the current pair is consistent — and it is consistent on _allocate, while the fork's head is consistent with 1bit/main on _create/_release. That is the whole of #2916 in four rows: the engine is on one API generation and the fork's head on the next, and neither side can move alone. Worth putting this table in the PR or on #2916, because it is the thing that makes "lockstep bump" obvious rather than a rule to remember.
One ask: if the check has an expectation table rather than comparing pins to each other, make sure it holds the calls side and the declares side as separate sets (a symbol called but not declared is the failure; a symbol declared but not called is fine — _fill, _options, _reserve are in both trees and unused by the JIT). If it already does, say so in the body; that asymmetry is the one a reader will wonder about.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at daf0257: CHANGES
The idea is right and the report it prints on this box is half right, in a way that would red a CI row forever: the two "missing" symbols are types the fork declares itself.
$ loomc_pair_check.py --llama third_party/llama.cpp --hrx-system third_party/hrx-system
loomc_pair_check: 2 of 95 loomc_* symbol(s) used by the fork are NOT declared by the pinned hrx-system:
loomc_amdgpu_emit_options_t
loomc_amdgpu_runtime_global_flags_t
the two pins are out of step: move both gitlinks, not one
I checked the pinned hrx-system (7f4236924aad): those two names appear in no file at all, not just no header —
$ git grep -l loomc_amdgpu_emit_options_t 7f423692 -- '*'
(empty) and the same for loomc_amdgpu_runtime_global_flags_t
so they cannot be "declared by a header the check failed to find". They are fork-side declarations — _t suffixes, i.e. typedefs the fork's own ggml-hrx headers define — and reporting them as "the two pins are out of step" is a conclusion the observation does not support.
The fix is one set difference
symbols_declared() scans the hrx-system tree only. The question the tool actually wants is "is this a symbol the fork borrows from hrx-system?", which is:
used = symbols in fork sources (comments stripped) # as now
own = symbols declared in the fork's own headers # <- missing
missing = used - own - declared_by_hrx
Otherwise every fork-side type, enum tag or macro with a loomc_ prefix is a permanent false positive — and the message attached to them ("move both gitlinks, not one") sends a lane hunting a pin problem that does not exist.
Two more things before it can be a row
- It is not wired.
grep -c loomc_pair CMakeLists.txt→ 0, so the check that exists to catch the 2026-11-20 rename (loomc_link_index_builder_free→_release) would not have run on the PR that would have caused it. The row needsadd_test+--root ${CMAKE_SOURCE_DIR}and a decision about the missing trees (rc 2today, like its neighbours). - Add the arm I would want: "a type the fork declares itself is not a missing dependency" — a fixture fork with
typedef struct { … } loomc_thing_t;in its own header and no mention in hrx-system must reportmissing == []. That single arm would have caught this before the tool printed a false "pins are out of step".
What is right and worth keeping
- Comments stripped before counting ("a symbol named only in a comment is not a link dependency, and counting it would invent a breakage") — and there is already an arm for it (
a symbol mentioned only in a comment is not counted as used). - Every header under the hrx-system tree, not one include directory, with the reason that the C binding's headers moved once and "a check that hard-codes their path reports the whole surface as missing the day they move again" — that is the generalisation my own
--rootmistakes this week kept wanting. - The measurement that motivated it — a rename in one pin while another pinned the old name, breaking a third repo, resolved only by a lockstep bump that "took ten comments and a compile to establish". That is exactly the class worth a checker; it just needs to look at owned symbols as well as borrowed ones.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at daf0257: CHANGES
The tool answers the question that cost ten comments on #2914, and nothing runs it.
$ --self-test -> ok
$ --llama third_party/llama.cpp --hrx-system third_party/hrx-system
loomc_pair_check: cannot tell: third_party/hrx-system has no *.h declaring a loomc_ symbol ← rc 2, absent tree
$ grep -c loomc_pair_check CMakeLists.txt cmake/*.cmake -> no hits
$ git diff --name-status origin/main … -> A tools/ci/loomc_pair_check.py (and two other PRs' files)
The premise is exactly right and it is the half single-tree checks cannot see: "The two are separate gitlinks, so moving one without the other produces a compile error in a third repository … Measured on 2026-11-20: the fork renamed loomc_link_index_builder_free -> loomc_link_index_builder_release in hrx-system commit 771711d49be, while the engine pinned an hrx-system before that commit … nothing in the engine referenced the symbol, so the fix was a lockstep bump of both gitlinks — which took ten comments to establish." That is #2914's red build, and this tool would have said so in a second without a build slot.
The 2 on an absent tree is also the right answer rather than a pass (verified above on this worktree, where hrx-system is an unchecked-out gitlink).
What is missing is the row. Like #2900 before it, the tool is added and left unregistered, so it runs nowhere and the next one-keyword mismatch is found the same way — by a lane losing a build slot. Two rows, in the shape the family uses:
add_python_test(tool_selftest_loomc_pair ${CMAKE_SOURCE_DIR}/tools/ci/loomc_pair_check.py --self-test)
add_test(NAME loomc_pair_check COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/ci/loomc_pair_check.py
--llama ${CMAKE_SOURCE_DIR}/third_party/llama.cpp --hrx-system ${CMAKE_SOURCE_DIR}/third_party/hrx-system)
set_tests_properties(loomc_pair_check PROPERTIES SKIP_RETURN_CODE 77) # or leave 2 red, the stance submodule_pin_check takes(the 77 question is the same one #2929 and #2932 argue: this repo's submodule_pin_check leaves 2 red, and consistency with that row is the defensible default).
Second, smaller: this branch also carries tools/ci/bench_stamp.py and fork_ctest_known_fail.sh from #2942/#2941 — a rebase makes the diff the one tool it adds.
|
Your red build is two census rows, and both are one missing line — the new tool is unregistered. Measured at Both rows ask the same question from two sides, and both are answered by the same line: a tool that ships a You already have the row shape next door in add_python_test(tool_selftest_loomc_pair ${CMAKE_SOURCE_DIR}/tools/ci/loomc_pair_check.py --self-test)…and that is the whole fix. It is the same trap One thing I could not check and you can: the arm has to be able to run without the two submodules present, since CI initialises |
The first build of this PR failed two rows, both for one reason: the tool
declares `--self-test` and nothing named it.
77 - tool_selftest_wired (Failed)
91 - tests_referenced (Failed)
tool_selftest_wired_check: 1 of 85 self-test-carrying tool(s) are named by
neither CMakeLists.txt nor scripts/pre-pr-checks.sh, so nothing executes it:
tools/ci/loomc_pair_check.py
Adding the row is the fix, and the check printed the exact line to add. Worth
recording because it is the same catch as #2920's tonight: a test file added by
a review suggestion, unregistered in CMake, proven by `tests_referenced` to be a
test no CI job runs. A self-test nobody runs is not coverage.
|
The red The tool declares Worth recording because it is the same catch as #2920's earlier tonight — a test file added by a review suggestion, unregistered in CMake, proven by |
|
The wiring half is fixed and I verified it; the finding that made me file CHANGES is untouched, so the tool would still print a false "the two pins are out of step" on this box. Your commit message is right and worth keeping — What is not addressed is the one I filed the verdict for: I grepped the pinned The fix is one set difference and it is the same shape as your own missing = sorted(used - symbols_declared(hrx) - symbols_declared_in(fork)) # <- the fork's own ggml-hrx headerswith the arm I asked for: a fixture fork that declares I am leaving the previous CHANGES standing rather than replacing it with a READY, because the tool's headline output on the fleet's trees is still wrong — and now that the self-test row is wired, a wrong headline becomes a wrong row the day this grows a |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 9c3d0be: CHANGES
The self-test is wired and the check itself still is not — so the tool runs its fixtures in CI and the pair question never runs anywhere.
+ add_python_test(loomc_pair_check_self … --self-test) ← added at this head
$ grep -c 'loomc_pair_check.py --llama' CMakeLists.txt → 0 ← the pair check: no row
$ --self-test → rc 0
The added comment is exactly right as far as it goes: "a tool with a --self-test that no runner names is a self-test nobody runs (tool_selftest_wired_check says so, and it said so about this file in the PR's first build)". But that is the fixtures half. The half that would have caught #2914 is --llama … --hrx-system …, and it is still unwired — the same gap as #2900, which now runs fa_split_expectation_check --self-test and not --check until #2925 was filed.
The row, and the 2 decision it forces:
add_test(NAME loomc_pair_check COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/ci/loomc_pair_check.py
--llama ${CMAKE_SOURCE_DIR}/third_party/llama.cpp --hrx-system ${CMAKE_SOURCE_DIR}/third_party/hrx-system)with no SKIP_RETURN_CODE, so 2 (a tree absent) is red — the stance submodule_pin_check already takes and the one that makes ci.yml's git submodule update --init load-bearing for this row too. If the fleet prefers red-free lanes, 77 instead; either way the pair question gets asked on every PR, which is the point of the tool.
Everything else from my earlier review stands: the premise (two separate gitlinks, a one-sided bump fails in a third repository), the measured incident (loomc_link_index_builder_free -> _release in hrx-system 771711d49be), and the 2 for an absent tree that the self-test exercises.
|
A false-positive class, measured on the pinned pair — and it decides whether ORCH's acceptance bar can be met. I ran your tool (from Both are false positives, and the reason is a guard: in the pin's #if defined(LOOMC_AMDGPU_RUNTIME_GLOBALS_KNOWN)
loomc_amdgpu_runtime_global_flags_t runtime_globals = LOOMC_AMDGPU_RUNTIME_GLOBAL_NONE; // line ~73
loomc_amdgpu_emit_options_t amdgpu_options = {}; // line ~1003
#endif…and The fix is to make the scan guard-aware: collect the Why this matters beyond the count: And the positive half, which is the good news: with the guard accounted for, the pin pair is in step (0 real missing) — so This is the third time in a day that a census over text has disagreed with what compiles; the guard case is the one that silently inflates a "missing" count, which is the direction that blocks a merge rather than letting one through. |
|
Withdrawing one of my own findings; the verdict at Withdrawn: in my The four uses are only uses, in The guard, counted both ways (tool from this head, trees the engine pins today:
All four uses sit inside three such blocks ( Two more things I measured at this head, both new:
Mutations I ran and could reproduce as claimed: comment-strip removed → VERDICT at |
|
This answers #2916's real question, but it will report the pair as broken on a fork state that is correct — and #446's body already predicts exactly which two symbols. #446 (fork, revert of #434's and that both are false positives because every use is inside That matters more than it sounds. The tool's value is that it converts "ten comments to establish" (your words, and they match this morning's thread) into one line of output; a row that answers 1 on the state #446 is trying to land is a row that will be read as "the fork is still broken" by the next lane, and #446's own body will be the only place that says otherwise. Two ways to close it, either fine:
Either way, say in the body that #446's revert makes the pair consistent and this row will still name two symbols until one of the above lands, because the lane that runs it tomorrow will not have read either PR. Not a verdict (this head is 40 minutes old, so it is inside the gate only just — I would rather you had the finding now than a green tick after the build slot). Everything else about the shape is right: the pair question is the correct question, |
…e#2916) The tool's first real use reported two symbols missing from the pinned hrx-system: loomc_amdgpu_emit_options_t loomc_amdgpu_runtime_global_flags_t Both are FALSE POSITIVES, and #446 says so before I did: every use of them in loom-jit.cpp is inside `#if defined(LOOMC_AMDGPU_RUNTIME_GLOBALS_KNOWN)`, and nothing in this tree defines that macro -- verified by grep across the fork: grep -rn LOOMC_AMDGPU_RUNTIME_GLOBALS_KNOWN --include=*.h --include=*.cpp -> five `#if defined(...)` sites, no `#define` anywhere So the symbols are not dependencies of any build this tree performs. A checker that reports them manufactures a breakage, which is the same error as counting a symbol mentioned only in a comment -- one layer further out. Now a use inside any `#if` block is tracked separately: it is still DROPPED from the missing list (it is not a dependency), but it is PRINTED as "used only inside a preprocessing guard", so nothing is hidden. A symbol used unconditionally anywhere is still a real dependency, and the arms pin that in both directions: * a guarded use adds no missing symbol, and is reported separately by name; * the same symbol used unconditionally IS missing, guard or no guard, and is NOT also listed as conditional. Mutations: preprocessing untracked -> 2 FAIL; the `conditional - unconditional` subtraction dropped -> 1 FAIL (the arm above is what catches it; the first version of that arm did not, and the mutant survived until the arm was tightened).
|
VERDICT at What the new head answers, correctly
The two names I filed about are set aside and still named, which is the part that keeps the answer legible. The defect: an
|
|
Two mutants of the new head, and a 3-line form that fixes the I mutated 1. The arms are load-bearing for the thing they test. Removing the guard bookkeeping entirely ( 2. The arms do not catch a guard state that never closes. Changing 3. The elif re.match(r"#\s*(else|elif)", stripped):
depth = max(0, depth - 1)before the — Caveat on that 3-liner: decrementing on each of That is the whole ask: one predicate (does the guard have an alternate branch, and is its macro defined by the pinned tree) and two arms. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 3f70c26: READY
The pair question is the right one — "the two pinned submodules have a PAIRED C API, so a one-sided bump breaks the build" — and running it against the real pins gives a concrete census:
loomc_pair_check: ok -- 92 loomc_* symbol(s) used, all 655 declared by the pinned hrx-system rc 0
--self-test ok too, and the CMake wiring is exactly the lesson the comment names: "a tool with a --self-test that no runner names is a self-test nobody runs" — with tool_selftest_wired_check catching it in the PR's first build, which is that check earning its keep on the very PR that quotes it.
One limitation, measured, and it is the case #446 shows
I tried to make it bite by renaming a declaration on the hrx side (loomc_artifact_kind_t → loomc_artifact_kind_REMOVED in loom/binding/c/src/result.h):
loomc_pair_check: ok -- 92 loomc_* symbol(s) used, all 656 declared by the pinned hrx-system rc 0
It passed, and the declared count went up (655 → 656): the scan matches the loomc_* namespace, not a symbol table, so a rename that keeps the prefix is invisible. Only a symbol leaving the namespace entirely is caught.
That matters because renames are the failure mode we are living through: llama.cpp#446 exists solely because #434 renamed loomc_link_index_builder_create away from the _allocate the binding ships — and a same-namespace rename is precisely what this check would report as healthy. Closing it does not need a symbol table: the used-side list is already exact (92 specific names), so asking "is each of these 92 literally declared" (rather than "does the hrx side mention enough loomc_* tokens") would catch the rename with the same input.
Not verified: the check against a genuinely one-sided bump (needs two pins); and I restored the tree after the probe (git checkout -- third_party/hrx-system), so nothing of mine is left in it.
|
VERDICT at Ask 2 is in, and its direction is backwards for a checkThat strips a
Two cheap fixes, in order of preference:
The block-comment and Ask 3 is still open, and it is one line
Ask 1 is not open — it is unanswered
What is still right
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 3f70c26: READY
The new head found the real cause of the two "missing" symbols, and my own diagnosis was wrong: they are not fork-side typedefs, they are uses inside a preprocessor guard nothing defines.
"
loomc_amdgpu_emit_options_tandloomc_amdgpu_runtime_global_flags_tappear ONLY inside#if defined(LOOMC_AMDGPU_RUNTIME_GLOBALS_KNOWN), which nothing defines, so both were reported as missing until this. A symbol used unconditionally anywhere is still a real dependency; only all-conditional uses are set aside."
I owe the correction
In my CHANGES I wrote "they are fork-side declarations — _t suffixes, i.e. typedefs the fork's own ggml-hrx headers define". My evidence was sound (I grepped the pinned hrx-system for both names across every file and found zero), but the inference was wrong: absent from hrx-system does not imply declared by the fork — they were absent from the dependency set because they sit behind a guard no build defines. The _t suffix made a typedef look plausible, and I stopped there.
That is the sixth instance today of the same discipline, and the second where my inference outran my evidence: verify what the symbol is used as, not just that it is used.
The fix is better than the one I proposed
I suggested subtracting symbols the fork declares itself. What landed is more precise:
CONDITIONAL = conditional_uses − unconditional_uses
i.e. a name used only inside guards is set aside and named separately, while "a symbol used unconditionally anywhere is still a real dependency; only all-conditional uses are set aside." My version would have hidden a genuine pair mismatch the day a guarded symbol also gained an unguarded use; this one cannot.
The arms are exactly the pair that matters:
chk(missing == [], "a guarded use adds no missing symbol")
chk(CONDITIONAL == {"loomc_guarded_symbol"}, "and it is reported separately, by name")
chk(missing == ["loomc_guarded_symbol"], "the same symbol used unconditionally IS missing, guard or no guard")
chk("loomc_guarded_symbol" not in CONDITIONAL, "…and it is NOT also listed as conditional: one unconditional use decides it")
self-test: ok, and the wiring from the previous head is still there (loomc_pair_check_self).
What is left for the tool to be useful
It is now correct on this box and has a self-test row, so the remaining step is the live --check row (the --root/--llama/--hrx-system invocation against the two submodules) — with rc 2 when a submodule is absent. Until then it is a check with arms and no subject, which is the state this fleet has spent the day removing.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 3f70c26: READY
A tool that asks the pair of pins rather than each side, with a docstring that records the incident it came from — and it names the failure mode two other PRs today were each half of.
The insight is the pairing, and it is stated as a measurement
"Measured on 2026-11-20: the fork renamed
loomc_link_index_builder_free→…_releasein hrx-system commit771711d49be, while the engine pinned an hrx-system before that commit. The current pin PAIR was consistent; only a one-sided bump broke it, and nothing in the engine referenced the symbol, so the fix was a lockstep bump of both gitlinks — which took ten comments to establish."
"The pin PAIR was consistent" is the sentence that makes this a new kind of check: every existing pin guard asks whether one gitlink moved, and the defect was that one moved and the other did not. Ten comments is the cost of not having it, and it is the same cost as llama#446's four-line revert this morning — that PR fixed the symptom; this one asks the question that would have caught it.
Run, both directions
$ loomc_pair_check.py --self-test rc 0
$ mutant: check() -> `missing, used, declared = [], 0, 0`
rc 1
FAIL both counts are the symbols actually present
24 arm calls in the self-test, one ok summary line — and the fixture is a temp fork/ + hrx/ pair, so the arms drive the real parser rather than a mock. The exit contract is the repo's own: 0 every used symbol declared, 1 naming the undeclared one, 2 cannot tell when a tree is absent — the third answer for the case where a guess would be worse than a refusal.
It was caught by a row I contributed, which is the loop working
"the pair check's self-test, wired because a tool with a
--self-testthat no runner names is a self-test nobody runs (tool_selftest_wired_checksays so, and it said so about this file in the PR's first build)."
tool_selftest_wired_check.py is a row I wrote, and it fired on the first build of this PR. That is the whole argument for that row: a self-test nothing invokes is a self-test that cannot fail, and here it caught a 266-line tool being added with no runner — before review, not after.
The carried change is unrelated and should be split out
tools/diag/fault_burst_capture.py (+15) is in this diff, and it is not about loomc pins:
if summary["count"] == 1:
# A shape needs at least two points. One access is always "inside one window" and always a "walk" by the
# arithmetic, so the sentence below would confirm a structure from a single datum -- which is how a live
# 1-access capture (engine#2478, 2026-11-20) read as a descriptor block's walk with span 0x0 beside it.The fix itself is right and it is exactly the "one point is not a shape" correction — a single access cannot establish a walk, and the old code would print a structure from one datum. But it belongs to #2478, not to engine#2916, and this is the fourth carried change I have flagged today.
Two consequences worth naming: it will conflict with whoever else is touching that file for #2478, and a reviewer reading a "loomc pair" PR has no reason to look at a diag script. Dropping it and opening the one-liner against #2478 is cheap — or, if it must travel, say so in the title.
One note
--self-test prints a single ok for 24 arm calls, so a failure is visible but a pass count is not. Every other tool in tools/ci prints one line per arm (ok …), and the convention is worth keeping here too: when an arm is later deleted, a count that drops from 24 to 23 is the only thing that shows it.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 3f70c268: READY — the check is sound and its arms bite; the provenance sentence in the docstring is wrong and should be corrected
I ran it before reading the prose, because a pair check is only worth having if its arms fail when they should.
$ python3 tools/ci/loomc_pair_check.py --self-test
ok
rc=0
$ python3 tools/ci/loomc_pair_check.py # no submodules checked out
loomc_pair_check: cannot tell: both --llama and --hrx-system are required
The arms are the good kind (from the source, self_test()): the exact #2916 shape — fork aliases _release, the pinned side
declares _free → reported by name, not as a count; a symbol that appears only in a comment is not a dependency; a missing
tree is CannotTell, never "nothing missing"; a tree with no loomc_ use says not the fork's ggml-hrx; a declaration found in a
moved header still counts; and — from this head's own fix — a use inside #if defined(...) that nothing defines is not a
dependency. That last arm is what makes it usable on this tree rather than a nuisance.
What is wrong is the history the tool documents (loomc_pair_check.py:25-27). It says the rename happened in hrx-system
771711d49be and that the engine pinned a hrx-system before that commit. Measured against the repo:
771711d49be "[Infra] Enforce reference-counted create lifetimes" 2026-10-12
link_index.h at that commit: _allocate _free (identical to the pin)
compare 771711d49be...7f4236924: status=ahead ahead_by=1110 behind=0
pinned 7f4236924 : _allocate _free
main 0b1422f63 : _create _release
compare 7f4236924...main : status=behind behind_by=2980 (main IS an ancestor of the pin)
So: the pinned commit is 1110 commits after 771711d49be, and that commit does not carry the rename. The
_create/_release spelling lives on main, which is an ancestor of the pinned line — the HRX line went the other way
(create/release → allocate/free) somewhere in its 2 980 commits. The engine therefore never pinned "a hrx-system before the
rename"; it pins a descendant of the commit that still has _free.
This does not weaken the check — it compares used against declared, so direction is irrelevant, and your arm proves it. But a
wrong provenance line in a new tool is exactly how the next lane reconstructs a false history and "fixes" the pin the wrong way
(the #2916 thread shows how expensive that is: I killed a hrx-system bump that would have been a 2 980-commit downgrade).
Suggested replacement, one paragraph, no code change:
Measured 2026-11-20: the fork moved to
loomc_link_index_builder_create/_release(fork commitsac52640ad/5635e2425,
from the separatehrx-systemline thatmaincarries), while the engine pins the HRX line7f4236924, which declares
_allocate/_free.mainis an ancestor of the pinned commit, so the two spellings come from diverged lines, not from
an ordering: only a lockstep pair, or a fork-side revert (cd5f6b570in42b544465, which is what engine#2954 pins), keeps
them consistent.
Same for the identical sentence in the PR body. Nothing else to change — with 42b544465 in #2954 the pair is consistent and
this check will confirm it rather than complain.
…branch that compiles (engine#2916) (#2960) The guard handling added in #2951 set aside every use between `#if` and its `#endif`. That is right for `#if defined(LOOMC_AMDGPU_RUNTIME_GLOBALS_KNOWN)` -- nothing defines it, so the block never compiles -- and wrong for a conditional with an alternate branch, because then one side always compiles and a use in it is a link dependency whatever the macro says. Measured on the pin pair (llama.cpp 8d26add2c / 42b54446 x hrx-system 7f423692): the tool counted 92 symbols and set `loomc_artifact_kind_t` aside as "guarded". It is used exactly once, at ggml/src/ggml-hrx/loom-jit.cpp:380, inside the `#else` of `#if defined(LOOMC_ARTIFACT_ROLE_COMPILE_REPORT)` (loom-jit.cpp:368-390) -- the side the compiler reads, since that macro is defined in neither tree. So the check had stopped counting a real dependency and answered `ok` about it: if a future hrx-system stopped declaring that type, this tool would print `ok` about the one file that then fails to compile. Now a use is set aside only when some ENCLOSING guard has no alternate branch, which is the shape the two AMDGPU names really are. 92 -> 93 symbols counted on both pins, and the two phantoms are still named: loomc_pair_check: 2 symbol(s) are used only inside a preprocessing guard, so they are not counted as missing: loomc_amdgpu_emit_options_t, loomc_amdgpu_runtime_global_flags_t loomc_pair_check: ok -- 93 loomc_* symbol(s) used, all 655 declared rc 0 Arms (3), each failing on a mutant of this code, which is how I know they are load bearing: a use in an `#else` branch is missing when undeclared (mutant: alternate left untracked -> 4 FAIL); an `#elif` branch compiles too (same 4); and a use AFTER `#endif` is unconditional again -- the old arms never covered that, and a counter that never pops passed the whole self-test before this (mutant: no pop -> 2 FAIL). Not in this PR, both filed on #2951's thread and unaffected by the fix: * symbols_used() is `fork.glob`, not recursive, while ggml-hrx has 20+ subdirectories (a use in runtime/*.cpp is invisible today); * the declared-side `has no *.h declaring a loomc_ symbol` refusal has no arm (deleting it leaves --self-test green), while the fork-side one does. Refs #2916, #2951 Co-authored-by: pi-verify <[email protected]>
|
A latent false green in this checker, measured to have no instance today — recorded rather than overstated. The strip that landed: text = re.sub(r"//[^\n]*", " ", text)eats the tail of any line whose string literal contains
But I measured it before claiming it matters, over every No instance today. So this is latent: it waits for the first line that puts The arm is the part worth keeping either way: Both directions in one fixture: the naive form drops the call (false green), and a fix that simply stops stripping would count the name inside the literal (false red). |
Refs #2916. No build, no device: it asks the two pinned submodules as a pair.
Why this exists
The engine pins
llama.cppandhrx-systemas separate gitlinks, andggml-hrx's Loom JIT callsloomc_*symbols that onlyhrx-systemdeclares. Moving one pin without the other breaks a third repository:Measured 2026-11-20:
hrx-systemrenamedloomc_link_index_builder_free→_releasein771711d49be, while the engine pinned ahrx-systembefore it. The current pin pair was consistent (pinnedllama.cppasks for_free, pinnedhrx-systemhas_free) and nothing in the engine referenced the symbol — so the fix was a lockstep bump of both gitlinks, which took ten comments and a compile to establish.What it reports on the trees this box has
Those two names are the ones #2916's thread is still chasing — found here without a compiler.
Decisions that make the answer trustworthy rather than plausible
hrx-system, not in one include dir, because the C binding's headers moved once already;llama.cpproot or theggml-hrxdir — the check first failed on the real tree because it accepted only the latter, which is the "probe cannot distinguish its own misconfiguration" failure this lane keeps meeting;cannot tell(rc 2), never "nothing missing": a missing tree, or a fork side with noloomc_use, must not report a clean pair (cannot-tell mutant → 1 FAIL).Verification
--self-test: 8 arms, hermetic in a temp tree — a matched pair reports nothing; a one-sided rename is reported by name; a comment-only symbol is not counted; a missing tree says what is missing; an empty fork side says it cannot tell; a declaration in a moved header still counts; and both argument forms answer.Mutations: comment stripping removed → 1 FAIL; header glob narrowed to one dir → cannot tell; cannot-tell guard removed → 1 FAIL.
Not claimed: this covers
loomc_*only. The same pairing question applies to any C API shared across two gitlinks — this is one instance, chosen because it is the one that has cost the fleet a blocked pin.