Runtime README: the fenced span's measured length on the M3 Max, the 780M and the Iris Xe

What: the known gap of memory blocks (a texture in place over host memory's import) states how long
a RestoreFence holds its span: from before returning to after being called. In microseconds, the
median of 16 fenced makes and then the largest, without the validation layer:
- 1920x1080 BGRA8Unorm: Apple M3 Max (KosmicKrisp 26.3.1) 455 and 645; Radeon 780M (RADV PHOENIX,
  Mesa 26.2.6) 603 and 877; Iris Xe (ANV, Mesa 26.2.6) 3267 and 3504.
- 16x4 RGBA8Unorm: 328 and 396; 120 and 169; 507 and 934.
It also says the span holds the whole submission that carries the restore.

Why: the consumer picks its fence from these numbers.

Verified: printed by the new test (host_in_place's
each_device_fences_a_host_writer_around_the_restore_alone) at 7bc3d18e4e, with
METAL2VULKAN_TEST_UNVALIDATED=1, in jobs m3-max-82721 (M3 Max), m3-max-82720 (780M Phoenix) and
m3-max-82734 (Iris Xe). Under the validation layer, in the same jobs, the 1080p numbers were 478
and 591, 1240 and 1972, and 3731 and 3993; the 16x4 numbers were 350 and 444, 209 and 825, and
793 and 1411. Docs only.
This commit is contained in:
Anees Iqbal committed 2026-12-03 01:06:30 -08:00
1 parent 1ee4cd95d5
commit e79864f16f
1 file changed
+10 -3
+10 -3
View File
@@ -1507,13 +1507,20 @@ exported block, an exported surface in either form, and a Direct3D 11 import.
of them then may see them undefined, where Metal's make touches no bytes; the make waits for the
GPU work already submitted, as well as for its own. A caller that can have such a writer gives
the make a `RestoreFence` (Imported blocks) and fences the writer between its `before` and
`after`, which hold the save, the move and the write-back. The pair copies the texture's bytes out and
back, so the make's time grows with its size. A make of a 1920 by 1080 BGRA8Unorm texture in
`after`, which hold the save, the move and the write-back. The pair copies the texture's bytes
out and back, so the make's time grows with its size. A make of a 1920 by 1080 BGRA8Unorm texture in
place takes, in microseconds (the median of 16 makes, then the largest), 848 and 1149 on the
Apple M3 Max (KosmicKrisp 26.3.1, job m3-max-81753), 720 and 1426 on the Radeon 780M (RADV,
Mesa 26.2.6, job m3-max-81798) and 3499 and 3927 on the Iris Xe (ANV, Mesa 26.2.6, job
m3-max-81801); one of 16 by 4 texels takes 436, 278 and 420, and a make that is the counted
copy 25 to 60. In place, every read of the texture is a read of a linear image, as of
copy 25 to 60. The span a `RestoreFence` holds, from its `before` returning to its `after`
being called, is most of the make: in microseconds (the median of 16 fenced makes, then the
largest, without the validation layer), 455 and 645 for 1920 by 1080 BGRA8Unorm on the Apple
M3 Max (KosmicKrisp 26.3.1, job m3-max-82721), 603 and 877 on the Radeon 780M (RADV PHOENIX,
Mesa 26.2.6, job m3-max-82720) and 3267 and 3504 on the Iris Xe (ANV, Mesa 26.2.6, job
m3-max-82734); for 16 by 4 RGBA8Unorm texels 328 and 396, 120 and 169, and 507 and 934. The
span holds the whole submission that carries the restore, so another thread's command buffers
in it lengthen it. In place, every read of the texture is a read of a linear image, as of
any texture over a Shared buffer in place, where the copy's image is optimal. The device type
chooses because of what a frame costs each way. Measured with a 1920 by 1080 RGBA8Unorm texture
over host memory that the CPU writes whole each frame and a 1080p pass of 1 or 4 draws that read