Files
metal2vulkan/docs
Anees Iqbal 2fff78740e Record that a sparse slice past the texture's costs its other levels and tail what it costs inside
UnitGrid::clipped_region charges a mapping update whose slice is past
the texture's own what the same region inside the texture costs: the
region clipped to the level's tiles, a page per tile, the slice's whole
tail at firstMipmapInTail, and nothing inside the tail past it. That
was measured on level 0 alone, and mapping.rs called every other level
and the tail unmeasured.

sparse_slice_past_levels_usedsize.m (landed with rows2's fixes) ran on
the M3 Max (macOS 27.0.1, job m3-max-4446): eighteen shapes, each in its
own process and run twice. It used the direct selector, the indirect one
and the direct one through a view, over a 2-slice 256x256 nine-level
R32Float texture. Every reading is the rule's, and so is every
control's on an in-bounds slice:
- a tile of level 1 or of level 2 costs one page;
- 8x8 tiles on a level holding 2x2 cost four;
- a tile of level 3, the first tail level, costs the slice's tail (one
  page here);
- level 5, inside the tail, costs nothing;
- an unmap gives the page back.
The three forms and the two runs read alike. No behavior changes.

- tests::sparse gains the readings row by row, each with its control.
- mapping.rs states the rule as measured on those levels and the tail.
- The probe's header records what it read.
- FAST-PATHS's known gap said the runtime counts none of these pages.
  It counts the pages Metal's heap counts (sparse/bind.rs charges them
  through SparseState::charged), as docs/API.md's accepted difference
  already said, so the known gap now says the same.

(cherry picked from commit c4a47fc17d634f750b9c62b6489c95d3d4d5d966)
2026-11-07 14:00:19 -08:00
..