Commit Graph
5683 Commits
Author SHA1 Message Date
Anees Iqbal dcfa3e7a94 Re-bless the authored compile census at pin 94
The census at 13bac091e1 (M3 job m3-max-30410, corpus-triage --audit
authored-compile --bless) moves only the artifacts_at product hash: no
case's artifact changed. The engine goldens' bless (m3-max-30409) left
no patch.
2026-11-14 15:25:56 -08:00
Anees Iqbal 13bac091e1 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-14 15:18:36 -08:00
Anees Iqbal dd486250e3 RUNTIME 2317: A kept draw reading its pass's copy by the area rule takes its reader identity and query
What:
- render/draw_again.rs, rebound.rs: a kept reader drawn again or rebound
  takes its reader identity and occlusion query as every step takes them,
  whichever form it reads through (the copy taken before the pass among
  them), and records its drawing commands inside the query. A debug
  build checks each draw again's identities against the step's
  (Readers::taken).
- slow_submissions.rs, command_buffer/submit.rs: a batch held in the
  scheduler's group gets its slow line, timed from its submission to its
  hold, naming the group.
- Tests: kept_shadowed_draws counts a frame's begins as the command buffers
  it began (WorkCounts::command_buffers_begun), not the device's begin
  calls, which begin-ahead spares move; kernel_end_device's slow-line
  check expects a group held by the groups' ends.
docs/API.md and env_vars.rs describe the slow line.

Why: at pin 93b on the 780M (devlegs), kept_shadowed_draws' kept frame
recorded 3 queries where the apart frame recorded 4: a kept draw through
the pass's copy skipped its reader's query, so its coverage was never
learned. kernel_end_device's slow line was missing for a batch held in a
group.

How verified (lane keptquery): 780M (RADV PHOENIX) at 918d3319ea,
m3-max-30392: 86/87, all four kept_shadowed_draws pass with queries 4 in
both frames, 31 of 355 kept draws checked taking an identity, begins equal
to the command buffers begun; the one failure was its own new group check,
fixed in 68c8917098. Negative control at 400efe7932, m3-max-30393: 3 of 7
fail as at 93b (queries 3 vs 4; slow line absent). Lavapipe 87/87 and
clippy plain and cpu_icd at 918d3319ea (um790 m3-max-30313). The 3090 run
(m3-max-30394), lint (m3-max-30391) and the 780M kernel_end rerun at
68c8917098 run after landing.
RUNTIME 2317: a kept draw records a query and a slow line it did not.
2026-11-14 15:17:52 -08:00
Anees Iqbal c404358025 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-14 15:17:11 -08:00
Anees Iqbal 1858a2fb34 RUNTIME 2316: Rate-mapped passes count their region-copy and fanned-out vertex work by box size
What: new WorkCounts fields
- rate_map_whole_copy_vertex_regions, rate_map_own_copy_vertex_regions,
  rate_map_run_vertex_regions: vertices x regions drawn through the
  region-copy variant into the whole table, by the encoder's own draws,
  and by a host step's runs;
- rate_map_fanned_vertices, rate_map_fanned_box_vertex_regions: vertices
  fanned out through the geometry stage, and those times the regions of
  their probe-bounded boxes;
- rate_map_fanned_vertices_boxed_16, _64, _256: fanned-out vertices whose
  boxes hold at most that many regions.
render::fan_out::Probed::of also ORs every block's bounds (its reach).
FAST-PATHS' FanOut row, docs/API.md and rate_mapped_pass.rs list them.

Why: on Iris a whole-table region copy costs about 16x a geometry-stage
fan-out a triangle, and the consumer's 127 ms a frame of rate-mapped GPU
time cannot be split between the encoder's own whole-table draws, runs and
fanned draws from today's counts. A plain sum cannot say how much fanned
work lies in small boxes, which a cheaper route for few-region draws
would take.

How verified (lane ratemap3, msi m3-max-30401 at 7a17a61829): render::fan_out
unit tests 6/6; rate_map device tests on lavapipe 19/19, with exact counts
in a_host_step_fans_out_the_commands_the_probe_does_not_flag (encoder frame:
own == whole == (5 x 3072 + 9) x table regions; host step: no whole-table
work, fanned vertices exact; under Exact all zero); clippy -D warnings
plain, cpu_icd and gpu; api_signatures --check clean.
RUNTIME 2316: what a run records changes. No Degradation kind, no
behaviour change.
2026-11-14 15:16:31 -08:00
Anees Iqbal 44cab7933f 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-14 15:15:51 -08:00
Anees Iqbal c2154d174f Device tests at pin 93b: staged records, queue plans, readers' own counts, unmade shadows
What (lane devlegs, the pin 93b device legs' test-side fixes):
- 308a8fe305 Device tests weigh readers by their own counts, bound command buffers by the peak seen, and expect staged records in generated executions
- 6951cb9635 Host-step notice checks of queue_order expect staged records too, through one helper
- 32d3d4eed7 Lane notice checks expect staged indirect records wherever the device staged them
- dcd14d9bb3 Lane tests that make a command queue per dispatch or per program take the queue plan
- ba649ccc4e The parity harness's runtime device takes its queue plan
- 7449dda069 shader_stencil's notice checks start from shared_kinds, staged records with it
- 6437e8482c fresh_pages: a shadow left unmade is announced as a reach makes it
- e0163a7a94 compute_inherited_buffers' runs share one command queue, whose kept barriers the first records

Why: at pin 93b (400efe7932) on lavapipe, the 780M, the XTX, the 3090 and
the 5080, device tests failed on expectations the runtime had moved past:
discrete devices stage indirect-command records (StagedIndirectRecords,
RUNTIME 2294), command queues take the device's queue plan, readers are
weighed by their own counts, begin-ahead primaries (spares) move begin
counts, NVIDIA's queue plan gives each command queue its own VkQueue
(a test's runs now share one queue), and since RUNTIME 2309 a shadow left unmade is made and announced
at the first reach. No runtime change: render/coverage.rs gains only a
cfg(test) constructor of ReaderKey for the device tests.

How verified: the lane's lavapipe runs of the touched modules; its check at
e0163a7a94 (build, clippy plain and cpu_icd, the touched modules on
lavapipe) and the device reruns run after landing.
Test-only: no RUNTIME bump.
2026-11-14 15:15:11 -08:00
Anees Iqbal c5b49b39d1 Apart-read tests clear to whole 8-bit codes and name the bytes they expect
What: buffer_carved_reads and heap_placed_reads clear the texture they read
to [64/255, 128/255, 191/255, 1.0] in place of a 0.5 channel, and each texel
check prints the bytes it expected and the first other texel it read.

Why: on the RTX 3090 and RTX 5080 at pins 91b, 92 and 93b, the three
apart-read tests failed with every texel [0x40, 0x7f, 0xbf, 0xff] where the
test expected 0x80 in the second channel. 0.5 x 255 = 127.5 lies halfway
between two codes; Vulkan's float-to-unorm conversion may return either
(spec 3.10.2), and NVIDIA rounds it down where RADV, lavapipe and Metal round
up. The runtime announces it already (device-color-conversion). The draw
read the right texture, and sync validation reported no hazard (3090 job
m3-max-30280). Whole codes round the same on every device;
device_recovery_textures already uses 128/255 so.

How verified: the old colour fails all three on the 5080 (m3-max-30250) and
the 3090 (m3-max-30252) at 91b and 92. The branch's lint and lavapipe check
(m3-max-30325) and the 3090 and 780M reruns run after landing.
Test-only: no RUNTIME bump.
2026-11-14 15:13:44 -08:00
Anees Iqbal 77c0733442 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-14 14:33:19 -08:00
Anees Iqbal 057b794f5b SEMANTICS 2115 / RUNTIME 2315: rate-mapped region copies record a box of regions per multi-draw
What: a draw through its region-copy variant recorded its regions 16 at a time (the device's
viewports). Each recording set 16 scissors, pushed its first region and stored DrawIndex as
ViewportIndex. On a guest frame the host step made about 4.7k such recordings a frame (Iris and
RTX 3090), while the GPU sat idle waiting for the step.

The variant's four clip distances already keep each copy to its region's pixels, as a fanned-out
copy's are kept; the per-region scissor only culled. Now:
- The vertex function draws region first + (DrawIndex / c)*nx + DrawIndex mod c from a pushed
  box (PushField::RegionBox, renamed from RegionFirst, now [first, columns]).
- It stores 0 as ViewportIndex, the recording's one viewport, so it writes every output the base
  variant wrote.
- The recording sets one viewport and its box's union scissor.
- A direct draw records a box as many regions at a time as one vkCmdDrawMultiEXT takes
  (maxMultiDrawCount - 1), its rows in order. A run records one recording per box its bounds
  reach; any other draw records the whole table in one or a few.
- Indirect draws keep one region a recording, under that region's scissor.
- The variant still needs shaderOutputViewportIndex and shaderDrawParameters; it no longer
  needs multiViewport.

Exactness: a border between two regions of a recording holds no pixel centre and no sample at
Vulkan's standard sample locations (at least 1/16 px inside a pixel, up to 8 samples), while each
copy's clip distance there is zero up to rounding. A box is recorded one column (row) at a time:
- in a pass whose custom sample positions put a sample on a pixel's left (top) edge;
- on a device without standardSampleLocations;
- in a 16-sample pass.
See render/fan_out.rs, folds.

A box's recording and the recordings of each of its regions alone run one pipeline that writes
the same outputs. They differ only in their dynamic viewport and scissor values and the integer
region each draw selects (Vulkan's Invariance appendix, Rules 2 and 4). The agreement between the
encoder's region-copy vertex function and the host step's fan-out geometry stage stays the
existing FAST-PATHS known gap, checked by running: no new near-equivalent, no new accepted
difference.

SEMANTICS_VERSION 2115 (the variant's module and push layout); ARTIFACT_FORMAT_VERSION 523 (the
PushField tag); RUNTIME_VERSION 2315 (what a region-copy draw records). Docs: rate_mapped_pass.rs,
render/fan_out.rs, bind/fan_out.rs, the translator's region-copy plan and store, docs/API.md, and
the FAST-PATHS fan-out row and known gap. docs/REFUSALS.md regenerated unchanged; api_signatures
blessed. No new Degradation kind, no WorkCounts field.

Tests:
- render/fan_out/tests.rs: run boxes, box recordings, box scissors, the fold rule.
- tests::rate_mapped_region_boxes (device test): the same two passes drawn directly (boxes) and
  indirectly (one region a recording, its own scissor), additively blended into RGBA16Float with
  a ground plane, border-crossing slivers and off-screen and w-straddling triangles, then an
  Equal pass, compared bit for bit, with the recordings counted.

Verified (lane ratemap2):
- msi m3-max-30288 at 9240cc0ea6: clippy -D warnings, all targets and features, plain, cpu_icd
  and m2v_gpu, exit 0; rustdoc -D warnings exit 0; translator touched tests 226/226; runtime
  33/33; lavapipe 13/13.
  - rate_mapped_depth_equal: 0 failing pixels in every pairing under Exact and FanOut. Without
    the ViewportIndex store, FanOut's mixed-route pairings had 2853 of 89483 (m3-max-30235).
  - rate_mapped_region_boxes: direct 3 draws in 3 recordings against indirect 3 in 624, 0 texels
    differ, Equal-pass mismatches [0, 0].
- Negative control (each clip distance widened by one pixel): rate_mapped_region_boxes fails,
  25464 texels differ, Equal-pass mismatches [11019, 0].
- The Iris GPU-time A/B (ms01, m3-max-30315, exclusive) is running; the consumer's renderer run
  at the next pin is the workload proof (rate_map_piece_gpu_nanos a frame on Iris).

Landing note: docs/API.md merged by hand with RUNTIME 2314's probe-parts sentence (both rewrote one
paragraph), and rate_mapped_pass.rs's Fan-out now says the probe runs in parts (RUNTIME 2314).
2026-11-14 14:32:33 -08:00
Anees Iqbal 400efe7932 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-14 14:00:41 -08:00
Anees Iqbal 744dfd4d9d RUNTIME 2314: A host step's rate-map probe runs in parts, each on the GPU while the host records the next
A rate-mapped pass whose records the GPU may write is recorded by a host step that fans
its triangles out to the map's regions after a probe: every command's draw recorded once
more through the probe variant, submitted, and waited for before the routes are
recorded. The host recorded the whole probe with the GPU idle, then sat idle itself for
the probe's whole GPU time. On a 3D renderer's frame on an RTX 3090 (pin 91b) that wait
was 23-35% of host_step_nanos, 5-7 ms of a ~22 ms step, three steps a frame.

Now the probe is recorded in parts: at least 32 commands a part and at most 8 parts a
probe (DeferredPass::probe_parts). Each part is submitted with its own fence once
recorded, so the GPU runs it while the host records the next, and the host waits once,
for every fence, after the last part (CommandBuffer::submit_fenced / wait_fenced, the
halves of rerun::submit_waited, which the predicated loop's runs again keep using). A
part may hold commands of several executions; its draws take the flag words one
recording would give them (the index carried from part to part, each command's slot by
its place among its execution's commands that run), so the probe's words, the routes
and the pixels are the same in any parts. A probe that stops (a barrier, a draw that
writes memory) stops for the rest of its execution; a part recorded in more than one run
sends the execution region by region, as one recording did. Every part submitted is
waited for before the step goes on, a failed later recording's too.

Ordering: the parts go on the command buffer's own VkQueue, in order, and each part's
primary begins with the segment's full barrier (EncoderCore::segment), as the one
probe's did, so part k+1 follows part k and the pass follows the last; no semaphore and
no other queue's edge is added.

Cost: up to 7 more submissions and probe render pass instances a step (load and store in
GENERAL, no fragment). WorkCounts::rate_map_probe_parts counts the parts;
rate_map_probes stays one a step; rate_map_probe_gpu_nanos sums the parts' times;
rate_map_probe_wait_nanos is now the host's one wait after the last part.

Test: tests::rate_mapped_fan_out's a_host_step_probes_many_commands_in_parts: 72
commands (the eight's pattern nine times) probe in 3 parts with the same flagged,
fanned-out and parted draws, each 9 times the eight's, and the encoder's pixels; the
eight-command test asserts one part. The workload takes its command count.

New WorkCounts field: rate_map_probe_parts (api_signatures blessed). No new Degradation
kind. No RUNTIME_VERSION bump (main does it at landing).

Also in this landing: the icb_reads example's --rate-map and --wide-every W (the A/B shape);
the parts' recordings joined once, after the wait; and the split fenced wait reaching the
device's functions inside each exit-guard section (a predicated loop's run again on the loop
thread).

RUNTIME_VERSION moves: a host step's probe of an unchanged artifact is now recorded and
submitted in parts.

Verified (lane icbstep2, msi lavapipe):
- m3-max-30234 at c41586a13d: clippy -D warnings plain and cpu_icd (runtime, all targets, all
  features) exit 0; 63/63 for rate_map|rerun_arenas|indirect_command_buffer|icb_|host_step|
  fan_out, among them the ordering tests a_flagged_draw_s_parts_take_each_triangle_once_in_order,
  a_host_step_s_instances_follow_their_commit_in_the_program_s_order,
  a_recovery_s_carry_waits_for_a_write_without_the_lock and
  an_unshared_head_at_its_host_step_goes_before_work_whose_room_came_after_its_commit; the new
  a_host_step_probes_many_commands_in_parts reports probes [1,36,36,36], 3 parts and 5
  submissions, with the encoder's pixels.
- Negative control m3-max-30241 (one part a probe): the new test fails, "the probe's parts of
  32, 32 and 8 commands, left: 1 right: 3", with the same probe counts.
Expected, not yet measured: the 3090 release A/B (host_step_nanos and rate_map_probe_wait_nanos
a step) follows. The consumer's renderer run at the next pin is the workload proof.
2026-11-14 14:00:01 -08:00
Anees Iqbal f3a2ff76f7 Runtime device tests: an unmade shadow is a shadow; a wide view alignment reads one table whole
What:
- tests::shadow_forms(before, after) (tests/mod.rs) counts the textures
  that took the shadow form, made or left unmade until a reach makes it
  (RUNTIME 2309, e453efbf0a): shadowed_textures + shadows_left_unmade -
  shadows_made_at_use. copied_device's over_copy_or_shadow helper and
  fresh_pages' check over fresh pages use it.
- padding_unobserved: shadowed(texture) reads a texture whose shadow is
  unmade as a shadow, where Texture::shadow() answers none for it. Its
  form checks and counts use that and shadow_forms.
- draw_again::a_table_read_whole_is_counted_by_why expects one more whole
  read, for views, on a device whose uniform view base alignment
  (BindState::view_base_alignment_of) is past 16 bytes. On such a device
  the second draw's vertex buffer, bound at 16, is left out of the slots
  read at their bind offset (argument_table::AtBindViews), so that draw
  reads its vertex table whole once, and in part one draw fewer.

Why: on the RTX 5080 Laptop GPU leg at 4aacef045b (b5080 batch m3-max-30190,
entries devlegs-5080-p1/p2, the first 1817 tests), these failed:
copied_device::a_texture_over_a_copied_buffer_is_an_image_over_the_copy_where_the_check_passed
("an image over the copy or a shadow" 0 vs 1),
fresh_pages::a_texture_over_a_long_buffer_is_its_bytes_in_place_where_the_check_passed
(shadowed_textures 0 vs 1), and
padding_unobserved::a_texture_over_unobserved_padding_aliases_its_buffer_and_over_observed_padding_is_a_shadow
(at a pitch of 416, which NVIDIA's explicit planes are refused at since
RUNTIME 2308: shadow() none where the answer was a shadow). In each, the
texture's shadow was left unmade. Also draw_again's [4,0,0,0,1,0,0,0]
against [4,0,0,0,0,0,0,0]: NVIDIA's minUniformBufferOffsetAlignment is 64,
so the alignment is 64 and an offset of 16 leaves the slot out. That is
argument_table's documented rule, not a stray read. Where no shadow is
unmade, or the alignment is 16, the expected counts are the old ones.

How verified: the lavapipe run (unchanged counts there) in the branch's msi
check job; the 5080 and 3090 reruns follow at the next pin's archive.

Checks (lane devlegs, msi m3-max-30233 at 081b143d3b): clippy -D warnings plain and cpu_icd exit 0;
lavapipe 207/207 (draw_again 29, copied_device 35, fresh_pages 6, padding_unobserved 6, and the
modules of RUNTIME 2313). Test-only: no RUNTIME bump.
2026-11-14 13:58:27 -08:00
Anees Iqbal 1a6fcf6ece A kernel's patch control-point input stays refused: pin it and say why
What: an ABI test, a_kernel_takes_no_control_point_input, decodes one synthetic module's
air.patch_control_point_input (its declared, never-defined fetch function and two fields) on a
post-tessellation vertex function and checks that the same input on a kernel is refused,
InvalidInput(Abi(UnknownKey)) at argument 0 and that key. docs/API.md's kernel [[stage_in]]
section states the refusal, Metal's answer, and the two forms through which a kernel does read
vertices by index.

Why: Metal refuses the shape too. `metal` (32023.922) writes no control-point input for a
kernel: every MSL spelling fails to compile ("invalid type 'patch_control_point<CP>' for input
declaration in a kernel function"). A kernel assembled by hand in the post-tessellation shape
(xcrun metal-as, metallib) gives a library and a function on an M3 Max under macOS 27.0.1, whose
reflection lists both fields as control-point stage-input attributes. Every compute pipeline of
it fails, "Internal compiler error.", under Constant, ThreadPositionInGridX (rates 1 and 2, a
region origin of 2), ThreadPositionInGridY and both indexed steps. Without a descriptor Metal
asks for one, and a vertex step function in a compute descriptor stops at a framework
assertion. As a check that the module was well formed, the same body as a [[patch(quad, 4)]]
vertex function makes its render pipeline and fetches patch p's point j as element 4p + j. As a
check of the host and the descriptors, an MSL kernel [[stage_in]] of the same attributes makes
a pipeline under every one of them. So the refusal stays where it is, at the pipeline compile.
The ABI has no error kind for a role outside its stage other than UnknownKey (its documentation
covers a role the stage does not accept), so the error kind is unchanged and REFUSALS.md does
not move.

Verified: the M3 probes ran as potluck jobs m3-max-30194, 30197, 30201 and 30203. The test,
clippy, and a negative control (the role allowed on a kernel, which fails the test) ran in one
msi job, named in the report.

Checks (msi m3-max-30227 at 70b57adf99): clippy -D warnings plain and cpu_icd exit 0; 74 touched
tests pass; negative control (the refusal made to accept) fails the new test, exit 100. No
RUNTIME bump: the refusal and its error are unchanged.
2026-11-14 13:56:59 -08:00
Anees Iqbal b8b03a31cc Lanes: leading_costs and compositor_costs measure what a frame's attachment reads cost on the GPU
What: two ignored release lanes in metal2vulkan-validation, measurement only. No product code
changes.
- runtime_lane::attachment_read_costs::leading_costs: a reader whose snapshots lead its
  instance, against the split's copy. Its private plane lies at 64-byte aligned rows, which a
  linear image takes in place.
- runtime_lane::compositor_costs: a compositor-shaped frame of 105 render encoders, with the
  read ratios of a consumer's desktop walk. It comes in four shapes:
  - readers as they are;
  - readers whose read texel decides a branch, which take the split;
  - the same calls without barriers;
  - no reads at all, the frame's floor.
  Each shape runs over a private framebuffer and over one on host pages. The lane prints GPU ms
  a frame with passes, barriers, splits, snapshots and copied texels.

Why: to size a lever before building it. Measured (median of 15 frames, GPU ms):
- Iris Xe, ANV (m3-max-30191 at d2c9d15a73):
  - host pages: floor 28.07, readers 37.87, branch readers 39.32, no barriers 39.18;
  - private: floor 6.89, no barriers 10.94, branch readers 12.48, readers 13.30.
- RTX 5080 (b5080), floor / no barriers / branch readers / readers:
  - private: 0.97 / 1.62 / 1.99 / 2.25;
  - host pages: 30.22 / 35.17 / 38.81 / 41.06.
On Iris, serving branch readers by snapshots would save about 24 us a reader over host pages,
under the bar for building it. Fills over host pages cost 4.1x (Iris) and 31x (5080) the
private ones. No 3090 run was made.

Checks: msi m3-max-30230 at 163c7efdbf: clippy -D warnings (runtime + validation, all targets,
all features) plain and cpu_icd, both exit 0. No RUNTIME or SEMANTICS bump: no artifact's run
changes.
2026-11-14 13:55:28 -08:00
Anees Iqbal 38cc6ae244 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-14 13:53:44 -08:00
Anees Iqbal ec6f1a1109 RUNTIME 2313: DeviceRecovered's announced cost states the pooled ICB records RUNTIME 2311 loses; device-leg tests count lazy shadows and size depth heaps by the query
Three fixes from the device legs at 4aacef045b (Radeon 780M HawkPoint m3-max-30180) and pin 93's
checks at b89241fafa (merged m3-max-30182, lavapipe m3-max-30185).

1. Degradation::DeviceRecovered's cost string now says what docs/API.md's catalogue entry says
   since RUNTIME 2311 (dfda37628d). An indirect command buffer's records are lost at a recovery:
   - on a device that imports no host pointer;
   - where their import failed;
   - under the default DevicePolicy::indirect_records = IndirectRecordsPolicy::Untaxed, on a
     device whose check found that a held host-pointer import costs every submission (RADV, ANV
     on i915), where they lie in pooled memory.
   They are kept in the runtime's own pages everywhere else, and under
   IndirectRecordsPolicy::Carried, which exact_answers() selects. RUNTIME 2311 changed the entry
   but not the announced cost, so tests::degradation_catalogue::a_runtime_kind_s_entry_states_the_cost_it_announces
   failed on every venue.
2. The tests that check the form a texture takes as it is made (a shadow, or in place, exactly
   one) now count a texture whose shadow RUNTIME 2309 (e453efbf0a) leaves unmade until the first
   reach as a shadow. runtime_lane::shadow_forms counts shadowed_textures + shadows_left_unmade -
   shadows_made_at_use. It is used in no_copy_textures, pitched_surfaces, linear_alignments,
   in_place_textures, aliased_surfaces and device_copies; the runtime's
   texture_placement_device path() reads an unmade shadow as "shadow". Each texture still takes
   exactly one form.
3. store_out_device's two depth tests lay their no-copy heap over pages sized by
   Device::heap_texture_size_and_align, as a program sizes a heap. They had taken 64 KiB whatever
   the device answered, and failed on the 780M with OutOfMemory(Heap).

RUNTIME_VERSION moves because the device-recovered notice's announced text changes. Fixes 2 and
3 are test-only. No new Degradation kind, no WorkCounts field, no public item.

Verified (lane devlegs, msi lavapipe m3-max-30224 at 399ca0a0b3):
- clippy -D warnings plain and cpu_icd (runtime + validation, all targets, all features) exit 0;
- 129 of the 131 selected tests passed and none failed; the job was cancelled with 2 still
  running, at its RAM reservation. The passes include degradation_catalogue 5/5,
  pitched_surfaces::a_texture_that_only_reads_keeps_every_byte_of_its_pages_in_place (it fails
  at b89241fafa), no_copy_textures *_padded x5, linear_alignments, texture_placement_device x2,
  store_out_device 9/9 and degrade_notices.
The 780M rerun follows on the next pin's archive.
2026-11-14 13:53:00 -08:00
Anees Iqbal 05d5da5ba6 Re-bless the authored compile census at pin 93
The census at b89241fafa (m3-max-30184, M3) moves only the artifacts_at product fingerprint
(RUNTIME 2309-2312 and the translator changes since pin 92); every row is unchanged. The engine
golden bless (m3-max-30183) wrote no change.
2026-11-14 13:36:30 -08:00
Anees Iqbal b89241fafa 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-14 13:12:39 -08:00
Anees Iqbal 22fa0997b1 RUNTIME 2312: A write-only argument-buffer use of a texture whose writes Metal drops names none of its image
What. A command that makes a texture resident whose writes Metal drops
(metal::format::writes_dropped: the 4:2:2 formats, the subsampled and packed
two-plane YCbCr ones) names no use of it where its binding plan's heap holds
it at no element (no WriteSource::HeapEntry of its token): every heap storage
array holds such a texture as its neutral (bind::heap's Fit::Dropped), and a
kernel that only writes it declares no sampled array, so its function reaches
none of the texture's image (binding.rs, resident_uses_into; the storage-only
test holds_write_shadow becomes heap_holds, by class access or any).

Why. A kernel that only wrote a YCBCR8_420_2P texture through an argument
buffer (useResource WRITE) named the texture's image as a written use. That
use matched the texture's converted shadow, so the command's shadow planning
made and recorded the planes' conversion (ShadowCopies::prepare ->
YCbCrConversion::make), and on a device that converts 4:2:0 itself (Iris Xe:
the consumer's pin 92 Iris leg, writes_through_argument_buffers_of_two_plane_
ycbcr_textures_are_the_slots) that first conversion announced
ycbcr-filter-not-exact though nothing read the texture: relayed in default
mode, fatal in strict mode. The write itself was dropped, as Metal drops it.
4:4:4 textures already named only their write shadow. Now such a command
converts nothing and announces nothing; a command whose function reads the
texture through the argument buffer (a sampled array holds it) converts it
and announces the device's conversion as before.

Test: runtime_lane::ycbcr_argument_writes::a_kernel_that_only_writes_a_held_
420_texture_converts_none_of_its_planes (lavapipe and GPU lanes): resident
WRITE and READ|WRITE, the write-only kernel records no conversion
(ycbcr_refreshes + ycbcr_whole_conversions), announces no
ycbcr-filter-not-exact and leaves the planes' bytes; a kernel reading it
through the argument buffer records one conversion and announces the notice
where the device converted the texture itself. lavapipe converts 4:2:0
through Metal's arithmetic, so there the conversion count is the check that
fails without the fix. docs/API.md's catalogue entry and ycbcr.rs's writes
bullet say so.

Verified (lane ycbcrnote, at 12dbbcc67e on fe38b678dc):
- msi lavapipe m3-max-30151: touched lane tests 173/173 and runtime cpu_icd
  tests 238/238; clippy -D warnings plain and cpu_icd exit 0. Negative control
  in the same job (binding.rs back to fe38b678dc): the new test fails at "the
  writing command converted the planes".
- RTX 5080 (b5080 entry ycbcrnote-held420-130832, prebuilt m2v_gpu archive):
  passes; device conversion true, write-only commands announce nothing, the
  reading command announces YCbCrFilterNotExact once.
- msi m3-max-30159: clippy -D warnings under m2v_gpu and rustdoc -D warnings
  exit 0.
Expected, not run: the consumer's Iris strict test passes.
RUNTIME_VERSION moves: the same artifact's write-only commands now record and
announce nothing where they converted and announced before.
2026-11-14 13:11:54 -08:00
Anees Iqbal 4aacef045b 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-14 12:49:52 -08:00
Anees Iqbal dfda37628d RUNTIME 2311: ICB records lie in pooled memory where a held pointer import taxes every submission
What: DevicePolicy gains indirect_records (IndirectRecordsPolicy, a runtime
choice no profile carries). Under the default, Untaxed, an indirect command
buffer's records and overflow slots take fresh pages of the runtime's own
(a pointer import held for the buffer's life) only where the device's import
tax check has not found that a held pointer import costs every submission, or
has not answered; where it has (RADV, ANV on i915), they lie in pooled
host-visible memory as the runtime's other buffers do. Under Carried, which
exact_answers() selects, they lie in fresh pages wherever the device imports
host pointers, as before, so a recovery keeps them. A recovery of a taxed
device under the default loses pooled records and rewrites them as a new
buffer's (carry.rs's existing pooled path); the device-recovered notice
already counts such buffers ("N indirect command buffers, M of them whose
records were lost"), as on a device without pointer imports and for
device-local records on discrete GPUs. No new Degradation kind.

Why: on a Radeon 780M (RADV, Mesa 26.2.6, Linux 7.3.3) beside a guest game
whose ICB records were the process's only pointer imports (3 buffers, 19.6 MB),
the submission thread had 5 windows of 65-140 ms in 12 s in which every
amdgpu_cs_ioctl waited in mmu_interval_read_begin or returned EAGAIN (373 of
the run's 382 failed calls, retried at once by libdrm). RADV lists every
imported memory in every CS, amdgpu re-faults every userptr page each CS and
adds the CS fence to every listed BO, so a page migration of one of those
pages (kcompactd, khugepaged, and the runtime's own block making in direct
compaction) waits in amdgpu_hmm_invalidate_gfx for all the process's GPU work
in flight while every submission waits behind it. With no userptr BO listed,
compaction migrates pages without waiting on any fence.

Docs: the FAST-PATHS ledger row (default, switch, the recovery cost, the
measured chain), API.md's device-recovered text, HOWTO's residency section,
fresh_pages.rs, indirect_command_buffer.rs and carry.rs, the conformance
crate's Policy::Exact list. API: signatures blessed, api_surface row,
REFUSALS.md regenerated.

Tests: tests::icb_records_policy (Linux, cpu_icd/gpu): the import tax forced
Holds/Fails; under Untaxed+Holds the records lie in pooled memory, no fresh
pages made, a recovery moves them and its notice counts 1 lost; under
Untaxed+Fails and Carried+Holds in the runtime's own pages, kept, 0 lost. The
translator's fast_paths names the choice, checks it keys no profile and that
exact_answers() takes Carried. icb_carry_race's own-pages cases run on a
Carried device (device_recovery::carried_device), so they assert the carry of
own pages whatever the device's verdict.

RUNTIME_VERSION moves: where records lie and what a recovery keeps change on taxed devices.
New public items: metal2vulkan::device::IndirectRecordsPolicy { Untaxed, Carried } and
DevicePolicy::indirect_records.

Verified, msi m3-max-30127 at cba1ec585a (the fix plus a test-only fix: DevicePolicy is
non-exhaustive, so the tests set the field on a copy):
- clippy -D warnings --all-targets --all-features: metal2vulkan + runtime plain 0, runtime
  --cfg m2v_cpu_icd 0;
- translator tests 49/49 (fast_paths with the new choice, its no-profile key and exact_answers
  tests, api_surface, api_signatures);
- runtime under cpu_icd on llvmpipe 34/34: icb_records_policy, icb_carry_race, icb_records_home,
  indirect_command_buffer*, device_recovery_every_kind, device_recovery_carry.
ICB-RECORDS lines:
- Untaxed with the tax forced Holds: records not in own pages, 0 fresh-page buffers, the
  carry moved them, notice "1 of them whose records were lost";
- Untaxed with the tax forced Fails: own pages, 2 fresh-page buffers, kept;
- Carried with the tax forced Holds: own pages, 2, kept.
Workload proof owed: reims's traced loaded-desktop walk on the 780M (per-CS get_user_pages 0, no
-EAGAIN windows).
2026-11-14 12:49:09 -08:00
Anees Iqbal 483b4650d1 fixed_index_draws example: a frame of indexed draws whose indices a dispatch before each draw writes
What a GL-on-Metal layer's frames cost the GPU where a compute dispatch before each draw fixes
up that draw's index buffer (each dispatch writing a Private buffer of its own, in serial compute
encoders of 256 dispatches, then render passes of 26 indexed draws, 4 passes a command buffer),
beside the same frame with the indices written once before (prefixed) and the compute encoders
alone (dispatches). The defaults follow a GL benchmark's per-second counts on the runtime (about
470 compute encoders of 256 dispatches, 4,650 passes of 26 draws, 1,270 command buffers).

The kernel and the draw's functions are a new owned MSL fixture,
fixtures/public/examples/fixed_indices.metal, compiled by regen-air-fixtures --dir examples.

Release measurement on an RTX 5080 Laptop GPU (b5080 entry glfix-framesplit-124152; GPU busy per frame, union of
command-buffer spans, median of 60 frames; a frame of 1280 draws):
- fixed: 0.526 ms;
- prefixed: 0.404 ms;
- compute encoders alone: 0.116 ms (0.09 us a dispatch).
fixed minus prefixed equals the dispatches' own time, so the compute-to-render transitions and the extra command
buffers cost about 0.006 ms a frame. No runtime source changes; the runtime pin moves alone.

Verified: msi m3-max-30123 at 195f2073fd:
- runtime crate clippy -D warnings --all-targets --all-features, plain and --cfg m2v_cpu_icd: 0;
- release build: 0;
- a lavapipe run of all three shapes: the index check passed after each.
2026-11-14 12:46:26 -08:00
Anees Iqbal fe38b678dc 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-14 12:23:29 -08:00
Anees Iqbal ce54ad8b25 RUNTIME 2310: an unshared commit on its way goes before another queue's batch whose room came after it
A scheduler pass that found another queue's batch's room let it go while an unshared queue's
commit there, taken in, waited only for the runtime: its host step (handed to the steps'
thread in the same pass), its submission checks, or a shared event's value whose signal was
already submitted and had not landed. Order::next refused the unshared head and sent the
other batch; the unshared command buffer then waited for that whole batch on the GPU. In
reims's traced walk ld91 (um870 Radeon 780M, guest compositor beside gameload) another queue's
batch went in while a compositor's command buffer so waited ahead of 33 of the 46 frames
answered more than a refresh late: 20 at its host step (e.g. take 1794684425.009: gameload
#19392 committed -3.0, submitted +2.6, inside WS #19398's commit +2.3 -> submit +2.8), 13
waiting for the landing of its other unshared queue's signal.

The rule (unshared_hold.rs, "Commits on their way"): each unshared commit carries its place
among those posted on its VkQueue (SlotShare::posted_unshared now answers it). Each look
collects the unshared heads on their way (on_its_way: binary semaphores ready, every event
value reached or reached by a submitted signal, held only for its host step with no pipeline
making pending, or for its checks) that wait behind no earlier commit (is_behind), and a
batch whose room came is held (behind_commits) while one posted before its noted count leads
its line so. The step's end, the checks or the landing wake the scheduler's thread, whose
next pass sends the unshared one first. Each look asks again: a head waiting for anything
else (a value nothing submitted reaches, a binary semaphore, a making, a decode, a rebind) or
behind an earlier commit (the held batch's own included) holds nothing, so neither waits for
the other. Other threads' passes leave such batches to the scheduler's thread
(first_for_the_thread widened to heads on their way), which they wake. Counted in the
existing WorkCounts::heads_held_for_unshared_commits (doc widened). No switch, no public item,
no Degradation kind. Docs: unshared_hold.rs, FAST-PATHS unshared-isolation row, API.md.

Tests: unshared_hold unit test of behind_commits with places on their way; queue_share_device
(lavapipe), each leg by the scheduler's pass and a committing thread's:
an_unshared_head_at_its_host_step_goes_before_work_whose_room_came_after_its_commit,
an_unshared_head_waiting_for_a_signal_to_land_goes_before_work_whose_room_came_after,
an_unshared_head_behind_an_earlier_commit_of_the_held_queue_holds_nothing,
an_unshared_head_waiting_for_a_value_nothing_submitted_reaches_holds_nothing.

RUNTIME_VERSION moves: what a run submits, and in what order, changes.

Verified (msi lavapipe):
- m3-max-30046 at 71c8bf7337 (the rule plus a test-only fix), runtime crate, --all-features
  --all-targets -D warnings:
  - clippy plain and --cfg m2v_cpu_icd: 0;
  - 103/103 tests: unshared_hold, queue_share, queue_share_device, scheduler,
    scheduler_held_wakes, scheduler_wakes, inbox, waiter_submits, commit_and_submit, hold_sites,
    dispatch_pending, queue_limits_device, stall.
- New tests, each run once through the scheduler's pass and once through a committing thread's:
  - at its host step: the other buffer began 0.168 / 0.199 ms after the unshared one;
  - waiting for a signal to land: 0.183 / 0.206 ms after;
  - behind an earlier commit: holds nothing;
  - waiting for an unreached value: holds nothing.
  The RV2303 tests still pass.
- Negative controls:
  - m3-max-30021, rule off: both "goes before" tests fail (the other buffer began 1.519 ms
    before the unshared one);
  - m3-max-30036, the two no-hold exclusions removed: both no-hold tests time out at 20 s.
- Test-only fix in this change: RV2303's committing-thread test held its scheduler thread with an
  application batch that now correctly waits behind the stepping unshared dispatch. Its holder is
  now a command buffer on another unshared queue, which nothing holds back.
2026-11-14 12:22:47 -08:00
Anees Iqbal bfb51bc5c2 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-14 12:16:00 -08:00
Anees Iqbal e453efbf0a RUNTIME 2309: a texture whose rows are in place makes its shadow at the first reach of its image
A device-gap texture over a buffer (its image refused for a reason that leaves its rows in
place: format, pitch, placement, source, dma-buf) was a shadow made at new_texture: its
VkImage, memory and views, its notice and shadow-log line, and its slot in the texture table
and every heap set. A slot whose function only reads, writes or asks its size binds the rows
in place, so a texture only ever bound that way paid for a shadow no command used (reims's
gbs91 on the 780M: hundreds of such textures, 8 to 52 MB each).

Now such a texture (rows in place, no pending in-place verdict, not over a heap's buffer) is
made with its shadow left unmade (texture/lazy_shadow.rs): the storage accessor makes it at
the first reach, once, under a lock, with the making's notice, log line and counts, then
places its slot (its resource ID reads the neutral until then). Paths that must not make it
read the recipe instead (rows binding, placement and heap-set writes, CPU copies, blits on
the bytes, shape and plan questions, logging). The reaches that make it: a slot that binds
the image (before the command's copies are planned from its uses), use_resource, a pass's
attachment, an execution of commands inheriting the bindings, a view, its VkImage handed out.
An out-of-memory making fails the reaching call, as new_texture did.

WorkCounts::shadows_left_unmade and shadows_made_at_use count both halves; docs/API.md says
when the shadowed-texture notice is given.

Not in scope: two kinds still make their shadow at new_texture. A texture waiting on its pages'
in-place verdict may move in place. A texture over a heap's buffer is made resident by use_heap
through a path that checks the shadow.

RUNTIME_VERSION moves because the run's announcements change. The shadowed-texture notice and the
shadow-log line come at the making, and a texture only ever bound through its rows gives neither.
A resource-ID read of an unmade texture gets the neutral. No new Degradation kind. No FAST-PATHS
row: the copy work follows uses, not the shadow's existence (an unbound shadow was copied 0 times
per commit before and after), so no accuracy is traded. The saving is the making: the VkImage, its
memory, views and heap-set slots.

Test: tests::texel_rows_device::a_shadow_is_made_at_the_first_reach_of_its_image, on a copied
buffer, since over the pages lavapipe lays the rows in place. Three cases:
- a written-only texture: shadows_left_unmade +1, none made, shadowed_textures 0,
  shadow_copies 0, texels inverted in the pages;
- a rows write then a sample in one command buffer: made at the sample, copies > 0, pixels equal
  to a device-own texture's;
- use_resource: made at the call.
joined_residency's helper asserts shadows_bytes() where it asserted the shadow at new_texture.

Verified, msi m3-max-30024 at 088a73d3b7:
- clippy -D warnings, runtime crate, all targets and features: plain and --cfg m2v_cpu_icd exit 0;
- lavapipe 206/206: texel_rows, shadow*, read_twin*, joined_residency, padding/kept_padding,
  exported_*, first_host_texture, surface_shapes, attached_read*, copied_device, fresh_pages,
  texture::*;
- translator api_signatures, api_surface and fast_paths: 47/47;
- the negative control in the same job (lazy = false): the test fails at "Copy: left unmade",
  (0,0,1) against (1,0,0).
2026-11-14 12:15:15 -08:00
Anees Iqbal 9972bec765 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-14 12:06:15 -08:00
Anees Iqbal 160837e4e0 Rebound draws gather shadow uses that differ from the kept draw's instead of stopping
A draw rebound that was not carried in went on only where its uses of shadowed
textures (ShadowUse::used_as: the shadow, writes, area, own-pixel read bounds)
equalled its kept draw's, since it gathered nothing into its instance. Another
shadow at a changed slot, or own-pixel bounds that follow a restated scissor,
stopped it, and the draw took every step. That is the largest rebind stop in the
780M desktop walk (draws_rebind_stopped_arguments_shadows 62,642 of 98,870
stops; Launchpad 24.1k, Mission Control 26.6k).

Now such a draw gathers its own shadow uses into its instance as every step
does (shadow::join, through InstanceShadows::add, or InstanceShadows::join for
a narrowed draw), as a carried draw already did, and keeps them as the uses the
next draw rebound compares with. It still stops where it uses some and its kept
draw used none, or the other way: Kept::again follows that. A new check stops a
draw that reads a color's copy after a barrier inside its instance (counted
_checks): every step splits there or weighs the spare, and only the shadow stop
kept such draws out before. The debug rebound check compares a ninth part, the
draw's shadow uses against its every step's.

kept_shadowed_draws: the kept frame's commands recorded (every kind) and copies
equal the every-step frame's; its second-target and scissor draws rebound
instead of stopping; a lane of draws of other arguments (base instance
alternating) rebinds every draw after the first; a lane across a barrier stops
at the new check, with the split and texels of every step.

Also: examples/draw_costs gains a "backdrops" shape (every compositor draw reads its pass's colour
at its own pixel under its own scissor), which the A/B below uses.

No new WorkCounts field or Degradation kind. No RUNTIME_VERSION bump: the commands, copies and
pixels are those every step records. The runtime pin moves alone.

Verified (msi lavapipe):
- Base repro m3-max-29949: the kept frame had as_before 2, rebound 0, stopped 2.
- kept_shadowed_draws, 4 lanes. Each compares the kept frame with an every-step frame on pixels,
  copy counts with copied texels, and the recorded command map. At the tip:
  - plain lane: stops 2 -> 0;
  - other-arguments lane: _arguments_shadows 2 -> 0;
  - a lane where the rebound draws are the last to use a shadow: _shadows 3 -> 0;
  - barrier lane: _checks 1, with 1 split.
- Negative control m3-max-30008, by hand:
  - restoring the stop fails 3 lanes (_shadows 2/2/3);
  - removing the gather fails 3 lanes on copied texels (1124 vs 2048) and on the last-use lane
    (copies 1 vs 2, texels 525 vs 1313).
- Release A/B m3-max-29983/30002:
  - base 88f577d11c md5 48293e84, tip 882c9a785b md5 daa3de5b;
  - own target dirs, P-cores, 5 interleaved rounds, medians per draw.
  Results:
  - backdrops: cpu 9963.7 -> 6688.9 ns (-32.9%), instructions 75034 -> 50632 (-32.5%);
    _arguments_shadows 1856 -> 0 and rebound 383 -> 2239 over 2240 draws;
  - compositor: instructions 54492 -> 54493 with identical counts (time +2.2%, noise).
- m3-max-30016 at 1494716c54: clippy -D warnings --all-targets --all-features (runtime crate), plain
  and --cfg m2v_cpu_icd, exit 0; 204/204 touched tests: draw_again, kept_shadowed_draws,
  render_fold, encoder_fold, kept_*, rebind_*, shadow_*, attached_read_*, render::shadows.
2026-11-14 12:05:33 -08:00
Anees Iqbal 15eab80f10 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-14 12:04:22 -08:00
Anees Iqbal 818ebc942d A render encoder that split carries its kept draw: the Split check holds pieces alone
carry_ends refused to carry the kept draw of an encoder whose pass split into instances (a reader
of a colour after a barrier over the targets). The check came in with the first carry commit
(fa7bb25dd2) as a scope limit, not a Metal ordering rule. A carried draw records into the next
encoder's own first instance, after everything the ended encoder recorded, so nothing is
reordered, and carried_into already resets every field that depends on the instance (stated,
between, stamps, under, command_buffer, settled). The check now refuses only an instance split
into pieces: draws recorded before an execution of render commands, or the draw of a pipeline
still being made. The counter names (Uncarried::Split, encoders_uncarried_split,
encoders_none_kept_next_split) stay; their docs now say pieces.

No new WorkCounts field or Degradation kind. No RUNTIME_VERSION bump: the commands, state commands
and pixels are those every step records. The runtime pin moves alone.

Test: split_keeps' kept_draws_past_a_split_carry_into_the_next_encoder: two encoders of A, B, a
barrier, a reader, A, B, B again twice, each on a queue of its own. Kept run against every-step
run:
- kept_draws_rehomed (4, 0); draws_rebound_carried drawn_alone(2) (1 in debug, where the first
  carried draw takes the every-step check);
- draws_none_kept (4, 14); no unlike, stopped or carry-stopped draws; encoders_uncarried_split and
  encoders_none_kept_next_split (0, 0);
- the same commands, draw states recorded and pixels as every step.
draw_again's run_into can now open several encoders: the first clears, later ones load.

Verified (msi lavapipe):
- m3-max-29979 at 150bcb4dc5 (later commits change only doc comments): clippy -D warnings, plain and
  --cfg m2v_cpu_icd, exit 0; 145/145 tests in 35 touched modules, carried_draws and both split_keeps
  tests among them.
- Negative control m3-max-29991, the old check restored: the test fails on draws_rebound_carried,
  (0, 0) against (1, 0).
- Release A/B of walk_costs' barriers private shape:
  - builds m3-max-29980, base 042d11378b md5 0f833451, tip md5 27e08f2f, own target dirs;
  - runs m3-max-30010, 15 interleaved rounds on P-cores.
  Per frame: draws_none_kept 9 -> 3, draws_rebound 6 -> 12 (6 carried), encoders_uncarried_split
  3 -> 0, no cmd_* count changed. CPU per frame: base median 175.9 us, tip 175.2; paired median
  -4.2 us, tip slower in 6 of 15. msi's load average was 13-27 throughout, so: neutral within noise
  on lavapipe, where ~76% of the encoding thread is the driver.
2026-11-14 12:03:41 -08:00
Anees Iqbal 6353690110 Re-bless the golden hashes and the authored compile census at SEMANTICS 2114
SEMANTICS 2114 (2960070096: write() through an argument buffer to a two-plane YCbCr texture)
changed the SPIR-V of heap float writes, so 14 golden hashes moved. The authored compile census
was re-run at the same tip.

Verified: pin 92 at 5c9d222e05. The merged job m3-max-29974 failed only
tests::golden_hashes::golden_hashes_match_the_table (5748/5749 core; validation 1387/1387,
conformance 1043/1043, clippy, doctests, rustdoc, private docs all 0). Bless m3-max-29975
(inventory, golden, printouts 0) gave this table. Census m3-max-29976 exited 0.
2026-11-14 12:01:47 -08:00
Anees Iqbal 5c9d222e05 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-14 11:35:28 -08:00
Anees Iqbal e0744825a5 A replayed draw walks its plan's heap members and its resident uses once, not at each draw
A plan's descriptor writes and uses number one for each resource its heap
reaches (every texture an encoder made resident, in each heap array), and a
draw's uses begin with those of everything its encoder made resident. Three
per-draw checks walked them at every draw, though their answers are fixed for
the plan or for the resident uses' identity, so a host step's replay of an
indirect command buffer paid every resident texture at every command:

- binding::binds_own_zeros (every write of the plan) is now a fact of the plan,
  worked out as its pipeline state settles it (PlanFacts::own_zeros);
- the read-twin slot proofs (read_only_slot / read_only_buffer_slot, a walk of
  the plan's uses and writes for each slot) are worked out once for the plan,
  the first time a draw asks on a device with read twins, and kept in its facts
  (binding::TwinProofs, which replaces TwinSlots::of with TwinProofs::slots); a
  command's own uses name no slot (debug-asserted), so the proofs are the
  plan's alone. A dispatch works its out per dispatch, as before; a test's
  device that binds twins unproven proves them at each command;
- EncoderCore::note_draw's check for a write of a read twin walks the uses of
  what the encoder made resident once for their identity (ResidentPrefix,
  process-unique; the same uses wherever it is) and the draw's own uses past
  them at each draw (refuses_twin_write_past).

render.rs and render/draw_again/rebound.rs change one statement each at their
call sites (facts.twins().slots, facts.own_zeros()).

Test: tests::resident_uses's
draws_walk_their_plan_and_resident_uses_once_however_many_textures_are_resident
counts, on a device with a read twin, the plan walks and twin-write checks of
each draw with 0 and 64 more textures made resident: the first draw walks
more with more, every later draw the same and nothing of its plan.
Also: examples/icb_reads gains a gpu-step shape (`icb_reads --only gpu-step --heap-textures H
[--no-twin] --runs 9`), a host-stepped execution of textured draws a kernel writes, reading its
textures through a material argument buffer over a heap. It prints host_step_ns_per_command.

No RUNTIME_VERSION bump: the same commands and answers, worked out fewer times. The pin moves
alone. No new Degradation kind or WorkCounts field; the walk counters are test-only.

Verified:
- msi m3-max-29962 at be9eff60d2 (runtime crate, --all-features --all-targets, -D warnings):
  - clippy plain, --cfg m2v_cpu_icd and --cfg m2v_gpu: 0;
  - rustdoc: 0;
  - 134/134 touched tests on lavapipe: resident_uses, draw_again, read_twin_device, twin_reads,
    twin_flights, shadow_twins, host_step_neutrals, icb_carry_race, icb_records_home,
    indirect_command_buffer and its device suite, kept_heap_uses, carried_draws,
    neutral_zeros_shared.
- Negative control by hand (m3-max-29957): the count test fails. Per draw, 147 plan entries walked
  and 11 uses checked with 0 extra textures, against 531 and 75 with 64.
- Release A/B (m3-max-29960, msi lavapipe):
  - base 5608c77dbb md5 65c9a10d, tip 0aae380fcc (this fix before its clean rebase) md5 197ac4e6;
  - own target dirs, P-cores, 3 interleaved rounds, 8192 commands a step, medians of 9.
  Host-step ns per replayed command, base -> tip:
  - H=8: twin 3851 -> 3839, no twin 3866 -> 3811;
  - H=512: twin 4676 -> 3881, no twin 4268 -> 3864;
  - H=2048: twin 7533 -> 3991, no twin 5845 -> 3981.
  At the tip the cost is flat in H.
2026-11-14 11:34:48 -08:00
Anees Iqbal 042d11378b 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-14 11:32:19 -08:00
Anees Iqbal 88f577d11c A split keeps the encoder's kept draws: re-homed into the instance after it
A draw that recorded into a later render pass instance after a split (a read
of a color attachment's texture after a barrier over the render targets, the
walk's reader) kept nothing, and a draw that keeps nothing forgets every kept
draw its encoder set aside: each later draw of the pass's other states took
every step again. A draw recorded into an instance recorded inline after a
split (render/inline_splits.rs) was never kept either (draws_unkept_other).

What changed:
- render.rs: `split_alone`, set where a draw keeps nothing only because it
  began a later instance after a split (no continuation, no stand-in's
  arrival), of the shape, views and formats of the instance before, its
  other steps a plain draw's. Then `rehome_aside` keeps the kept draws set
  aside with other states' bind states into that instance, but those that
  read the pass's colors other than through snapshots of their own, readers
  through snapshots, draws carried in and not drawn since, and those whose
  `Under` (moves, residency, sampler slots, rebinds, aliases) differs, which
  it lets go.
- draw_again.rs: `Kept::rehomed_into` marks a kept draw re-homed (`rehomed`):
  after draws of other states, under a render state of another stamp,
  through no record, so its next draw is rebound.
- rebound.rs: a re-homed draw's uses are made whole and its shadowed
  textures' uses gathered into its new instance where it uses them as its
  kept draw did, as a carried draw's are.
- A plain draw into an instance recorded inline after a split is now kept
  (`plain` no longer requires no room). A kept draw's next draw there is
  always rebound (draw_again's room guard), and its recording goes into the
  room (`record_rebound`), recorded at the group's end through the pass's
  record as every step's; `settled` stays None there.
- The debug check compares `rehomed` as the every step it takes keeps it.

New WorkCounts field: kept_draws_rehomed. No new Degradation kind.

Test: tests/split_keeps.rs, kept_draws_set_aside_are_rebound_past_a_split
(A sampling, B adding, a barrier, a reader of the target that splits, A and B
of other bindings, B twice again with no call between): 2 kept draws
re-homed, the draws after the split rebound (drawn_alone(4)), none unlike or
stopped, no draws_unkept_other, the same commands, state commands and pixels
as every draw taking every step, and the pixels of the draws after the split
those of what they bound. tests/draw_again.rs: `run_into` (a run into a
given target) split out of `run_on`; `checks_ended` and `drawn_alone` shared.

No RUNTIME_VERSION bump: the commands, state commands and pixels are those every step records.
The runtime pin moves alone.

Verified on msi (lavapipe):
- m3-max-29952 at 15ba7cf939: clippy -D warnings, plain and --cfg m2v_cpu_icd, exit 0; 143 of 144
  tests in 35 touched modules passed (draw_again, inline_splits, inline_continues, carried_draws,
  kept_*, snapshot_reader_*, attached_read_*, learned_coverage, leading_snapshots, shadow_runs and
  others). The one failure was the new test. Its first draw ran before any fragment buffer was
  bound, so that draw's rebind stopped, which is correct. The test now binds fragment buffer 0
  first, as the walk does.
- m3-max-29958 at e8daf89d87 (test code only since 15ba7cf939): clippy --cfg m2v_cpu_icd exit 0;
  split_keeps passes.
- In debug, the re-homed draw and the draw in the room take the every-step check and pass it.
2026-11-14 11:31:39 -08:00
Anees Iqbal f07887b354 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-14 11:30:38 -08:00
Anees Iqbal 41bac06524 RUNTIME 2308: no explicit DRM_FORMAT_MOD_LINEAR plane at a row pitch NVIDIA's shaders misread
On NVIDIA's proprietary driver, a DRM_FORMAT_MOD_LINEAR image with an explicit plane at a row
pitch that is no multiple of 32 bytes is made, and vkGetImageSubresourceLayout reports that pitch
back, but its shaders read the rows at another pitch. Measured case: 64 x 64 BGRA8Unorm at rows
272 bytes apart is read by a kernel at 256 and copied out by a blit at 272. Rows 288, 320, 384 and
1024 apart read right.

Measured on:
- the RTX 5080 Laptop GPU (615.71.09): the sweep over every multiple of 16 bytes to 1024;
- the RTX 3090 (620.70.06).
Both over host pages and over the device's own memory.

Vulkan makes the implementation validate an explicit plane layout and refuse one it cannot use
(VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT), so no documented rule explains the
misread: it is a driver defect. It caused the 5080's wrong texels on development. A texture in
place over host pages, at rows padded 16 bytes past their texels, read other rows through the
pitched route; a read twin at rows 272 apart was one such texture.

The change:
- RuntimeDriverDefect::ExplicitPlanePitchMisread, on every NVIDIA GPU and release until a probe
  finds a clean one.
- Device::explicit_plane_pitch refuses such a plane at a row pitch that is no multiple of 32 where
  the device has the defect. It does so in both makers of an explicit plane: pitched_image (host
  allocations and the device's own memory) and explicit_plane_image (dma-bufs). The texture then
  takes its shadow (Refusal::Pitch; the shadowed-texture notice names the pitch), or texel rows
  for a slot that only reads.
- The bound is the measurement, not the driver's own linear alignment. The driver's own linear
  images lay rows at multiples of 128, and keying on that would shadow 288 and 320, which read
  right.
- A cfg(test) switch, DeviceShared::explicit_plane_pitch_misread_forced, stands in for the defect
  on a driver that reads such planes right (lavapipe).
- docs: a FAST-PATHS known gap (NVIDIA's pitch, with both measurements); api_signatures.tsv +1.
  REFUSALS.md is unchanged.

No new Degradation kind or WorkCounts field. RUNTIME_VERSION moves because in-place routes change
on NVIDIA, and the linear-alignment records are keyed on it.

Tests:
- textures_at_padded_rows_read_their_bytes: 64 x 64 BGRA8Unorm at 256, 272, 288, 320, 384 and
  1024, over host pages and the device's own memory, each read by a kernel and by a blit. No
  pitched image at 272 where the defect applies.
- The same test under the forced defect: on lavapipe, 272 moves off the pitched image and reads
  right, while 288 stays pitched.
- driver_defects lists the new defect.
- The padded-rows sweep tests, and the shadow log test's twin at padded rows.

Verified:
- msi m3-max-29913 at 7a64d31930:
  - clippy -D warnings, all targets and features: plain, --cfg m2v_gpu and --cfg m2v_cpu_icd all
    exit 0;
  - lavapipe read_twin_device, driver_defects, in_place_check and shadow_causes_device: 43/43;
  - api_signatures, api_surface and fast_paths: 47/47.
- Negative control (rule disabled): the forced test fails with pitched 1 at 272.
- RTX 5080 at 39d564abc4 (archive md5 dd1f3982, b5080 entry roip2-fixarch-5080-112137):
  read_twin_device 20/20. That includes the shadow log test that failed before: its twin at 272
  now takes the twin's shadow.
- The RTX 3090 run of the same archive (m3-max-29951) is queued; its result follows in the lane.
2026-11-14 11:29:56 -08:00
Anees Iqbal b0ed7c6c24 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-14 11:07:50 -08:00
Anees Iqbal 1db01c30be Compute encoders park their core's box and bind state between group members; command buffers reuse record-list storage
== Compute encoders park their core's box and bind state, with its memo, in the command buffer for the next
A command buffer of one-dispatch compute encoders (dispatch_chain's encoders shape) cost the
host about twice a serial encoder of the same dispatches: on msi lavapipe (release, d2c72548cd)
4270/3557 ns a dispatch folded against 1458/1539 serial. Each folded encoder's first dispatch
settled again what the encoder before it had settled for the same bindings: each end let the
dispatch memo go as it gave the bind state to the device's spares, and the next encoder's new
table took a new stamp.

- An ended compute encoder parks the box of its core and its bind state, with its memo, in its
  command buffer (State::park_compute, under the end's one lock), and the command buffer's next
  compute encoder opens on them (under the open's one lock) rather than on the device's spares.
  The commit gives them back to the device, its memo let go. The core's contents are built at
  each open as before; only its box goes on.
- A parked entry lets go of the device's sampler states it listed
  (DispatchMemo::unlist_samplers), as the command buffer holds none of them; the dispatch that
  takes it lists them again (restamp): those the device lists at the count of sampler slot
  changes the entry compares, so the very states it listed. The resident textures' lists are
  emptied at each end as before.
- A dispatch whose memo entry holds in every input but its table's stamp brings the state in
  place, and where that changed no value of any kind (Reshape::moved empty) and the samplers'
  maps are the entry's, takes the entry under the new stamp (LiveDispatch::settled_across,
  Across::Taken): the entry is a function of the bind state and of the inputs DispatchMemo
  compares beside the stamp, which stands only for the table-derived part of that state. Builds
  with debug assertions assert the entry's planned shape is the state's. Where a value moved,
  settle_live takes the state as that refresh left it, with its samplers' maps, and does not
  bring it in place again (Across::Refreshed): the same inputs, so the same state.
- WorkCounts: parked_compute_taken and dispatches_settled_across_encoders (new).
  api_signatures.tsv (+2).
- New tests::compute_parked (m2v_gpu / m2v_cpu_icd): eight compute encoders of the same bindings
  in a command buffer, each after a blit fill of their output, on a device holding a live
  sampler state, take 7 parked and settle 7 across encoders in each of two command buffers, and
  the last writes its words after the fill; eight that each bind another offset of the output
  take 7 parked and settle none across, each writing its own words.
- Call sites of end_with_replay in blit.rs and render.rs pass no parked state (render.rs: one
  line).

Verified:
- Clippy (-D warnings, --all-targets --all-features, runtime crate; plain and --cfg m2v_cpu_icd)
  and nextest on msi lavapipe (m2v_cpu_icd): the runtime suites compute_parked,
  compute_instantiated, compute_bind_memo, encoder_fold, render_fold, encoder_state_locks,
  encoder_holds, held_lately, dispatch_pending, dispatch_tracking, inert_dispatch, submit_check,
  submit_check_device, submit_failure, submit_failure_device, pending_rebind,
  rebind_behind_a_wait, rebind_descriptor_slip, rebind_making_wait, tiled_texture_reencode and
  in_place_check, and the validation runtime_lane suites predication, protection_options,
  dispatch_work, failed_commits, rebinds, rebind_reach, submission_checks, parallel_encodes and
  commit_work. m3-max-29815 (this change before the settle took the refresh, Across): clippy
  0/0, runtime 119/119, validation 87/87. m3-max-29896 (this tree with the next commit on top):
  clippy 0/0, runtime 120/120, validation 87/87.
- Negative control by hand (m3-max-29802: settled_across false, nothing parked): both
  compute_parked tests fail (parked 0 against 7, across 0 against 7).
- Release A/B on msi lavapipe (m3-max-29900; frame pointers; base d2c72548cd md5 5f091a78 and
  this tree md5 24f39604 in their own target dirs; dispatch_chain --host 3 --dispatches 2300
  --groups 64 --runs 9; 8 rounds, the order alternating; paired medians, ns a dispatch):
  folded binds 1 encode -153 (lower in 5 of 8 rounds), folded binds tex +76 (3 of 8), serial
  binds 1 +16, serial binds tex +45: inside the noise. The folded shape's dispatches settle
  across encoders 1.00 a dispatch (dispatches_settled_across_encoders; parked_compute_taken
  1.00), against 0 before. A dispatch that takes the entry still reads its table whole, lists
  the device's sampler states and lists them into the entry again; that this is most of what a
  settle that finds its plan as before costs is expected from the earlier profile, not measured
  apart. An earlier A/B before the settle took the refresh (m3-max-29814) showed serial binds
  tex +56 in 8 of 8 rounds, the table read twice.

== Command buffers start on the storage of the record lists a released command buffer left
A folded compute encoder's end grew its command buffer's lists of records one reallocation at a
time: the ended encoders' records, their recordings and the group's stashed logs (about 190 ns
of the end on msi lavapipe by perf, dispatch_chain's encoders shape at 2300 encoders a command
buffer), and the commit's held logs.

- command_buffer/record_storage.rs (new): a device keeps up to 2 storages of those lists
  (DeviceShared::record_storage), each of at most 8 MiB of room. CommandBuffer::new starts on the
  latest one a released command buffer left, emptied with its room kept; the release (Drop of
  CommandBufferShared) takes the lists whole, empties them there (what they held goes as it went
  before, at the release) and gives the storage back.
- A group of encoders recorded into one VkCommandBuffer takes the command buffer's stash room as
  it begins and gives it back, emptied, as it closes with more than one member (close_fold: the
  held logs by append, the kept ones by drain); a lone member's close consumes it as before.
- WorkCounts: record_lists_grown (lists that held more room at the release than the storage they
  started on, counted once each) and record_storage_kept (new). api_signatures.tsv (+2).
- New tests::record_storage (m2v_gpu / m2v_cpu_icd): after a warming command buffer, command
  buffers of 32 compute encoders, one after another's release: the first's lists grow (at least
  2), the next two grow none. compute_parked's kernel is shared with it.

Verified:
- m3-max-29896 (msi lavapipe, m2v_cpu_icd): clippy (-D warnings, --all-targets --all-features,
  runtime crate; plain and --cfg m2v_cpu_icd) 0/0; the runtime suites of the commit before with
  record_storage 120/120; the validation runtime_lane suites 87/87 (the commit before lists
  them).
- Negative control by hand (m3-max-29934: no command buffer starts on a kept storage): the test
  fails, round 1's lists grown 4 against 0. The test passes with this change (m3-max-29896).
- A count run (m3-max-29894, dispatch_chain --host 3 --binds 1, 2300 encoders a command buffer):
  record_storage_kept moved and record_lists_grown did not, folded and serial. At the first cap
  tried (4 storages of 2 MiB) the folded shape's storage was not kept (record_lists_grown moved,
  record_storage_kept did not), so the cap is 2 of 8 MiB.
- Release A/B on msi lavapipe (m3-max-29895; frame pointers; the commit before, md5 24f39604, and
  this tree, md5 670342b3, in their own target dirs; dispatch_chain --host 3 --dispatches 2300
  --groups 64 --runs 9; 8 rounds, the order alternating; paired medians, ns a dispatch):
  folded binds 1 encode -172 (lower in 8 of 8 rounds: end -230, commit -52, dispatch +63),
  thread CPU -222; folded binds tex encode -164 (6 of 8: end -320, commit -80, dispatch +113),
  thread CPU -245; serial binds 1 -3, serial binds tex -70 (5 of 8).

No answer, refusal or recorded command changes: RUNTIME_VERSION stays; the pin alone moves.

Verified (msi lavapipe): m3-max-29896 clippy plain and --cfg m2v_cpu_icd 0, runtime suites 120/120,
validation runtime_lane 87/87. Release A/Bs in alternating order, paired medians a dispatch: park
(m3-max-29900) folded binds 1 -153 ns, binds tex +76, serial +16/+45 (neutral; memo hits 1.00 a
folded dispatch); record storage (m3-max-29895) folded binds 1 encode -172 (8 of 8), binds tex -164
(6 of 8), thread CPU -222/-245. Negative controls by hand: compute_parked 0 vs 7 (m3-max-29802),
record_storage 4 lists grown vs 0 (m3-max-29934).
2026-11-14 11:07:09 -08:00
Anees Iqbal 60088bcf3a 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-14 10:54:50 -08:00
Anees Iqbal e4747b174b handle_entry_flags: name FLAG_YCBCR_WRITES without a link to the private item
Rustdoc at 8e992466f7 (-D warnings) failed: the public function's doc
linked the crate-private memory::handles::FLAG_YCBCR_WRITES. It names
it in code instead, as the docs name the other flags.

Docs only. Verified: rustdoc -D warnings on the three published crates at 7f92e76fe8 (m3-max-29884) 0;
development's rustdoc at 8e992466f7 failed on this link (m3-max-29876).
2026-11-14 10:54:09 -08:00
Anees Iqbal 8dd9d3af55 Refusals name what they saw: an unknown ABI key's string or shape, a stage-size refusal's weight and bound
- Every Abi(UnknownKey) that named no key now carries what the reader found: the unknown string
  (an argument's role or attribute, a visible function's key, a node's tag, a compile option, a
  signature kind, a module flag), cut at 64 bytes, or, where there is no string, the operand's
  shape in LLVM spelling. The detail is a crate-private field of InputError (`saw`), printed by
  Display and Debug; it lives there and not in Location because a Location field grew the
  translator's Error past clippy's result_large_err. No public item or refusal kind changes;
  REFUSALS.md regenerated unchanged.
- The ANV stage-size refusal (Feature::StageSize, DriverDefect) names the module's entry weight
  and the bound it passed in its symbol, which Display prints: "entry weight N, past the bound B".
  The bounds and the refusal are unchanged; the FAST-PATHS known-gap row says so.

Why: a consumer's log of a GL-on-Metal kernel refused as UnknownKey at an argument with key None
and of two kernels refused for stage size could say neither which key nor how far past the bound;
one rerun at the pin carrying this names both.

Translation output unchanged: no SEMANTICS or RUNTIME bump.

Verified (msi, m3-max-29879 at 2ddbda8ecf): clippy air + translator 0; metal2vulkan-air 567 passed
incl. abi::tests::an_unknown_key_names_what_it_read (a synthetic node per site, whole location,
seen detail and Display); metal2vulkan a_kernel_past_the_stage_bound_keeps_the_widest_pin_or_is_refused
(symbol and Display name weight and bound past each defect's bound), error::tests and engine_handles
compute tests 10 passed, llvm-as present (no SKIPPED).
2026-11-14 10:52:44 -08:00
Anees Iqbal 198f7a3606 walk_costs: a WALK-MOVED line of every work count a shape's frames moved
The WALK-COUNTS list names 24 counts and none of the reasons a draw
took every step, a kept draw was let go or a rebind stopped
(kept_draws_let_go_*, draws_unkept_*, draws_rebind_stopped_arguments_*,
draws_carry_stopped_*, stage_tables_read_whole_*, ...). Each shape now
also prints every count its timed frames moved, a frame, through
video_frames::moved_per_frame, which reads WorkCounts' Debug, so no hand
list goes stale. Validation only; a measurement, no check changes.
Verification: msi lavapipe job (clippy --cfg m2v_cpu_icd, walk_costs
run).

Verified (msi lavapipe, m3-max-29866): clippy validation --cfg m2v_cpu_icd 0; walk_costs 1 passed,
all 4 shapes printed WALK-COST, WALK-COUNTS and WALK-MOVED.
2026-11-14 10:48:34 -08:00
Anees Iqbal 8e992466f7 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-14 10:47:07 -08:00
Anees Iqbal 2960070096 SEMANTICS 2114 / RUNTIME 2307: write() through an argument buffer to a two-plane YCbCr texture stores or drops as the slot write does
An argument buffer's texture2d<float|half, write> of a two-plane YCbCr
texture died at dispatch (its storage heap member was refused). Metal
stores through a handle exactly what it stores through a slot (the M3
Max under macOS 27.0.1, measured by the consumer): nothing of
YCBCR8_420_2P, both planes of the unpacked 4:4:4 formats byte for byte
the slot's.

- bind::heap: a storage class holds a texture whose writes Metal drops
  (metal::format::writes_dropped) as its neutral (Fit::Dropped), and a
  4:4:4 texture whose writes Metal stores (ycbcr_writes_stored) through
  the R32G32B32A32_SFLOAT view of its write shadow; its table entry
  carries FLAG_YCBCR_WRITES (bit 15). A stage that reads the storage
  class (new RuntimeFact::HeapStorageReads, a PlanTimeCheck) refuses
  either texture it reaches there, Format / NotImplemented, as a slot
  that reads one is refused.
- memory::handles: the search carries the flag into handle bit 29
  (HANDLE_YCBCR_WRITES) under the stage's new SpecKey::HeapYCbCrWrites,
  a u32 constant the plan gives from the command's members (1 where a
  member it names is such a texture, usage writing). At 0 the carry
  mask, the element mask and the write's test are spec-constant
  folds, so a command naming no such texture runs the pipeline it ran
  before (the predicted bindings name none).
- lower::texture: a float/half 4-lane 2D heap write selects
  (rgb, 1.0) where the handle carries the flag: the mark the write-back
  kernel reads (nonzero), in place of any member conversion.
- runtime: the write shadow's image is MUTABLE_FORMAT with an
  R32G32B32A32_SFLOAT view where the device stores that format; the
  heap's float storage element is that view; a command making such a
  texture resident for writing names the shadow in its uses (its copies
  clear the marks and encode the marked texels into the planes), and
  the texture's own image only where it reads it too.

Tests: src/tests/engine_heap_ycbcr_writes.rs (interpreter run at the
constant's 0 and 1, plan values and one variant for every command
naming no shadowed texture, the storage-read refusal);
runtime_lane::ycbcr_argument_writes (500/503/507/523/527/542/545
through an argument buffer against the slot's bytes, and the pipeline
count). REFUSALS.md regenerated; api_signatures blessed: two new
variants of #[non_exhaustive] enums, nothing breaks for a consumer.

Metal (M3 Max, macOS 27.0.1, m3-max-29643): argument-buffer writes are byte-identical to slot writes
for 500/503/507/523/527.

Verified (msi lavapipe, --cfg m2v_cpu_icd): m3-max-29859 clippy translator/runtime/validation 0,
runtime 243/243, lavapipe lanes 75/75, translator 246/247 (a word bound the mark raised, fixed in
ce01da189e); m3-max-29865 at ce01da189e clippy 0, translator 4/4, lavapipe 2/2: argument-buffer
writes byte-equal to slot writes for all 7 formats (alpha-0 writes, so an unmarked write stores
nothing); pipelines 1 after RGBA8/RGBA16Float/500 commands, 2 after the first 503 and still 2
after a second.
2026-11-14 10:46:27 -08:00
Anees Iqbal 15fc7f62a5 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-14 10:41:24 -08:00
Anees Iqbal 7f36b6ee36 draw_again: a carry sets aside up to seven other pipeline states, not three
Doc only: the module docs' carried bullet still said three, from before
live_bind::SET_ASIDE became 7 (RUNTIME 2267). Verified by reading
live_bind.rs (const SET_ASIDE: usize = 7) and render/carried.rs's docs.

Comment only; the runtime-sources pin moves with it.
2026-11-14 10:40:44 -08:00
Anees Iqbal de69a4a218 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-14 10:38:39 -08:00
Anees Iqbal 73b97e1e0c A draw after scissor rectangles alone restates by them alone
A render-state call drew one fresh stamp, so a kept draw's next draw after
set_scissor_rect(s) ran restate_kept in full: the route and DrawSettings
again (compared by value), the pipeline clone, the fragment tests, the
depth/stencil descriptor, the shape-memo lookup and clone, and two
FixedState compares, only to take new Vulkan scissors, which none of those
read. Compositor shapes and the walk set a scissor before nearly every
draw.

What changed:
- The encoder's render-state stamp is now a pair (`Stated`): `set`, drawn
  afresh by every render-state call, and `beyond_scissors`, drawn afresh by
  every one but set_scissor_rect(s) (`log_restating_scissors`).
- `Kept::restates_by_scissors`: whether the kept draw's route meets every
  condition a restate asks (no failing state, no hidden depth/stencil, no
  restart strip, provoking vertex as-is or native), set where every step
  keeps the draw and where a full restate succeeds, so the debug Kept
  comparison holds.
- A draw whose kept draw's stamps differ in `set` alone, of such a route,
  takes the encoder's scissors into its kept recording's draw state (as a
  draw that finds its state in the shape memo takes them) and derives
  nothing else; every other restate is unchanged.

New WorkCounts field: draws_restated_scissors (counted at each such
restate, a debug check turn's too). No new Degradation kind.

Test: draws_after_scissor_rectangles_alone_take_them_alone (runtime
tests/draw_again.rs): 8 draws again after scissor sets alone restate by
them alone, rebound, with the same commands, state commands and pixels as
every step; a viewport set before one draw takes the full restate, still
rebound. In debug builds every second rebound draw takes every step and
compares the draw state the restate left. Verification follows on msi
(lavapipe, potluck).

Recorded commands are unchanged (the draws rebound record the same commands, state commands and
pixels as every step), so RUNTIME_VERSION stays and the runtime-sources pin alone moves.

Verified (msi, lavapipe): m3-max-29822 clippy plain and --cfg m2v_cpu_icd 0, 103/103 of 20 touched
modules incl. draw_again::draws_after_scissor_rectangles_alone_take_them_alone; negative controls
m3-max-29825: fast path off reads 0 against 8; stale scissors trip the debug rebound check. Release
A/B m3-max-29845 (7 interleaved rounds, medians a draw): compositor 57,172 -> 55,820 instructions,
8.81 -> 8.64 us (1216 of 2237 restates by scissors alone); pass17 33,003 -> 30,783, 4.48 -> 4.18 us.
2026-11-14 10:37:58 -08:00