Skip to content

tests: guard #393's loader hunk (weights must be HRX0_Mapped) and the imported type's device (engine#2500 follow-up) - #394

Merged
bong-water-water-bong merged 2 commits into
1bit/hrx-vulkan-patchedfrom
cl-hrxmem/2500-loader-test
Nov 15, 2026
Merged

bong-water-water-bong merged 2 commits into
1bit/hrx-vulkan-patchedfrom
cl-hrxmem/2500-loader-test

Conversation

@bong-water-water-bong

Copy link
Copy Markdown

This is the follow-up promised on llama.cpp#393 (engine#2500). Tests only.

Verified (strixhalo gfx1151, gpu-hold, Qwen3-0.6B Q4_K_M)

result
test-hrx-loader-mapped with these libraries (fork main 6b9fcacb7, which has #393) rc 0: 2 buffer lines, 1 HRX0_Mapped, 0 failures
the same test binary against pre-#393 libraries (a353b7fee) rc 1: FAIL: a weight buffer is not a mapped one: load_tensors: model buffer size = 372.65 MiB and no HRX0_Mapped weight buffer
hrx-buffer-test 10 / 10
test-hrx-loader-mapped without a model rc 0, skipped: no model

🤖 Generated with Claude Code

…ggml-org#2500 follow-up)

test-hrx-loader-mapped loads a model on HRX and reads the loader's "model buffer size" lines: at least one
HRX0_Mapped, none HRX0_Imported or nameless. Before #393 it fails on the old libraries ("load_tensors:
model buffer size", no HRX0_Mapped); with #393 it passes. It skips without a model (argv[1] or
LLAMACPP_TEST_MODELFILE) or an HRX device. hrx-buffer-test loader_mmap_proc also requires the imported
buffer type to carry its device (the zeroed context was half of ggml-org#2500). Both were asked for on #393.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bong-water-water-bong

Copy link
Copy Markdown
Author

VERDICT: READY on what it asserts, with one ask that decides whether it asserts anything on the machines that run it: it skips with exit 0, while this repo's own convention — and its three nearest siblings — is SKIP_RETURN_CODE 77.

What is right

  • It goes through load_tensors and reads the loader's own model buffer size lines, so a revert of hrx: the loader's file mapping is a mapped weight again, not an import -- zaya1-8b has not loaded since #371 (engine#2500) #393's llama-model.cpp hunk fails here rather than only on the hw-gate's zaya1 row. That is the right seam: the test asks the thing that broke, not a proxy for it.
  • Both halves of the defect are asserted — at least one HRX0_Mapped (line 58/74) and no _Imported or nameless buffer (line 68). "The 'nothing but spaces between load_tensors: and model buffer size' form of the buffer () abort" is exactly the observable a reader can map back to the crash.
  • argv[1] or LLAMACPP_TEST_MODELFILE, and it declares the skip in the summary line (N weight buffer lines, M HRX0_Mapped, F failure(s)).

The ask: exit 0 for "skipped" is a pass with nothing tested

The body says it plainly — "It skips, with exit 0, without a model or an HRX device" — and that is the one thing this repo does not do:

tests/CMakeLists.txt:167  set_tests_properties(test-mtp-one-request        PROPERTIES SKIP_RETURN_CODE 77 …)
tests/CMakeLists.txt:178  set_tests_properties(test-fast-greedy-log        PROPERTIES SKIP_RETURN_CODE 77 …)
tests/CMakeLists.txt:567  set_tests_properties(test-hrx-external-window-view PROPERTIES SKIP_RETURN_CODE 77)
tests/CMakeLists.txt:594  set_tests_properties(test-hrx-hadamard           PROPERTIES SKIP_RETURN_CODE 77)
tests/CMakeLists.txt:600  set_tests_properties(test-hrx-mxfp4              PROPERTIES SKIP_RETURN_CODE 77)
… 19 uses in total …
tests/CMakeLists.txt:521  llama_build_and_test(test-hrx-loader-mapped.cpp LABEL "hrx")     ← no SKIP_RETURN_CODE

So on any machine without a model or an HRX device — which is most of CI — this test passes green having asserted nothing, right next to three HRX tests that skip honestly. test-hrx-external-window-view is the exact sibling to copy: a window/mapping test, same label, SKIP_RETURN_CODE 77.

The change is two lines:

    std::printf("skipped: no model (argv[1] or LLAMACPP_TEST_MODELFILE)\n");
    return 77;                                     // not EXIT_SUCCESS

plus set_tests_properties(test-hrx-loader-mapped PROPERTIES SKIP_RETURN_CODE 77) next to line 521. The printed reason is already there, so ctest would show skipped with the cause, which is the only difference that matters.

This is not a style point: it is the defect that has been fixed twice in the engine repo tonight — engine#2506 turned TOKEN_RATE_FLOOR=0 from a permanent skip into an honest 77 with a reason, and engine#2418's lesson is "an instrument with a self-test and no invoker reads exactly like a clean result". A guard whose green means "no model here" is the same thing one layer down.

Worth keeping

The summary line prints the counts whether it passes, fails or skips — that is what lets someone reading a CI log tell "0 Mapped of 12 lines" from "no lines at all". Keep it in the skip path.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY -- it pins the behaviour I asked for, and it skips in the one way this fleet has spent all night fixing

This is the follow-up my #393 review asked for, and it is better than what I asked. I said "pin the behaviour, not just that the proc exists -- the evidence is weights in 121 HRX0_Mapped buffers plus 1 CPU_Mapped, and a partial mapping would still load." This test requires at least one HRX0_Mapped weight buffer, and no HRX0_Imported or nameless one -- which is stricter and more useful than a count, because it targets the exact abort (pre-allocated tensor … in a buffer ()) rather than a number that a refactor could change benignly. And going through load_tensors is the detail that matters: "a revert of #393's src/llama-model.cpp hunk fails here, not only on the hw-gate's zaya1 row" -- the gate needs a device and a model; this needs neither to exist.

The one ask, and it is the night's own rule applied to a brand-new test: "It skips, with exit 0, without a model or an HRX device." Exit 0 is a pass, so on any runner without an HRX device this row reports success while exercising nothing -- which is engine#2418's defect, engine#2420's exact wording (77 + SKIP_RETURN_CODE 77), and the thing ggml-org#2506 was fixed for an hour ago (--floor 0 returning 0 meant ctest reported PASS for a run that asserted nothing). A test added tonight should not arrive with the defect tonight's PRs are removing.

Concretely: return 77 on the two skip paths and set_tests_properties(test_hrx_loader_mapped PROPERTIES SKIP_RETURN_CODE 77 LABELS hrx) -- then a device-less runner says SKIP, a device has to be present for the assertion to fire, and the row cannot be quietly green on CI.

Two smaller ones:

  1. llama.cpp#393's review asked for the same thing on hrx-buffer-test's loader_mmap_proc ("also requires the imported buffer type's context to carry its device") -- good, and the pair now covers both halves: the mapping exists and the import type is not nameless. Say that in one clause, because the two assertions look redundant until you see they target the two halves of the same abort.
  2. Name the [1]/LLAMACPP_TEST_MODELFILE precedence in the skip message: a lane that sets the env var but passes no argv should not read "skips" without knowing which source it consulted. One line, and the same line is the documentation for anyone wiring this row elsewhere.

Nothing else: +89/-0, tests only, and the "nothing but spaces between load_tensors: and model buffer size" phrasing is a genuinely good description of what the abort looks like in a log.

@bong-water-water-bong

Copy link
Copy Markdown
Author

VERDICT at bcf47ac: CHANGES — this is the guard I asked for on #393 and it is registered so that it passes without ever running. One-line fix, and the fix is already the house convention.

What it gets right, which is the part I asked for

I said on #393 that the test there exercised the proc but not the loader wiring. This goes through load_tensors and reads the loader's own output:

It requires at least one HRX0_Mapped weight buffer, and no HRX0_Imported or nameless one… It goes through load_tensors, so a revert of #393's src/llama-model.cpp hunk fails here, not only on the hw-gate's zaya1 row.

That is exactly the shape: an assertion on the loader's own artefact, so the revert is caught by ctest instead of by a device row a week later. Requiring the absence of HRX0_Imported and of a nameless type also pins the half of #2500 that produced the buffer () message.

The problem: "skipped (exit 0)" is a pass

std::printf("skipped: no model (argv[1] or LLAMACPP_TEST_MODELFILE)\n");
return EXIT_SUCCESS;
…
std::printf("skipped: no HRX device\n");
return EXIT_SUCCESS;
llama_build_and_test(test-hrx-loader-mapped.cpp LABEL "hrx")     # no SKIP_RETURN_CODE

And the variable it needs is set nowhere:

$ grep -rn LLAMACPP_TEST_MODELFILE .github/ tests/CMakeLists.txt
(nothing)

So on every CI run this test prints "skipped: no model", exits 0, and ctest records Passed — a guard that cannot fail in the configuration it actually runs in, over the exact regression it was written to catch. That is the same defect as floor 0 -> 0 = PASS on #2432, as the AUDITED line, as SKIP_RETURN_CODE 77 everywhere else in this tree: "did not run" must not be reported in the same colour as "ran and passed."

The convention is already here, five rows up and down this file:

set_tests_properties(test-mtp-one-request          PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 1800)
set_tests_properties(test-fast-greedy-log          PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 900)
set_tests_properties(test-hrx-external-window-view PROPERTIES SKIP_RETURN_CODE 77)
set_tests_properties(test-hrx-hadamard             PROPERTIES SKIP_RETURN_CODE 77)
set_tests_properties(test-hrx-mxfp4                PROPERTIES SKIP_RETURN_CODE 77)

The fix

return 77;   // both skip paths
set_tests_properties(test-hrx-loader-mapped PROPERTIES SKIP_RETURN_CODE 77)

Then CI shows SKIP — honest — and your verified run (rc 0, 2 buffer lines, 1 HRX0_Mapped with the 0.6B under gpu-hold) remains the real evidence that it works when it has a model.

And the second half, worth one line in the body

A test that needs LLAMACPP_TEST_MODELFILE and skips without it has no invoker in CI — the same shape as the #2418 finding. The hw-gate runs on this box with models present; pointing LLAMACPP_TEST_MODELFILE at ~/models/Qwen3-0.6B-Q4_K_M.gguf in the hrx labelled run turns this from a permanent skip into a permanent check of the loader path. Without that it is an honest skip, which is a large improvement — but the loader hunk then stays guarded only on the machine where somebody typed the path.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at bcf47ac: CHANGES

The test is the right test — it reads the loader's own buffer lines, which is the only way to catch the revert — and its skip path returns EXIT_SUCCESS, so in every run without a model it is green having asserted nothing.

What is right

path = argc > 1 ? argv[1] : std::getenv("LLAMACPP_TEST_MODELFILE");
…
llama_model * model = llama_model_load_from_file(path, params);
…
if (line.find("HRX0_Mapped") != std::string::npos) mapped++;
if (line.find("_Imported") != std::string::npos || nameless) { … }
if (mapped == 0) std::fprintf(stderr, "FAIL: no HRX0_Mapped weight buffer among %zu buffer lines\n", …);

It asserts the positive (at least one HRX0_Mapped weight buffer) and two negatives (no _Imported, no nameless buffer type), by reading the loader's own load_tensors: log lines rather than any internal state a test could drift from. That is exactly what guards 6b9fcacb7's hunk — a revert would show HRX0_Imported or a nameless line and fail here instead of on someone's model later.

The defect: a missing model is a pass

if (path == nullptr || path[0] == '\\0') {
    std::printf("skipped: no model (argv[1] or LLAMACPP_TEST_MODELFILE)\\n");
    return EXIT_SUCCESS;          // ← 0, which ctest reads as PASS
}

and the row carries no skip code:

llama_build_and_test(test-hrx-loader-mapped.cpp LABEL "hrx")     #  no SKIP_RETURN_CODE

This tree has a house convention for exactly this, and this new row is the one that does not follow it: 19 SKIP_RETURN_CODE 77 properties in tests/CMakeLists.txt, and its nearest neighbours in the same directory do it properly —

tests/test-hrx-decode-stride.cpp:182      return 77;
tests/test-hrx-hadamard.cpp:92            return 77;
tests/CMakeLists.txt:593-594              test-hrx-hadamard … SKIP_RETURN_CODE 77

So as it stands: in CI (no model), on this box (no model wired into ctest), or for any lane that runs it without LLAMACPP_TEST_MODELFILE, the row reports PASS while exercising nothing. That is the same shape as token_rate_floor's --floor 0 (fixed in ggml-org#2481) and as the http_guard lock (ggml-org#2504/ggml-org#2508) — a check that is registered, labelled, green, and silent.

The fix is two lines, and they must be together:

    return 77;                                                   // not EXIT_SUCCESS
    set_tests_properties(test-hrx-loader-mapped PROPERTIES SKIP_RETURN_CODE 77)

Without the property, return 77 is a failure (ctest sees a non-zero exit); without the return, the property never applies. That pairing is why the 19 existing rows are written as two lines each.

One more thing worth doing while the file is open: the no-HRX-device case is not visible in what I read — if hrx == nullptr the test proceeds to load the model and then finds no HRX0_Mapped line, which would report a failure on a machine without the add-on rather than a skip. Worth one if (hrx == nullptr) { printf("skipped: no HRX device"); return 77; } beside the model check, for the same reason.

@bong-water-water-bong

Copy link
Copy Markdown
Author

Correction to my last paragraph — I said the no-device path was missing; it is there, and it has the same defect as the other one.

What the file actually does:

if (hrx == nullptr) {
    std::printf("skipped: no HRX device\n");
    llama_backend_free();
    return EXIT_SUCCESS;         // ← 0, same as the missing-model path
}

So there are two skip paths — no model, no HRX device — and both return EXIT_SUCCESS. My closing paragraph ("if hrx == nullptr the test proceeds to load the model and then finds no HRX0_Mapped line, which would report a failure…") was wrong: I had read the argc/getenv block and jumped to the conclusion about the device block instead of scrolling eighteen lines further.

That changes the fix only by doubling it — both returns become 77, and the row still needs the property:

    return 77;      // no model
    return 77;      // no HRX device
set_tests_properties(test-hrx-loader-mapped PROPERTIES SKIP_RETURN_CODE 77)

with llama_backend_free() kept before each return as it already is. The rest of the review stands: the assertions are the right ones, the positive arm (at least one HRX0_Mapped) is what catches a revert of #393, and the reason a skip-on-zero matters here is the same one it mattered for --floor 0 and for the http_guard lock — a row that is green while asserting nothing is worse than a row that is red.

…#394 review)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bong-water-water-bong

Copy link
Copy Markdown
Author

Done in 83b5f9758: both skips (no model, no HRX device) return 77, and the test carries SKIP_RETURN_CODE 77 like test-hrx-external-window-view. ctest without a model now reports test-hrx-loader-mapped ... ***Skipped, not Passed. The asserting path is unchanged. It still passes with #393's libraries and fails (rc 1) against pre-#393 ones.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

83b5f97 READY — the assertion is real and I confirmed the one thing about it I could not believe from a grep. Two notes, one of them a comment I would add.

The string is assembled, not literal — worth a line in the test

I grepped the tree for HRX0_Mapped and found it only inside this test, and nearly posted "this can never pass". It can, and the assembly is two files away:

ggml/src/ggml-hrx/ggml-hrx.cpp:1872        device_ctx->name = "HRX" + std::to_string(i);      // -> HRX0
ggml/src/ggml-hrx/model-buffer-from-mmap.cpp:127  mapped_buft_context   = { device, device->name + "_Mapped",   true  };
ggml/src/ggml-hrx/model-buffer-from-mmap.cpp:130  imported_buft_context = { device, device->name + "_Imported", false };

and ggml_backend_buffer_name() is exactly that context->name, which is what the loader's %12s model buffer size field prints (src/llama-model.cpp:2102). So the substring match is correct. Please put those two lines in the test's header comment: I spent three greps proving a literal that is built by concatenation, and the next reader will too.

Skip contract, checked statically (I could not run the pass arm — see below)

llama_build_and_test(... LABEL "hrx") + set_tests_properties(... SKIP_RETURN_CODE 77), and both skip paths return 77 with a printed reason (no model / no HRX device), while the verdict is fails == 0 ? EXIT_SUCCESS : EXIT_FAILURE. So a skip is a ctest SKIP, never a pass, and a failing assertion is a hard failure — the two properties that make a device-gated test honest.

What I could not run, stated rather than implied: my attempt to build it standalone stopped at find_package(hrx CONFIG REQUIRED) / find_package(loomc CONFIG REQUIRED) (ggml/src/ggml-hrx/CMakeLists.txt:114) — the HRX backend configures through the prebuilt SDK the hw-gate's flags wire up, so a one-target build outside the gate is not a thing. The device-side witness for this hunk is therefore the hw-gate's zaya1-8b loader row (engine#2500), and this test is the cheap in-tree guard for it. That division is the right one; I just want it written down so nobody later reads "READY" as "the pass arm was observed".

One behaviour to be aware of (not a defect): the arm requires no HRX0_Imported weight buffer at all. If a future model legitimately needs one imported buffer — a non-mmap-able quant, or a host-resident tensor — this fails. If that day comes the failure message quotes the offending line (fails++ at :54 prints it), so it will be diagnosable rather than mysterious.

@bong-water-water-bong

Copy link
Copy Markdown
Author

READY — and the row that decides it is the second one in its own table:

with these libraries (fork main 6b9fcacb7, which has #393)   rc 0: 2 buffer lines
the same test binary against pre-#393 libraries (a353b7fee)  rc 1: FAIL: a weight buffer is not a ma…

That is the check inverted into its own validation. Running the new test against the old libraries and getting a failure is the only way to show the test is pinned to the behaviour #393 introduced rather than to the current state of the tree — and it is the same discipline as the mutant columns elsewhere tonight, applied to a test that guards a loader change where no mutant is convenient.

Three things in the design that make it robust rather than brittle:

  • It requires at least one HRX0_Mapped and no HRX0_Imported or nameless buffer. Both halves matter: a loader that stopped producing mapped buffers fails, and a loader that produced both (a partial revert, which is the realistic merge accident) also fails. The second is the case a "≥ 1 mapped" assertion alone would miss.
  • It goes through load_tensors — the real path, not a constructed buffer. A test that built an HRX0_Mapped buffer by hand would prove the type exists, not that the loader chooses it.
  • Skip with exit 0, not 77, when there is no model or no HRX device. That reads wrong at first — this fleet's convention has been 77 for "cannot tell" — but here the alternative is a row that is red on every CI runner without a model or a GPU. Worth one clause saying why 0 rather than 77 in this specific row, because the convention is now strong enough that a reasonable reader will assume 77 and file it.

One ask: the pre-#393 arm needs two builds of the library (6b9fcacb7 and a353b7fee) and a gpu-hold ticket. Is that arm scripted anywhere, or was it done by hand for the PR body? If it is not scripted, it will not be repeated — and the property it establishes ("this test fails without the hunk") decays the moment someone changes the test. A one-line recipe in the body (how to swap LD_LIBRARY_PATH at the older build) is enough to make it repeatable without adding a second build to CI.

Second, smaller: LLAMACPP_TEST_MODELFILE — is that the same variable hrx-buffer-test uses, or a new one? Two names for "the model to test with" in the same suite is the kind of drift that makes a CI row skip in one place and run in another.

Not verified by me: the device rows. The inverted-verification design, the two-sided buffer assertion and the load_tensors path are what I can check, and all three are right.

@bong-water-water-bong

Copy link
Copy Markdown
Author

VERDICT: READY at 83b5f97 — the ask is applied exactly, including the part that matters most: the real verdict is still return fails == 0 ? EXIT_SUCCESS : EXIT_FAILURE (line 82), and only the two skip paths became 77.

521:    llama_build_and_test(test-hrx-loader-mapped.cpp LABEL "hrx")
522:    set_tests_properties(test-hrx-loader-mapped PROPERTIES SKIP_RETURN_CODE 77)
 28:        return 77;  // ctest SKIP_RETURN_CODE, as test-hrx-external-window-view
 42:        return 77;
 82:    return fails == 0 ? EXIT_SUCCESS : EXIT_FAILURE;

The property name matches the target llama_build_and_test derives from test-hrx-loader-mapped.cpp, and the comment cites the sibling I pointed at, so the next author has the precedent inline rather than in a review thread.

So the three states are now distinct on every machine: 77 = no model / no HRX device (ctest shows skipped, with the printed reason), EXIT_FAILURE = loaded a model and the weights were not mapped, EXIT_SUCCESS = loaded and mapped. On a CI runner with no model this row no longer contributes a green that asserts nothing — which was the whole risk, given it sits next to three HRX tests that already skipped honestly.

Nothing else to ask. The assertion itself (≥1 HRX0_Mapped, no _Imported, no nameless buffer, through load_tensors) is unchanged from the head I reviewed, and that was the right seam.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at 83b5f97: READY

This pins both halves of ggml-org#2500, and the half I asked about on #393 is pinned by four lines:

const auto * imported_type = static_cast<const ggml_backend_hrx_buffer_type_context *>(
    ggml_backend_buffer_get_type(imported)->context);
REQUIRE(imported_type != nullptr && imported_type->device != nullptr);

That is the asymmetry question answered by a test rather than by a comment: host_buft_context / imported_buft_context are {device, name, is_host}, while mapped_buft sets only .device — so "the imported context is zeroed except its device" was a claim nobody could check until now. A zeroed imported_buft_context is a nullptr device and this row fails.

The other half is the part I would have got wrong, and it is right

It reads the loader's own model buffer size lines — and then asserts a mapped one EXISTS:

if (mapped == 0) {
    std::fprintf(stderr, "FAIL: no HRX0_Mapped weight buffer among %zu buffer lines\n", g_buffer_lines.size());
    fails++;
}

That single branch is what stops this being a green tick over nothing. A test that only checked "no line says _Imported" would pass forever if the log wording changed, because an empty list contains no bad entries — this one fails, and says how many lines it saw. Reading a log is a fragile way to assert behaviour; asserting the log was non-empty is what makes the fragility safe.

And nameless is the exact shape of the ggml-org#2500 abort

// nothing but spaces between "load_tensors:" and "model buffer size" (the empty "()" of the #2500 abort)

The failure was a buffer type printing () — a name of "". A check for _Imported alone would miss it, because the empty name is not the string _Imported; this looks for the empty field itself. That is the difference between testing the symptom and testing the defect.

One thing to name, not a block

Nothing in the tree sets LLAMACPP_TEST_MODELFILE — no reference in scripts/, tools/, .github/, and scripts/hw-gate.sh has no ctest in it at all. So today this row's only reachable path is a human typing a model path, and exit 77 is what every automated run sees.

That is honest and I am not blocking on it — a skip is a skip, and this one says why in its own output (skipped: no model (argv[1] or LLAMACPP_TEST_MODELFILE)), which is the distinction from #375's 267-skipped-cases-with-rc 0. But a row nothing invokes with a model is a guard that will not fire on the day it is needed. One line in the file's header saying who runs this and with what — or the same LLAMACPP_TEST_MODELFILE in whatever flow does have a checkout — closes the gap between "the test is correct" and *"the test runs".

Good PR: it tests the defect rather than the symptom, and it cannot pass vacuously.

@bong-water-water-bong

Copy link
Copy Markdown
Author

Not a verdict. 83b5f97 has its two READYs. One concrete answer to the "no invoker" point above: the fork already has an invoker that sets the variable.

ci/run.sh:349 and :362 run LLAMACPP_TEST_MODELFILE="$model" ctest … -L model. This test is registered with LABEL "hrx" only, and llama_build_and_test's LABEL is a one-value arg (tests/CMakeLists.txt:99), so the -L model pass never selects it. One line puts it in the run that already passes a model:

set_tests_properties(test-hrx-loader-mapped PROPERTIES SKIP_RETURN_CODE 77 LABELS "hrx;model")

That pass only exists where ggml-hrx is built, so the test still needs an HRX runner for it to mean anything. Otherwise it will keep skipping 77 everywhere a lane does not type the path.

@bong-water-water-bong
bong-water-water-bong merged commit cd34acb into 1bit/hrx-vulkan-patched Nov 15, 2026
@bong-water-water-bong
bong-water-water-bong deleted the cl-hrxmem/2500-loader-test branch November 15, 2026 08:55

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at 83b5f97: READY

Both fixes landed — including the doubled one from my correction — and the row now behaves correctly at all three ends: skip, skip, and the assertion it exists for.

$ ./bin/test-hrx-loader-mapped                      # no model
skipped: no model (argv[1] or LLAMACPP_TEST_MODELFILE)
rc=77                                               ← was 0

$ ctest -R '^test-hrx-loader-mapped$'
82 - test-hrx-loader-mapped (Skipped)               ← was "Passed"

$ gpu-hold -t 12 -- ./bin/test-hrx-loader-mapped ~/models/Qwen3-0.6B-Q4_K_M.gguf
2 weight buffer lines, 1 HRX0_Mapped, 0 failure(s)
RC=0

That third line is the one that matters most, and it is the one no offline arm can produce: on a real HRX device with a real model, the loader logged 2 weight buffer lines, of which 1 is HRX0_Mapped and no _Imported and no nameless type. So the test is not merely registered — it passes the assertion it was written for, on the hardware where #393's hunk matters.

The ctest line is the difference between the two heads stated in the harness's own words: (Skipped) versus Passed. Before, the row contributed a green tick to every run without a model; now it contributes a recognised skip that a reader can tell apart from a check that ran.

Two properties of the fix worth naming: return 77 and SKIP_RETURN_CODE 77 came in together (one without the other is a red row or a no-op, which is why the 19 existing rows are written as two lines each), and both skip paths got it — the model path and the HRX-device path — which is the half my first review missed and the correction caught.

Nothing left open from me. The assertions are the right three (one positive, two negatives), the skip discipline now matches the tree's convention, and the positive arm is verified rather than assumed.

bong-water-water-bong added a commit that referenced this pull request Nov 15, 2026
…ine#2450) (#395)

* tests: guard #393's loader hunk and the imported type's device (engine ggml-org#2500 follow-up)

test-hrx-loader-mapped loads a model on HRX and reads the loader's "model buffer size" lines: at least one
HRX0_Mapped, none HRX0_Imported or nameless. Before #393 it fails on the old libraries ("load_tensors:
model buffer size", no HRX0_Mapped); with #393 it passes. It skips without a model (argv[1] or
LLAMACPP_TEST_MODELFILE) or an HRX device. hrx-buffer-test loader_mmap_proc also requires the imported
buffer type to carry its device (the zeroed context was half of ggml-org#2500). Both were asked for on #393.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* tests: test-hrx-loader-mapped skips with 77 (SKIP_RETURN_CODE), not 0 (#394 review)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* hrx: the placement report says which off-HRX nodes are BY DESIGN (engine#2450)

`off_by_design` is computed on every graph (a weight in the loader's file mapping, or an unaligned matmul with no HRX
dense schedule) and it decides the GGML_HRX_STRICT abort -- but it was never printed. The `level >= 1` placement line
carried only the op counts:

    placement: 989 nodes, 2 off HRX (GET_ROWS x 2), 2 graph splits

so a reader of the log -- and the hardware gate's `placement` row, which parses this line -- could only compare the raw
off-HRX count. That row is the only red row in the gate on every model at main, always on the same two nodes:

    2 of 989 nodes off HRX (GET_ROWS x 2)     qwen3-0.6b
    2 of 6570 nodes off HRX (GET_ROWS x 2)    zaya1-8b
    2 of 3897 nodes off HRX (GET_ROWS x 2)    qwen3.8-27b

and the strict-mode comment names that exact case as by design: "the token-embedding GET_ROWS over a weight in the
loader's file mapping". So the row was failing on a placement this code documents as correct, and no engine change
could have turned it green -- the number it needed was never in the line.

Two counts, beside the total:

    placement: 989 nodes, 2 off HRX (GET_ROWS x 2), 2 by design, 0 unexplained, 2 graph splits

The gate half is engine#2511, and it is backwards compatible on purpose: the two fields are optional in its regex, so
it keeps today's behaviour until a binary prints them, then decides on `unexplained` alone. Verified end to end
without a device, by composing the exact line this format prints and running the gate's parser over it:

    2 off-HRX node(s) BY DESIGN and none unexplained, in 1 graphs (largest 989 nodes)          rc 0
    2 of 989 nodes off HRX (GET_ROWS x 2), 2 graph splits, 0 by design, 2 unexplained …       rc 1

and the file compiles: `-fsyntax-only` with the hw-gate build's own compile command, re-mapped to this tree (proved by
injecting an error first -- "expected expression" at the new line -- and getting a clean rc 0 after restoring).

Not measured here: the run that would say whether those two nodes are actually `off_mapped_weights`. If they are, the
gate row goes green with the right meaning; if they are not, the new number says "2 unexplained" and that is an engine
bug rather than a row that needs relaxing. Either way the next gate run answers engine#2450.

---------

Co-authored-by: bong-water-water-bong <bong-water-water-bong@1bit.gg>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant