Commit Graph
5485 Commits
Author SHA1 Message Date
Anees Iqbal 12fa641450 Tests: a surface plane over declared padding follows its placement answer where the driver refuses the pitch
What: tests::padding_unobserved's surface plane leg asks
Buffer::texture_placement_with_iosurface_plane before making each texture. A
declared plane is the DRM_FORMAT_MOD_LINEAR image at the pitch exactly where the
query answers NotHostPages; elsewhere it must be a shadow the device refused
(Shadow(Refused(_))), never one of the check's verdicts. Undeclared, a shadow as
before. The answer is printed.

Why: the leg skipped only devices that make no modifier images, so it assumed
every other driver takes a DRM_FORMAT_MOD_LINEAR plane with rows 416 bytes
apart. RADV refuses it: on the XTX and the 780M (pin 82 legs at 86ecc71b54) the
notice reads "the driver refuses a DRM_FORMAT_MOD_LINEAR image for the
runtime's own memory with rows 416 bytes apart
(ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT)", and its own linear image
lays the rows 512 apart, so the texture is a shadow, the device's honest
answer, and the leg failed (false, 0) against (true, 1).

Verified: XTX, 780M and lavapipe runs of the leg (jobs in the lane's report).
2026-11-13 21:29:42 -08:00
Anees Iqbal 9ebd6abe52 Tests: a texture that renders over padded Private rows is a shadow only where no check of renders passed
What: tests::merge_scratch's two_ways_merges_take_few_scratches runs on the
shadow policy's device (blit_holds::shadow_device), so its texture over a
Private buffer of padded rows is a shadow, the test's subject, on every device.
runtime_lane::in_place_textures' pooled_pitched_costs expects its undeclared
caches to be shadows exactly where Buffer::texture_placement answers Shadow,
and prints that count. Its edit (rendered_descriptor, the answer per cache)
went into 3677205866 with the rest of that file; the previous commit's
message wrongly says it is in this one. merge_scratch's module doc says the
padded Private target is in place where the check of renders passed.

Why: both still assumed such a texture is a shadow "on every device". Since
ed8b9a137b, linear_plan::holding's renders_kept puts it in place where the
device's policy takes images in place and its check of renders over its pooled
memory passed (Device::ordered_renders_kept, Between::Kept), as on the XTX: pin
82's legs (86ecc71b54) failed "the texture is a shadow" and "undeclared:
shadows" there alone; the 780M passed both.

Verified: XTX, 780M and lavapipe runs of both tests (jobs in the lane's
report).
2026-11-13 21:29:42 -08:00
Anees Iqbal 4df1dd5575 Tests: an attached read with no barrier follows the device's snapshot path
What: tests::pass_end_tiles' read over host pages expects a read through a
snapshot (WorkCounts::reading_draws_snapshotted) where
shadow_standing_device::reads_through_snapshots (now pub(super)) says the device
reads the texture so, else through the copy, as before. runtime_lane::
in_place_textures' attached-move test counts each pass's read through a copy
or a snapshot (exactly one) and checks the pages by the path counted: through
a copy every texel is the CPU's red; through a snapshot the fill's block holds
the fill's DRAWN_RED and the rest the CPU's. It is in the validation crate,
which sees the public counts alone. Only the pooled_pitched_costs edit
(rendered_descriptor) is the next commit's.

Why: on the XTX and the 780M (pin 82 legs at 86ecc71b54), a draw reading its
own attachment over a buffer's bytes takes the snapshot at any area
(render/snapshot.rs, over_bytes), so no copy moves (read_copies 0, and "0
reads through copies"). With no barrier, the snapshot reader reads what the
draws before it wrote: the accepted difference render/snapshot.rs states (an
AMD Radeon Pro 5300M and an Intel UHD Graphics 630 read so, probe ownread.m,
where an M3 Max reads the texels from before the pass), so the fill's block
was 128, not the paint ("the pages are not all red"). The tests took their
expectations from the copy path alone. Same class as 4d95375fe2.

Verified: XTX, 780M and lavapipe runs of both tests (jobs in the lane's
report).
2026-11-13 21:29:42 -08:00
Anees Iqbal 9ee2fd6bd2 Tests: separate depth and stencil's unstored pass clears to zero, so a clear is told from a released stencil
What: tests::unwritten_parts' separate depth and stencil leg gave both of its
passes the stencil clear value MARK (0xA5), the DontCare/DontCare pass too.
That pass now clears to 0 where its load is not Clear, and the leg runs on a
device of each UnstoredDontCarePolicy (Driver, then Cleared).

Why: with the clear value equal to the mark, the test could not tell a
released texture's stencil from Metal's clear. A device that clears an unstored
DontCare load (clear_reach::UnstoredLoads::Cleared: UnstoredDontCarePolicy::
Cleared, or DriverFact::UnstoredClearNoSlower, the Radeon 780M's) loads the
scratch image's stencil as its Clear to the attachment's clear value, Metal's
answer, which was MARK: every pixel passed the Equal test and the leg reported
"the released texture's mark" on the 780M (pin 82 legs at 86ecc71b54). No
released byte was read. Running both policies takes the Cleared form on every
device, lavapipe and the XTX included, where the default takes the zero start
(7b77851a95).

Verified: the Cleared leg with the old clear value fails on lavapipe and passes
with 0; lavapipe, XTX and 780M runs of the leg (jobs in the lane's report).
2026-11-13 21:29:42 -08:00
Anees Iqbal 10aa5209f1 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 21:06:19 -08:00
Anees Iqbal 7a691f6a52 SEMANTICS_VERSION 2107: a kernel's static threadgroup memory length is reported rounded up to 16 bytes, as Metal reports it
ComputePipelineState::static_threadgroup_memory_length answered the plain sum of a kernel's
static threadgroup variables (with typed threadgroup objects or the arena, no [[threadgroup(n)]]
regions). Metal rounds it up to a multiple of 16 bytes, its threadgroup memory's granularity:
`threadgroup uint a[256]; threadgroup uint b;` answers 1040 on the M3 Max (macOS 27.0.1), where
the runtime answered 1028 (reims's measurement; their compute-state test pins the difference).
The length a kernel with regions reports was already the 16-byte-aligned offset of the first
region. Only the reported answer changes: the planner counts the kernel's own bytes in each
dispatch's total as before.

Test: engine_simd_emulated::the_static_length_is_rounded_up_to_16_bytes_as_metal_reports_it (an
arena of 257 words answers 1040).

Verified (msi, m3-max-28025): the metal2vulkan suite passes; with the fix reverse-applied the new
test fails.
2026-11-13 21:05:39 -08:00
Anees Iqbal 1eaeb7079a Re-bless the authored compile census at 94a0dbaf85
The census at the pin-83 tip (m3-max-27988) covered 2369 cases over 21 profiles: 48670 compiled,
1079 refused, 0 failed, 0 differences, 0 regressions. 88 cells' artifact hashes moved with
SEMANTICS 2106 (the replay plan's inherited buffers and CommandWrites kinds); each is still
compiled. Slowest compile 1.9 s.
2026-11-13 20:59:52 -08:00
Anees Iqbal eebb9d6723 Re-bless the golden tables at 94a0dbaf85
The golden-table bless at the pin-83 tip (m3-max-27986). It adds the rows of the new owned
fixture engine/hpr_reads (RUNTIME 2257's heap-placement reads: hpr_one, hpr_five,
hpr_level1_write): its golden hashes, its engine expectation rows and its air_input printout.
No existing cell moves. These are the engine failures of the pin's merged check (m3-max-27985):
golden_hashes_match_the_table, inventory_lists_every_fixture_in_order,
engine_fixtures_match_their_golden_printout and llvm_as parts 1 and 3 (the new rows).
2026-11-13 20:59:52 -08:00
Anees Iqbal 94a0dbaf85 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 20:25:53 -08:00
Anees Iqbal 804d8df68a RUNTIME 2258: a device's command-count shards are built on the heap, so a device is made on a 256 KiB stack
A program that made a device on a thread of 512 KiB of stack or less overflowed it on any driver
(reims's window render thread: "thread ... has overflowed its stack", confirmed on the Iris at
m3-max-27854; the SIGSEGV in assemble of x4route's second device). Line::new's
`counts: Arc::default()` built work_counts::Counters on the making thread's stack and moved it to
the heap: 172,928 bytes, 166,400 of them CommandTallies' inline arrays of 65 shards of 1,280 bytes.

Shards now hold a Box<[Shard<T>]> collected shard by shard, each written straight to the heap
(Counters 6,784 bytes); the shards' pointer lies on a 128-byte line of its own that nothing writes
once the device is made, so the one extra load a count takes stays a cache hit beside the shard's
own load and store. The adders' API is unchanged.

Test: tests::small_stack_device makes a device of its own options on a std::thread with a 256 KiB
stack, fills a buffer, reads it back and drops the device on that thread.

Verified: lavapipe m3-max-27859, the test passes with the fix and with the fix reverse-applied in
the same job overflows its stack (SIGABRT); device creation needs more than 1 MiB and at most 2 MiB
of stack before, more than 192 KiB and at most 256 KiB after (lavapipe debug, RUST_MIN_STACK
sweeps 27833, 27851); RTX 2080 on um790 m3-max-27937: small_stack_device, recorder_shards and
command_counts pass; clippy plain, gpucfg and cpuicd and rustdoc exit 0 (27875-27877); the plain
runtime suite 1538 passed (27876).
2026-11-13 20:25:04 -08:00
Anees Iqbal ed3dfd8160 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 20:19:47 -08:00
Anees Iqbal b31c23f7c0 RUNTIME 2257: render targets placed apart in one Private placement heap keep no shadows
A game's render targets placed apart in one tracked Private placement heap (reims gameload G2
rtheap: MSAA colour, MSAA depth and a shadow map) were held as shadows on the Iris and the AMD
GPUs, with attached reads through copies, clears in part and sample moves every frame (+34.9 ms a
frame over native on the Iris guest at pin 77). Four causes, each with a test that fails before:

- C (d1eaec0f47, 792ea614de): a heap's images shared memory wherever their keys met, so a
  texture placed apart was taken as attached to another's pass; images now share memory only where
  their bytes meet, and the heap's own shadow images use their whole key's memory.
- B1 (6f54af68e2, e56bb982d7): a multisample heap texture takes the device's own size and
  alignment answer and lies in its image (the 780M asks at most 64 KiB).
- D (f760b95001): a whole clear of a 2D multisample attachment copies nothing in.
- B2 (317d905449): a heap texture's device answer takes the device's alignment up to the heap's
  own (the XTX's MSAA colour answers 256 KiB: 2375680 @ 256K, depth 1179656 @ 128K, shadow map
  393224 @ 128K), the host GPU's real value as the owner's rule for device-describing answers
  states.
New owned fixture hpr_reads (our MSL; regen-air-fixtures): fragment functions reading a device
buffer; its golden and the compile census are re-blessed at the next pin.

Verified (steelbrain/rtheap at 23fc75a899): release lane heap_placed_targets (320x192, 7
heap-placed targets, Device policy, mean of 10 frames), placed vs device-made: XTX 1.619 vs 0.576
ms before, shadows MsaaColor/MsaaDepth/Shadow, to 0.530 vs 0.594 ms, every shadow count 0
(m3-max-27670); 780M 2.150 vs 0.579 to 0.548 vs 0.599 ms (27671). Metal policy
(exact_answers): XTX 2.033 to 0.683 ms, 780M 2.650 to 1.079 ms, shadows kept as the switch says.
Texels and kernel reads equal the device-made frame on every leg. lavapipe green (27676); XTX
(27687) and 780M (27688) every heap_placed*, attached_levels, tracker, heap and shadow test
passes, the other failures only under the carried archive's compile-time paths and the
shadow_standing layer test fixed separately (4d95375fe2). Per-draw walk_costs on the XTX, one run
a side (27834): barriers 304.5 to 275.0 us a frame, no barrier 178.7 to 251.8 us with identical
draw-path counts; an exclusive alternating re-run (27858) decides whether that is noise.
2026-11-13 20:19:07 -08:00
Anees Iqbal 4d95375fe2 Tests: a layer pass's backdrop read moves no copy where the device reads it through a snapshot
a_layer_pass_reading_its_own_target_copies_in_its_read_alone_after_the_first took its counts
from lavapipe alone (m3-max-20039), where the read with no barrier reads the copy taken before
the pass and moves its 18x6 texels each frame. On a device that takes the snapshot path (the
XTX and the 780M: the snapshot draws' features, a fetch in the pixel interlock, and feedback loop
usage on the plane's shadow image), a read over a buffer's bytes takes the snapshot at any area
(render/snapshot.rs, over_bytes), so no copy moves and the test failed "moved 0 vs 108" on both
AMD GPUs (m3-max-27687, 27688, 27795).

The expectation now follows the runtime's own predicate for the device and the texture
(reads_through_snapshots: color_write_masks, through_storage, the image's feedback loop usage):
from the second command buffer on the read is counted through a snapshot exactly where the
predicate says so, and its copy moves 18x6 texels where it reads the copy, none where it takes
the snapshot. The line printed per frame names the device, the predicate and the count.

Verified: XTX (RADV NAVI31) m3-max-27883 passes, one snapshot read a frame and the copies in
skipped against the standing from frame 1; lavapipe m3-max-27900 passes, 108 texels a frame.
2026-11-13 20:13:22 -08:00
Anees Iqbal 6c3acd9ae8 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 20:11:40 -08:00
Anees Iqbal 76855fc0ba SEMANTICS_VERSION 2106, ARTIFACT_FORMAT_VERSION 522, RUNTIME_VERSION 2256: GPU-written indirect command buffers that inherit the encoder's buffers run on the GPU; write routes reach the indirect command buffers of their own command kind
A GPU-encoded indirect command buffer whose records inherit the encoder's buffers took the host
step: the render GPU form refused inherit_buffers (DrawReplayRule::InheritedBuffers) and the compute
GPU form had no inherited-bytes path, so every frame read the records back and replayed them on the
host (gameload's icb: 8,192 indexed draws, ~44 ms of host step a frame on the Iris against 0.29 ms
natively).

- Render (da75a4602f..f3745fd69c): a draw replay's variant takes the encoder's vertex and fragment
  buffers by index as its parent buffers, resolved to device addresses past the parent's record;
  inline bytes (set*Bytes) are planned at their slots; an unaddressed inherited buffer keeps the
  host step with its cause named (parent_entries refuses it rather than writing a zero entry). The
  executor's draw preprocess binds the encoder's vertex buffers.
- Compute (7c148c3995..0a68ac5f15): a GPU-written buffer of dispatches that inherits the encoder's
  kernel buffers runs on the GPU the same way; the new fixture icb_inherited_dispatches (our MSL) and
  its golden.
- Route kinds (2d9f4ac597..2e206952c2): every route of a command buffer joined every indirect command
  buffer it made resident for writing, so a compute ICB's writer (DISPATCH|RESET) refused the render
  ICB's GPU form in the same command buffer (DrawReplayRule::Operations): gameload -b's render ICB
  host-stepped although nothing refused its own shape. A write route now reaches only the ICBs of its
  command kind (render or compute); CommandWrites carries the kinds (ARTIFACT_FORMAT 522).
- host-replayed-indirect-commands is announced once per cause instead of once per device
  (a660b2fe8d), naming the rule that keeps a pass from the GPU form, as copied-host-pages announces
  per reason; no new Degradation kind or WorkCounts field.

Verified on the branch (steelbrain/icbinherit2 at a660b2fe8d): clippy plain, m2v_gpu and
m2v_cpu_icd and rustdoc exit 0 (27886); runtime suite 1538/1539, the one failure the catalogue text
RUNTIME 2253 already fixed on development (27884); lavapipe ICB and notice lanes 214/219 with
render_inherited_buffers, compute_inherited_buffers, write_routes, written_commands and the
beside test (inherited and own buffers: cold (8,8,0), warm (8,8,0,0), pixels as alone) passing, the
5 failures failing the same at the branch's base (27926, 27927); before route kinds the beside
test fails as designed, (0,0,8) against (8,8,0) (27764); XTX 90/101 at 60c85035e3 (27853), the 11
failures fixture paths under msi's compile-time path only, all 11 passing on lavapipe (27807).
2026-11-13 20:11:00 -08:00
Anees Iqbal 86ecc71b54 SEMANTICS_VERSION 2105: the half hold charges what it holds to the byte ledger
spirv::half_hold (081fea3239) charged nothing: its tables over the module's values and blocks, its
maps of twins, a copy of each block it rebuilt (phis and instructions cloned whole), the rebuilt
block beside it, and what the module's values, constants, types and declarations grew by were
all outside the ledger. On a stage that computes half in 16 bits under the float controls the
largest block is held three times at once (the block, its copy and its rebuild, 96 bytes an
instruction each), so the owned fixture grd_half_many_samples (320 half samples converted by the
bound format's class, one large block) reached an allocator peak of 4,638,806 bytes against a
ledger peak of 2,840,483 on the 10 profiles that hold half at 16 bits, under the 7/10 floor
ledger_coverage_4 holds every owned compile to.

The pass now charges, as the other passes charge theirs:
- its analysis tables (exact halves, wide-use and narrowing counts, rounded flags, block
  positions, the held places, folds and variable sets), released as each is dropped;
- its maps of twins as they grow, released when it returns;
- each rebuilt block: its reservation before it is made, its growth, boxed operand lists and twin
  phis once built; the replaced instructions' bytes are released as they leave, so only the
  block's growth stays charged with the module;
- what the module's own tables grow by, which stays charged with the module.

The rebuild no longer copies a block whole: it reads each phi and instruction from the block as
it goes (it changes values, types, constants and declarations, never a block), so the copy is
gone from the peak rather than charged. The dead-code pass runs after the pass's tables are
dropped. The output is the same module.

Test: spirv::half_hold's what_the_pass_holds_uncharged_does_not_grow_with_the_module builds one
block of 16 and of 4,096 narrow, 16-bit add, widen and minimum steps and requires that at most a
tenth of what the pass holds over the extra steps (the allocator's count) is uncharged; every
step's narrowing leaves at both sizes.

SEMANTICS_VERSION 2105: the output modules are byte-identical, but the ledger decides when a
translation is refused for its budget, so a module near the ceiling can now be answered
differently and cached answers must not be reused.

Verified (msi): ledger_coverage_4, the new unit test, half_bits and both engine_half_hold tests
pass (m3-max-27772); the old pass with the new test fails "2846712 of the 3503592 bytes the pass
holds over 4,080 more steps are uncharged" (27773); all six ledger_coverage shards pass (27805);
on the 10 profiles the ledger now covers 0.961 of the allocator peak (was 0.612), the peak 21%
lower (27819, print-only probe); release SPIR-V byte-identical base vs tip on rdna3, irisxe and
rtx50, median CLI translation ~44 ms either way (27835, 27830); clippy plain, m2v_gpu and
m2v_cpu_icd and rustdoc exit 0 (27813-27816).
2026-11-13 19:34:25 -08:00
Anees Iqbal da739e4aa5 The runtime-pin input test lists spirv/ir/intern.rs as not a runtime input
The test the_runtime_sources_are_the_committed_ones failed on development
(full validation suite, m3-max-27765 at d72dc03519): the runtime inputs
reach metal2vulkan/src/spirv/ir/intern.rs through bind/state.rs, which has
used its FxHasher since RUNTIME 2226 (54752dd4f7) to key kept bind shapes
and samplers, and the file is neither hashed nor listed.

The hash only narrows which kept shapes a draw compares field by field;
that comparison decides, so another hasher changes no run's answers. The
file goes on the not-runtime list with that reason instead of into the
pin's hash, which would re-pin on every translator interning change.

Test infrastructure only: no version bump.

Verified: the_runtime_sources_are_the_committed_ones on msi (m3-max-27822).
2026-11-13 19:28:32 -08:00
Anees Iqbal 38a4a22675 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 19:19:49 -08:00
Anees Iqbal 1cf0e1910d RUNTIME 2255: cubes and BC rows over an IOSurface plane are made where the x86 Macs make them
reims's oracle_surftex found the Radeon Pro 5300M and the UHD 630 making three IOSurface-plane
shapes that the runtime refused:
- a Cube and a CubeArray over a plane of a surface with planes (cases 119, 188-191). These were
  refused as Metal's own Invalid; the M3 Max asserts "carriesComplexTexture || numFaces == 1", the
  arm64 envelope.
- BC1 64x64 over a 420v luma plane, whose rows of blocks are wider than the plane's row (case 187).
  This was refused as NotImplemented(SurfacePlaneShape); the M3 answers nil.
An x86 guest was answered "made" while the host held no object for it. The x86 envelope is the x86
Macs', and they agree, so the runtime now makes them as those Macs lay them out. Measured with
surface_texture_envelope on both x86 GPUs (m3-max-27621, -27622).

Cubes: face k lies at the plane's offset + k x rows x bytesPerRow, rows bytesPerRow apart. The
planner (linear_plan.rs, faces_at_pitch) lays a colour cube or cube array over a plane, at an offset
and bytesPerRow that are multiples of 16, as a 2D array of its faces at that pitch, for the GPU
and the CPU alike. Faces past the buffer go in the texture's tail, announced as SurfaceTexelsTail,
as a 2D array's texels past it do. The image is cube-compatible, as every cube's is. Every other
cube over such a plane (another format, off 16, several levels, rows wider than the plane's) is
NotImplemented(SurfacePlaneShape) instead of Invalid. Over a surface without planes it stays
BufferTextureProblem::TextureType. The CPUs differ: the 5300M's getBytes and replaceRegion take
every face at the first's bytes, and the 630's take them one image on from the surface's byte 0.
The runtime's CPU calls take the GPUs' layout.

BC rows of 8-byte blocks wider than the plane's row keep to it, as the x86 Macs' blits do: the
blocks in the plane's row lie in place; the blocks past it read zero and their writes are dropped.
There is no tail storage: the shadow zeroes them at its first move, and blits, replace_region and
get_bytes clip to the kept columns. InPlaceRefusal::Rows's doc now also covers rows that hold fewer
of a BC texture's blocks than its row. No Degradation kind and no public item were added. docs/API.md
records two accepted differences: the CPU calls follow the GPUs' layout, and a cube's faces past
the plane's rows lie at the plane's pitch. linear_plan.rs, the RuntimeGap and BufferTextureProblem
docs, FAST-PATHS known gaps and REFUSALS.md (regenerated) are updated.

Verified (planerows, 97de630b9f on 4e694366cc, msi):
- lavapipe (m3-max-27711): 27/27, SURFACE_SHAPES_LVP_EXIT=0. Every surface shape, over Shared and
  over host pages, reads 0 wrong: 119/188/189/190/191, the four probe cube shapes, 187
  (420v.p0.fmt.bc1) and 420v.p0.bc1.32x64. The validation layer reported nothing.
- Planner unit tests (27659): 26/26.
- clippy m2v_gpu 0 (27721), m2v_cpu_icd 0 (27722), plain 0 (27724); runtime rustdoc 0.
- Owed: the XTX leg (27731, queued).

RUNTIME_VERSION 2254 -> 2255.
2026-11-13 19:19:09 -08:00
Anees Iqbal c5c80623b5 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 19:06:59 -08:00
Anees Iqbal 2bd067d6c7 RUNTIME 2254: a command buffer's completion exports as a SYNC_FD sync file
A consumer that composites one GPU's frames on another vendor's GPU has to order the second
device's work after a runtime command buffer. The only semaphore export was
SharedEvent::export_semaphore_fd: a timeline semaphore as OPAQUE_FD, which Vulkan imports only on a
device with the same deviceUUID and driverUUID, so it cannot cross from NVIDIA to RADV. The consumer
waited on the CPU instead, about 3.5 ms a present on its window thread. A cross-driver handle needs
SYNC_FD, which only binary semaphores export.

New (unix only, no Metal counterpart):
- CommandBuffer::add_completion_sync_file(), before the commit: the command buffer's last batch
  also signals a binary semaphore exportable as SYNC_FD, after its to-host barrier. That batch never
  joins a submission group. A command buffer with no GPU work submits the signal alone, after its
  queue's earlier work.
- CommandBuffer::export_completion_sync_file() -> Result<Option<OwnedFd>, Error>, after the
  commit. It blocks only until the signalling batch's vkQueueSubmit has returned, never on the GPU.
  None means the work already ended, or the driver answered -1; the importer imports -1 or skips
  the wait.
- Spec: the export follows the signal's submission (VUID-03254), with copy transference. One export
  per command buffer. Event::reserve_vk_signal's doc carries the contract for a reserved signal
  that the batch waits on.
- The semaphore goes back to an idle pool of up to 8 per device once the command buffer completes
  with its fd exported, and is released otherwise.

Where the host writes the caller's pages after the GPU work (a copied host buffer's merge back, or a
managed two-copy buffer's copy-out), no GPU signal can come after those writes. There the export
waits for completion and answers None, announced by a NEW Degradation: SyncFileAfterHostCopies
(sync-file-after-host-copies, performance). Also new: WorkCounts::sync_files_exported and
sync_files_after_host_copies; RuntimeGap::SyncFileExport, for a device without
VK_KHR_external_semaphore_fd or without binary SYNC_FD export (MoltenVK, an adopted device without
the extension); Problem::SyncFile(SyncFileProblem { Committed, NotCommitted, Exported }).
docs/API.md (catalogue entry), the runtime README, REFUSALS.md (regenerated), the reach table and
api_signatures are updated.

Verified (syncfile, 8f9caba0ae on d72dc03519, msi):
- Runtime suite: 1538 passed, 6 skipped (27758).
- tests::sync_file on lavapipe (27733). llvmpipe exports and imports SYNC_FD. The no-copy buffer
  was imported by pointer. A second VkDevice imported the fd and read every byte filled. The export
  came while the status was Scheduled.
- The lane test a_sync_file_after_host_copies_waits_for_them_announced (27759): the export over a
  copied buffer's merge back waited, the pages held the fill, and the kind was announced once and
  counted.
- clippy plain, m2v_cpu_icd and m2v_gpu 0 (27709, 27737, 27760); rustdoc 0 (27730).
- Owed: the cross-vendor run on um790, the 2080 writing and an XTX VkDevice importing (27739,
  queued).

RUNTIME_VERSION 2253 -> 2254.
2026-11-13 19:06:19 -08:00
Anees Iqbal d72dc03519 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 19:02:09 -08:00
Anees Iqbal 6ba577a89e RUNTIME 2253: the device recovery's announced cost states an indirect command buffer's records as docs/API.md does
RUNTIME 2247 (0ee5fb1b9b) moved an indirect command buffer's records into the runtime's own pages.
A recovery now keeps them, except on a device that imports no host pointer or where their import
failed. That commit rewrote docs/API.md's device-recovered entry to say so, but the kind's announced
cost in degradation.rs still said the records outside the runtime's own pages reset. The catalogue
test degradation_catalogue::a_runtime_kind_s_entry_states_the_cost_it_announces holds the entry to
the cost word for word. It has failed on development since then (msi plain runtime suite,
m3-max-27744): "they part at ... records o[utside the runtime's own pages] / [n a device that imports
no host pointer]"). The cost now uses the entry's words. Only the announced text changes; no
Degradation kind is added or removed.

Verified (syncfile, 55da7d6c9a): the parting text read from 27744's log. The runtime suite at the
landing tip follows on development.

RUNTIME_VERSION 2252 -> 2253.
2026-11-13 19:01:29 -08:00
Anees Iqbal ea5d2b5dbb The dev tools find the fixtures beside the crate the test runner names
devtools::fixtures_dir() returned the validation crate's fixtures/public beside the dev-tools
crate as it was built (env! of CARGO_MANIFEST_DIR at compile time). A nextest archive built on one
machine and run on another, as the GPU nodes now run every device leg (built on msi, carried to
um790), therefore read the build machine's paths and found no fixtures. It now looks first beside
the manifest directory the test runner names at run time (cargo test and cargo nextest set
CARGO_MANIFEST_DIR for the test's crate; a run with --workspace-remap names it in that machine's
checkout), and falls back to the build-time path where that directory has no fixtures.

Test infrastructure only (metal2vulkan-devtools, unpublished); no product path reads it.

Verified (devcopy, 5c30935a78): validation-lane archives built on msi ran their fixture tests on
um790 (the XTX device_copy run 27511 and the 2080 run 27575 read their fixtures through it).
2026-11-13 18:43:40 -08:00
Anees Iqbal 9f897f2544 Re-bless the authored compile census at df39170a2e
The census at the pin-81 tip (m3-max-27641) covered 2369 cases over 21 profiles: 48670 compiled,
1079 refused, 0 failed, 0 differences, 0 regressions. 768 cells' artifact hashes moved with
SEMANTICS 2104 (loop-invariant uniform-view loads hoisted); each is still compiled. Slowest
compile 3.2 s, peak worker 235 MB, wall 220 s.
2026-11-13 18:27:02 -08:00
Anees Iqbal 8cb8e58eff Re-bless the golden tables at df39170a2e
The golden-table bless at the pin-81 tip (m3-max-27640). The 19 robust profiles' cells of
engine/tns_mm_flags.ll | tns_mm_flags move with SEMANTICS 2104: its loop's uniform-view loads are
loaded before the loop. The robustness-off cells are unchanged, since those profiles have no
uniform views. The engine inventory and the air_input printouts are unchanged. This is the one
engine failure of the pin's merged check (m3-max-27639), golden_hashes_match_the_table.
2026-11-13 18:27:02 -08:00
Anees Iqbal df39170a2e Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 18:16:29 -08:00
Anees Iqbal 761bc21c29 RUNTIME 2252: overlapping YCbCr planes convert with the device's own conversion, a row at a time
YCbCrSampler::of took the device's sampler Y'CbCr conversion only for planes whose rows of codes do
not overlap: one buffer-image region per plane cannot state a pitch below the row
(VUID-VkBufferImageCopy-bufferRowLength-09101). RUNTIME 2251 made two-plane YCbCr textures over
rows of codes that overlap. On the RX 7900 XTX, where RADV converts G8_B8R8_2PLANE_420_UNORM
itself, the overlapping 66x64 texture went through Metal's fixed-point conversion. The same codes
laid apart went through the device's, so the lane's twin check failed (m3-max-27506: "read() is
the twin's, bit for bit"). Where the device has a native form, that is the only form (owner rule
1), so the layout must not choose Metal's arithmetic.

Such planes now copy into the conversion's image one region per row, each from its own first byte,
and convert on the device like any other. One region per plane remains where a plane's rows are at
least as long as its texels. Chroma rows that overlap (a 4:4:4 format over a 4:2:0 surface's rows)
took the same fallback before and now convert on the device too. The lane test asserts that the
device converts the overlapping texture and its twin alike, prints which form ran, and checks the
twin against the model or the device's bound.

Verified (planerows, 6c16371805 on 8e41d50f94):
- XTX (m3-max-27589, archive built on msi and carried): 6/6, LANE_XTX_EXIT=0. "YCBCR84202P 66x64
  over rows of 64 bytes: converted by the device true", within 0/2048 of Vulkan's conversion for
  the texture, the twin and the read after replace_region. The 10-bit shape is not converted by
  the device on RADV.
- lavapipe (27572): 8/8.
- clippy plain 0 (27592), m2v_gpu 0 (27590), m2v_cpu_icd 0 (27591); rustdoc 0 (27592).

RUNTIME_VERSION 2251 -> 2252.
2026-11-13 18:15:49 -08:00
Anees Iqbal 415beb0943 SEMANTICS 2104: loop-invariant loads of uniform views move out of their loops
A new pass, spirv/hoist, runs after the roll pass. It moves a load out of every loop it is
invariant in, into the loop's preheader, in original order and inner loops first. The pure value
ops its indices need move with it. A load qualifies only when all of the following hold:
- It is not volatile and does not make memory visible.
- It goes through an access chain rooted at a Uniform-class Block view. ModuleBuilder declares
  those only for a read-only slot with a bounded window, on a profile whose containment emits no
  check; it refuses a Uniform resource that is not a Block, so no BufferBlock view exists.
- Every index is defined outside the loop, or computed inside it only by pure value ops of
  invariant operands.

A loop is a candidate only where no buffer write can run in any block from which its header is
reachable: the body, what runs before the loop, and an enclosing loop's later code through its
back edge. A buffer write is a store, atomic or image write through StorageBuffer,
PhysicalStorageBuffer or Uniform memory, or a call to a function containing one. Inside a routine,
a loop is a candidate only where the module writes no buffer at all. This also covers another
invocation's write that a barrier inside the loop would make visible.

Speculation: a load in the loop's header block runs whenever the loop is entered, so it moves on
every profile. A load in any other loop block moves only under containment with robust buffer
access (robustBufferAccess or robustBufferAccess2): a uniform view carries no in-shader check to
bypass, and robust access answers in range or zero past the bound range. Under
ContainmentPolicy::UnsafeOff only header-block loads move. Every decision comes from storage
class, view kind, operand definitions, the loop metadata, CFG reachability and the profile's
containment. The values are the same, so the pass is exact and has no FAST-PATHS row.
docs/ARCHITECTURE.md names it in the spirv row and the tidy stage.

Verified (ftk2, 6d6add9acf on 73caf92102):
- The 4 hoist unit tests plus the engine test pass (27487). The engine test reads an authored
  constant struct at fixed words, each under a per-trip branch, in a loop. On all 4 robust
  access-test profiles: the slot is Descriptor(UniformWords), the loop holds no Uniform-class
  load, and the interpreter's sums are right for n = 0, 1, 2, 5, 8. Negative control: with the
  hoist call removed, the test fails ("moltenvk-m3: loads of in in the loop").
- Suite: 3572/3573. The one failure is golden_hashes: 19 cells, engine/tns_mm_flags on the 19
  robust profiles, re-blessed on development. clippy all-features, m2v_gpu and m2v_cpu_icd 0;
  rustdoc 0 (27513-27517).
- Authored compile census (27501, M3): 0 failed, 0 differences, 0 regressions, 768 artifacts
  moved. Slowest compile 590 ms. Peak per-case worker 392 MB, against 391 before.
- Registers on the real modules:
  - RADV XTX: VGPRs 48 both ways, SGPRs 108, no spills, scratch 0, 32 subgroups per SIMD both
    ways; latency -29% (c4) and -26% (c6_8).
  - NVIDIA 2080: registers 64 -> 62 (c4_0, c4_3) and 64 -> 64 (c6_8), stack 0.
- Release timings, cold, one run each, GPU median of 21 CBs at K=1, before -> after in us:
  - The face-tracking conv kernels through the runtime, device-local:
    - XTX: c4_0 22.7 -> 20.8, c4_3 18.3 -> 17.2, c6_8 160.3 -> 133.9 (-16%).
    - 2080: c4_0 29.2 -> 26.7, c6_8 107.9 -> 103.2.
  - One interleaved bare A/B on the 2080 (27567, 6 pairs, P0): the hoist is faster in 5 of 6
    pairs, by 0.8% to 3.7%.
  - Cold "state made in" is unchanged: XTX 8.4-12.1 ms and 2080 20-71 ms in both builds.

SEMANTICS_VERSION 2103 -> 2104.
2026-11-13 18:08:36 -08:00
Anees Iqbal 4e694366cc Re-bless the authored compile census at 8e41d50f94
The census at the pin-80 tip (m3-max-27524) covered 2369 cases over 21 profiles: 48670 compiled,
1079 refused, 0 failed, 0 differences, 0 regressions. No artifact hash moved; only the
artifacts_at product stamp did. Slowest compile 2.9 s, peak worker 231 MB, wall 194 s.
2026-11-13 17:58:28 -08:00
Anees Iqbal d4df01c395 Re-bless the golden tables at 8e41d50f94
The golden-table bless at the pin-80 tip (m3-max-27523): SEMANTICS 2103's new owned fixture,
engine/icb_merged_arguments, gets its golden_hashes rows and its four engine-inventory rows
(ica_fragment, ica_inherited and the rest). Its function that dereferences a loaded pointer, and the
kernel that encodes indirect commands, need buffer device addresses or Int64 where a profile lacks
them. No existing cell moved, and the air_input printouts are unchanged; the fixture's printout
landed with it.

These are the three engine failures of the pin's merged check (m3-max-27522):
golden_hashes_match_the_table, inventory_lists_every_fixture_in_order and llvm_as::part_2_of_8,
each about icb_merged_arguments alone.
2026-11-13 17:58:28 -08:00
Anees Iqbal 8e41d50f94 The golden printout of icb_merged_arguments
Blessed with bless_engine_goldens under llvm-as 21 on the M3 (job
m3-max-27493): every other golden printout came out unchanged, only this
fixture's file is new.
2026-11-13 17:44:14 -08:00
Anees Iqbal a522b478f3 SEMANTICS 2103: a merged draw finds its command's slot tables before any entry hook reads one
A merged draw replay's functions read their command's slot table where other functions read a
RootTableAddress push field. The vertex function takes the table of the command its corner falls
in; the fragment function takes the table of the command its vertex wrote. That lookup ran in
stage_io::emit_entry, after access::dynamic::emit_entry, which reads each wide buffer parameter's
root entry at entry from that same table. So a merged function that loads a pointer from a buffer
read its table before the lookup had found it. An argument buffer holding a constant pointer is
one such case. The compile failed on the Internal Invariant "a merged draw's fragment slot table
read before its entry" (or the vertex's "slot table read before its entry"), and the execution of
a GPU-encoded indirect command buffer went to the host step. In the consumer's own game-shaped
program that step cost 32-48 ms a frame on the M3 (MoltenVK) and on Iris Xe (ANV), both logging the
invariant.

The lookup is now a hook of its own, stage_io::emit_draw_entry. It runs after the push fields,
specializations and dispatch values and before the access family's hook, and covers the captured
index of the de-indexed and private list forms, a merged vertex's command and a merged fragment's
table. The pulled attribute fetch stays in stage_io::emit_entry, after both.

New owned fixture: engine/icb_merged_arguments (MSL of our own). It has a [[stage_in]] vertex
function over vertex buffers 0..2, and a fragment function whose buffer 0 is an argument buffer of
two textures and a constant pointer. Two kernels encode indexed triangle draws with resets, one
binding the commands' own buffers and one binding none.

Verified (icbinherit, ebbcdad70a on 73caf92102, msi lavapipe):
- pipeline::compile::tests::a_merged_fragment_reads_its_argument_buffer_through_its_command_s_table
  compiles the state's merged replay variant on moltenvk-m3, amd-rdna3-radv and lavapipe.
- It fails at the fixture commit with exactly the invariant (27480).
- With the fix, 82/82 merged and replay tests in metal2vulkan --lib pass (27488).
- The fixture's golden_hashes, engine-inventory and air_input rows are re-blessed on development.

SEMANTICS_VERSION 2102 -> 2103.
2026-11-13 17:42:58 -08:00
Anees Iqbal 53f3dd2764 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 17:32:31 -08:00
Anees Iqbal 7e827c1b5e RUNTIME 2251: a two-plane YCbCr texture over IOSurface rows of codes that overlap is made, as Metal makes it
A two-plane YCbCr texture can sit over a plane of a surface with planes whose rows of codes are
wider than the planes' bytesPerRow (a texture wider than its plane, or a 10-bit format over 8-bit
rows). Metal makes it. The runtime refused it at creation: linear_plan's overlap_held answered
NotImplemented(OverlappingSurfaceRows), and the guest got nil. An arm64 guest's oracle run met
one: YCBCR8_420_2P 66x64 over plane 0 of a 64x64 '420v' (luma rows of 64 bytes).

Such a texture's texels are its conversion of the planes' bytes (ycbcr.rs), which reads every code
at the planes' rows, so rows that share bytes need no row rule. The refusal was written for a
plain plane's two-region shadow copies, which a converted texture never uses. overlap_held now
holds a two-plane YCbCr texture over a plane of a surface with planes, whatever its usage.

Still refused, now at use and with the precise gap NotImplemented(OverlappingSurfaceRows) (was
NotImplemented(Format)):
- a blit from a buffer into such a texture: Metal leaves no single row's bytes there (the
  earlier row's at every shared byte of the 8-bit shape; 2047, then 1919, of 4032 for the 10-bit
  one);
- a 4:4:4 texture's stored writes;
- a render pass whose rows of codes overlap (unmeasured).

Over a surface without planes it stays refused at creation (unmeasured). docs/FAST-PATHS.md's
known gaps, the RuntimeGap doc and REFUSALS.md (regenerated) say so. No Degradation kind, no public
item.

Metal's answer (probes/ycbcr_wide_code_rows.m, m3-max-27270, macOS 27.0.1, two processes a shape),
for the 66x64 8-bit shape and a 64x64 10-bit one:
- read() and the nearest sample of every texel equal the same texture over the same bytes laid
  apart, bit for bit (0 of 4224 and 0 of 4096 texels differ);
- getBytes reads the luma rows at the pitch;
- replaceRegion writes them in order, the later row standing.

Verified (planerows, 5fdbf147d5 on 90ced1544a):
- lavapipe lane (27310): 6/6, including the new
  ycbcr_textures_whose_rows_of_codes_overlap_read_what_metal_reads.
- runtime tests::linear_plan (27319): 25/25, including the new
  a_two_plane_ycbcr_texture_whose_rows_of_codes_overlap_is_held_over_a_plane.
- clippy plain 0 (27348), m2v_cpu_icd 0 (27382, after the type_complexity fix); rustdoc 0 (27349).
- The XTX lane run and clippy m2v_gpu are queued (27440/27441/27472).

RUNTIME_VERSION 2250 -> 2251.
2026-11-13 17:31:50 -08:00
Anees Iqbal 73caf92102 Re-bless the authored compile census at a081a49ad4
The census at the pin-79 tip (m3-max-27370) covered 2369 cases over 21 profiles: 48670 compiled,
1079 refused, 0 failed, 0 differences, 0 regressions. 1177 cells' artifact hashes moved with
SEMANTICS 2102 (a pointer reloaded from thread, threadgroup or payload memory names no object in
the lockstep device pass); each is still compiled. Slowest compile 2.3 s, peak worker 235 MB,
wall 142 s.
2026-11-13 17:17:17 -08:00
Anees Iqbal f7a698bd42 Re-bless the golden tables at a081a49ad4
The golden-table bless at the pin-79 tip (m3-max-27369):
- The new owned fixture engine/wlk_readers (RUNTIME 2250's walk_reader_forms bench) gets its rows:
  - its air_input printout;
  - its two engine-inventory rows: wlk_read_branch compiles on every profile; wlk_fetch_branch
    needs framebuffer fetch on the profiles without it;
  - its golden_hashes rows.
- The engine/generic_pointers rows move with SEMANTICS 2102: generic_functor reads its buffer
  through a pointer held in thread memory and now takes the device barrier.
- Nothing else moved.

These are the three engine failures of the pin's merged check (m3-max-27368):
engine_fixtures_match_their_golden_printout, inventory_lists_every_fixture_in_order and
llvm_as::part_5_of_8, each about wlk_readers alone.
2026-11-13 17:17:17 -08:00
Anees Iqbal a081a49ad4 Re-bless the authored compile census at 25462e8c90
The census at the pin-78 tip (m3-max-27287) covered 2369 cases over 21 profiles: 48670
compiled, 1079 refused, 0 failed, 0 differences, 0 regressions. No cell's artifact hash moved;
only the artifacts_at product stamp did. Slowest compile 1.9 s, peak worker 235 MB, wall 150 s.
2026-11-13 17:04:09 -08:00
Anees Iqbal 9a66682922 Re-bless the golden tables at 25462e8c90
The golden-table bless at the pin-78 tip (m3-max-27286). Eleven profile fingerprint rows of
golden_hashes.tsv moved: the 780M, RDNA2 APU, RDNA3, the four Intel and the three NVIDIA
profiles. They now carry VkProperty::SubgroupGeometryStage, from SEMANTICS 2100/2101's rate-map
probe. No cell moved. The engine inventory and the air_input printouts are unchanged.
2026-11-13 17:04:09 -08:00
Anees Iqbal 63b71d6e2f SEMANTICS 2102: the lockstep device pass takes a pointer loaded from thread, threadgroup or payload memory as naming no object
The device pass treated every device pointer loaded from memory as the object named by the
canonical spelling of its source address (Root::Loaded). That is the right model for argument
buffers, where two loads of one member name one buffer. A pointer loaded from thread, threadgroup
or payload memory is different: it is a copy of a pointer that a store put there, and two slots can
hold the same buffer's pointer. The pass took two accesses through two such slots never to
overlap, and gave them no barrier. A convolution kernel stored through pointers reloaded from
separate byval copies. An authored kernel that stores through one slot and reads its neighbour's
word through another read a word that another chunk had already overwritten.

Such a load now has unknown roots and meets every object, so the pair falls to the address facts
like any other pair. Pointers loaded from device or constant memory still name the member's
object, as the documented binding-overlap reading has it. docs/FAST-PATHS.md's known gaps record
that reading.

Verified (ftk2, 3f8dd8821e on 69c5ab1de6):
- Fail before: the new engine_simd_lockstep::a_buffer_through_two_thread_slots_is_one_object
  fails at development (27084; the chunked schedule read 8..15 where lockstep reads t ^ 8) and
  passes at the tip.
- Suite at the tip (27141, -p metal2vulkan --all-features): 3566/3567. The one failure is
  golden_hashes. Against the table blessed at 69c5ab1de6, the change moves 19 cells, all
  engine/generic_pointers.ll | generic_functor, one per profile. That entry reads its buffer
  through a pointer a functor holds in thread memory, so its accesses now meet the binding's and
  take the barrier. The table is re-blessed on development.
- Authored compile census (27091, M3): differences 0, regressions 0, slowest compile 2663 ms,
  peak case worker RSS 391 MB.
- clippy all-features 0 (27093), m2v_gpu 0 (27095), m2v_cpu_icd 0 (27096); rustdoc -D warnings 0
  (27097).

SEMANTICS_VERSION 2101 -> 2102.
2026-11-13 17:01:49 -08:00
Anees Iqbal 1f8baf9af4 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 16:59:40 -08:00
Anees Iqbal 8b09e7c51d RUNTIME 2250: a render-target barrier inside the pass keeps the encoder's kept draws
In the consumer's Launchpad walk on the RX 7900 XTX (lp75-xtx, pin 75), 293 of about 446 draws a
present took every step (about 21.6 us each against 7.6 us for a rebound draw), and RUNTIME 2240's
reader keeping never fired (reading_draws_snapshotted_again 0): a memoryBarrierWithScope
(RenderTargets, fragment -> fragment) came before nearly every snapshot reader (~80 a present
against 77 readers), and every barrier forgot every kept draw, the last one and those set aside.

The barrier changes no state the command buffer holds (pipeline, sets, push constants and dynamic
states survive vkCmdPipelineBarrier; a draw again records into the same command buffer). Now an
RT-only barrier recorded inside the current instance (render_target::between_draws), or one that
records nothing, keeps the kept draws, except those that read the pass's colours other than
through their own snapshots (through copies, at levels apart from the attached ones, or through
memory that shares an attachment: Kept::reads_colors, applied to the draws set aside and to the
last direct draw's kept draw), whose every step would change after it; where a use cannot be
told, the draw is let go. A barrier that splits the pass (its colours put apart there) and every
other scope still forget. New: WorkCounts::kept_draws_kept_across_barrier.

Also: runtime_lane::walk_costs, a release lane bench of the walk's draw mix (3 encoders a command
buffer, each [A, B, RT barrier, snapshot reader, A, B], indexed draws with their own scissors and
moved offsets over host pages, a fence wait and update), with and without barriers, and
walk_reader_forms over the owned fixture wlk_readers.metal (a reader whose texel decides a branch,
split and copied or fetched).

Verified (perdraw6, 2ebea446ac on 69c5ab1de6, msi lavapipe, debug):
- 149 touched runtime and lane tests at d407b50c87 (27245); kept_across_calls and draw_again 31/31
  at 2ebea446ac (27279), including the debug cross-check (every second draw takes every step and
  compares).
- Negative control (the reads_colors forget removed, 27279): the new
  a_barrier_inside_the_pass_lets_go_the_last_draw_s_kept_reader_of_its_colors fails (the debug
  check: a draw again changed its encoder's instance).
- tests::draw_again's in-pass barrier line now expects kept_across_barrier == 1 (its command,
  state-command and pixel equalities with every step unchanged). Clippy plain 0 (27250).
- Owed: the XTX walk_costs before/after, clippy m2v_gpu and m2v_cpu_icd, rustdoc.

RUNTIME_VERSION 2249 -> 2250.
2026-11-13 16:59:01 -08:00
Anees Iqbal 25462e8c90 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 16:53:52 -08:00
Anees Iqbal c7810a5925 SEMANTICS 2101: the rate-map probe raises a block's bounds once a subgroup where the geometry stage runs subgroup operations
SEMANTICS 2100 (8c89e236d0) had every probed triangle AtomicOr its bounds into its 64-triangle
block's one word, so a subgroup of consecutive triangles hit one address 32 times: the RTX 2080's
probe went from 1.46 to 9.98 ms in runtime_lane::rate_mapped_pieces (plain frame 14.8 -> 17.7 ms).
Two throwaway experiments confirmed same-address contention: loading the word before the Or
9.40 ms; spreading the Ors over 32 lane words 2.38 ms.

Now, where the device runs basic, arithmetic and ballot subgroup operations in the geometry
stage (new VkProperty::SubgroupGeometryStage, from subgroupSupportedStages; appended to the cache
codec), a subgroup's bounded lanes peel off the first lane's word in a loop, OR their bounds
together, and the elected lane does the one AtomicOr (FanOutStage::subgroup_bounds). Elsewhere each
triangle does its own, as before. A geometry module's subgroup operations now require
SubgroupGeometryStage rather than SubgroupStage(Vertex). FAST-PATHS row 50 updated.

Verified (blotch, 8881d61d60..eb549eb558 on 31a07f2867):
- Lane, warm, probe / plain / wide / Exact wide: RTX 2080 1.90 / 10.6 / 15.4 / 79.4 ms (9ec2b198f3:
  probe 1.46, plain 14.8, wide 18.6); XTX 0.20 / 7.2 / 12.7 / 130.5 (probe 0.24 before); 780M probe
  0.62 (frames from a loaded node; rerun owed). Wide frame: 35 runs into 12,241 regions, none
  into every region.
- Translator unit tests 273/273 (msi), including
  a_probe_raises_a_block_s_bounds_once_a_subgroup_where_the_geometry_stage_has_subgroups: on
  nvidia-pascal-linux one BitwiseOr reduction feeds the AtomicOr under an Elect branch and the
  module requires SubgroupGeometryStage; on lavapipe no group ops; Iris Xe and Pascal probe
  modules pass check_words_valid.
- Owed on development: clippy in three configurations, rustdoc, lavapipe/780M/XTX depth_equal and
  fan-out (warm and cold), the 780M frames rerun, the consumer's Iris sample.

SEMANTICS_VERSION 2100 -> 2101, ARTIFACT_FORMAT_VERSION 520 -> 521.
2026-11-13 16:53:13 -08:00
Anees Iqbal 90ced1544a Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 16:40:14 -08:00
Anees Iqbal 262d3df12b Build the region ranges from explicit Range literals (clippy single_range_in_vec_init)
8c89e236d0 (SEMANTICS 2100 / RUNTIME 2248) wrote `vec![0..scissors.len() as u32]` in render.rs
and `[0..15]` in render/fan_out/tests.rs, which clippy's single_range_in_vec_init rejects in every
configuration (carryrace's jobs 27210, 27213, 27214, exit 101). Both are now explicit
std::ops::Range literals; the values are unchanged. No behavior change.
2026-11-13 16:39:27 -08:00
Anees Iqbal 56a8a1246f Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 16:39:02 -08:00
Anees Iqbal cbd2898434 RUNTIME 2249: a recovery's carry of pooled ICB records waits out the setters' unlocked writes; getters hold the overflow slots; reset GPU time counted
RUNTIME 2225 and 2242 let an indirect command buffer's setters write without the lock. RUNTIME
2247 put the records in the runtime's own imported pages wherever the device imports host
pointers, so every carry there keeps the pages, the pointer and the records (Kept; the carry's
forget_keys sends the next named set under the lock), and an unlocked write needs no tracking.
Records that still lie in pooled memory (a device without host-pointer import, or a failed
import) move at a recovery (Lost, every command reset), and an unlocked write could hold their
old pointer across the carry's release: a use-after-free.

- Pooled records only: each unlocked setter call counts itself with one read-modify-write
  (decided per ICB at creation, counted_write #[cold]); the carry waits the count out before it
  releases the old parts. Own-pages records write as before RUNTIME 2247, behind one branch.
- A getter's read of the slots past the records (overflow) holds their parts, as record reads do.
- WorkCounts::indirect_record_reset_gpu_nanos: the GPU time of each resetCommandsInBuffer
  dispatch, timed with the rate-map pieces' timestamp slots (a third kind), read when the command
  buffer lets go of what it retained; no sync added; 0 where timestamps are absent or wait for
  every queue's.
- set_each's setters run inlined in its loop (#[inline(always)] on set_one): the consumer saw the
  set passed by pointer read wide after narrow writes (a store-forwarding stall).
- HOWTO: each live ICB's records are one held import.

Verified (carryrace, 13fd624294 on 31a07f2867, msi lavapipe):
- Suite 27209: 92/92 (ICB carry race, reset timing, rate-mapped, indirect, executions, device
  recovery, fresh pages, no pointer import, recycling); pooled tests print Lost, own pages Kept;
  the reset timing read 0 ns for a copy alone and 1.28 ms for a reset.
- Negative controls: with the count off, the carry-waits test fails (the recovery ended while an
  unlocked write held the records' bytes); with bytes read at batch creation and no getter hold,
  the unlocked-set and getter tests crash (SIGSEGV).
- Bench 27171 (Core Ultra 9 275HX, one core, least of 3 passes), 256 commands, development
  before 2247 / 2247 / this: compute set_compute_command 70.8-74.8 / 70.8-72.4 / 71.2-71.9 ns;
  full slot 95.9-106.1 / 98.1-100.6 / 102.4-105.8; draw only 32.4-33.5 / 32.4-32.9 / 33.3-34.0.
  Pooled path with the count +35 ns a command. Inlined set_one: batched render rows -10 ns, compute
  -3 to -4 ns. Submissions with 0 / 64 / 256 live ICBs: 104.8 / 99.6 / 100.3 us median.
- API tests 15/15, rustdoc 0. Clippy's only errors at this base are development's 2248 lints in
  render.rs and render/fan_out/tests.rs, untouched here.

RUNTIME_VERSION 2248 -> 2249.
2026-11-13 16:38:21 -08:00
Anees Iqbal 31a07f2867 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 16:27:20 -08:00
Anees Iqbal 8c89e236d0 SEMANTICS 2100 / RUNTIME 2248: a rate-mapped pass's parted run is drawn only into the regions its blocks reach
A flagged draw's runs (blocks of 64 triangles around the triangles the probe flags) were drawn
region by region into every region of the map's plan. With the consumer's rate-map sample on the
Iris Xe that was most of the frame: rate_map_piece_gpu_nanos 382 of 441 ms a frame at pin 74
(232 runs into 2074 regions, 83k run triangles).

Now the probe ORs each 64-triangle block's bounds, widened as before, into 16 x and 16 y buckets
(bind::fan_out::BOUND_BUCKETS, PROBE_BOUNDS_AT, BLOCK_SET, STRADDLE_SET, fn bucket; PROBE_SETS 6 ->
7), and a run is drawn, through the region-copy route as before, only into the regions its
blocks reach, as consecutive ranges in table order. A triangle crossing w = 0 is bounded by its
part where w > 0: per axis its positive-w vertices' coordinates, plus infinity on each side where
an edge crosses w = 0 (the side is the sign of w_a*v_b - v_a*w_b; within 2^-16 or NaN, both
sides). A run whose bounds reach every bucket draws into every region, as before. The route,
its clip distances and the Equal-depth identity are unchanged. New counters:
WorkCounts::rate_map_run_region_draws, rate_map_runs_every_region,
rate_map_straddling_triangles. FAST-PATHS row 50 says so with its numbers.

Verified (blotch, d141fe9096..b277d4df9e on 69c5ab1de6):
- runtime_lane::rate_mapped_pieces, wide frame (23 flagged draws, 35 runs, 8983 run triangles,
  2074 regions), warm GPU: XTX fan-out 7.2 / wide 11.7 ms (9ec2b198f3: 6.1 / 20.3), runs 4.5 ms
  against 14.2; 780M 27.9 / 37.0 (28.9 / 43.0), runs 9.1 ms or less against 14.1. Runs drawn into
  12,241 regions against 72,590; 0 runs into every region, 0 straddling triangles.
- lavapipe: rate_mapped_depth_equal 0 red in all 10 route pairs; rate_mapped_fan_out 4/4 (1
  straddling triangle; 6 runs into 864 regions, each spanning the target); 135 fan_out, region,
  rate_map and probe unit tests; the probe's structural test checks the straddle add, the bounds
  Or, the two infinities and the 12 edge-side compares.
- Owed on development: 780M/XTX depth_equal and fan-out runs with cold creation per state,
  clippy in three configurations, rustdoc, the 2080 lane numbers, and the consumer's Iris sample.

SEMANTICS_VERSION 2099 -> 2100, RUNTIME_VERSION 2247 -> 2248.
2026-11-13 16:26:40 -08:00