Files
metal2vulkan/crates
Anees Iqbal 7cc30e485e Tests: a no-copy buffer's import goes at the completion past a merge on the host
RUNTIME 2440 removed the program's buffer from the host step's drains
(SpliceDrain, MergeDrain), whose segment the command buffer keeps until
it goes. The test that showed the hold,
a_no_copy_buffer_a_committed_dispatch_writes_a_texture_over_keeps_its_import_until_completion,
no longer reaches a merge on the host since RUNTIME 2438/2439: its rows
fill whole lines, so no line holds a byte beside its texels, and the
merge goes by its kernel alone.

The new leg TextureMergedOnHost keeps the path: the same dispatch into a
texture over the no-copy buffer, its rows a texel short of their pitch
(511 RGBA8 texels in 2048 bytes), on a device whose every texture over
host pages is a shadow (HostPageTexturePolicy::Shadow, under which the
check gives no answer), so both releases (at the commit, and once
scheduled) take the merge on the host. Each asserts that a host step ran
(WorkCounts::shadow_host_steps grew) and that the deallocator runs once
the command buffer completed, the CommandBuffer still held. Where the
device's lines hold no more than a texel, the leg prints and returns.

texture_write and over_buffer take the width. The texture write legs'
check goes row by row: each row's texels hold the dispatch's, and the
bytes past them to the pitch still hold the pages' fill (the merge keeps
them); for the 512-texel rows of TextureWrite that is every word, as
before.

Test only; no product change.

Verified (lavapipe, m2v_cpu_icd, msi m3-max-36042):
- CONTROL_LVP=100 with 7713853865's shadow.rs, shadow_merge.rs and
  shadow_splice.rs (the drains holding `_buffer`): "host steps 1", then
  "the deallocator never ran" at the Committed release.
- HOLD_LVP=0 at RUNTIME 2440: the new test (host steps 1 at each
  release) and TextureWrite, 2 of 2.
- HOLDS_LVP=0: every *holds* test, 134 of 134.
- clippy of metal2vulkan-runtime under m2v_cpu_icd and m2v_gpu: clean.
2026-11-16 03:29:54 -08:00
..