Files
metal2vulkan/crates
Anees Iqbal ac7dffa3fd RUNTIME 2488: A spliced shadow's staged heads and tails go back as row copies too, one dispatch each where faster
A spliced copy back out of a staging buffer copied its rows' edges into
the arena region (each row's head before its first line boundary and its
tail after its last, which the host step then copies into the pages) as
one vkCmdCopyBuffer region per edge: 2N regions per copy back. On ANV,
which splices every such copy back, and on the RTX 5080 Laptop
(DriverFact::RowCopiesDispatchFaster), the driver records each region as
an operation of its own. That is the cost row_copies.rs removes.

shadow_splice::staged now puts a cut's heads (in `edges`) and its tails
(in `tails`) in separate lists. Each takes the region in the same order as
before (a row's head, then its tail), so the region's layout, the pieces
and the host step are unchanged. For rows of one shape the heads are
equal-sized and equally spaced in both buffers, and so are the tails.
SplicePlan::place makes each list a RowCopies from the staging buffer into
the region (the arena's chunks carry storage usage), beside the whole
lines' RowCopies into the truth. record_spliced records all three; the
encoder takes their stages and uses (ShadowCopy::spliced_stages and
spliced_uses: a texture buffer's shadow is read by every dispatched copy)
and retains every set.

Tests:
- tests::shadow_splice::a_staged_cut_of_equal_rows_is_three_copies_of_rows_of_one_shape_each
  checks that the cut of the validation test's shape, at three phases,
  gives whole lines, heads and tails of one dispatchable shape each.
- The staged cut's byte test also reads the tails.
- runtime_lane::row_copies::a_spliced_shadow_s_lines_heads_and_tails_go_back_as_one_dispatch_each
  (renamed from ..._whole_lines_go_back_as_one_dispatch) asserts 3 row
  copies of 96 regions, 3 dispatched where the fact holds. Before this
  change it was 1 copy of 32.
- The unforced test expects 3 copies where its copy back was spliced,
  else 1.

The three row copies live in Splice.rows (clippy's large_enum_variant refused a 600-byte variant of
SpliceCopies::Staged; nothing boxed). RUNTIME_VERSION 2488 (2487 is the early pin branch's).

Verified: msi m3-max-38042 at 777d9a3412, lavapipe, --cfg m2v_cpu_icd: clippy -p runtime -p validation
--all-targets --all-features -D warnings 0; validation 43/43 (a_spliced_shadow_s_lines_heads_and_tails_
go_back_as_one_dispatch_each: spliced 1, row copies 3, regions 96, 3 dispatched where the fact holds;
the same scenario measured 1 copy at 869519d69f, m3-max-38028); runtime shadow, splice and row-copy
tests 118/118 (a_staged_cut_of_equal_rows_is_three_copies_of_rows_of_one_shape_each: each copy meets
RowsDispatch::new's conditions, so ANV and the 5080 dispatch them: expected, not run). Plain and
--cfg m2v_gpu clippy and rustdoc in m3-max-38043.
2026-11-16 15:23:37 -08:00
..