Skip to content

hw-gate: report the trees and the ui dist a build reads (engine#2868) - #2872

Merged
bong-water-water-bong merged 8 commits into
mainfrom
ci/pin-iq1s-arm
Nov 18, 2026
Merged

bong-water-water-bong merged 8 commits into
mainfrom
ci/pin-iq1s-arm

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

The gate died six times per run at third_party/llama.cpp/scripts/ui-assets.cmake:137 with only the
CMake headline in the log, so there was nothing to say which copy of the UI dist was being validated.
Two candidates exist and they differ by tree: ${UI_SOURCE_DIR}/dist (the checkout, checked first at
scripts/ui-assets.cmake:523) and ${DIST_DIR} (the build tree, validated unconditionally at :592
even when both LLAMA_USE_PREBUILT_UI and LLAMA_BUILD_UI are off).

So this records both, before the removals, in build.log:

hw-gate: src=<checkout> build=<build dir> ui-checkout-dist=absent ui-build-dist=present(72 files)
         ui-stamp=ggml-org/llama-ui|<version> ui-cache=LLAMA_USE_PREBUILT_UI:BOOL=<ON|OFF>

Measured on strixhalo before this patch, for the record: no checkout under
actions-runner-*/_work/engine/engine/third_party/llama.cpp has tools/ui/dist (47e7724b's removal is
insurance, not the fix), while the gate's cached tree ~/.cache/hw-gate/build-685489b587/tools/ui/dist
held 72 files with no workbox* at all - that is the copy the validator rejected. be43fbbb already
deletes it before configuring, which is why the 18:36 run on be43fbbb reached every device phase
(ops 3604/3604).

No behavior change beyond the log line.

bcloud and others added 8 commits November 18, 2026 19:20
The pin at 831ed614 selects a motif that calls @ggml_kquant_grid_fill_for
(defined in ops/kquant_decode_f32.loom) and @ggml_iq1s_f16_pair (defined in
motifs/kquant_iq1_s.loom) without declaring either module in any of the 22
exports that compile the motif, so the Loom root link fails and every q4_K /
q6_K prefill launch is refused:

  LINK/MATERIALIZE: unresolved exact declaration '@ggml_kquant_grid_fill_for'

That is why hw_gate was 3593/3604 against 3604/3604 on the parent.  The fork
commit 8c23f152 calls the motif's own @ggml_kquant_iq1s_grid_fill and declares
motifs/kquant_iq1_s.loom in all 22 recipes.  No kernel arithmetic changes:
the arm stays keyed where 831ed614 put it, which stage A corrects separately.

test-backend-ops -b HRX0 -o MUL_MAT,MUL_MAT_ID on that tree: 2642/2642.
The recorded source hash carried the right 9-character prefix and a wrong
tail, so registry_pins compared two different hashes that printed the same
and registry_content found the file stale. Regenerated with
tools/registry_build.py in a tree whose submodule is at the pin; only the
sources hash changes, every architecture entry already matched.
The pin moves to d43f82f34, which carries the IQ1_S producer arm (fork #427),
the op, matcher and test rows for it (fork PR stacked on #427) and one
ui-assets fix: the published UI dist bundles workbox into sw.js and no longer
ships workbox[hash].js, so ui_validate_assets stopped every configure this
gate does on a pin bump, and hw_gate could not reach a device phase at all
(44346581686, 44297044947, 44238065559: build FAIL 8s, six repeats).

registry/architectures.json is regenerated in this tree, so the recorded
llama.cpp source hash is the gitlink's full hash rather than a hand-typed
string that happened to share its first nine characters.
The gate configure died before any device phase on every pin bump (six
repeats of "CMake Error at third_party/llama.cpp/scripts/ui-assets.cmake:137
(message)", build FAIL in 8 s on 44346581686, 44297044947, 44238065559).
ui_validate_assets requires workbox[hash].js, and the prebuilt dist the fork
downloads - the moving "latest" tag of the ggml-org/llama-ui bucket, since the
versioned tags 404 - now ships the SvelteKit layout, which bundles workbox
into sw.js. A gate tree that reconfigured with the older dist in it kept
passing, so only branches that move a pin hit this.

No gate phase reads the UI: they drive kernel entry points or llama-server over
HTTP. LLAMA_USE_PREBUILT_UI=OFF and LLAMA_BUILD_UI=OFF make the asset step
embed an empty table ("UI: no assets available - building without an embedded
UI", "embedded 0 assets") and never touch the network, and .ui-flags wipes a
cache that was configured without them.

1bit-MONSTER/llama.cpp pin to 4df0f3e6c: the IQ1_S prefill arm with both packet
halves staged, the op that selects it, its matcher and its test rows.
LLAMA_USE_PREBUILT_UI=OFF stops a new download but ui-assets.cmake emit_files()
validates a dist directory that already has assets, and the gate tree still held
the 12:35 copy of the current "latest" Vite layout, so the configure died again
(44369282109, build FAIL 8 s, six "missing required asset(s)" messages). Remove
the generated dist and its stamp with the cache: with nothing to embed the step
reports "no assets available - building without an embedded UI" and "embedded 0
assets", verified on a tree carrying that same layout.
The gate has been failing every run for 8 s with 'CMake Error at
third_party/llama.cpp/scripts/ui-assets.cmake:137' -- the asset check, before
any device phase, so ops/kat/kld/needle/placement never ran on any PR.

ui-assets.cmake:524 checks ${UI_SOURCE_DIR}/dist first and, when it holds an
index.html, embeds and validates that copy. ${UI_SOURCE_DIR} is the checkout,
while the removals above only clear the build tree, so a checkout that once
provisioned a dist keeps failing regardless of LLAMA_BUILD_UI=OFF.
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Log Clarity Improvement

The PR adds a log line to report the state of UI distribution files in both the source and build directories before removals. This helps diagnose UI validation failures by indicating which tree (checkout or build) contained the UI assets that were rejected by the validation script.

# engine#2868: record what the tree held BEFORE the removals below, so a UI failure in the log names
# the tree and the copy to clean. ui-assets.cmake checks ${UI_SOURCE_DIR}/dist (the checkout) before
# ${DIST_DIR} (the build tree) and validates whichever exists even with the UI switched off.
dist_state() { [ -e "$1/index.html" ] && echo "present($(find "$1" -type f | wc -l) files)" || echo absent; }
ui_report="hw-gate: src=$src build=$build ui-checkout-dist=$(dist_state "$src/tools/ui/dist") ui-build-dist=$(dist_state "$build/tools/ui/dist") ui-stamp=$(cat "$build/tools/ui/.ui-stamp" 2>/dev/null || echo none) ui-cache=$(grep -m1 '^LLAMA_USE_PREBUILT_UI:' "$build/CMakeCache.txt" 2>/dev/null || echo none)"
# A tree that provisioned a dist earlier still embeds and validates it (ui-assets.cmake emit_files only
# skips the check when the directory holds nothing), so the downloaded copy goes with the cache.
rm -rf "$build/tools/ui/dist"
rm -f "$build/tools/ui/dist.tar.gz" "$build/tools/ui/dist.tar.gz.sha256" "$build/tools/ui/.ui-stamp"
# scripts/ui-assets.cmake:524 checks the SOURCE tree first -- if ${UI_SOURCE_DIR}/dist/index.html
# exists it embeds and validates that copy, and ${UI_SOURCE_DIR} is the checkout, not the build dir.
# A checkout that once provisioned a dist therefore still dies on "missing required asset(s)" no
# matter what the build dir holds.
rm -rf "$src/tools/ui/dist"
# the same configuration as cmake/hrx.cmake (llama_hrx), plus the two test tools
: > "$OUT/build.log"
echo "$ui_report" >> "$OUT/build.log"

@bong-water-water-bong
bong-water-water-bong merged commit c2e3408 into main Nov 18, 2026
11 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the ci/pin-iq1s-arm branch November 18, 2026 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hw-gate Run the HRX hardware gate on Strix Halo (docs/hw-gate.md) Review effort 2/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant