Commit Graph
2835 Commits
Author SHA1 Message Date
Anees Iqbal 85465062e2 HOWTO section 7: where a texture over an exported frame's plane lies in place
Names the rule the runtime applies to each plane's linear image (the
plain one first, else DRM_FORMAT_MOD_LINEAR), made for the export's
handle type: the image format query takes that handle type, not in a
dedicated allocation alone; the plane's byte in the memory is a multiple
of vkGetImageMemoryRequirements' alignment; vkGetImageSubresourceLayout
answers offset 0 and the plane's row pitch, its size fitting; and the
device's in-place check of that exported memory passed. The shadow's
causes otherwise, and the measured alignments for a 3840x2160 NV12
frame: 64 on lavapipe (m3-max-10165), 256 on the RX 550 under RADV with
opaque descriptors (m3-max-10151), whose dma-buf planes are shadows.

(cherry picked from commit 15affc37f6910f8ea7bababe1bcb5c69d5ae7d5c)
2026-11-08 17:00:48 -08:00
Anees Iqbal d3f012afcb dma_buf_export: each plane's expectation from its own placement query
The check's verdicts for exported dma-bufs can differ by row ends
(lavapipe: reads InLines not passed, OnLines passed), so a test keyed on
both verdicts skipped its assertion there. Each plane now asks
texture_placement_with_iosurface_plane once the check answered: a
shadow of TextureShadowReason Unchecked or CheckFailed must not alias;
any other answer must alias as the plain frame's plane does.

Verified so far: lavapipe at 03f36709ee (m3-max-10165) 48/48 with the
earlier form; this form's runs follow.

(cherry picked from commit 99dea717ca568a094ffda7ae08794dd9b9e99844)
2026-11-08 17:00:48 -08:00
Anees Iqbal 4b4e19937a Exported-memory texture tests follow the in-place check's verdict
On an RX 550 under RADV (POLARIS12) the device makes no image over a
dma-buf, so the in-place check leaves the runtime's memory exported as
dma-bufs Unchecked (a cause that lasts), and textures over such memory
are the shadows their verdict decides. The two tests asserted in place
there: an_nv12_picture_s_planes_over_exported_memory_go_in_place_naming
_its_handle_type now expects in place where the placement query answers
NotHostPages after the check, else a shadow of TextureShadowReason
Unchecked or CheckFailed (any other answer fails), moves only the
planes the check passed for, and counts a shadow made after the check
only where it did not pass; a_frame_a_second_device_writes_through_its
_dma_buf_reads_in_the_runtime_s_textures expects the plain frame's
aliasing where the check's reads over exported dma-bufs passed for both
row ends, and a shadow where neither passed.

Seen: m3-max-10151 on the RX 550 (the run meant for the 780M, its
device not pinned): OpaqueFd planes in place (alignment 256, row pitch
3840, offset 0), DmaBuf planes Shadow(Unchecked { Reads, OnLines }),
both tests failing on their in-place assertion. The re-runs follow.

(cherry picked from commit 03f36709eefb7b649975900aa7b6430c380d023d)
2026-11-08 17:00:48 -08:00
Anees Iqbal 7ebb4bd2aa Exit guard: a call set as many words of 64 as the table needs
The table's 129th entry point (vkGetBufferMemoryRequirements2, which the
in-place check's exported pages call inside a section) overflowed the
u128 call word: every test that makes a device panicked at Call::bit
("attempt to shift left with overflow") on lavapipe and RADV.

Calls is a set of [u64; CALL_WORDS], CALL_WORDS = Call::ALL.len()
rounded up to words of 64, so the set grows with the table; CALLED,
PENDING and the priming's calls use it. Call::bit answers the word and
the bit.

Verified: cargo fmt only so far; the lavapipe and RADV runs follow.
every_entry_point_has_a_bit_of_its_own panics without this change.

(cherry picked from commit 71fcbfa60b26a691ecb2e11155403fbba843c686)
2026-11-08 17:00:48 -08:00
Anees Iqbal 1dddb6023c The section table and priming take vkGetBufferMemoryRequirements2
The in-place check's exported classes make their exportable buffer on the check's thread, in a section, and exportable_buffer asks the buffer's requirements with its dedicated ones (vkGetBufferMemoryRequirements2). Outside the exit guard's table that entry point is ash's stub inside a section, so every check panicked on lavapipe (m3-max-10064: 8 tests, each 'Unable to load get_buffer_memory_requirements2' on m2v-in-place-check). The table names it and priming makes it beside vkGetBufferMemoryRequirements.

(cherry picked from commit 1e6037c8d7524eb14b898610a6d9f6390e885fe2)
2026-11-08 17:00:48 -08:00
Anees Iqbal 275611eeba Exported-memory images: Debug by raw handle, the counters' class match
ash's flags implement no Debug without its debug feature, so BoundMemory and ModifierMemory print their handle types raw, and the format query's refusal prints the features raw. host_texture_in_place counts no texture over the runtime's exported memory as over host pages, as for the pooled memory. Found by the Linux build (m3-max-10049).

(cherry picked from commit 3be365383cd0846d5e9604017cc74bb83797d2c1)
2026-11-08 17:00:48 -08:00
Anees Iqbal 098eec639b API.md: when a texture over exported memory is a shadow
The shadowed-texture list in section 10 gains the exported-memory causes the handle-type fix introduced: the check of that exported memory not passed (pending ones move in place), the image format query refusing the handle type but in a dedicated allocation, and a buffer's dedicated allocation.

(cherry picked from commit cd993135eca08d877b7b55a3c0570df86df7510f)
2026-11-08 17:00:48 -08:00
Anees Iqbal 8911bc5241 Runtime README: textures over an exportable buffer name its handle type and wait for its check
The consumer-facing half of the handle-type fix: such a texture is a linear image made for the memory's handle type, made UNDEFINED, in place where the device's check of that exported memory passed; a shadow before, which moves in place; a dedicated allocation keeps shadows. HOWTO section 7 gets the placement rule with the measured alignments once the device runs report them.

(cherry picked from commit ddfb9797827fbd2138217de4a5cba2d600716a6c)
2026-11-08 17:00:47 -08:00
Anees Iqbal 99453e91d8 Images bound over exported memory name its handle type; a check class per export handle
A texture over an exportable buffer (exported_memory.rs) was a PREINITIALIZED linear
image, or a DRM_FORMAT_MOD_LINEAR one, with no VkExternalMemoryImageCreateInfo, bound in
memory allocated with VkExportMemoryAllocateInfo: VUID-vkBindImageMemory-memory-02728
("it must include at least one of the handles set in
VkExternalMemoryImageCreateInfo::handleTypes"). RADV and NVIDIA tolerate it; the layer
does not.

What changed:
- memory.rs: Memory::bound_memory reads a placement's own record (the block's export,
  import, own pages or read-only view, a guest RAM chunk's handle, a dma-buf import) and
  answers the handle type an image bound there names: none for memory of no export, the
  export's handle for a shared exported block, HOST_ALLOCATION or DMA_BUF for imports, and
  no image for a buffer's dedicated allocation (VUID-vkBindImageMemory-memory-10926) or the
  caller's memory. Buffer::bound_memory answers it for a buffer (a heap buffer's, its heap's).
- texture.rs alias_unbound decides the image from that record, not the route: over exported
  memory the device's linear image made for the handle type (external_linear_image, the
  former host_linear_image generalized), else the DRM_FORMAT_MOD_LINEAR one made for it
  (ModifierMemory::Exported). Either is made UNDEFINED (VUID-VkImageCreateInfo-pNext-01443),
  so its first move may discard the bytes, which only the device's check may vouch for.
- in_place.rs: two check classes, PagesClass::ExportedFd and ExportedDmaBuf. Their buffer
  is an exportable Shared buffer of that handle type in a shared block; their textures take
  the product's image. A texture over exported memory takes its image where the policy and
  those verdicts pass for its accesses; before them it is a CheckPending shadow that moves
  in place at the next quiet commit, as over the pooled memory (storage_form.rs now moves
  any class over the runtime's own memory). No LinearCost bound there: another API writes
  those bytes.
- The image format query (VkPhysicalDeviceExternalImageFormatInfo) must answer the handle
  type exportable (importable for imports) without DEDICATED_ONLY, for the linear and the
  DRM_FORMAT_MOD_LINEAR image alike; else the texture is a shadow, its notice naming the
  query's refusal. A dedicated allocation keeps the shadow, its notice naming 10926.
- ycbcr_planes.rs: the two-plane image is PREINITIALIZED with no handle type, so it takes
  only memory whose record says no export or import (KeptTexels::Memory elsewhere).
- in_place::CHECK_VERSION 12 -> 13: the record holds two more classes, so every driver's
  check runs once more.

Checked and unchanged: heap.rs's images (heaps are never exported; over host pages they are
HOST_ALLOCATION images, over a copy in device memory a shadow or an Own linear image), the
in-place images over host pages and copies (HOST_ALLOCATION over imports, Own over device
copies), and the runtime's own images in Holds::Images/Buffers blocks.

The placement rule (in_place.rs, "The runtime's exported memory"): per texture (per plane),
the texels' offset in the memory (the buffer's first byte, or its aligned_byte, at a
multiple of 256 there, plus the texture's offset) must be a multiple of
VkMemoryRequirements::alignment from vkGetImageMemoryRequirements for the image made for the
handle type of the texture's format, extent and usage; vkGetImageSubresourceLayout of its
first subresource must answer offset 0 and Metal's rowPitch; its size must stay inside the
buffer. The linear image first, then the DRM_FORMAT_MOD_LINEAR one with its own alignment.

Test: tests/exported_textures.rs, an NV12 picture's R8 3840x2160 and RG8 1920x1080 planes at
32 and 8294432 of an exportable buffer laid with aligned_byte(32), opaque fd and dma-buf,
Private and Shared, under the validation layer: a shadow first, both moved in place after
settle_in_place_checks, readback equal, in place at once after, no layer message.
dma_buf_export settles the checks before its plane textures. Not yet run: this commit is
for the build and the device runs.

(cherry picked from commit 40872fbb4748cbd228c06c27dc0cd63ca2d0a5ec)
2026-11-08 17:00:47 -08:00
Anees Iqbal ae87c11e14 copied_device: the dma-buf mapping test keeps its Linux gate
ba83af1318 (0e07fff15b) put its new test between the dma-buf mapping test's doc comment and
#[cfg(target_os = "linux")] and that test, so the test lost its gate and macOS --cfg m2v_gpu clippy
failed on Host::over_dma_buf, a Linux-only helper (round 062, s37 clippygpu, E0599). The doc and
the gate move back onto their test. Test code only; nothing else moves.
2026-11-08 16:09:11 -08:00
Anees Iqbal 9bfc1b52ea Re-bless the authored compile census at ba83af1318
Its product fingerprint follows development's versions at ba83af1318 (SEMANTICS_VERSION 1995). Blessed on the
M3 (s37-pl.sh censusbless --bless, rebless-062).

(cherry picked from commit 36669615150850198b0f09bf3f7362cfc8b680c0)
2026-11-08 16:04:55 -08:00
Anees Iqbal f4524d4044 Re-bless the golden tables at ba83af1318
Translation changed at ba83af1318 (SEMANTICS_VERSION 1995). Blessed on the M3
(s37-pl.sh bless, dv-golden).

(cherry picked from commit e5296514e0b460dc94264095b04ad115bca96e49)
2026-11-08 16:01:36 -08:00
Anees Iqbal ba83af1318 RUNTIME_VERSION 1929: no-copy buffers and heaps whose pointer the device refuses, with no dma-buf source, are copies
0e07fff15b (radvruns): new_buffer_with_bytes_no_copy and a no-copy heap's own buffer over shared
memory the device refuses (RADV with a shared memfd and no source) were refused, though Metal makes
them. They now take copied.rs's copied-host-pages path, announced with the device's refusal and
counted (WorkCounts::copied_host_buffers_device_refused). A rebind to such memory without a source
stays refused (HOWTO 6). Verified: gem10 m3-max-10021 clippy x2, unit 46/46, lavapipe lane 52/52
(lavapipe imports shared memory, so the path is not reached); 780M m3-max-10057 lane 52/52, the new
test makes a Copied buffer, the first-fill bench passes whole; negative control fails with the old
refusal.
2026-11-08 15:58:50 -08:00
Anees Iqbal 3f69d1af77 No-copy buffers and heaps whose pointer the device refuses, with no dma-buf source, are copies
On RADV (amdgpu userptr takes anonymous private pages only) a no-copy buffer over shared memory,
a memfd mapping among it (QEMU's memory-backend-memfd,share=on guest RAM), made with no source of
dma-bufs of its pages, was refused (Unsupported, HostMemory), where Metal makes a no-copy buffer
over any page. Device::buffer_over_host_memory now makes it over a copy of the pages instead
(copied.rs), announced (copied-host-pages, its detail naming the device's refusal) and counted
(WorkCounts::copied_host_buffers_device_refused, of copied_host_buffers_made). A no-copy heap's own
buffer takes the same path. The import with a source is unchanged: the source is still called
first, and a copy follows its failure only as before. A rebind to such memory without a source is
still refused (its own import path), as HOWTO section 6 now says.

Docs: the runtime README, HOWTO sections 6 and Copied host buffers, HostMemory::new,
Device::imports_shared_host_pointers, the copied-host-pages catalogue entry and copied.rs's opening.
docs/REFUSALS.md regenerated (unchanged: the refusal stays where pages cannot be read).

Test: tests::copied_device::copied_buffer_is_made_over_shared_memory_whose_pointer_the_device_refuses
(Linux): where the device refuses shared memory's pointer, the buffer is a copy, announced and
counted as the device's refusal, with every copy's coherence; elsewhere an import.

(cherry picked from commit 0e07fff15b79cf0fdcf4f09a2836c7075db266a3)
2026-11-08 15:58:08 -08:00
Anees Iqbal f922125bb1 SEMANTICS_VERSION 1995, RUNTIME_VERSION 1928: a branch that only decides whether the invocation demotes itself keeps the snapshot slot
StageModule::snapshot_textures left out every own-pixel slot whose fetched value reached a
conditional branch, so a fragment function that fetches its pass's texture at its own pixel and
demotes on a guard of the fetched value (`if (c.a == 0) discard_fragment();`, a compositor's
coverage test) took the split after every barrier
(WorkCounts::reading_draws_split_unreadable_own_pixel: 23,463 in the 780M glass walk at
d63c119a7b).

The limit was how the analysis was written, not a helper-visible effect: a branch whose one arm
holds OpDemoteToHelperInvocation alone and goes on to the other, both paths meeting with the
same values, changes nothing in a helper invocation, which is one already ("Demote this fragment
shader invocation to a helper invocation", which "is not considered a flow control
instruction"), and its arm holds no derivative, quad or subgroup operation, loop or undefined
behavior a helper's path could reach. In a non-helper invocation the snapshot's texel is the
texture's, so the discard is Metal's. spirv::requirements::snapshot's demote_guard recognizes
the shape (either arm, through an empty forwarding block); every other branch on a fetched value
still leaves the slot out. Only the demote form counts (MSL 2.3 or later on a profile with
shaderDemoteToHelperInvocation); a predicated or terminating discard keeps the old rule.

SEMANTICS_VERSION 1995: a module's snapshot_textures interface fact changes for such functions.

Tests:
- spirv::requirements::snapshot::tests::only_values_no_helper_can_pass_on_qualify: a demote
  guard in the then arm and in the else arm qualify; an arm that demotes and also writes, and
  arms whose values merge apart, do not.
- runtime_lane::snapshot_reads::a_reader_that_discards_by_its_texel_takes_the_snapshot: the
  overlapping-primitives draws with sd_read_discarding (new owned fixture
  engine/snapshot_discard.metal, compiled by scripts/regen-air-fixtures): 3 * FILL at the block
  (the second reader discards), no unreadable-own-pixel split, a snapshot for each reader where
  the device takes the path, else a split for each.

Verified (perdraw): gem10 m3-max-10029 clippy x3, rustdoc, unit 26/26, lavapipe
runtime_lane::snapshot_reads 8/8 (lavapipe takes no snapshot path: the slot is no longer refused
as unreadable); negative control 10043 (guard disabled) fails the unit case and the lane. The
780M leg, where the snapshot path runs, confirms after landing (10071/10072). Goldens and the
compile census are re-blessed on development.

(cherry picked from commit ff8772456b)
2026-11-08 15:57:57 -08:00
Anees Iqbal 3137fca46d RUNTIME_VERSION 1927: pooled blocks made ahead for every pool the encodings place in, each right after a burst of submissions
radvruns (9deb53889b..ec53b47594): a 64 MiB pooled block's vkAllocateMemory holds the device VM's
root reservation through its page allocation (RADV makes such memory VM_ALWAYS_VALID; function-graph
trace m3-max-9889), so every amdgpu_cs_ioctl of the process waited behind an inline make (reims: 16
of the scroll's 18 slow submits end as a block is made). memory/ready.rs now makes one block ahead
per kept pool, off the caller's thread, once the pool grows, starting 1 ms after a burst of the
device's queue uses ends (at most 50 ms); a creation that needs it waits only for its allocation
(blocks_ahead_hurried). Block size stays 64 MiB: 16/32/64 MiB and dedicated allocations held alike
(37f2ba7038, 9943). New WorkCounts: blocks made ahead and in place by pool kind, waited for, hurried,
past the quiet wait, unused (blocks_ahead_hurried added to the public surface: a new field, nothing
breaks). 780M block bench, 4 alternating pairs (m3-max-10022): buffer making p99 17.6-27.7 ms ->
0.2-9.8, max 32.9-71.6 -> 6.4-26.7, ping max 26.0-51.8 -> 18.3-27.5; device tests 70/70 on the 780M,
blocks_ahead on lavapipe 2/2; negative control 1 fails (6 in place). Negative control 2 (no hurry)
reruns as 10050.
2026-11-08 15:50:07 -08:00
Anees Iqbal 346f00c223 memory_block_bench: each round's blocks made in place beside those made
(cherry picked from commit ec53b47594eb77d342e105b6b889ee45f3d0c964)
2026-11-08 15:49:10 -08:00
Anees Iqbal 53c731da52 blocks_ahead: a call's wait for a making is counted apart from its ask to hurry
blocks_ahead_waited_for read the making's go word, which only the ask to hurry sets, so with the
ask removed (the test's second control, 9999) no wait was counted and the test ran to its buffer
limit instead of failing on the hurried count. The wait now sets a flag of its own.

(cherry picked from commit 08d261a9edc343aabccf92f8564744f850a43032)
2026-11-08 15:49:09 -08:00
Anees Iqbal 58cbae312d blocks_ahead: count the buffers' pool's own growth, not every pool's blocks
On lavapipe the first pooled block made after the device's first creation was another pool's, so
the growth the test took for the buffers' pool's first, made in place, was not, and that one fell
in the counted run (1 in place, 5 ahead: 9999). Both tests now wait for the buffers' pool itself to
grow (WorkCounts::buffer_blocks_made_ahead plus _in_place) and count its blocks alone.

(cherry picked from commit e38d8111c044cf03279fb4d3cac31eddafec152e)
2026-11-08 15:49:09 -08:00
Anees Iqbal f87a247fee blocks_ahead: a call's wait for a making cuts its wait for quiet short, counted and held
A creation call that needs the block a making still waits for quiet over already asks it to go at
once (Waiter::wait), so the call waits for the allocation alone, never for the program's own
submissions to pause. This counts it (WorkCounts::blocks_ahead_hurried: of the blocks a call waited
for, those whose wait for a burst's end the call cut short) and adds the device test that holds it:
beside three threads that keep the device's queues in use with no pause of 1 ms, the creation call
that needs the block made ahead returns within the 50 ms quiet bound, its making hurried. Without
the cut (the control drops Waiter::wait's ask) the call waits out the bound and the test fails.

The block bench prints the hurried count beside the made-ahead and in-place ones.

(cherry picked from commit c94d815321468379313bcd7eeabf1bc4ceb0f3b0)
2026-11-08 15:49:09 -08:00
Anees Iqbal e1d9d034b3 Pooled blocks made ahead for every pool the encodings place in, each right after a burst of submissions
On a Radeon 780M (RADV, kernel 7.3.1) a guest's scroll made its pooled blocks of 64 MiB inline on
the naming's own thread (memory::keep_room and memory::place), and every vkQueueSubmit beside one
waited: a kernel trace of tests::memory_block_bench put the block's page allocation (ttm_pool_alloc
under amdgpu_gem_create_ioctl) at 10.2 ms median, 31 ms at most, under the reservation of the
process's GPU address space, which amdgpu_cs_ioctl takes in amdgpu_vm_lock_pd (waits up to 29.4
ms). So making a block on another thread alone does not keep a submission from waiting.

What changes:
- memory/ready.rs generalizes from the host copies' pool to every pool keep_room keeps room in:
  one making a pool at most, on its own thread. A making waits for a burst of the device's queue
  uses to end (device/queue_quiet.rs: none under way for 1 ms after one ended), at most 50 ms,
  and begins at once on a device idle for that long.
- keep_room starts a making for a kept pool that grew (a second or later pooled block added within
  KEPT_EMPTY_FOR) and lacks room for a whole block, so steady growth finds a block made. A pool
  without room for half a block takes its block made ahead, or waits for its making (asked to stop
  waiting for a burst's end) rather than make a second; place does the same for a pooled placement.
  The host copies' making is still never waited for. The made-and-freed-at-once path is gone.
- A block made ahead counts against its heap's kept budget while it waits, and goes once its pool
  stopped growing for KEPT_EMPTY_FOR with room for half a block.
- device/queue_quiet.rs: every hold of a queue's lock (SlotHold) and every staging submission
  counts as a queue use.
- WorkCounts: buffer_blocks_made_ahead / _in_place, image_blocks_made_ahead / _in_place,
  blocks_ahead_waited_for, blocks_ahead_past_quiet_wait, blocks_ahead_unused.

The block size stays 64 MiB: in tests::memory_make_hold_bench on the 780M a plain allocation of
16, 32 or 64 MiB, and a 29.7 MB one plain or dedicated, each took 0.05-0.15 ms at the median (p99
at most 1.4 ms), so no size shortened a hold there. No docs/FAST-PATHS.md row: this trades no
accuracy for speed.

Tests: tests::blocks_ahead (a growing pool's new blocks are made ahead and none in place) and
tests::queue_quiet (the wait's four ends).
(cherry picked from commit 7c36dab10663a5c2c4ffd9f09473496d9fd843a0)
2026-11-08 15:49:09 -08:00
Anees Iqbal 0c8cf34325 memory_make_hold_bench: what one allocation of a block's size holds of the device's submissions, by size and dedicated
(cherry picked from commit 37f2ba7038e86cccdefc05fb99110f5fccaaf00a)
2026-11-08 15:49:09 -08:00
Anees Iqbal f3f89bc412 memory_block_bench: each round's makes, frees by cause and the empty blocks left
(cherry picked from commit 178d1ad4c66b951359d72967e49ecbc33ffbab67)
2026-11-08 15:49:09 -08:00
Anees Iqbal 9771825bc1 memory_block_bench: pooled blocks made and freed beside a compositor and a pinger, as a guest's scroll makes them
Two threads make Private buffers of 7,471,104 bytes and 1024 x 1024
RGBA8Unorm textures, one every 8 ms, keep 240 each, then let them all go,
twice. Meanwhile a compositor commits a 64 MiB fill every 16.7 ms and a pinger
commits a one-word fill every millisecond, each on its own queue. The bench
prints the makings' spread, the pings' and frames' commit to completion, and
the pooled blocks made, freed and most live at once. It is the before and
after measure for making blocks off the creation call's thread and away from
submissions (a consumer's scroll on a Radeon 780M made blocks inline that
took 5-60 ms and held concurrent submissions).

(cherry picked from commit 9deb53889b21aaabb1df859ca7e7f9b9cc4d123b)
2026-11-08 15:49:09 -08:00
Anees Iqbal f2625edc0d RUNTIME_VERSION 1926: heap depth textures keep a CPU write made after their copy in, and their copy in clamps where the device clamps
air11 (f6fabc432f..9cc8e169b3): a tiled heap depth's keep copies its staging buffer, never the
heap's bytes at keep time, so a CPU write between the copy in and the keep is no longer undone by
the merge. The tiled copy-in kernel clamps 32-bit float depth into [0, 1] where the device clamps
(no VK_EXT_depth_range_unrestricted, no DepthImageKeepsValuesOutsideUnitRange), so the copy no
longer breaks VUID-vkCmdCopyBufferToImage-pRegions-07931; the restricted-depth-upload notice says so.
Verified: Iris (m3-max-10007) heap lanes 29/29, the two new lanes (0 VUID-07931 under GPU-assisted
validation); negative control 9971 fails both (old depth kept; 6 VUID-07931); gem10 (10005) lavapipe
29/29, unit 53/53, rustdoc, clippy x3.
2026-11-08 15:42:08 -08:00
Anees Iqbal e4647a159c Heap depth range lane: a -0.0 reads as the device stores it, with its sign or without
Iris 9990 at cb88cd74f1's tree passed the copy-in check (0 VUID-07931
reported, only the GPU-assisted check's two settings warnings) but read
each -0.0 texel back as 0.0: ANV's depth image keeps no zero's sign. The
copy in hands -0.0 over unchanged (it is inside [0, 1]); what the image
then stores is the device's own answer, so the lane takes either zero
there and still compares every other texel bit for bit.

Verified: the other 28 lanes of heap_textures, heap_layouts and
heap_device_samples passed on Iris in 9990; this lane is rerun on Iris.

(cherry picked from commit 9cc8e169b39a8fb1428a605ab28ec3efd20fed2f)
2026-11-08 15:41:20 -08:00
Anees Iqbal 85a404deff Heap depth lanes: place the CPU's write by the spin's cap too, and pass the GPU-assisted check's settings warnings by their IDs
On ANV (job 9969) the spin saw no release and ended at its 250 ms cap,
19.4 ms after the GPU began the command buffer and the CPU wrote, so the
write is placed between the copy in and the keep by the cap as well. The
depth range lane failed on the layer's WARNING-Setting-Limit-Adjusted
warning, which GPU-AV's lowered descriptor limit raises: it and
VALIDATION-SETTINGS now pass by their IDs, every other message fails.

(cherry picked from commit cb88cd74f1fa16e3ce691d249cc7543c3eaa26ca)
2026-11-08 15:41:20 -08:00
Anees Iqbal b42727f5de Heap depth lanes: check texel places in the heap's bytes only where Metal's tiles hold them
On lavapipe the Shared heap's Depth32Float texture lies in place in its
driver's layout (job 9923: tiled false), so the bytes at Metal's tile
places are not its texels there: a_heap_depth_texture_keeps_a_cpu_write_made_after_its_copy_in
failed reading the blit's texel there. Both new lanes now check texel
places in the heap's bytes, and the depth range lane its read values,
where the texture is a shadow of Metal's tiles; the CPU's bytes and the
blit's texel, read back by a blit, are checked everywhere.

(cherry picked from commit 7d376d19111cd372f2ea1bdf5ff0d9878a3da4e5)
2026-11-08 15:41:19 -08:00
Anees Iqbal 7daaf41da1 a_heap_depth_texture_keeps_a_cpu_write_made_after_its_copy_in: count the merge, and place the write by the GPU's start
A tiled shadow's keep moves no texels WorkCounts::shadow_texels_kept counts
(ShadowCopies::texels is 0 for a tiled target), so the lane failed on Iris
(job 9935) with a merge that ran: it counts shadow_merge_dispatches_planned
now. ANV showed the host no ticket within 200 ms, so the write's place
between the copy in and the keep is also read off the command buffer's GPU
start time, 2 ms before the write, and the line prints each part.

(cherry picked from commit b0b8ac959dbe57c7f06ddb6a46e4ad375e4b4630)
2026-11-08 15:41:19 -08:00
Anees Iqbal ee3f269fa3 Heap depth textures: the copy in clamps a 32-bit float depth into [0, 1] where the device takes no other
A heap's 32-bit float depth texture whose shadow copies the heap's bytes
into its image went through vkCmdCopyBufferToImage with whatever float the
bytes held. On a device without VK_EXT_depth_range_unrestricted that is
invalid usage for a value outside [0, 1]
(VUID-vkCmdCopyBufferToImage-pRegions-07931); ANV stored it clamped, and
the runtime only announced it (restricted-depth-upload).

The tiled texel kernel (metal2vulkan::bind) now clamps a level's elements
on the way into the tight buffer where the level says so:
- TiledLevelMove::clamps_depth, set with TiledLevelMove::clamping_depth;
- the shape's level record grows to 14 words;
- the clamp compares the word's bits, so no denormal is flushed: a
  negative value becomes 0.0, one above 1.0 (and +inf) becomes 1.0, a NaN
  of either sign becomes 1.0 (as nan_clear.rs clears a NaN depth), and
  -0.0 and every value inside [0, 1] keep their bits;
- the move back is unchanged.
HeapTiledCopies::new takes the image's format and marks the 4-byte depth
planes' levels of a D32_SFLOAT or D32_SFLOAT_S8_UINT image where
ImageFacts::depth_clamps holds: exactly where restricted-depth-upload is
announced. MoltenVK, whose driver is measured to keep such values
(DriverFact::DepthImageKeepsValuesOutsideUnitRange), keeps its copies as
they were. The clamp is the device's own answer, so the notice stays and
its text now says the copy in clamps.

Tests:
- bind::tiled_texels::tests::clamped_depths_move_into_the_image_inside_0_1,
  run through the CPU interpreter;
- lane heap_textures::a_heap_depth_texture_s_copy_in_takes_no_depth_outside_0_1,
  which turns on the layer's GPU-assisted buffer-copy check
  (gpuav_buffer_copies), asserts no VUID-07931 message, and checks a blit
  reads the clamped values where the device clamps, else the bytes as
  they are.

Docs:
- the restricted-depth-upload declaration, docs/API.md's catalogue and its
  docs/FAST-PATHS.md device-gap row say the copy in clamps;
- docs/FAST-PATHS.md's known gaps gain one entry: a heap texture Metal
  keeps uncompressed lies in its driver's layout where its image fits
  Metal's answer (heap-texture-untiled-layout);
- api_signatures.tsv is blessed for the two new public items.

Verification in the tip report.

(cherry picked from commit de683c02ce08d337e8281dd752c2519f863bbe39)
2026-11-08 15:41:19 -08:00
Anees Iqbal 5ccbde1b01 a_heap_depth_texture_keeps_a_cpu_write_made_after_its_copy_in: print, not assert, whether the write fell between
A device that shows a running kernel no host store (the M3 Max, per
first_use::Busy) runs the spin to its cap, and one that shows the host no
store of a running kernel never shows the ticket: the writes are kept
there all the same, so the lane asserts them and prints whether the CPU's
write fell between the copy in and the keep.

(cherry picked from commit 136285e42917c899e6e9337c8306c7adca3ce934)
2026-11-08 15:41:19 -08:00
Anees Iqbal 92f88a37a2 Heap depth textures: a merge's keep copies the staging buffer, never the heap's bytes as it runs
A keep of a heap's tiled texture with a depth aspect that did not directly
follow its copy in copied the heap's bytes as the keep ran. A CPU write
made while the command buffer ran, after the copy in read the bytes and
before the keep, was then in the keep but not in the image, so the merge
saw the image's value as changed and wrote it over the CPU's write. Metal
keeps such a write of bytes no command touches.

Every copy of such a shadow fills its staging buffer whole
(HeapTiledCopies::record and record_out), and no command writes through
the texture between the shadow's last copy and a keep. So the staging
buffer holds the heap's bytes as the image stands for them: the bytes the
copy in read, or the image's elements as the last copy back or merge
wrote them into the heap. ShadowCopies::record_kept now copies it, after a
barrier from everything before, as the keep right after a copy in already
did. The values the copy in changed (restricted-depth-upload,
drawn-depth-copy) are still written back as stored, and every byte a
command wrote is still merged.

New lane heap_textures::a_heap_depth_texture_keeps_a_cpu_write_made_after_its_copy_in:
- a Shared placement heap's 37x5 Depth32Float texture;
- one command buffer: a blit reads a texel (the copy in), then a Busy spin
  ordered after it, then a blit encoder whose first copy reads the spin's
  published word and whose second writes texel (3, 1), so its keep runs
  after the spin;
- the CPU writes texel (3, 0) where Metal's tiles place it once the spin
  raised its ticket, then releases the spin;
- it checks the CPU's write and the blit's write both survive, and the
  other texels are unchanged;
- where the texture is a tiled shadow, it checks that a keep was counted
  and that it was not a keep right after its copy in.
first_use::Busy gains spin_in, one spin encoded among a command buffer's
other work.

Verification in the tip report.

(cherry picked from commit f6fabc432fcee43bf29f077a44d72120dde8d352)
2026-11-08 15:41:19 -08:00
Anees Iqbal db0b9a6c81 RUNTIME_VERSION 1925: a draw whose only reason not to be kept was its shadows is kept
68955761d2, 6ad8d65e2e (perdraw): where the instance's shadow gathering already covers a draw's
shadow uses (an equal use joins idempotently), the draw is kept, recording its uses with their read
bounds; drawing again or rebound goes on only where the uses compare equal. In the 780M glass walk
at 97260b4c71, 104,092 of 127,346 unkept draws named their shadows (35k-52.6k by that reason alone).
Verified on lavapipe (m3-max-9902): clippy x3, rustdoc, runtime 1942/1942, the new lane
tests::kept_shadowed_draws (same planned copies and pixels kept and apart); two negative controls
fail (9953 keep condition, 9974 shadow-use comparison).
2026-11-08 15:27:18 -08:00
Anees Iqbal d9da03befc Kept shadowed draws: a lane of draws that read their pass's copies, kept and apart; the docs say what a kept draw may use
tests::kept_shadowed_draws: one pass over two private BGRA8Unorm targets draws tob_read over
rectangles reading the first target's copy (the pass's first draw, a draw kept, a draw again), a
draw rebound (vertex bytes bound again, its shadow the kept draw's), a draw of the second
target's copy (another shadow: it takes every step), a draw through a scissor (its read's bounds
another where the device bounds own-pixel reads: it takes every step) and draws again. The same
frame runs again with setTessellationFactorScale: before each draw but the first, which keeps no
draw. Both frames must answer Metal's reds, with the same shadow copies, texels copied in, reads
through copies and at own pixels, splits and inline passes; the kept frame's draws keep all but
the pass's first (by its instance alone: draws_unkept_shadowed 0), with its draws again, rebound
and stopped counted as the build's checks leave them.

The docs: WorkCounts::draws_unkept_shadowed, draws_as_before and draws_rebound, and the
draw-again and rebound module docs, name what a kept draw may use now.

Verification: to follow.
(cherry picked from commit 6ad8d65e2effad074f67868ed0d62f3a050e0b55)
2026-11-08 15:26:34 -08:00
Anees Iqbal c1f3a3c1e8 Keep a draw whose shadowed textures its instance gathered: draws again and rebound use the same
A render encoder's draw that used a shadowed texture kept nothing to draw again, so every draw
of a pass that samples its own target through its copy took every step: in the 780M glass walk
(w1916) 104,092 of 127,346 unkept draws named a shadow among their reasons, and 12,637 of
225,984 draws were rebound.

The shadowed textures a draw uses are copied around its instance, which gathered them as the
draw took every step (render/shadows.rs), and shadow::join of an equal use changes nothing. So a
draw that uses the same shadowed textures, each as it used it, into the same instance gathers
nothing new. Such a draw is now kept:

- A draw again uses the kept draw's bindings, so its shadows. It counts the kept draw's reads
  through copies (attachment_reads_through_copies, own_pixel_reads), which move from the device's
  shared counters to the encoder's tally, as a draw again counts nothing others share.
- A draw rebound works out its shadows as every step does (RenderLowering::draw_shadows, now
  shared by both), binding a texture of the pass's attachments through its copy
  (Tables::with_attachments), and goes on only where they are the kept draw's, each the same
  shadow used as it was (ShadowUse::used_as: writes, the bounds of writes and reads), else it
  takes every step. A draw moved whose kept draw used no shadow still looks at none.
- A draw that reads a color its pass clears behind its load actions keeps nothing: its copy's
  clear or its split is its own. draws_unkept_shadowed now counts those, snapshots and
  extended-range shadows.

Verification: to follow (clippy, the runtime suite on lavapipe, a lane of kept shadowed draws).
(cherry picked from commit 68955761d2d9e3baa9a865856b82194be9809844)
2026-11-08 15:26:34 -08:00
Anees Iqbal f7034c072f RUNTIME_VERSION 1924: an exported buffer's announced external write lets go of its shadows' standings
542237e45f, 950bd7da18 (perdraw): external_write_done only queued an acquire barrier, and a shadow
over an exported Private buffer kept standing across command buffers, so a texture over a decoder's
cache kept showing its first picture (reims, the 5080: 23.5-31.5 distinct frames/s of 60 presents,
run 9908 at pin 24). The call now counts a write against every standing on the buffer's key, so the
next command buffer's first copy in moves what the other API wrote (fd and dma-buf exports alike).
Without the call a write has no claim on a standing, as the docs already said. Verified on ms01
lavapipe: clippy x3, rustdoc, runtime suite 1944/1944 (m3-max-9938); the R8 padded-row lane, three
writes through a second device's import (9992); its negative control fails with the stale shape (9993).
2026-11-08 15:25:13 -08:00
Anees Iqbal 1d18ff7ef1 Exported standing lane: the plane reims' repro reads, R8Unorm with padded rows, three writes
The lane now mirrors the consumer's repro of the stale frames: an exportable
Private buffer written through its import three times (0x11, 0x22, 0x33),
each write followed by external_write_done, read after each through a
padded-row R8Unorm texture (a shadow: bytes between rows over the device's
own memory). The BGRA8 plane's constants stay private to
shadow_standing_device.

Verified: built and run as potluck jobs (see the tip's message to main).
(cherry picked from commit 950bd7da1805d586cec8874c773af99e8cf28eb6)
2026-11-08 15:24:26 -08:00
Anees Iqbal ddb5440aad An exported buffer's announced external write lets go of its shadows' standings
A texture over an exportable Private buffer whose rows no image holds (a decoder's pitch) reads it
through a shadow, and a shadow over a tracked Private buffer the runtime made stands across
command buffers (shadow_standing.rs): a later command buffer's first copy in moves nothing while
no batch wrote the buffer or the image. Another API's writes through an import of the buffer's
memory are no batch's, and Buffer::external_write_done only noted the acquire, so once such a
texture had copied in, every later external write was missed: each of reims' NVDEC pool
surfaces on the 5080 kept showing its first picture.

external_write_done now counts a write of the buffer's key against every standing recorded on
it (Standings::written_apart, LetGo::TruthWritten), so the next command buffer's first copy in of
each shadow over the bytes moves what the other API wrote. Standings stay otherwise: the
contract already says the device reads another API's writes only once the caller announces them
("What the other API writes there is the device's to read once the caller says so", "Call it
once after each of the other API's writes"), so a write made without the call keeps no new claim
on a standing, and an exported buffer's shadows keep standing between announced writes (one
copy in per write, not one per command buffer). The runtime README, HOWTO and the module docs say
what the call does for a texture's shadow.

tests::exported_memory::a_shadow_over_an_exported_buffer_reads_each_announced_write: a second
VkDevice fills the buffer through an import of its opaque descriptor (released to
VK_QUEUE_FAMILY_EXTERNAL), three values in turn, each followed by external_write_done and two
reads of a padded-row texture through a kernel: the first must read the write and copy in, the
second must read it again with the image standing.

Verification: to follow (clippy x3, the lane and the standing tests on lavapipe and the 780M, a
negative control without the let-go).

(cherry picked from commit 542237e45fe706a39d5cd9e39f861f792c4c2996)
2026-11-08 15:24:26 -08:00
Anees Iqbal 62e58da228 RUNTIME_VERSION 1923: copies over RAM the device refuses always stage through the CPU
590a07faf1 (radvruns): where the RAM has no source, a range is shared memory and the device
refuses shared host pointers, every chunk's copies stage through the CPU and import_ahead faults
none in (WorkCounts::host_ram_chunks_faulted_ahead). Before, a gather after the thread's import
was refused went to the import path and was refused, so the same call succeeded or failed by
timing. Verified on gem10 (m3-max-9826): clippy x3, unit 16/16, RAM suites 63/63 on the 780M
(0 chunks faulted ahead) and lavapipe; three negative controls fail on the 780M.
2026-11-08 14:49:16 -08:00
Anees Iqbal 0cadcbae8c Copies over RAM the device refuses always stage through the CPU; its chunks are not faulted in
On a device that refuses pointers to shared memory (RADV) and a RAM of shared
memory with no dma-buf source, a gather was staged through the CPU while the
device's thread had not yet tried the chunk. Once the thread's import was
refused (`tried`), the same gather went to CopyTake::Waits, imported the chunk
itself and was refused as Unsupported(HostMemory). So a copy Metal takes
succeeded or failed depending on when it came. The first-fill bench's steady
fills failed so on a Radeon 780M. A gather after a staged scatter into the
chunk was refused the same way: the scatter set `scattered`, so written_over
kept the gather off the CPU's path. And the thread faulted each 64 MiB chunk
in before an import the device refuses whatever the pages hold.

Now the plan records the refusal (Plan::shared_refused: no source, a range of
shared memory, and the device answers imports_shared_host_pointers false,
asked once at the use). Each chunk of shared memory under it is
ChunkSlot::refused, known from the use on. copy_take answers ThroughCpu for a
refused chunk whether or not the thread ran or tried it. written_over ignores
a copy's write into a refused chunk, which only a staged scatter's CPU drain
makes, in a host step before any later copy's. import_ahead faults no refused
chunk in (it still tries the import, which is refused at once). Chunks it does
fault in are counted: WorkCounts::host_ram_chunks_faulted_ahead.

Tests:
- copies_over_shared_ram_move_their_bytes_after_the_thread_reached_its_chunk:
  gather, scatter, gather over a shared memfd RAM after the thread reached its
  chunk. On a refusing device all three stage and move the right bytes.
- the_ahead_thread_faults_in_only_chunks_the_device_may_import: 0 chunks
  faulted in where the device refuses, and at least the chunks imported ahead
  where it imports (Linux).

(cherry picked from commit 590a07faf1468b162333f479a0f857aa71a353a3)
2026-11-08 14:48:32 -08:00
Anees Iqbal b0ff4a440e resource_ids: a refit 2x2 heap texture lies in Metal's tiles and announces no layout notice
Since the refit keeps a texture Metal leaves uncompressed only in a linear
image whose every element lies where Metal's tiles place it, the heap's
bytes are Metal's layout and heap-texture-untiled-layout is not announced.
heap_texture_kinds still expected it for every refit, so on Iris (ANV) the
two resource_ids tests whose 2x2 RGBA32Uint texture refits into a linear
image failed with 'not announced: [HeapTextureUntiledLayout]' (job 9720).
The helper now expects the route alone and asserts the texture is one Metal
keeps uncompressed (shorter side under 16).

(cherry picked from commit 9cbabe0e300fc544fe9a19b15a7f6cab923c5009)
2026-11-08 14:36:39 -08:00
Anees Iqbal d63c119a7b RUNTIME_VERSION 1922: snapshot splits counted per draw by reason
perdraw (f34a3e868f, 7f40335f15, 301bc5a7fb): a SplitReason for each reading draw that splits its
pass, counted in WorkCounts::reading_draws_split_*, among them unreadable_own_pixel (a function
whose own-pixel read reaches a branch, a sample, a derivative or a store, which no snapshot
serves). learned_coverage expects each reason from the device's facts. Verified on lavapipe
(m3-max-9821 at 7f40335f15: clippy x3, rustdoc, api_signatures, runtime 1937/1939 with the two
lane expectations fixed in 301bc5a7fb; 9839 re-checks the lane).
2026-11-08 14:35:21 -08:00
Anees Iqbal d6e39ef4d9 Split reasons lane: a device that fetches through input attachments splits by the pass's shape
On lavapipe the device has the color write masks but fetches through input attachments
(rasterizationOrderColorAttachmentAccess), so its reader splits by the pass's shape
(SplitReason::PassShape), and inside an app's visibility query by the query, which is checked
first. The lane expected the device's lack for every device without the snapshot path (job 9821:
[0, 0, 0, 1] and [0, 0, 1, 0] against [1, 0, 0, 0]). It now counts the pass's shape apart and
expects each reason from the device's facts: no masks, the device's lack; masks and fetch through
inputs, the pass's shape; inside a query, the query where the device has the masks.

Verification: the split-reasons checks on um790 lavapipe (to follow).
(cherry picked from commit 301bc5a7fbd6147e4e082a7f4e1c94a43c70dc51)
2026-11-08 14:34:40 -08:00
Anees Iqbal 2a48bfb540 Split reasons: the snapshot's split counts read through a closure of their own name
The counts' snapshot already reads the instance splits through a closure
named split; the reasons' closure of the same name shadowed it. Found by
m3-max-9789's clippy (18 mismatched types).

(cherry picked from commit 7f40335f15607c2ff759a3610044e9e3a66eb8a9)
2026-11-08 14:34:40 -08:00
Anees Iqbal 8062707d94 Snapshot splits counted by reason, a function whose own-pixel read no snapshot serves among them
A draw that reads its pass's texture after a barrier and takes the split
said why only once per device (METAL2VULKAN_LOG_PIPELINES), so a walk could
not size a reason: 9743's glass segment split 23,337 readers, yet the area
rule's own histogram weighed about 300 splits in the whole boot, and its
only logged reasons (area, coverage) were met at bring-up. The rest split
silently: the function reads the texture at its own pixels, but in a way
no snapshot serves (StageModule::snapshot_textures excludes the slot).

The reasons are now a SplitReason, each split counted by draw in
WorkCounts::reading_draws_split_{unreadable_own_pixel, not_in_place,
device_lacks, visibility_query, pass_shape, other_format, stand_in,
one_image, coverage, area, variant_refused, slot_left_out, views,
storage_binding, other_attachment}, and the log line unchanged but for one:
a draw whose own-pixel read no snapshot serves now says so too. On a device
without the snapshot path, whose images take no feedback loop usage, the
reason is the device's, not the texture's.

learned_coverage asserts each pass's split by its reason: the device's lack
where the device has no path, the coverage rule's where the count chose
the split, the app's visibility query inside one.
Verified: cargo fmt and the api-signatures bless only so far; the checks
run as a potluck job.

(cherry picked from commit f34a3e868fc36c2951aa82ee7f8768b246c6b7dd)
2026-11-08 14:34:40 -08:00
Anees Iqbal f243b6fa19 RUNTIME_VERSION 1921: dispatches and passes stop rebuilding storage per call; host_ab percall's gate green on the M3
nvreds: 3ed927ecda (a live dispatch refills its uses' storage; group counts only where a
predication unit gates dispatches), c5daefe594 (pass_targets visits attachments in place),
fba5723eb6 (HELD dispatch 8.2 -> 6.2). The HELD gate had drifted red on the M3 (dispatch 10.16,
end_render 25). At the tip on the M3 (m3-max-9815): gate exit 0, dispatch 6.133, end_render 24.000.
Linux clippy x3 + rustdoc (9822), lavapipe 326/326 touched modules (9832).
2026-11-08 14:32:30 -08:00
Anees Iqbal 21fa95cbdd host_ab percall: hold a dispatch to 6.2 allocations, what it makes now
With a dispatch's uses made over the last dispatch's storage and its group counts listed only
inside a predication unit, the gate's dispatch group makes 6.13 heap allocations a call on the M3
Max (MoltenVK) where the row held 8.2 (8.13 measured at the 11-03 re-bless, 10.16 at
a1ca5c673f). The row moves to 6.2, so the two allocations cut stay cut.

(cherry picked from commit fba5723eb6360658aecf6667516430d588641176)
2026-11-08 14:31:47 -08:00
Anees Iqbal 96e8748031 A pass lists its attachments for the fresh-texture log in no storage of its own
host_ab percall's gate holds a render encoder's end_encoding to 24 heap allocations a call. On
the M3 Max at 66edf02a20 it makes 25, so the gate stops there: an allocation-site trace of the
gate's own counted window (a scratch tracing copy of host_ab, never committed) finds the 25th
in FreshUnwritten::cleared. Where any texture the fresh-pattern record notes is live
(fresh.any()), a pass's begin (Load) and end (Clear) built a Vec of its attachments
(pass_targets) before asking whether one is noted, so every pass of a program holding one such
texture allocated at its start and its end, against the module's Cheap rule.

pass_targets now hands each attachment to the caller's closure, the depth-stencil textures from
an array of two, in the same order as before, so begin_pass and cleared log the same events.

(cherry picked from commit c5daefe594ad5daecbc5e203a5cb04f7234d8fe2)
2026-11-08 14:31:46 -08:00
Anees Iqbal 45d69aff80 Dispatches keep their uses' storage and list no group counts outside predication
host_ab percall's gate holds a dispatch to 8.2 heap allocations a call (8.13 measured on the
M3 at the 11-03 re-bless). At a1ca5c673f a scratch allocation-site probe of the gate's
dispatch group (256 dispatch_threadgroups of tiny_kernel, nothing changed between them) counts
10 a call in steady state on the M3 Max (MoltenVK) and on gem10's RX 7900 XTX (RADV) alike, so
the gate fails on its own venue: the same ten sites in compute::record on both.

Two of them rebuilt per call what nothing needed rebuilt:

- binding::command_uses made each dispatch's uses in a CommandUses of its own (its uses, the
  sources added on 11-03 for patching a draw's buffer uses, and the plan's other uses: 3
  allocations), where a draw makes them over the last draw's storage, keeping those of what the
  encoder made resident (command_uses_into, LiveBind::uses). An encoder's own dispatch now
  does the same over LiveDispatch::uses; an indirect command's state still makes them whole.
- record listed every region's group count for predication.gates, which answers none outside
  a unit that gates dispatches: the counts are listed only where
  Predication::gates_dispatches says the unit gates them.

The uses a dispatch records, its gates and its commands are unchanged: command_uses_into is
the draws' path, whose builds with debug assertions check the kept uses against those made whole
at every command.

(cherry picked from commit 3ed927ecda1e395550b54db0c3b237827e45d3eb)
2026-11-08 14:31:46 -08:00
Anees Iqbal b3278c19c1 RUNTIME_VERSION 1920: an attached read's first copy in moves only what the command reads where the command writes the shadow's truth apart
d0177e126e (perdraw): ShadowSync::before copied every texel of a may-stand shadow's first use in
a command buffer, though a pass that renders the bytes in place (or writes them through another
shadow) leaves the image stale at the end, so it never stands. That copy is now cut to the
readers' own-pixel area. 780M walk at 97260b4c71 (rvg boot 9743): glass's never-stood first copies
of the 3648x2038 surface were 26.2 G texels (3,524 whole copies); expected glass first_copied_in
36.2 G -> about 15.3 G (bounds 10.0-36.2 G). Verified on lavapipe (m3-max-9787): runtime suite
1939/1939, tests::attached_read_standing (negative control: 1024 texels with the old term), the 14
pass-start-barrier conformance rows replay and cost --check exit 0.
2026-11-08 14:18:49 -08:00