Skip to content

tests: the packing case pins the guarded packer, both arms measured (engine #534) - #149

Merged
bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
1bit/hrx-534-packing
Oct 25, 2026
Merged

bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
1bit/hrx-534-packing

Conversation

@bong-water-water-bong

Copy link
Copy Markdown

Base: 1bit/hrx-445-device (#148) on the fork tip. Closes engine ggml-org#534.

disjoint_transient_plan_packing asserted that two transients with disjoint lifetimes share one arena slot
(arena 256). They do not, and have not since d9594130 (2026-10-05, "transient arena reuse without false
dependencies") introduced the guarded packer: it hands a freed range to the next value only when that value's
first command already depends on every command that used the range before. In this graph the two chains are
independent (out0 does not feed out1), so sharing the slot would add a write-after-read barrier between two
commands that share no data, and sum1 gets fresh space instead.

Measured on this graph, host run, hrx-system 82804197bc:

default (guarded)                        arena 512, two 32-byte allocations at offsets 0 and 256
GGML_HRX_TRANSIENT_REUSE=legacy (stock)   arena 256, both at offset 0

The case now pins the guarded layout and says why, and the #534 known-fail marker is retired. The 256 that
was asserted is the stock packer's number, kept here as documentation rather than as an expectation. The cost is
bounded by the guard's own policy: a program keeps the guarded packing only while its arena stays within twice
the unguarded one plus 8 MiB.

Bisect note for the issue: the split is not in the 10-18 .. e7e5cd0 range. At 953b6397 (the 10-18 pin) the
same graph already measures arena 512 with allocations at 0 and 256, and the only change under
ggml/src/ggml-hrx/dispatch/ in that range is a 7-line zero-element CPY elision (61e19a45);
transient-allocator.cpp and transient-reuse-guard.{h,cpp} are byte-identical across it.

bong-water-water-bong added a commit that referenced this pull request Oct 25, 2026
… to the pin (engine #444, #445) (#148)

op_params_json() had no branch for FillParams (#140), so a graph snapshot dropped the FILL constant and the tree did not build under GCC; the constant is now written and read back, with a round-trip case. run_qwen_matmul_dispatch_checks leaked GGML_HRX_DISABLE_QWEN_DISPATCH across cases in one process; scoped. Expectation tables of hrx-backend-test and test-hrx-ops brought to the e7e5cd0 pin: both suites run to the end on HRX0, green except rows pointing at open issues (ggml-org#533 via ggml-org#570, ggml-org#534 via #149).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@bong-water-water-bong
bong-water-water-bong changed the base branch from 1bit/hrx-445-device to 1bit/hrx-vulkan-patched October 25, 2026 16:42
…red (engine ggml-org#534)

`disjoint_transient_plan_packing` asserted that two transients with disjoint lifetimes share one arena slot
(arena 256). They do not, and have not since `d9594130` (2026-10-05, "transient arena reuse without false
dependencies") introduced the guarded packer: it hands a freed range to the next value only when that value's
first command already depends on every command that used the range before. In this graph the two chains are
independent (`out0` does not feed `out1`), so sharing the slot would add a write-after-read barrier between two
commands that share no data, and `sum1` gets fresh space instead.

Measured on this graph, host run, hrx-system `82804197bc`:

    default (guarded)                        arena 512, two 32-byte allocations at offsets 0 and 256
    GGML_HRX_TRANSIENT_REUSE=legacy (stock)   arena 256, both at offset 0

The case now pins the guarded layout and says why, and the `ggml-org#534` known-fail marker is retired. The 256 that
was asserted is the stock packer's number, kept here as documentation rather than as an expectation. The cost is
bounded by the guard's own policy: a program keeps the guarded packing only while its arena stays within twice
the unguarded one plus 8 MiB.

Bisect note for the issue: the split is not in the 10-18 .. e7e5cd0 range. At `953b6397` (the 10-18 pin) the
same graph already measures arena 512 with allocations at 0 and 256, and the only change under
`ggml/src/ggml-hrx/dispatch/` in that range is a 7-line zero-element CPY elision (`61e19a45`);
`transient-allocator.cpp` and `transient-reuse-guard.{h,cpp}` are byte-identical across it.
@bong-water-water-bong
bong-water-water-bong merged commit 6b397ee into 1bit/hrx-vulkan-patched Oct 25, 2026
bong-water-water-bong added a commit that referenced this pull request Oct 25, 2026
…151)

* tests: qwen_matmul_dispatch runs to the end at the pin (engine #445)

The last red row of #445. Three things kept it from finishing, all of them the case outliving the dispatcher it
was written against:

- the router's four-row wave32 projection is the plan's only dispatch for its row, and its kernel name does not
  contain "mul_mat", so the row's lookup for "the last matmul dispatch" found nothing. The lookup now also accepts
  the kernel the table names; when that is not a matmul-named kernel the row pins the name, the token count and
  the verified program, because the checks below spell their parameters under the mul_mat prefix.
- with the rows running to the end, the case's single 8 MiB context no longer held the bookkeeping for ~40
  weight/input tensor pairs; it is 64 MiB now.
- the 128-input f32 projection block asserted "not schedulable"; the route that refused that shape is gone and the
  plan is built and verifies, so the block pins that instead (engine #445's rule for negative blocks the pin
  outgrew, same as the oversized-Q8_0 block in #148).

`hrx-backend-test` at this commit + hrx-system `82804197bc`, host: **65 passed, 0 failed, 1 known-fail, 0
unexpected-pass, 66 total, exit 0**. The one known-fail is `disjoint_transient_plan_packing` (ggml-org#534) - fixed by the
open PR #149, which is not in this branch; nothing else in the suite points at an open issue. The `#445` markers on
`qwen_matmul_dispatch` and `lowtoken_residual_dispatch` are both retired (the latter in #148).

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* tests: fa_prefill_full_cache schedules its projections first (engine ggml-org#533 fusion order)

The postprocess programme reads the three projections, and the fusion-order guard from #150 refuses a match
that reads a value no dispatch has written yet - so the manual matcher in this case now schedules the projection
MUL_MATs before it asks for the postprocess, the same shape #150 gave the matching case in hrx-backend-test.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
@bong-water-water-bong
bong-water-water-bong deleted the 1bit/hrx-534-packing branch November 12, 2026 21:13
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