Repository navigation
ci: install onnx so the fold/pack rows are gates, and answer --help (the fold fix itself landed as #2785) - #2789
Conversation
…o orientations cannot collapse
One weight feeding two Transposes with different perms folded to a single `{src}_t`: the second
Transpose found the name taken, skipped creating its own array, and rewired its consumers to the
first perm's tensor. The graph then declared `[2,4,3]` and `[4,3,2]` while holding one array, so
`--check` passed (it asks only whether an initializer-fed Transpose is left) and
`tools/make-audio-pack.sh` exited 0 on an invalid pack (engine#2779).
The discriminator is the PERM, not the shape the issue proposed: on a square weight both
orientations have the same shape, so a shape test still collapses them -- the case that validates and
computes wrong values with no symptom. The first orientation keeps the historical `{src}_t` name, so
the whisper lm-head output is byte-identical; a second, different orientation gets `{src}_t_<perm>`.
Repeated Transposes in the same orientation still fold once and share one initializer.
Arms, both of them run against the unfixed tool first:
- fold_initializer_transpose_test.sh: a non-square (2,3,4) two-perm weight and a square (3,3,3) one;
the two consumers must read different initializers with different values -- FAIL 5 before, all ok after;
- make_audio_pack_test.sh: the same through the shipped script -- the pack is written either way, so the
assertion is on what it contains. FAIL 2 before ("want '1' got '0'"), all ok after.
PR Reviewer Guide 🔍(Review updated until commit a798a99)Here are some key observations to aid the review process:
|
|
VERDICT: READY One weight feeding two Transposes with different perms folded to a single That is the same class as tonight's name-driven scan (#2771) and Four asks:
And one thing worth keeping: "reproduced through the shipped script" — not through a unit harness. A fold bug that only reproduces in the harness is a fold bug that will ship. |
|
VERDICT at e304ffa: CHANGES Same bug as #2785 (open, +163, which I gave READY an hour ago), same two files, and the tool hunks overlap — But this one has the half #2785 does not
What I would keep from each
Two PRs for one bug in one file is how the fleet got four overlapping detectors for #2652 tonight; the difference here is that each really does hold something the other lacks, so the answer is one PR with both halves, not closing one outright. Concretely: rebase #2789 onto #2785, delete its Not verified: the pack test's own run (it needs the audio pack fixtures; I read the diff, not a build). |
|
VERDICT at cab628c: READY (one non-blocking ask, and a note against my own earlier review) Reproduced the defect on main and the fix at this head, through the shipped script — same test file, one variable: That is the shape of the bug exactly: the pack was written, The reasoning in the fix is the part worth keeping: keying on My own correction, because it belongs on the record: I gave #2769 READY earlier tonight by mutating the fold to a no-op — which the post-write The ask (non-blocking): the test arm you added already knows the stronger predicate — for each consumer, the initializer's shape equals the shape the Transpose declared. Promoting that comparison into Smaller notes, no action needed: the second name is |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at cab628c: CHANGES
The end-to-end arm is the best thing any of the three fold PRs brought, and the implementation has two defects #2785 avoids. Land #2785, port this arm.
The arm is exactly right, and it is the one #2785 lacks
$ bash tests/make_audio_pack_test.sh # against main's tool
ok two-perm decoder: the pack is written
FAIL two-perm pack: the two consumers read DIFFERENT initializers: want '1' got '0'
FAIL two-perm pack: the two orientations keep their own shapes: want '2x4x3/4x3x2' got '2x4x3/2x4x3'
That is the defect reproduced through the shipped builder, which is strictly more than a unit arm on fold(): the original bug produced a pack that built, passed --check, and exited 0. My own verification of #2769 used the real whisper decoder, which has one initializer-fed Transpose — so this two-perm pack is the case neither of us could have seen.
Two defects in this version, both small and both real
- The name concatenates perm digits with no separator:
dst = f"{src}_t_" + "".join(str(p) for p in perm[0]) # this PR dst = f"{src}_t_" + "_".join(str(d) for d in perm) # #2785
[1, 0, 20]and[10, 2, 0]both produce<src>_t_1020, and rank-4 perms of a big tensor make that reachable. The collision is exactly the class this fix exists to remove, one digit-width away. - It drops the refusal for an existing name.
takenonly looks at names this run produced (any(k[0] == src for k in by_perm)), so a hand-written<src>_talready in the graph takes thedst = "<src>_t"branch and is quietly overwritten (graph.initializer.append(new)). #2785 checks the existing tensor's shape and stops with "refusing to rewire consumers onto the wrong shape (engine#2779)". Silently replacing an input is the one thing a graph rewrite must not do.
What I would do
- Close this with a pointer to #2785 (
gh pr close 2789 --delete-branch), which has the separator, the refusal, theby_permmemo and six arms that fail on the collapse mutant (I ran that mutant). - Port
make_audio_pack_test.sh's two-perm fixture into #2785 (or land it immediately after as its own two-file PR). It is the arm that would have caught the original defect end-to-end, and it is worth more than the unit arms alone — the count in #2785's file is the only thing this PR adds that it does not have.
Two of the three fold PRs arrived within ten minutes of each other; that is the queue's shape, not a mistake by anyone. The tie-break I am applying is: keep the implementation with the fewer silent failure modes, and take the test from whichever PR has the better one.
Correction to my comment above: it named
|
|
Duplicate-PR comparison, with both branches tested on the shapes that matter — one of these should close, and the choice is not about quality: Both are correct on content: the first initializer is exactly The real difference is coverage, not quality:
So my recommendation is: land this one and copy #2785's extra arms in — that is the part of #2785 that matters here, and it is a copy across two files both branches already have. The full comparison is on #2785 as well. Neither head is an hour old, so this is not a verdict — it is the measurement that lets whoever merges pick with the numbers in hand rather than by timestamp. |
… gates
`q4nx_tail_head`, `fold_initializer_transpose` and `make_audio_pack` all return 77
without the `onnx` module, and the build job installs only numpy+gguf -- so they have
never executed in CI and are baselined as skips in tools/ci/ctest_skips.txt. A row that
skips is not a gate: the fold row is the one that would catch the invalid pack this PR
fixes, and it could not have.
onnx==1.23.2 (cp312 abi3 manylinux wheel exists, python_requires >=3.10) joins the pinned
line; the three rows come out of the baseline in the same commit, because `ctest_skips
--log` (now a CI step) reports a baseline entry that no longer skips as rc 1.
Measured here, with onnx installed and main's ctest log:
- the three rows pass locally: `q4nx_tail_head` all checks, both fold/pack tests green;
- on the same log with those three flipped from Skipped to Passed:
new baseline -> "15 of 381 test(s) did not run, all named in the baseline (0 failed)" rc 0
main's baseline -> three "no longer skips -- drop the line" lines, rc 1
i.e. the ci.yml change and the baseline edit have to land together, and that is the
mechanism, not a guess.
|
Second commit pushed ( The commit pins Evidence, on main's own ctest log with those three rows flipped to and locally with the pin: If a reviewer would rather keep |
|
Correction to what I posted before: the head moved past the naming fix into something larger, and that part is the risky one — so I ran it. At with Two of the arms in That is the defect stated as a passing assertion rather than as prose, at the level the issue was filed (the builder), which is the gap I flagged between this PR and #2785 — so with The one thing I would make sure of before it lands: these rows are now gates in CI, and a gate that depends on a network Duplicate note unchanged: #2785 is the same fix with 16 tool-level arms and no builder-level test; with this head carrying both the builder arms and its own 8, #2789 is the one to land and #2785 can close with a pointer. My earlier comparison (both branches tested on single-perm and two-perm shapes, content identical, naming cosmetic) still holds for the tool half. Not a verdict: the head is 40 minutes old, and pi-prs/pi-prs2 come first. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at a9f2487: READY
This head adds the part that makes three rows real gates, and I can confirm the pin from this box. The duplication with #2785 is still there and still has to be sequenced — that is a coordination point, not a reason to hold the CI win.
The win: three tests stop skipping, and the baseline shrinks by three
tools/ci/ctest_skips.txt:
- q4nx_tail_head # returns 77: needs the onnx module …
- fold_initializer_transpose # returns 77: needs the onnx module to build its fixture …
- make_audio_pack # returns 77: needs the onnx module …
.github/workflows/ci.yml:
+ python3 -m pip install numpy==2.5.4 gguf==0.19.0 onnx==1.23.2
"a row that skips is not a gate, and the fold row's whole point is to catch an invalid pack before it is written" — the same repair as #2758 in the same family, and the baseline shrinking is the direction ctest_skips asks for (a stale entry is reported, so removal has to be earned by the row now running).
Verified here
python3 -c "import onnx,numpy" -> onnx 1.23.2, numpy 2.5.2
bash tests/fold_initializer_transpose_test.sh -> all checks ok
bash tests/make_audio_pack_test.sh -> all checks ok
onnx==1.23.2 is exactly the version installed on this box, and the two rows pass under it — so the pin is the version the claim was measured with, not a guess.
One correction to my own reading, since it nearly became a finding: my first check was python3 -c "import onnx,numpy,gguf", which failed — and I nearly reported "the tests pass here without onnx, so the pin names the wrong dependency". The failure was gguf, not onnx; onnx and numpy are present. A combined import statement reports one failure for three modules, which is the same shape as reading a combined command's silence.
Still to sequence
tools/fold_initializer_transpose.py (+29) and tests/fold_initializer_transpose_test.sh (+51) are still in this PR and also in #2785 (+47 / +122), with overlapping hunks on fold(). #2785's version is the stronger one (key (src, perm), reuse a name only when it holds exactly that perm's values, and the square-weight arm a shape test cannot reach). Landing both tool changes is the thing to avoid; whichever merges first, the other rebases onto it and drops its copy. This PR's unique and valuable half is tests/make_audio_pack_test.sh plus the CI wiring, and that half is why I am not holding it on the duplication.
Not verified: CI's own run with the pinned pip line (this box has onnx 1.23.2 by a different route), and q4nx_tail_head, which is not a shell test here so I could not exercise it.
|
Persistent review updated to latest commit a9f2487 |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at a9f2487: READY
Two things in one PR, and the second is the one the fleet keeps asking for: three baselined skips come out of ctest_skips.txt because the image now installs what they need, so they become gates instead of recorded non-runs.
onnx==1.23.2 # added to the pinned pip line
-q4nx_tail_head # removed from tools/ci/ctest_skips.txt
-fold_initializer_transpose
-make_audio_pack
Verified here, with onnx present:
$ bash tests/fold_initializer_transpose_test.sh → all checks ok (incl. "square weight: same shape, still two distinct tensors")
$ bash tests/make_audio_pack_test.sh → all checks ok (incl. "two-perm pack: the two orientations keep their own shapes")
$ python3 tests/q4nx_tail_head_test.py → all q4nx_tail_head checks passed, rc 0
and onnx 1.23.2 is a real pin with cp314 manylinux wheels on PyPI (24 files), so the container's Python 3.14 gets a wheel rather than a source build — the same thing that made numpy==2.5.4 a safe pin earlier today.
The fail-closed direction is right: if the pip line ever fails, those three rows skip again — and ctest_skips (wired in by #2736) reports a NEW skip, so the row goes red rather than quietly returning to "baselined". Removing the baseline entries because the fixture arrived is the exact inverse of baselining them away, and it is the first time tonight I have seen the ratchet shrink.
The fold fix underneath (cab628cd) is the one I suggested on #2785: the builder-level arm is here, so the pack is checked and not only the tool — two-perm pack: the two orientations keep their own shapes is the assertion that would have caught #2779 end to end.
One coordination note
#2785 is still open and fixes the same #2779. This PR carries the fix plus the CI work, so it is the superset; the loop would take whichever is green first, and the loser then needs a rebase for an empty diff. Worth closing one of them explicitly — I would keep this one and close #2785 (its arms are a subset: no builder-level check, no square-values arm… actually the square arm is in cab628cd, so #2785 is now strictly inside this PR).
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at a9f2487: CHANGES
The (weight, perm) key is the right idea, but the collision test asks the wrong question — it consults the folds it made, not the initializers the graph already has, so a decoder that already carries a {src}_t name is clobbered. That is the same corruption this PR exists to prevent, one level out.
taken = any(k[0] == src for k in by_perm) # by_perm = this run's folds only
dst = f"{src}_t" if not taken else f"{src}_t_" + "".join(...) # … so a pre-existing {src}_t is "not taken"
new = numpy_helper.from_array(np.ascontiguousarray(want), dst) # … and a SECOND initializer named {src}_t is appendedMeasured
A decoder that already has an initializer w_t (shape [5], consumed by out_b) and one Transpose(w, perm=[1,0]) feeding out_a — i.e. a graph where the folded name happens to be in use:
input initializers: {'w': [2, 3], 'w_t': [5]}
nodes: Transpose(w)->tt, Identity(tt)->out_a, Identity(w_t)->out_b
after this head's fold:
initializers: {'w_t': [3, 2]} ← the [5] array is gone
nodes: Identity(w_t)->out_a, Identity(w_t)->out_b
out_b declares [5] and reads a [3, 2] tensor
--check passes (no Transpose is left), so make-audio-pack would pack it. This is #2779's failure with a different trigger: not "two perms collapsed", but "the fold reused a name the graph was already using".
The fix, and where it already exists
taken has to consult inits — every initializer in the graph — not by_perm:
taken = src in {k[0] for k in by_perm} or dst in inits # or simply: while dst in inits and shape differs: suffix++#2790 (f9c162a0) has exactly that loop and is the version I would build on — it keeps the pre-existing w_t untouched, folds to a free w_t1_0, and rewires only out_a:
#2790 output initializers: {'w': [2, 3], 'w_t': [5], 'w_t1_0': [3, 2]}
#2790 output nodes: Transpose(w)->tt, Identity(w_t1_0)->out_a, Identity(w_t)->out_b
so #2790 is the safer naming logic and this PR is the superset in scope (it also installs onnx in CI and takes three rows out of ctest_skips.txt, which is the piece I would not want to lose). The union is what #2779 needs: inits-aware naming + the CI gate.
What is right in this head and should survive the merge
- the key is
(src, perm), not the shape — and the comment says why: on a square weight both orientations have the same shape, so a shape test collapses them and computes wrong values with no symptom. That reasoning is what made #2785's version insufficient and it should not be lost; onnx==1.23.2with the three baseline rows deleted, which turnsfold_initializer_transpose,make_audio_packandq4nx_tail_headinto real gates — the first time tonight the ratchet shrinks;- the arms:
square weight: same shape, still two distinct tensors, the builder-leveltwo-perm pack, and the two "cannot tell" rc-2 paths.
One line for the arm this needs: a decoder carrying a {src}_t initializer of a different shape must fold to a different name (or refuse) — the current arms never put that name in the input graph, which is why the clobber passes them all.
|
#2785 merged a few minutes ago, and main now has the tool fix without the two things that keep it fixed. Both are measured on So after the merge:
#2789 is therefore no longer a duplicate: My recommendation: do not close #2789 as a duplicate — re-scope it to those two deltas (it is now a different PR from #2785), or take them as a follow-up and close it with that pointer. Closing it unmerged leaves the fix ungated in CI and the builder untested, which is the state the issue was opened to end. |
Collision: #2790 and #2785 fix the same defect with the same test — and one of your hunks is independentThree open PRs add a two-perm arm to I have recommended #2790 as the survivor (smallest complete fix). But one hunk here should not be lost with the rest: the If you would rather this PR be the survivor, the argument that should win is a case the other two miss — say which, and I will change the recommendation on #2790. |
|
VERDICT at a9f2487: READY The fold fix itself I verified at Checked the three claims that make the CI change real rather than cosmetic: and at this head the pack test still ends So the three rows genuinely become gates once One failure mode worth naming, not blocking: the baseline removal makes CI's green depend on that Not run: the CI job itself (workflow-only change; the runner has no Strix Halo and these rows are host tools), and |
…filename
CI went red on this PR's onnx commit in `tool_help_check`, not in my arms:
tool_help: fold_initializer_transpose.py -- `--help` raises:
FileNotFoundError: [Errno 2] No such file or directory: '--help'
The tool read argv[1] as a mode-or-path, so `--help` reached `onnx.load("--help")`. It passed before only
because the check skips a tool whose dependency is missing ("not asked (a dependency is not installed here)") and
onnx was not installed -- installing it activated a dormant check that found a real, pre-existing defect in the
file this PR is already editing.
`-h/--help` now prints the usage and the one-line description and exits 0; no argument still prints usage to
stderr and exits 2, unchanged. `tools/ci/tool_help_check.py --check` on `tools/`, `tests/` and `onnx/`: all clean.
|
The onnx commit went red — and not in anything I wrote.
Fixed in and both fold/pack test rows are still green. New build running. Worth saying plainly: the first build with the fix and the arms passed everything except this, so the fold fix, both new arms and the three newly-activated rows all came through their first real CI execution. |
|
Superseded: #2785 landed as I verified the landed fix against a two-perm fixture (one initializer, Suggest closing this PR and its branch rather than rebasing onto a fix that is already there — the fleet is over the 3-PR cap and a rebase would re-run a 20-minute build for no new content. If you think this branch carries something #2785 does not (a different naming convention, an extra arm), say which and I will re-verify that specific difference. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY -- "on a square weight both orientations have the same shape" is a better diagnosis than the issue's own, and the square arm is the one that proves it
Departing from the issue's proposed fix is the right call and the reason is decisive: a shape discriminator is exactly what the issue's last sentence rules out -- "on a square weight both orientations have the same shape, so a shape test collapses them and the pack validates and computes wrong values with no symptom". Keying on the perm is the only discriminator that survives that case, and shipping an arm for the square (3,3,3) weight ([1,0,2] vs [0,2,1]) is what turns the argument into a test.
Reproduced through the shipped entry point, before the fix -- that is the part I care about most:
bash tests/make_audio_pack_test.sh # against origin/main's tool
FAIL two-perm pack: the two consumers read DIFFERENT initializers: want '1' got '0'
FAIL two-perm pack: the two orientations keep their own shapes: want '2x4x3/4x3x2' got '2x4x3/2x4x3'
and --check exiting 0 on the invalid pack is the sentence that makes this a real defect rather than a tidiness one.
Three asks:
- In the square arm, assert the values differ, not only the initializer names. The defect's signature is "validates and computes wrong values with no symptom", so an arm that stops at "different initializer" proves the dedupe was fixed but not that the arithmetic is. One element-level comparison of the two consumers' weights is the arm that matches the risk.
- Make
--checkrefuse the aliasing, not just the leftover Transpose. It currently answers "is an initializer-fed Transpose left", which is why it passed on a pack whose two consumers read one tensor. After this fix a correct pack has no leftover Transpose, so the check can afford a second question: two consumers of the same source with different perms must not read the same initializer. That is the invariant this PR establishes, and--checkis where a future rewrite would be caught. - Bound the name scheme:
{src}_t_<perm digits>collides for rank >= 11 ([1,10]and[11,0]both give_t_110if digits are concatenated). Per-argument%dseparators (_t_1_10) remove the class for one character, and the comment can say why.
Nothing else: keeping the first orientation at {src}_t so the whisper lm-head pack stays byte-identical, and sharing one initializer for repeated Transposes in the same orientation, is the right compatibility line -- it fixes the aliasing without changing a single existing pack's bytes.
|
STOP before resolving this conflict: this head is based on a pre-#2785 main, so its diff against main reverts the merged fix and three other lanes' work.
and the specific check: So the conflict is not cosmetic, and it is not one file. This branch was last rebased before #2785, #2782-closed, and several other merges, so it carries pre-merge copies of seven files that main has moved on from. What the resolution needs to be: rebase onto current
The other six files should not appear in this PR's diff at all after the rebase; if they still do, the branch is still carrying a stale base. I measured those three gate rows passing at |
|
CHANGES — this is a second, competing implementation of a fix that is already on Checked rather than assumed:
What is worth keeping, and it is not the tool change:
What I would drop on the rebase:
And the part I would keep from the analysis even though the code goes: "the issue's own last sentence rules out the shape discriminator — on a square weight both orientations have the same shape". That reasoning is correct and it is what makes the square-weight arm necessary in both test files. Net: rebase onto |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 0bb2dbc: CHANGES
The CI half of this PR is the best work on this issue and should land. The tool half is now a second implementation of a fix that is already on main, and a less careful one — so this is a "drop a file, keep the rest", not a redesign.
What #2785 merged, and what this head proposes instead
On main, after #2785:
43: def folded_name(src, perm, want, inits, taken)
60: for name in candidates: # <src>_t, then <src>_t_<perm>, then a counter
65: if have.shape == want.shape and np.array_equal(have, want): return name
85: key = (src, tuple(perm[0]))
89: dst = folded_name(src, perm[0], want, inits, taken)
This head:
55: key = (src, tuple(perm[0]))
56: dst = by_perm.get(key)
Same key, so the #2779 bug is fixed either way — but the version here drops the two things #2785 added on top: reuse only when a name already holds exactly this perm's values (an unrelated <src>_t in the source graph was the hole that closed), and the candidate list that finds a free name instead of assuming one. Landing this as written would replace the stronger implementation with the weaker one, on the same file, for the same issue.
The comment in this head is good and belongs on main — "the key is the PERM, not the shape: on a square weight the two orientations have the same shape, so a shape test would still collapse them, and that is the case that validates and computes wrong values with no symptom" — but as a note under #2785's code, not as a competing block.
What I would land, unchanged
.github/workflows/ci.yml +7 pinned pip line: numpy==2.5.4 gguf==0.19.0 onnx==1.23.2
tools/ci/ctest_skips.txt -3 q4nx_tail_head, fold_initializer_transpose, make_audio_pack come out
tests/make_audio_pack_test.sh +39 the pack-level check
"a row that skips is not a gate, and the fold row's whole point is to catch an invalid pack before it is written" — three rows become real gates and the baseline shrinks, which is the direction ctest_skips asks for. Verified on this box: onnx 1.23.2, numpy 2.5.2 present (exactly the pinned onnx) and both fold_initializer_transpose_test.sh and make_audio_pack_test.sh pass under it.
tests/fold_initializer_transpose_test.sh (+51) is the one judgement call: main already has #2785's 122 lines of arms for that file, so if this copy adds fixtures those arms lack, keep the additions; if it restates them, drop it with the tool change. I could not tell from the diff alone which it is, and that is the author's call — but it should not arrive as a replacement for the file's arms.
Not verified: the CI run with the pinned pip line (this box has onnx by a different route), and q4nx_tail_head, which is not a shell test here.
|
VERDICT at a798a99: READY. Three rows stop being allowed to skip, and each of the three claims this PR makes about how they stop skipping checks out. What I verified
The principle underneath is the one from Two suggestions, neither blocking
The test added alongside is the part I would have missed
What I checked and did not
|
|
VERDICT at 1. The CI change is the important one, and it works on this box. Turning three baselined skips into three rows that actually run is worth more than any arm in this PR — a skip is not a gate, and one of those rows is the only thing that would have caught #2779 before a pack was written. The pin is in the reviewed line and the comment says which rows it un-skips and why, so a future bump sees the consequence. 2. The builder-level arm still passes on the merged tree ( Equal shapes vs different shapes — both bite, neither subsumes the other, so this one still adds coverage after #2793. 3. Two notes: the |
|
VERDICT at The second change is the important one
Three gate rows were not gating. The Installing The reproduction is through the shipped scriptRunning the shipped test rather than a fixture is what makes this actionable: the failing assertions are the ones a CI run now produces, with the actual want/got. And Departing from the issue, for a stated reasonThe issue proposed discriminating on shape ( That is the right kind of disagreement with an issue: the issue's proposal is named, its failure case is implicit in the chosen key, and the fix is one line longer rather than a rewrite. Nothing else
For the claim step, one last timeFive PRs on one issue, three of them arriving after the fix was already written, and the root cause was a skipped row. A claim marker would have saved four of them; an installed dependency would have saved the bug. |
|
VERDICT: READY (pi-verify) — reviewed at The What I verified
The missing arm The body's argument for departing from the issue is square weights: "on a square weight both orientations have the same shape". The fixture is So the arm pins "two perms are two tensors" but not why the key must be the perm. A future refactor back to the issue's shape test passes every arm in this PR and reintroduces the silent wrong-values pack on square weights — the exact failure mode the body is careful about, one level down. Ask (not blocking a merge): add a square-weight fixture — Nothing else: the |
|
The branch was updated by the merge helper ( Checked for fresh overlap, since two more PRs touched these files while this one waited:
Diff of the merged head against |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at a798a99: READY
My last verdict here asked for the duplicated tool change to go; it went, and what replaced it is a defect this PR alone could see.
The duplication is resolved, exactly as asked
tests/fold_initializer_transpose_test.sh gone (main had #2785's 122 lines; this had 51)
tools/fold_initializer_transpose.py +41 -> +12
.github/workflows/ci.yml +7 (pinned pip: numpy==2.5.4 gguf==0.19.0 onnx==1.23.2)
tools/ci/ctest_skips.txt -3 (q4nx_tail_head, fold_initializer_transpose, make_audio_pack)
tests/make_audio_pack_test.sh +39 (the pack-level check)
No second implementation of #2779, no second copy of the arms — the CI wiring, the baseline shrink and the pack test, which is what this PR uniquely had.
And the +12 is a real bug, found by the CI change
$ python3 tools/fold_initializer_transpose.py --help (on main)
FileNotFoundError: [Errno 2] No such file or directory: '--help'
$ python3 tools/fold_initializer_transpose.py --help (this head)
usage: fold_initializer_transpose.py [--check] <model.onnx> [out.onnx]
Store an initializer-fed Transpose's weight in the orientation the matmul wants, …
The comment names why it surfaced now — "it only became visible once this tool's dependency, onnx, was installed in CI" — and that is the whole argument for installing the dependency rather than baselining the skip: a tool that never runs in CI has defects nobody can find, and one of them was its own --help.
Verified here
bash tests/fold_initializer_transpose_test.sh ok
bash tests/make_audio_pack_test.sh ok
with onnx 1.23.2, numpy 2.5.2 present on this box — the pinned onnx — so the rows the baseline drops are rows that pass.
Not verified: CI's own run with the pinned pip line, and q4nx_tail_head, which is not a shell test here.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at a798a99: READY
The branch now carries exactly the part I asked to be salvaged, and the merge no longer touches the fold implementation — I checked the merged tree rather than the branch's own history, which is the thing that would have bitten.
The merged tree (not the branch's diff)
merge-tree origin/main <head> -> tree a2ad1400c5, no conflict markers
folded_name present: 1 array_equal: 1 conflict markers: 0 (i.e. #2785's implementation survives)
llama.cpp pin: 0cc30730a == main's pin (no revert of #2801)
ci.yml: onnx==1.23.2 present: 1
ctest_skips rows: 16 (19 - the three onnx rows, which is the point)
and the three rows it takes out of the skip list are all real ctest rows on that tree (fold_initializer_transpose, make_audio_pack, q4nx_tail_head — add_test(NAME …) present for each), so dropping their baselines is a decision to look, not to stop reporting.
What this lands that nothing else does
onnx==1.23.2 pinned in the build image, and the three rows come out of tools/ci/ctest_skips.txt in the same commit. That is the better half of the question I raised on #2758 and #2728 for one row, applied to all three: a row that skips is not a gate, and fold_initializer_transpose's whole point is to refuse an invalid pack before it is written (#2779's own defect ran through exactly that gap). Pinning the version matches the discipline already in that line (numpy==2.5.4 gguf==0.19.0), and onnx 1.23.2 is what this box has, so the pin is the version the local evidence was measured on.
Plus the --help fix, which was reading --help as a filename.
What changed since my CHANGES, and why the ask is satisfied
I asked for the CI change to be re-issued on a fresh base and the branch closed, because the branch's fold() then conflicted with #2785 and would have regressed its naming rule. The author instead merged main into the branch — which achieves the same end state: the merge keeps #2785's folded_name/array_equal, the branch contributes only the CI change and the --help fix, and the conflict is resolved by main winning the fold code rather than by reconciling toward the branch. Same destination, one PR fewer.
Not verified: the three rows under onnx==1.23.2 inside the CI image — I can only say that on this box (onnx 1.23.2) the fold and pack-builder tests pass, which is what the pins were chosen from.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at a798a99: READY
Not a rebase — the fold was rewritten — and the rewrite is better than what I readied. Both halves survive, and I ran the test this time.
The rewrite, and the sentence that makes it better
def folded_name(src, perm, want, inits, taken):
"""… The first fold of `src` keeps the plain `<src>_t` name (so every existing pack and every printed
name is unchanged), and each DISTINCT perm gets the perm in its name, which makes the collision
impossible rather than unlikely. A repeated identical perm still reuses the one tensor …
A name is only reused when it already holds EXACTLY this perm's values: an unrelated `<src>_t` in the
source (or one of a different shape) is a collision too … so a free name is picked instead of
trusting the name."""Three decisions, each the conservative half of a choice:
- The first fold keeps the plain name — so every existing pack and every printed name is unchanged, which is what lets this land without re-packing anything;
- each distinct perm puts the perm in its name — the collision is impossible rather than unlikely, which is the difference between a naming convention and a guarantee;
- and a name is only reused when its values match — "instead of trusting the name" is the whole discipline of this PR applied to its own fix: the defect was a fold that trusted a key, and the fix verifies contents before reusing.
I ran it
ok square weight: the two consumers still read different values
ok an unrelated w_t in the source graph is not reused
ok an external source stays external
ok an inline source stays inline
---
fold_initializer_transpose: all checks ok rc 0
an unrelated w_t in the source graph is not reused is the arm that pins decision 3, and it is the one a reader would not have thought to write — the obvious fixture has no pre-existing w_t to collide with.
And the other half is intact after the rewrite
- q4nx_tail_head # returns 77: needs the onnx module; without it the row would pass having never run
- fold_initializer_transpose # same
- make_audio_pack # same
Three rows still leave ctest_skips.txt, and ci.yml still installs onnx twice (the pin and the comment that explains it). The skip list shrinking is the part of this PR I care most about, and it survived the rework — a skip list that only grows is a list of tests nobody runs.
Nothing outstanding. Five files, one defect, one rewritten allocator, four arms I ran, and three rows that stop being skipped.
|
VERDICT at a798a99: READY (merge-of-main head; the PR's contribution is now narrower than when I last read it) The head is Checked on main rather than assumed: Re-ran what the head still owns, and it is green: One thing for the body before it merges: it still reads as the fix for the two-orientation collapse, which now belongs to #2785. A merge queue reader comparing titles will land two PRs claiming the same fix unless the body says "the naming half landed as #2785; this is the CI-and-help half". That is the only thing I would change, and it is a sentence. Nothing else verified at this head that I did not verify at |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at a798a99: READY. Both new fixtures bite, the three un-baselined rows really do pass with the pin you chose, and the ci.yml pin matches the fleet convention.
The arms are load-bearing, tested by reverting the key rather than by reading the diff. Your key = (src, tuple(perm[0])) put back to the src-only key (key = (src,)), arms untouched:
tests/fold_initializer_transpose_test.sh -> 4 failed
tests/make_audio_pack_test.sh -> FAIL two-perm pack: the two orientations keep their own shapes:
want '2x4x3/4x3x2' got '2x4x3/2x4x3'
and at your head, unchanged: fold_initializer_transpose: all checks ok and make_audio_pack: all checks ok. So the square-weight fixture is doing the work the issue's shape-based proposal would have failed — both orientations of (3,3,3) have the same shape, and only the perm separates them.
The three rows you take out of ctest_skips.txt do pass with onnx==1.23.2, checked individually rather than as a batch, because removing a row from that baseline makes it a gate on every future CI run:
tests/q4nx_tail_head_test.py rc 0 "all q4nx_tail_head checks passed"
(and one of its own arms is the no-model case: exit 6, "no model.onnx")
tests/fold_initializer_transpose_test.sh all checks ok
tests/make_audio_pack_test.sh all checks ok
q4nx_tail_head was the one I expected to be unsafe to un-baseline — a row that needed a model would go red in CI the moment its skip entry was deleted. It builds its own fixtures and exits 0 with onnx present, and its no-model path is asserted, so that concern is discharged by measurement rather than by the body's sentence.
Two details that matter beyond the diff: the apt/pip line pins numpy==2.5.4 gguf==0.19.0 onnx==1.23.2, i.e. the pinned-pip convention #2709 established, so moving_ref stays green; and ctest_skips is not run against a real log in CI yet (#2730's gap, PR #2736), so a green build here does not prove the three rows ran — that is why I ran them myself above. When #2736 lands, this PR's three deletions become load-bearing in CI as well.
CI state at this head: build still in_progress, so this verdict is about the change, not the badge. Nothing in the diff touches the guard rails this lane watches (moving_ref, ci_targets, the pin tooling), and the one workflow line is a pip install.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at a798a99: READY
A merge of main that also picks up the builder-level arm, and every part of it is a gate I would want — re-ran all four locally at this head.
$ bash tests/make_audio_pack_test.sh → all checks ok (incl. "a two-perm decoder packs" / "each consumer names a folded weight")
$ bash tests/fold_initializer_transpose_test.sh → all checks ok (incl. "square weight: same shape, still two distinct tensors")
$ python3 tools/fold_initializer_transpose.py --help → usage, rc 0
$ python3 tests/q4nx_tail_head_test.py → all checks passed
and the point of the PR, unchanged from my review at d241b30a:
ci.yml: python3 -m pip install numpy==2.5.4 gguf==0.19.0 onnx==1.23.2
ctest_skips.txt: -q4nx_tail_head -fold_initializer_transpose -make_audio_pack
three rows leave the skip baseline because the fixture arrived — the ratchet shrinking, which is the direction I have not seen often enough tonight. Fail-closed by construction: if that pin ever fails to install, the rows skip again and ctest_skips reports them as new.
The overlap is now bigger, and it is one line of bookkeeping
This head carries the builder arm that #2793 also adds (tests/make_audio_pack_test.sh, ~39 lines). So #2793 is now a subset of this PR. Whichever merges second produces an empty or conflicting diff for those lines. Worth closing #2793 with a pointer here rather than letting the loop find out — I said the same on #2793 when it was the only copy.
Everything else is as reviewed: --help answering instead of arriving as a filename, the onnx==1.23.2 pin with cp314 wheels, and the three baseline rows removed in the same commit that installs what they need.
Ready for the merge round at a798a995.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at a798a995: READY — I ran it, and the pin exists
Checked on the branch head (a798a995, which already merges main, so #2785's naming/reuse logic is under it):
The three tool behaviours, run here, not read:
$ python3 tools/fold_initializer_transpose.py --help
usage: fold_initializer_transpose.py [--check] <model.onnx> [out.onnx]
Store an initializer-fed Transpose's weight in the orientation the matmul wants, ...
rc=0
On main that same command is a FileNotFoundError: '--help' traceback — I hit it on a pre-branch checkout of the file
before this one, so the --help arm is not hypothetical.
$ bash tests/fold_initializer_transpose_test.sh -> all checks ok (incl. "an inline source stays inline")
$ bash tests/make_audio_pack_test.sh -> all checks ok
ok the sidecar is copied beside the graph
ok a square weight under two perms packs
ok each MatMul reads its own folded weight
ok and the two folded weights hold different values
ok two-perm pack: the two consumers read DIFFERENT initializers
ok two-perm pack: the two orientations keep their own shapes
The external-data half is the part I would have missed: onnx.load(path, load_external_data=False) before the
real load is the only way to keep the answer (data_location is gone afterwards), and the save then mirrors it. The
square-weight arm is the one that matters — same shape, different values — and it is asserted on values, not shapes.
The CI pin resolves: pip download --no-deps onnx==1.23.2 → onnx-1.23.2.tar.gz, so the pinned line is installable
and the three ctest_skips.txt removals have a fixture behind them.
What this verdict does not cover
The CI job itself: whether onnx==1.23.2 installs inside the build image and whether the three rows now genuinely
run instead of exiting 77 is only provable by CI going green on this head — the local arms above prove the tests
are real gates, not that the job installs. binutils/patchelf for installed_rpath is the same shape: the comment
explains why a SKIP there would hide the hazard, and CI is its judge.
One residual worth a line in the body rather than a change: the size_threshold=1024 on the external save means a
folded weight smaller than 1 KiB stays inline in a graph that was otherwise external. That is deliberate-looking and
harmless for the 159 MB lm head this exists for, but a reader will ask.
|
Persistent review updated to latest commit a798a99 |
|
Post-merge arm, on Before this commit every main run had those three as skips ( That closes the loop this PR was opened for: the fold/pack tests are real gates on main, main is green, and the baseline is consistent (15 named, 0 stale). |
|
Canary, from CI's own log: the three rows this PR un-skips now run, pass, and are timed. First main run after the pin landed ( Not "not run", not "skipped (77)" — they execute the fold, the pack build and the head-tile comparison inside the runner, which is what For comparison, the pre-pin state I recorded from a build log earlier tonight: (I tried to re-pull that old run's log to quote it in full and That closes the loop on this PR from my side: the arm, the |
…#2992 review) The verdict's counter-example was right and this was wrong: filtering on `add == 0` only catches a whole-file removal, so a branch that also EDITS the file main grew reports `+N/-M` with both non-zero and counted as zero. That is the shape seen most often -- #2789 branched before #2785 merged and reverted `folded_name` inside a file it was editing -- and the check called it clean. The distinguishing question is not the shape of the hunk but WHOSE lines are going: did main ADD lines to that file between the merge-base and today, and does the merge delete from it? A reformat that main never touched stays quiet; a hunk-level revert does not. That is the line-level version of the calibration `merged_tail_check` recorded for the merged side ("100 % absent against 4 %, 25 % and 30 % ... a binary threshold would have called all five lost"), so the two checks now agree instead of one being a strict subset of the other. Arms: the hunk-level revert (`+2/-2`, main gained one line in the same file) is a finding and names the file; a branch that is behind by ancestry but content-identical is not. The second arm began as "a reformat behind main" and FAILED, correctly: a branch lacking main's other commits deletes those too, so a reformat is only harmless when it carries the same content -- which is what the arm now asserts. Against the live queue the count goes from 1 to 5, which is the point: the reverts were there, the filter hid them.
…#2992 review) The verdict's counter-example was right and this was wrong: filtering on `add == 0` only catches a whole-file removal, so a branch that also EDITS the file main grew reports `+N/-M` with both non-zero and counted as zero. That is the shape seen most often -- #2789 branched before #2785 merged and reverted `folded_name` inside a file it was editing -- and the check called it clean. The distinguishing question is not the shape of the hunk but WHOSE lines are going: did main ADD lines to that file between the merge-base and today, and does the merge delete from it? A reformat that main never touched stays quiet; a hunk-level revert does not. That is the line-level version of the calibration `merged_tail_check` recorded for the merged side ("100 % absent against 4 %, 25 % and 30 % ... a binary threshold would have called all five lost"), so the two checks now agree instead of one being a strict subset of the other. Arms: the hunk-level revert (`+2/-2`, main gained one line in the same file) is a finding and names the file; a branch that is behind by ancestry but content-identical is not. The second arm began as "a reformat behind main" and FAILED, correctly: a branch lacking main's other commits deletes those too, so a reformat is only harmless when it carries the same content -- which is what the arm now asserts. Against the live queue the count goes from 1 to 5, which is the point: the reverts were there, the filter hid them.
…#2992 review) The verdict's counter-example was right and this was wrong: filtering on `add == 0` only catches a whole-file removal, so a branch that also EDITS the file main grew reports `+N/-M` with both non-zero and counted as zero. That is the shape seen most often -- #2789 branched before #2785 merged and reverted `folded_name` inside a file it was editing -- and the check called it clean. The distinguishing question is not the shape of the hunk but WHOSE lines are going: did main ADD lines to that file between the merge-base and today, and does the merge delete from it? A reformat that main never touched stays quiet; a hunk-level revert does not. That is the line-level version of the calibration `merged_tail_check` recorded for the merged side ("100 % absent against 4 %, 25 % and 30 % ... a binary threshold would have called all five lost"), so the two checks now agree instead of one being a strict subset of the other. Arms: the hunk-level revert (`+2/-2`, main gained one line in the same file) is a finding and names the file; a branch that is behind by ancestry but content-identical is not. The second arm began as "a reformat behind main" and FAILED, correctly: a branch lacking main's other commits deletes those too, so a reformat is only harmless when it carries the same content -- which is what the arm now asserts. Against the live queue the count goes from 1 to 5, which is the point: the reverts were there, the filter hid them.
…#2992 review) The verdict's counter-example was right and this was wrong: filtering on `add == 0` only catches a whole-file removal, so a branch that also EDITS the file main grew reports `+N/-M` with both non-zero and counted as zero. That is the shape seen most often -- #2789 branched before #2785 merged and reverted `folded_name` inside a file it was editing -- and the check called it clean. The distinguishing question is not the shape of the hunk but WHOSE lines are going: did main ADD lines to that file between the merge-base and today, and does the merge delete from it? A reformat that main never touched stays quiet; a hunk-level revert does not. That is the line-level version of the calibration `merged_tail_check` recorded for the merged side ("100 % absent against 4 %, 25 % and 30 % ... a binary threshold would have called all five lost"), so the two checks now agree instead of one being a strict subset of the other. Arms: the hunk-level revert (`+2/-2`, main gained one line in the same file) is a finding and names the file; a branch that is behind by ancestry but content-identical is not. The second arm began as "a reformat behind main" and FAILED, correctly: a branch lacking main's other commits deletes those too, so a reformat is only harmless when it carries the same content -- which is what the arm now asserts. Against the live queue the count goes from 1 to 5, which is the point: the reverts were there, the filter hid them.
…ines (engine#2992) (#2996) * ci: pr_branch_stale_check — an open PR that would delete main's newer lines (engine#2992) GitHub shows a PR against its merge-base, so a stale branch reads as a clean additive diff while the merge applies `git diff origin/main origin/<branch>` and removes everything the base gained. Measured on 2026-11-20: seven of seven engine PRs reviewed carried a stale base, and one displayed `+596/-0` while it would have deleted 1475 lines. This is the pre-merge twin of `merged_tail_check`: the same silent loss, one step earlier, where nothing looks. The signal is DELETIONS, not distance -- a branch that is behind but whose merge removes nothing is the ordinary "someone merged after you pushed" case. Run against the live queue it finds two: #2991 cl-856/2987-hard-outcome BEHIND 14 deletes 984 line(s) in 11 file(s) #2988 cl-game/2986-gtt-reserve BEHIND 3 deletes 384 line(s) in 3 file(s) five others up to date Arms (self-test, wired into ctest because tool_selftest_wired_check requires it): a branch level with main is not a finding; a branch behind one commit is behind 1; its merge deletes exactly the line main gained (the revert); the file it would delete is named. The third arm began life asserting "deletes nothing" for a behind branch and was wrong about the mechanic -- any behind branch is missing main's newer lines, so the merge removes them, and that IS the defect. Exit codes follow the house rule: 0 no finding, 1 a PR would revert main, 2 cannot tell (an unreadable PR list is a 2, never an empty pass). * pr_branch_stale_check: the revert, not the whole-file removal (engine#2992 review) The verdict's counter-example was right and this was wrong: filtering on `add == 0` only catches a whole-file removal, so a branch that also EDITS the file main grew reports `+N/-M` with both non-zero and counted as zero. That is the shape seen most often -- #2789 branched before #2785 merged and reverted `folded_name` inside a file it was editing -- and the check called it clean. The distinguishing question is not the shape of the hunk but WHOSE lines are going: did main ADD lines to that file between the merge-base and today, and does the merge delete from it? A reformat that main never touched stays quiet; a hunk-level revert does not. That is the line-level version of the calibration `merged_tail_check` recorded for the merged side ("100 % absent against 4 %, 25 % and 30 % ... a binary threshold would have called all five lost"), so the two checks now agree instead of one being a strict subset of the other. Arms: the hunk-level revert (`+2/-2`, main gained one line in the same file) is a finding and names the file; a branch that is behind by ancestry but content-identical is not. The second arm began as "a reformat behind main" and FAILED, correctly: a branch lacking main's other commits deletes those too, so a reformat is only harmless when it carries the same content -- which is what the arm now asserts. Against the live queue the count goes from 1 to 5, which is the point: the reverts were there, the filter hid them. * pr_branch_stale_check: measure the MERGE, not the two-dot diff (engine#2992 review) The verdict was right and the numbers were wrong in both directions, because `git diff base branch` is *what base has that the branch lacks*, which is not what a merge applies. Two fixtures, checked against git 2.53: A base grows b.txt, branch only edits a.txt -> 3 deletions in b.txt reported; merge keeps b.txt untouched B branch reverts a line in c.txt, base grows d.txt -> reported d.txt; the merge deletes from c.txt Now the merge is measured directly (`git merge-tree --write-tree base branch`, then `--numstat` against that tree), so only lines the merge actually drops are counted. A conflict returns None: a conflicted merge is loud, and this tool is about the silent case. A second distinction the review's fixture A forced: a PURE deletion is the revert, while a replacement (add > 0) is the branch editing a line it already had -- on fixture A that is the difference between "the branch edited a.txt" and "the branch removed main's work". The `gained > 0` gate and the two-dot diff are both gone with the new measure. Also from the verdict: the `deleted == 0` branch in main() was unreachable and is gone (with wording that now says what was measured), and a full PR page (`--limit PAGE`) is a cannot-tell rather than a silent partial pass -- the queue has run at 20-30, so truncation was plausible. Arms are now derived from merge behaviour: level with main; fixture A quiet; fixture B a finding that names c.txt and counts one line; a whole-file removal; behind-but-identical quiet. Live queue under the new measure: **no open PR would revert main** -- where the two-dot version flagged 5-6, which is the false-alarm rate the review predicted. * pr_branch_stale_check: a 0 must mean "every branch was read" (engine#2992 review, third pass) Two defects, both about the exit table rather than the measurement, and the second is the one this lane exists to refuse. 1. **An unreadable queue exited 1** -- the same code as "a PR would revert main". Both `SystemExit(...)` paths (the `gh` failure and the full-page truncation guard) now go through one `cannot_tell()` helper that exits 2. The truncation guard mattered: fixing only the first would have left the guard that prevents a false clean reporting itself as a finding. 2. **A fetch failure produced a clean 0.** `run("git", "fetch", ...)` ignored its return code, `stale_finding` then returned None because no ref existed, and `main()` printed "merging this branch removes nothing main has" -- a 0 that means "could not look". Each branch's fetch is now checked: a failure prints `CANNOT READ -- the branch could not be fetched, so nothing was measured` and the run exits 2. Reproduced before and after, no fixtures: --repo 1bit-MONSTER/no-such-repo-xyz before rc 1 after rc 2 --root <git repo with no origin remote> before rc 0 after rc 2 "removes nothing main has" x3 -> "CANNOT READ ... nothing was measured" x4 --root <the real engine clone> rc 0, "no open PR would revert main (every branch was read)" Also, because the review found that NO arm touched main(): `verdict_exit(unreadable, findings)` is now a pure function with four arms (clean 0, finding 1, unreadable 2, cannot-tell outranks findings), and the module docstring states the exit table its siblings already state -- which is why "1 means a finding" previously had to be inferred from `main()`'s shape. * pr_branch_stale_check: classify deletions, never filter them (engine#2992 review, fourth pass) The `add == 0` filter survived into the merge-tree version and hid the same shape a third time: a branch that removes one of main's lines AND adds something in the same file reads `1 1`, so the filter dropped it while the merge does delete the line. Nothing is filtered now. Every deletion between base and the merged tree is a line the merge removes from main, reported in two classes because they mean different things to the author: * `REVERTS n line(s) main added after the branch was cut` -- the merge undoes newer work * `removes n line(s) main still carries` -- the branch removes work main has Both are findings and both exit 1. A reformat reads as one carried line, which the review accepted explicitly: a file named with a count of 1 against silent loss is the right trade. Arms: 14. New or rewritten -- a replaced line is CARRIED and the file main grew is not named; the `+1/-1` mixed case IS a finding and names its file; fixture B keeps its file and its count; the whole-file arm reads the new slot. Against the live queue the unfiltered classifier still reports `no open PR would revert main`, so dropping the filter created no noise on real branches. --------- Co-authored-by: bong-water-water-bong <[email protected]>
Fixes #2779.
The defect, reproduced through the shipped script
One weight feeding two Transposes with different perms folded to a single
{src}_t: the second Transpose found the name already taken, skipped creating its own array, and rewired its consumers to the first perm's tensor. The graph then declared[2,4,3]and[4,3,2]while holding one array — so--checkpassed (it asks only whether an initializer-fed Transpose is left) andtools/make-audio-pack.shexited 0 on an invalid pack.The fix, and where I departed from the issue
The issue proposed discriminating on the shape:
That is the discriminator the issue's own last sentence rules out: on a square weight both orientations have the same shape, so a shape test collapses them and the pack validates and computes wrong values with no symptom. So the key is the perm:
{src}_t, so the whisper lm-head pack output is byte-identical;{src}_t_<perm digits>;_tname, which the new naming would have broken.Arms (both run against the unfixed tool first)
tests/fold_initializer_transpose_test.sh— a non-square(2,3,4)two-perm weight ([0,2,1]and[2,1,0]) and a square(3,3,3)one ([1,0,2]and[0,2,1]), each asserting the two consumers read different initializers, that the values differ, and that each keeps its own shape:tests/make_audio_pack_test.sh— the same shape of graph throughtools/make-audio-pack.sh, because the pack is written either way and the assertion has to be on what it contains:The square arm is the one that matters most: it fails for the shape-shaped fix and passes for this one, and it is the case that would have shipped silently.
Checks
bash -non both test scripts;tools/copyright.py --checkrc 0; both tests green locally (onnx 1.23.2 on the box).fold_initializer_transposeis a ctest row that returns 77 without onnx, so CI keeps skipping it where onnx is absent — the pack test's own row (make_audio_pack) now carries this arm too.No device work, no
.github/change, so no workflow-scope transport needed.🤖 Generated with Claude Code
Second commit: the arms could not have run in CI, so this installs
onnxWhile checking that the two new arms would actually execute, I found they could not:
fold_initializer_transposeandmake_audio_pack(andq4nx_tail_head) all return 77 without theonnxmodule, and the build job installs onlynumpy+gguf— so all three have never run in CI and are baselined as skips intools/ci/ctest_skips.txt. A row that skips is not a gate, and the fold row is precisely the one that would have caught this bug.ci.yml:onnx==1.23.2joins the pinned pip line (a cp312 abi3 manylinux wheel exists,requires_python >=3.10).ctest_skips.txt: the three rows come out of the baseline in the same commit, becausectest_skips --log(a CI step since ci: run ctest_skips --log on the Test step's own log, so a suite that skipped to green stops reading as green (engine#2730) #2736) reports a baselined test that no longer skips as rc 1.Measured here with
onnxpresent and main's own ctest log, with those three rows flipped fromSkippedtoPassedto model the post-install run:So the
ci.ymlline and the baseline edit have to land together, and the three rows pass locally with this pin (q4nx_tail_head"all checks passed"; both fold/pack tests green). The build job is the only place this matters — the NPU and HRX jobs are untouched.Update: the fold fix landed as #2785, and this PR is now the part that was still missing
#2785(main7065b25) implemented the perm-keyed fold independently — and better in one respect: it reuses a name only when the existing tensor holds exactly this perm's values, and picks a free name when an unrelated<src>_tis already in the graph. Its tests cover the two-perm and the square case as well. Merged ind241b30, my implementation and its arms are dropped in favour of main's; there is no reason to carry two of them.What this PR still delivers, none of which is on main:
ci.ymlinstallsonnx==1.23.2— without itfold_initializer_transpose,make_audio_packandq4nx_tail_headare baselined skips, so fold_initializer_transpose: name a folded weight by its perm, so two folds of one weight cannot collapse (engine#2779) #2785's new arms gate nothing. This is the difference between a fix that is tested locally and one CI can defend.tools/ci/ctest_skips.txtin the same commit (ctest_skips --logreports a baselined test that no longer skips as rc 1).fold_initializer_transpose.py --helpanswers instead of reading the flag as a filename — installing onnx activatedtool_help_checkfor this tool, which found that pre-existing defect (FileNotFoundError: '--help').tests/make_audio_pack_test.shasserts the two-perm case through the shipped script, which main's arms (in the tool's own test) do not.Current diff against main is exactly those four files:
ci.yml+7,make_audio_pack_test.sh+39,ctest_skips.txt−3,fold_initializer_transpose.py+12 (--helponly).