Files
reims-vgpu/docs
Anees Iqbal d8ad27f09c 🐎 Cut a command buffer of compute encoders into parts
The Vulkan platform refused a split while a unit of command predication
was open, and every compute encoder opens one, so a buffer of compute
encoders alone was never cut: Geekbench 7's Fluid Simulation commits
2,600 one-dispatch encoders in one buffer, and its GPU work waited for the
whole walk. A split now needs only no block open, no loop body being laid
down again and no unit an unbalanced record emptied
(Predication::cuttable). A unit open at the cut goes on in the next part
(Predication::go_on): its first dispatch type, work, indirect dispatch and
numbering carry over, so what Metal decides by the unit (an unbalanced
encodeEndIf after its work, a first indirect dispatch of another type)
dies where it would in the whole buffer. With no block open the GPU's skip
counter is 0, so the next part's counter, reset at its first step, stands
for the cut part's.

For the guest only timing changes, and where a walk faults after a part
was committed, that part's work has run, as for a buffer of render passes
(only invalid input reaches that).

dispatch_cost's fluid shape (1 buffer of 2,600 encoders of one dispatch,
M3 Max, MoltenVK, release, median of 5 runs of 6), through the decoder:
first take to completion 87.0 ms -> 34.8 ms; the walk's CPU 14.7 -> 8.8 us
a dispatch (164.2k -> 110.6k instructions), as the runtime's work for an
encoder grows with the encoders before it in its buffer. The small (64 x 5
encoders) and one-encoder shapes are not cut, and stay as they were.

Tested by a_unit_goes_on_in_the_next_part,
a_block_open_keeps_a_command_buffer_whole and the encode_compute dies and
goes_on cases across a split.
2026-11-14 01:37:31 -08:00
..