Files
metal2vulkan/docs
Anees Iqbal 528379dad5 RUNTIME 2439: Merge on the host whole up to 1 MiB of rows; count host steps
On the Iris Xe (RPL-P, ANV) the split merge's own GPU work (two buffer
copies of the pieces beside the texels, three barriers and the kernel's
dispatch) cost about 0.6 ms a command buffer for the guest's 34x34
RGBA16Float target (m3-max-35898: draw minus clear 0.69 ms, against
0.10 ms when the merge went on the host whole), while the host step's
word loop costs about 0.30 ns a byte (4.97 ms for a 1920x1080 target's
16.6 MB, half its texels changed). So the split pays only past about
2 MB of rows.

A merge on the host whose cut rows hold at most HOST_WHOLE_BYTES (1 MiB,
half the break-even) now goes on the host whole again; larger ones
split. A merge none of whose rows' lines holds a byte beside its texels
still goes by its kernel alone, as on any device. The whole merge is
also the exact form for the unmeasured case (a CPU write to a texel the
commands left in a line whose other bytes they changed), so the known
gap now applies only where the kernel stores: past the bound, and where
no row's line holds a byte beside the texels. Both forms keep the
measured padding contract, so there is no switch and no FAST-PATHS row.

WorkCounts::shadow_host_steps counts the host steps that ran for
encoders' copies back spliced and merges on the host: against
command_buffers_submitted, the GPU-to-CPU round trips a command buffer
pays, for a walk to read before any deferral of them.

Tests:
- shadow_runs::merges_on_the_host_go_whole_up_to_the_bound_and_split_past_it:
  over pages 16 bytes into a page, a 512x512 BGRA8Unorm target (1 MiB
  of rows) compares every byte of its rows on the host, and a 512x513
  one each row's first and last lines alone; each one host step.
- shadow_write_lines: the contract test's draw merges now compare every
  byte of their rows; the cost test alternates its verdict arms round by
  round, so clock drift and order weigh on both alike (the 1080p gap
  35898 showed, equal in Clear and Draw, with the same work recorded in
  both arms by every count); a new test prints, for a render target
  whose rows end a texel short of a 4096-byte page (1023x256 and
  1023x1024 BGRA8Unorm), under the device's own check and default
  policy, over pages imported by pointer and as dma-bufs: every host-page
  class's renders and copies verdicts for those row ends and its memory
  flags, the form the texture takes with its notices, and the median per
  command buffer of a clear-and-store and of a draw.

Degradation kinds added: none.

Verified: msi m3-max-35933 at f763e15338 (same tree): CLIPPY=0, CLIPPY_GPU=0, API=0 (15/15), release archive built. PHOENIX, lavapipe and the Iris run follow on development.
2026-11-16 02:57:29 -08:00
..