Files
metal2vulkan/docs
Anees Iqbal f066aaf587 Blocks made ahead: a pool near its next block by three quarters of the largest block it holds
tests::blocks_ahead::mixed_sizes_find_their_blocks_made_ahead failed in
two of five runs of the memory tests on the Radeon 780M (gem10, jobs
12627 and 12669): "creation calls waited for a block of images at
textures [11]". In both, a slow making of the host's (the tests beside
it) made the device's blocks of plain memory smaller early in the run,
while its pool of images still filled its first block of 64 MiB, made
before. A pool that has not grown keeps its next block made ahead once
it is near it (Pool::near_next), which was measured by three quarters of
its blocks' size now: 12.75 MiB of a 17 MiB block (12 MiB of 16 MiB
before the blocks' sixteenth). The 64 MiB block had 12.4 MiB left, so
the pool kept none ahead, and texture 11 (2560 x 1440, 15,790,080 bytes
on RADV) found no room and waited for its block. Told of a slow making
before its fourth texture (a scratch of the test, job 12687) the 780M
waited at texture 11 in two runs of two; before its seventh or eleventh,
by which the pool had grown or was near its next block, in none.

A pool is now near its next block below three quarters of the largest of
its blocks' size and the pooled blocks it holds (Pool::ahead_room), so a
pool still filling a block made before its blocks were made smaller
keeps its next block ahead as it did for that block; the sweep of blocks
made ahead and unused reads the same measure. A pool whose blocks are
all of one size is unchanged.

New test: mixed_sizes_after_blocks_made_smaller_find_their_blocks_made_
ahead, the mixed run told of a slow making before its fourth texture.
memory/ready.rs and docs/FAST-PATHS.md's blocks-made-ahead row say the
measure.

Verified on the 780M (job 12692): the new test without this change
waited at texture 11 in three runs of three; with it, the memory tests
(66) pass in three runs of three, the new test with no wait (7 blocks of
images made ahead), and in one of them the existing mixed test's own
blocks made smaller at texture 15 by a slow making of the host's, with
no wait. The memory tests pass on the RX 550, lavapipe (job 12693) and
the Iris Xe (job 12694); clippy plain and under m2v_gpu and
m2v_cpu_icd, and the runtime's Rustdoc, clean.

(cherry picked from commit c3fd622421584dfcc0b34ca133dbae22f53203e6)
2026-11-09 17:52:06 -08:00
..