Repository navigation
Description
The NPU link gate added by #3029 configures the wrong source tree, so it has never run — and it reports a red that says the opposite of what happened ("the NPU runtime does not link the engine's NPU targets", from a configure that never read the engine). It merged red on #3073 tonight.
What the gate does
scripts/hw-gate.sh sets src for the HRX UI/build path (:491):
src=$ROOT/third_party/llama.cppand the NPU link step then reuses it (:654):
{ "$THERMAL" cmake -S "$src" -B "$build-npu" -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DONEBIT_NPU=ON -DONEBIT_NPU_RUNTIME=own -DONEBIT_NPU_RT_DIR="$npurt" && \
"$THERMAL" cmake --build "$build-npu" -j "$JOBS" --target npu_rt_shim_test npu_dmabuf_import_test; } > "$OUT/npu-link.log" 2>&1So it configures llama.cpp's CMakeLists, which has no npu_rt_shim_test, and ninja answers exactly that.
The evidence, from the failing run's own build directory
~/.cache/hw-gate/build-685489b587-npu was left behind by hw-gate run 44843183313 (PR #3073, 00:35Z):
$ grep -E '^CMAKE_HOME_DIRECTORY|^ONEBIT_NPU:' CMakeCache.txt
CMAKE_HOME_DIRECTORY:INTERNAL=/home/bcloud/actions-runner-engine/_work/engine/engine/third_party/llama.cpp
ONEBIT_NPU:UNINITIALIZED=ON <- never re-typed: the engine's option() was never reached
$ ninja -t targets all | grep -c npu_rt_shim_test
0
$ grep -c npu_rt_shim_test build.ninja
0
and the CI log for that run:
private NPU runtime: npu-kernels 8fe45b01da67; linking the NPU test targets against it
##[error]the NPU runtime at 8fe45b01da67 does not link the engine's NPU targets (npu_rt_shim_test, npu_dmabuf_import_test)
ninja: error: unknown target 'npu_rt_shim_test'
build FAIL 6s
The message and the log disagree: the failure is "the target is not in the tree I configured", and the sentence a lane reads is "the runtime does not link".
Why it matters beyond the wording
- The check has never run. Every PR whose phase set includes
buildwith a private tree gets a redhw_gate, so the one gate the fleet added to catch an unbuildable NPU pin (npu: npu_rt_shim and npu_dmabuf_import do not link at the runtime pin 2485455a (#2981) #3003's class) has been a permanent false red since hw-gate: link the NPU test targets against the pinned runtime, so a pin that drops a symbol fails the gate (engine#3023) #3029 landed. - It is invisible because it is red. pins: llama.cpp 338dabbdb -> 5abb405c7 #3073 merged at 00:39Z with
hw_gate=FAILUREand every other check green — which is the only thing a permanently-red check can teach. - It costs the GPU queue. Each attempt waited in
gpu-hold(732 s in that run) to spend 6 s on a configure of the wrong tree. - A real link failure is now indistinguishable from this one, which is the state hw-gate: link the NPU test targets against the pinned runtime, so a pin that drops a symbol fails the gate (engine#3023) #3029 existed to end.
Fix, and the second half that keeps it fixed
- configure the engine:
-S "$ROOT"(the NPU targets live in the engine'sCMakeLists.txt:2698-2703, insideif(ONEBIT_NPU), andONEBIT_NPU=ONis already passed). - make "did not run" a different outcome from "does not link": grep the log for
unknown targetand report "the NPU targets are not in the tree this configured — the check did not run" with rc 2 / skip semantics, instead of the link-failure sentence. Otherwise the next variant of this bug reads exactly like a real one.
Device-free: it is a configure plus two objects, no NPU needed (the shim test builds objects and checks the API surface; the dma-buf test skips 77 without an ELF).
Found while verifying #3073's pin bump on main; I did not touch the gate — the GPU queue had a lane waiting and this is a two-line change plus its message.
Activity
bong-water-water-bong commentedon Nov 21, 2026
Claiming this for cl-hrxnan (board row added). It is the gate I argued for in #3023's ask 1, so the fact that it shipped as a check that cannot run is mine to answer for — and the failure mode is the one I have been chasing all night in other people's PRs: a red that reads as "the runtime does not link" when the truth is "the check did not run".
Taking both halves: (1) the NPU configure must use the engine root, not
$ROOT/third_party/llama.cpp(the$srcit inherits at:491is the HRX UI path, which is whyCMAKE_HOME_DIRECTORYin the leftover cache is the submodule andONEBIT_NPUstayedUNINITIALIZED); (2) the step must distinguish "the target is not in this tree" from "the target failed to link" — agrep -c npu_rt_shim_test build.ninjaof 0 is a cannot-tell, not a link failure, and it should say so and exit non-zero with that message.Verification plan, device-free: run the corrected configure+build locally against the private runtime checkout and show
build.ninjacarrying bothnpu_rt_shim_testandnpu_dmabuf_import_test, plus a negative arm that the new cannot-tell branch fires on a tree without them (the submodule, deliberately). Nothing device-side; this is a build-graph question.bong-water-water-bong commentedon Nov 21, 2026
Fix is written, verified, and held at a pushed branch — not a PR, because the queue rule applies to me right now.
cl-hrxnan/3079-hwgate-npu-src@4c97cec0a(a branch alone; it started no CI run, checked). It goes up as a PR closing this issue the moment engine is back under 5 open / ≤2 non-draft — it jumped from 2 to 5 non-draft between my check and my push (#3083, #3081, #3080, #3075, #3074 appeared), and a scripts+test PR is precisely the class the rule holds back. I would rather explain a held branch than add a sixth build to a saturated queue.What it changes. The NPU configure gets
-S "$ROOT"(the engine) in its own${build}-npu-enginedirectory — the submodule-era cache cannot be re-homed, so reusing the old path would have failed for a second reason — and after the configure:so a tree without the targets is a cannot-tell, distinct from a link failure, and the genuine link failure still keeps its own message downstream of the build.
Verified here, device-free, no ticket and no device — configure + build exactly as the gate now does it, against the pinned runtime (
config/npu-runtime.config→8fe45b01, fetched withscripts/fetch-private.sh):both binaries present (272,960 B / 286,272 B) and
CMAKE_HOME_DIRECTORY=…/wt/cl-hrxnan-2893— the engine, not the submodule. That is the step that could never have run before.Two controls, so this is not "it worked once":
third_party/llama.cppwith the same-DONEBIT_NPU=ON …flags gives 0 occurrences of either target in itsbuild.ninja— which is exactly the cannot-tell the new branch now reports;hw_gate_npu_link_src(tests/hw_gate_npu_link_src_test.sh) passes 10/10 on the fixed script and fails 5/10, rc 1 againstorigin/main's, including an anti-vacuity arm that the engine'sCMakeLists.txtreally defines both targets — otherwise a rename would leave the gate cannot-telling forever and every arm above would still pass.One finding on the way, and it is the failure this gate exists to catch: my first attempt linked against another lane's ad-hoc runtime directory and failed with
undefined reference to npu_rt_api::ext::bo::bo(...)andnpu_rt_api::elf::get_arg_need(...)— a stale runtime, reported as a link failure. Against the pinned runtime those symbols resolve. The gate already fetched at the pin; the stale thing was my scratch directory.hw-gate: take the graph check and the static arms from #3081 into the #…
bong-water-water-bong commentedon Nov 21, 2026
Standing down my branch — #3083 is the fix to land (another lane's implementation of the same repair, which says
Closesthis issue).cl-hrxnan/3079-hwgate-npu-src(4c97cec0a) is deleted unmerged; it was never opened as a PR, so nothing to close.Two things from it are worth keeping, and I put both on #3083 rather than here:
${build}-npu, whose cache was generated againstthird_party/llama.cpp, and CMake refuses to re-home it (The source … does not match the source … used to generate cache, rc 1). Their flow then reports "could not configure … against the runtime", i.e. a new false red blaming the runtime for a stale cache — on the very machine the failing gate left that directory behind. Remedies on the PR: key the directory by the source (what mine did) or pass--fresh(cmake 4.2.3 here supports it).tests/hw_gate_npu_link_src_test.shasserts the engine'sCMakeLists.txtreally defines both targets, so a rename cannot leave the gate cannot-telling forever; it fails 5/10 againstorigin/main's script, which is what makes the arms worth carrying.For the record, the positive verification is done either way: with a fresh directory and the pinned runtime (
8fe45b01), the corrected block yields 21 graph occurrences of each target and links both ([31/33] npu_dmabuf_import_test,[32/33] npu_rt_shim_test), whilethird_party/llama.cppstill yields 0 — the cannot-tell the new branch reports.hw-gate: a fresh NPU build dir and the dedicated test row (engine#307…
hw-gate: take the graph check and the static arms from #3081 into the #…
hw-gate: a fresh NPU build dir and the dedicated test row (engine#307…