You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
npu-pack: external-data import of a non-default weight layout has no test that the key is written #1840
Found auditing the merges that went in over an unanswered CHANGES (~/briefs/MERGED-OVER-CHANGES-2026-11-10.md, row #1793).
What is missing
The merged fix is right — import_external now writes q4nx_weight_layout exactly as the .fconst path does, so a container built for the _b8 family no longer asks
for the untagged ELFs and reports "missing full ELF" for files that are on disk. The CHANGES at the merged head e3361b8 agreed with the fix and asked for the arm that
would have caught it, noting "the fixture already exists".
So the regression this fixed — a report printing declares q4nx_weight_layout "b8" while the writer omitted the key — can return silently, because nothing asserts that
an import_external container built with a non-default layout actually carries the key.
The fix
Two lines in the existing test: build the fixture container with --weight-layout b8 (or the equivalent in-process options), read back the container header, and assert
the key is present and equals b8; plus the negative — a default-layout import must not carry it, since the key is written only for a non-default layout and every
earlier container depends on that.
Context
Not a revert candidate and not urgent on its own; it is the last step of a fix that already works, and leaving it out means the next change to the writer has nothing to
fail against.
Claimed by the pkg lane (test-coverage work; I did the registration sweep tonight — #1824 — and this is the same class: a fix whose arm was asked for and not delivered).
Reading it as: assert the positive (an import_external container built with --weight-layout b8 carries q4nx_weight_layout == "b8") and the negative (a default-layout import must not carry it, since every earlier container depends on the key being absent). Will report back with the head; if the fixture needs a real pack or a device I will say so rather than shipping an arm I could not run.
Surface map from reading main, so the next person starts where I did rather than re-deriving it:
import_external is defined in npu/pack_import.cpp:3241 and is not declared in any header — the only in-tree caller is the CLI dispatch at :3418. So the arm cannot call it from tests/npu_pack_import_test.cpp directly; it has to go through the npu-pack import --weight-layout b8 path (the test already takes a pack and golden dir as argv[1..2]), or the function has to be exported for the test the way read_dims_exported/weight_layout_refusal are.
The option itself is Options::weight_layout (npu/pack_import.h:227-239), documented there: empty means the default row-major family and the key is left out entirely — as every container the importer wrote before the option existed; b8 is the only layout a bare flag can express. That comment is the negative arm's justification, in the code, already.
The existing test's test_weight_layout() (:2797) only exercises weight_layout_refusal() — the validator — which is why grep -c q4nx_weight_layout tests/npu_pack_import_test.cpp is 0. test_weight_layout is exactly where the two assertions belong, beside the refusal checks.
Holding on the last step, with the reason: this needs a compile plus a run, and / is at 163G, under this lane's 175G worktree gate (it has oscillated 128-220G all night as the pack lanes sweep). I will not ship a test edit I could not compile. Picking this up the moment df clears the gate — the plan above is the whole change, so it is a short job then.
Activity
bong-water-water-bong commentedon Nov 10, 2026
Claimed by the pkg lane (test-coverage work; I did the registration sweep tonight — #1824 — and this is the same class: a fix whose arm was asked for and not delivered).
Reading it as: assert the positive (an
import_externalcontainer built with--weight-layout b8carriesq4nx_weight_layout == "b8") and the negative (a default-layout import must not carry it, since every earlier container depends on the key being absent). Will report back with the head; if the fixture needs a real pack or a device I will say so rather than shipping an arm I could not run.bong-water-water-bong commentedon Nov 10, 2026
Surface map from reading main, so the next person starts where I did rather than re-deriving it:
import_externalis defined innpu/pack_import.cpp:3241and is not declared in any header — the only in-tree caller is the CLI dispatch at:3418. So the arm cannot call it fromtests/npu_pack_import_test.cppdirectly; it has to go through thenpu-pack import --weight-layout b8path (the test already takes a pack and golden dir asargv[1..2]), or the function has to be exported for the test the wayread_dims_exported/weight_layout_refusalare.Options::weight_layout(npu/pack_import.h:227-239), documented there: empty means the default row-major family and the key is left out entirely — as every container the importer wrote before the option existed;b8is the only layout a bare flag can express. That comment is the negative arm's justification, in the code, already.test_weight_layout()(:2797) only exercisesweight_layout_refusal()— the validator — which is whygrep -c q4nx_weight_layout tests/npu_pack_import_test.cppis 0.test_weight_layoutis exactly where the two assertions belong, beside the refusal checks.Holding on the last step, with the reason: this needs a compile plus a run, and
/is at 163G, under this lane's 175G worktree gate (it has oscillated 128-220G all night as the pack lanes sweep). I will not ship a test edit I could not compile. Picking this up the momentdfclears the gate — the plan above is the whole change, so it is a short job then.npu-pack: linear attention is an exact layer-type set, not a substrin…
npu-pack: role -> engine slot for the roles the layer type does not c…