Files
metal2vulkan/crates/metal2vulkan-runtime/examples/host_ab
Anees Iqbal 88a5b95f7a Runtime: a class's memory types are read in place, so a host-copied texture's making allocates no list of them
class_types, which host_image_types asks for every texture whose texels the host copies (since
399e8d6d17), collected candidates() into a Vec only to fold it into bits: one allocation per
texture made. On lavapipe, host_ab's percall texture_256_shared read 32.3125 allocations a call
at development, against its bound of 32, in 6 of 6 runs. An allocation trace of the call named
candidates <- class_types <- host_image_types <- placed_image_starting as the site, one a call.
That trace came from a host_ab build that recorded every allocation in one group's counted
window.

ranked() yields each usable memory type with its rank, in Vulkan's order, and collects nothing.
class_types folds it into bits. candidates collects it and stable-sorts it by rank as before, so
both answer the same types in the same order: the system-memory branch for unified Private and
Memoryless, and the required, preferred and avoided flags otherwise.

Verified (release host_ab at this tree, with the settle commit before it and the test commit
after it, against development 58c3147007, 6 runs each unless named):
- lavapipe: texture_256_shared allocs 32.312 -> 31.312 (base over its bound in 6 of 6 runs, this
  tree in 0 of 6), heap_texture_256 allocs 14.25 -> 12.25; every row within its bound.
- RTX 5080 Laptop (40 runs each): heap_texture_256 allocs 15.25 -> 12.25.
- 780M PHOENIX: texture_256_shared 30.312 -> 29.312, heap_texture_256 79.25 -> 75.25 (over its
  17.25 bound at both: the heap-tiled path, handed to the orchestrator).
- tests::memory, tests::host_memory, tests::host_image_room and tests::device_memory_overflow
  pass on the RTX 3090 and PHOENIX (47 each, 2 ignored) and on lavapipe (48).
- percall.rs's account of a heap texture's allocations now reads the counts measured here
  (lavapipe and the 5080, 12.25 a call). The M3 Max's was not measured at this tree.
- clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd) and rustdoc -D warnings clean on Linux.
2026-11-11 06:16:11 -08:00
..