Commit Graph
5657 Commits
Author SHA1 Message Date
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
Anees Iqbal c28a0e0523 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:22:47 -08:00
Anees Iqbal 948b5e37fb RUNTIME 2306: a texture over a bit-24 buffer that no image lies over reads a shadow of its read twin, not of the copy
A no-copy buffer of Metal's private option bit 24 is a copy of its pages off macOS, beside a read
twin over the pages in place. A slot that only reads a texture over such a buffer binds the
texture's read twin, but only where the twin's texture lies in place over the twin's bytes. Where
it did not (RADV lays no DRM_FORMAT_MOD_LINEAR plane whose rows or first byte are off a multiple
of 256: a window server's 48x48 textures at rows of 192 bytes, its 128x128 ones at rows of 512
from 32 bytes in), the twin's texture was made as a shadow and dropped. The slot then bound the
program's texture, itself a shadow of the copy for the same reason, so its command buffer used the
copy and its commit compared the whole copy with the pages.

Workload reason (reims's appwalk17 desktop walks, numbers only): twin textures not in place
780M 362, RTX 3090 304, Iris Xe 1; copies compared 52,537 (2,897 MB), 43,384 (2,138 MB) and 331
(35 MB); the Iris compared in one walk step only, the one that made its one twin not in place.
Copies compared plus twin slot reads come to about the same total on all three (56,775, 52,277,
54,233): every such read that missed a twin read the copy.

Now the twin's texture is kept as a shadow of the twin's bytes where the program's texture is a
shadow too, and the slots that only read the texture bind it under the same proof as before. The
program's texture lists it beside its own shadow (shadow::texture_copies, held weakly), so draws,
rebound draws, dispatches and resident textures copy it in from the pages in place at its first
use in each command buffer, where they copied the texture's own shadow in from the copy (a shadow
of a copy of Shared memory never stands). Where the pages carry a log of their writes only the
changed rows move. The command buffer names the twin's and the shadow image's keys, never the
copy's, so its commit compares nothing. No store reaches the pages: the twin's one GPU access is
the copy in's read, the shadow is the runtime's own image no call returns, the slots only read it,
and a copy back would write the twin's key, which every encoder refuses.

Discrete devices take it too: their copy lies in system memory (MemoryClass::Shared), as the
pages do, so the shadow's copy in crossed the bus before and crosses it now; what goes is the
CPU's comparison. Cost: an image of the texture's size per such texture while it lives.

- WorkCounts::read_twin_texture_shadows (new field). No new Degradation kind.
- The shadow log's twin line says whether the twin's shadow serves the read slots.
- cfg(test) DeviceShared::linear_pitch_rule_forced: RADV's LINEAR plane rule at Device::unplaced.
- Tests (read_twin_device): the two shapes sampled by a draw and the 128x128 one read by a
  kernel through the twin's shadow (compares 0, a CPU write read next, a fill read back through
  the copy, pages kept); over logged pages the second command buffer copies nothing in and a told
  write moves its rows alone. The screen-sized texture lavapipe lays no image of now reads its
  twin's shadow too.
- Docs: read_twin.rs, shadow_log.rs, API.md and the FAST-PATHS row on bit-24 memory;
  api_signatures.tsv (+1).

Verified (msi lavapipe, m3-max-29778 at 69f0a567b1): clippy plain and --cfg m2v_cpu_icd 0;
read_twin_device, copied_device, copied:: units, texel_rows_device, dirty_pages_device and
waited_reads 73/73; api_signatures and fast_paths 35/35. With RADV's LINEAR rule forced (offset
and pitch multiples of 256): 48x48 at pitch 192 and 128x128 at pitch 512 offset 32 sampled by a
draw and read by a kernel: twin slot reads +1, compares 0, texels the pages', a CPU write read
in the next command buffer; a fill in the same command buffer reads back through the copy with
one compare, pages kept; over a dirty log an unchanged twin copies 0 bytes. Negative control
(serves cut back to in-place only): the 3 new tests fail, the commit compares the copy.
2026-11-14 10:22:01 -08:00
Anees Iqbal 607f2d430a 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:21:14 -08:00
Anees Iqbal 7325cef772 Spare command pools: take before making, in sections too, each pool up to 32 of a level
A command buffer whose pools handed out every VkCommandBuffer of a level they held now takes the
spare holding the most of that level from its first hand-out on (before: only past 16 handed out,
making the rest in its first pool), and inside a section of the exit guard (the scheduler's
barrier command buffers, a host step's recording) it takes a spare whose command buffers need no
reset (before: no spare at all). Where no spare holds one, it makes it in its last pool, up to
POOL_HOLDS (32) of the level there, past which it takes a pool for more (a spare holding none of
the level, or a new pool). HELD stays the hard bound; idle sheds and recent-uses frees are
unchanged; no new switch.

Why: under command buffers of fenced one-dispatch compute encoders split into parts (a guest's
fluid simulation's shape), the barriers' command buffers, made in sections, were 64% of the
allocations and the first-pool makes 34%; the pools grew past what was in use at once to HELD,
and each give-back shed the oldest pool whole, which the next takers made again (45,914 made over
30 rounds of 200, about 1,250 a round, on lavapipe). On RADV each made VkCommandBuffer is a new
buffer object with cleared pages.

New WorkCounts field: command_buffers_made (vkAllocateCommandBuffers' count), POOLED in the
conformance cost table.

Tests: tests::spares unit tests take `settled` and a new one checks a section takes only a spare
that needs no reset; the device test of a small and a large command buffer now asserts none is
made where the spares hold them; tests::spares_parts (device): fenced command buffers 16 in
flight make none once warm and hold at most the in-use bound; a load that falls sheds down.

No answer, refusal or recorded command changes (only which VkCommandBuffers the spares
hand out), so RUNTIME_VERSION stays 2305 and the runtime-sources pin alone moves.

A/B (msi lavapipe release, m3-max-29720, spares_compute_parts: 200 command buffers a round
of 2-120 fenced one-dispatch encoders, 48 in flight, rounds 6-30, two interleaved runs):
command_buffers_made 1,498/1,448 a round -> 8.8/4.3; spare_command_buffers_shed 1,460/1,447
-> 0; spares held pinned at HELD -> 3,251/3,263; committing thread CPU per command buffer
-7%/-6%, scheduler -4%/-8%, queue waiters -12%/-9%, free thread to 0; anonymous RSS at round
30 187/190 -> 71/74 MiB. Control (sections take no spare): 2,189/2,305 made a round, fails
the steady test.

Verified (m3-max-29776 at 2a5db4d65e, msi): clippy runtime+conformance plain and
--cfg m2v_cpu_icd 0; tests::spares and spares_parts 26/26; conformance cost 0; signatures 0.
2026-11-14 10:20:31 -08:00
Anees Iqbal 26b8d7b4d1 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 09:52:10 -08:00
Anees Iqbal 9fa1fe4a7a SEMANTICS 2113 / RUNTIME 2305: write() and render into the _sRGB two-plane 4:4:4 twins (523, 527) store what Metal stores
write() (kernel and fragment) into YCBCR8_444_2P_sRGB (523) and YCBCR10_444_2P_sRGB (527) over a
surface plane, and such a texture as a render attachment, were refused (the encoding unknown).
Metal's bytes, measured on an M3 Max (macOS 27.0.1; 8 colours, kernel write, fragment write and
Clear+Store over 444v/x444 surfaces), fit one reading exactly: each channel is sRGB-encoded first,
then converted as the non-sRGB twins 503/507 convert (here BT.601 video range). Metal's own paths
differ by one code on one 10-bit luma (kernel 696, pass 697).

- metal::format: ycbcr_writes_stored and ycbcr_renders take 523/527; the 4:2:0 and 4:2:2 sRGB
  twins stay refused (unmeasured).
- bind::ycbcr_write: one shape word, SRGB: per channel the pass's half (pass only), then
  lower::arith::pack::srgb_encode (the device's Pow), then the existing grid step and rows. The
  device's float curve is the conversion we implement (no sRGB view can store a matrix
  combination of encoded channels); no PrecisionNote: any difference is within Metal's own
  one-code spread.
- A pass that Loads a twin is refused at its start, and a pipeline that blends into one at its
  attachment, both NotImplemented(Format) (Metal's load and blend of the twins unmeasured).
  REFUSALS.md regenerated (Format sites 124 -> 125).
- CPU references ycbcr_write/ycbcr_store encode the twins by the same f32 steps.

Verified (msi, lavapipe, m3-max-29687 at db17bcce16): clippy (metal2vulkan, runtime, validation,
--cfg m2v_cpu_icd) 0; translator tests 13/13 (reference and interpreter give Metal's eight
colours for 523/527); lavapipe 14/14 (lane ycbcr_srgb_twins: both planes against Metal's table
for kernel, fragment and Clear+Store, one code allowed on the 10-bit luma only; load and blend
refusals; the 503/507/542/545 tests unchanged). Negative control (SRGB word forced to 0,
m3-max-29701): the CPU test and the kernel, fragment and pass tests fail on grey,
(0.2,0.6,0.9) and (0.9,0.3,0.1).
2026-11-14 09:51:17 -08:00
Anees Iqbal 6a9a05ccad Tests: pin 91's three failures and the tile fixture, test-only
- tile_pending: tile_state resolves its fixture through metal2vulkan_devtools::engine_dir()
  (the run-time CARGO_MANIFEST_DIR, else the build's), as heap_border_texels and a8_over_buffers
  do, so a carried archive finds it.
- render_merged_executions: a rebind of a shadowed target's bytes encodes again the named
  encoders and the rest of their fold group (RUNTIME 2302: the pass joins the writer's compute
  encoder's group, and a rebind encodes a group whole); rebound_run reads the group from
  encoders_folded. Rows and pixels unchanged.
- compile/tests.rs: the earlier-derived-debug test drops SEMANTICS 2112's empty texel_rows.
- property_reads: rounds go on until each thread has landed inside a submission, bounded by
  30 s instead of 8 rounds; the window is a 0.05-0.2 ms submission and the full suite's load
  closed it for 8 rounds at both a91629c1a6 and d8666d430f (m3-max-29674), so the fold is not
  the cause. A thread that never lands still fails.

Verified (msi, lavapipe): 29662 all 7 tile tests; 29685 the four tests; 29686/29700 clippy
cpuicd and plain 0 for metal2vulkan, runtime and validation; 29699 property_reads alone round 1,
beside 64 busy loops in 4.8 s. Negative control (status() takes the state lock submit_batch
holds): fails at the bound, the status reader never inside in 214 command buffers over 30 s.
2026-11-14 09:49:08 -08:00
Anees Iqbal d2c72548cd 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 09:40:17 -08:00
Anees Iqbal be62103f73 One state lock per encoder open and one per end
A compute encoder opened after another took its command buffer's state lock
7 times as it opened and 3 times as it ended (a debug count on lavapipe):
the protection check, settle_end's three takes, the open itself,
enter_predication and inherited_residency; end_predication,
note_scheduled_work and the end itself. About 17 ns each under perf, 118 ns
of a folded dispatch's open and 55 of its end on msi.

- EncoderCore::open checks the protection options (compute and render),
  settles the last render encoder's end where one waits (CommandBuffer::
  settled: the three takes only where something is there, else the lock it
  holds), and runs the kind's own state work as a closure under its lock:
  compute's enter_predication and State::inheriting, blit's protection
  options.
- end_with_replay notes the scheduled work and, for a compute encoder whose
  command buffer has no predication record, its unit's work under its own
  lock. Captures::unpredicated tracks that: false at open where the command
  buffer has a record, cleared by the encoder's own record, false for an
  encoding again, so those keep end_predication's lock.

Tests: tests::encoder_state_locks (debug, device): a compute encoder and a
blit encoder opened after a compute encoder lock once at open and once at
end.

No behaviour changes (what a run answers, records and submits is the same), so RUNTIME_VERSION
stays 2304 and the runtime-sources pin alone moves.

Verified (msi, lavapipe): tests::encoder_state_locks 1 lock at open and 1 at end for compute and
blit (negative control with the base sources: compute 7/3, blit 5/2); touched runtime suites
156/156 (render_fold 13, encoder_fold 22, ...); validation predication and protection_options
18/18; clippy plain, m2v_gpu and m2v_cpu_icd 0; rustdoc 0. Release A/B (base 0c3c24ec0e vs
tip, own target dirs, medians of 4 interleaved): host time per dispatch within the run's noise
(about 200 ns): long folded encode 4246 -> 4303, short folded 4122 -> 4018. Kept as a
correct, neutral change.
2026-11-14 09:39:37 -08:00
Anees Iqbal 7f01a06014 queue_share: the quiet unshared queue's test makes again a run whose first long one's completion let the second go
Pin 91's lavapipe suite (0c3c24ec0e, under the whole suite's load) failed
a_quiet_unshared_queue_s_first_command_buffer_waits_behind_the_idle_budget_and_one_batch at
'a head let go under the idle budget': the first long one ran 63.5 ms against its queue's
expected 81.1 ms, so it completed before the 16 ms budget's point (about 65.1 ms) and its
completion let the second go at 64.0 ms, which neither budget holds and none counts as let go
under the idle one. Such a run shows nothing of the bound, as a run whose unshared command buffer
was committed after the third was let go shows nothing: it is now made again too, up to
HELD_RUNS runs (the second let go before the first's GPU end). A product that ignored the idle
budget still fails: a run that lets the second go while the first runs is still required, and
the counts and the early let-go are asserted on it.

Not a product change, and not RUNTIME 2303's: alone on msi lavapipe (m3-max-29668) the test
passed 3 of 3 at 2216540a68 (before 2303, binary md5 8963d218) and 3 of 3 at 6b6c9a002f (2303,
md5 21cdc46a), each run letting the second go at about 20 to 24 ms, under the idle budget, with
one head counted. 2303 changes only passes of committing and waiting threads with an unshared
head in the order; this test's unshared queue has none there while the long ones go.

Verified (msi lavapipe): the test alone 3/3 at 2216540a68 and 3/3 at 6b6c9a002f (m3-max-29668);
pin 91's failure was the suite's load (the first long one completed at 63.5 ms, before the
idle budget's let-go point). At the tip (m3-max-29677): clippy plain and cpuicd 0, 29/29 of
queue_share_device and unshared_hold.
2026-11-14 09:38:07 -08:00
Anees Iqbal 0c3c24ec0e 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 09:05:32 -08:00
Anees Iqbal 933b4e774d SEMANTICS 2112 / RUNTIME 2304: a texture no image can lie over is read and written in place through a texel buffer of its rows
A texture over a buffer is Metal's linear layout: texel (x, y) at offset + y * bytesPerRow +
x * bpp. Where the device refuses the image route over the buffer's pages (a texture over pages
that need more than one dma-buf, a LINEAR plane at a refused pitch or offset) but the buffer is
in place, a slot whose function only reads (read, not sample or gather), writes or asks the
size of that texture now binds a storage (or uniform) texel buffer view over the buffer's bytes,
addressed as rows (the row pitch in texels and the size from a push field), instead of a shadow
image copied in and out. The texel buffer view's format converts as the image's would: the
device's own conversion, no note.

- Translator: a structural fact of the slot (its uses are read/write/size only, proven in
  lowering), a push field and a variant key, after the YCbCr in-place variant's machinery.
- Runtime: the planner takes the rows variant where the image route is refused for a stated
  reason; the tracker sees the slot's writes as writes of the buffer's bytes (rows only, the
  bytes between rows untouched); a buffer with a read twin takes no rows (its twin texture
  stays the shadow of its truth). Sample and gather uses, levels past the first, arrays, 3D and
  compressed formats stay shadows.
- WorkCounts: texel_rows_textures, texel_rows_bound. No new Degradation kind, no precision note.
- Docs: API.md variant section, FAST-PATHS known gap narrowed, the shadow log's rows line.

Workload reason (consumer's 780M diagnostic, numbers only): of the device-gap shadows in three
compute workloads, half the textures are only written by their kernels (1.67 G texels per pass),
the other half only sampled; the written half takes this route.

Verified (msi, lavapipe): texel_rows and read_twin tests 28/28 at f848389cfc (m3-max-29579):
over a copy that lavapipe refuses as an image (pitch 272), no shadow copy, rows bound, texels
inverted in the pages, gap bytes kept, a sample in the same and the next command buffer read the
rows' writes; RGBA8Unorm 1024 codes read / 1024 floats stored and RGBA16Float 65536 / 65536 bit
for bit against the image route. Clippy plain, --cfg m2v_cpu_icd and --cfg m2v_gpu 0; rustdoc 0
(m3-max-29541 at 532be1f473, route code unchanged since). Negative control (the row word swapped
for the width word): 6 of 13 tests fail. Release first dispatch of a new state on lavapipe: base
4.12 ms cold / 0.98 warm, rows 2.80 / 1.56 (the rows side also commits over a copied buffer).
2026-11-14 09:04:48 -08:00
Anees Iqbal 6b6c9a002f 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 09:02:07 -08:00
Anees Iqbal 2818c1fcd0 RUNTIME 2303: a committing or waiting thread's pass leaves other queues' batches behind an unshared head it cannot send
A thread about to block (Scheduler::submit_before_waiting) or one that just committed with
commit_and_submit (Scheduler::submit_at_commit) takes the inbox in and submits only the batches
that need nothing of the scheduler's thread (submit_plain_ready, plain_ready). take_in counts
the unshared commit taken, so RUNTIME 2300's gate in plain() lets other queues' batches through;
Order::next puts the unshared queue's head first but skips any head `ready` refuses and goes on
to the next. So where that head is ready for the scheduler's own look but not plain for this
pass (a submission or scheduled handler for a waiting thread, a host step already recorded, a
switch of storage forms riding on it), another queue's batch on its VkQueue whose room had come
was submitted ahead of it, where the scheduler's pass sends the unshared one first
("Heads put first").

The rule: such a pass notes the VkQueue of an unshared head it leaves that the scheduler's look
would find ready (first_for_the_thread: nothing of submit_ready's holds, every event value
reached), and leaves the other queues' batches held back there to the scheduler's thread too
(left_behind_unshared), which its caller already wakes for what it left: that thread's next pass
sends the unshared one first and them next. Bound: one wake and one pass of that thread. An
unshared head not ready for that thread either holds nothing, as its own pass lets the batch go
then. submit_ready's five holds move into holds_back(), shared by both, with the same order and
the same counts; CommandBufferShared::held_back_on() factors what held_for_unshared and
unshared_commits both tested. No switch, no counter, no public item, no Degradation kind.

Not covered, a known limit now written in unshared_hold.rs ("Deferred commits"): a commit left
to the lowering thread under RenderLoweringPolicy::Worker; counting it posted at the call would
hold other queues' batches through the lowering backlog, leaving the GPU idle.

Tests (queue_share_device, lavapipe): a waiting thread's pass with the scheduler's thread held in
a submission handler (waiter_submits::Held, now shared) takes in an application's fill and an
unshared fill with a scheduled handler; a committing thread's pass (commit_and_submit, default
Grouped completion: the fill goes alone where the device groups) takes in an application's fill
while the unshared queue's dispatch waits with its host step recorded (the pool's making held,
the steps' thread held at new trace points Step and Stepped while the scheduler's thread is held
in a submission handler). Each asserts that the pass ran and that the unshared one began first.
Docs: unshared_hold.rs ("Passes of other threads", "Deferred commits"), FAST-PATHS unshared
isolation row, submit_plain_ready.

Verified (msi lavapipe, m3-max-29578 at 258953844d): clippy plain and --cfg m2v_cpu_icd 0;
91/91 of unshared_hold, queue_share, queue_share_device, scheduler, scheduler_held_wakes,
scheduler_wakes, inbox, waiter_submits, commit_and_submit, hold_sites, dispatch_pending.
Both new tests: passes 1, batches the pass submitted 0, the other queue's buffer began
0.100/0.108 ms after the unshared one. Negative control m3-max-29586 (rule off): both fail,
the pass submitted 1 and the other buffer began 0.35/0.34 ms before the unshared one.
2026-11-14 09:01:26 -08:00
Anees Iqbal 2216540a68 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 09:00:37 -08:00
Anees Iqbal d8666d430f RUNTIME 2302: render encoders record into the VkCommandBuffer of the encoders before them
A render encoder took a VkCommandBuffer of its own at every open, so a compute, render
and blit step began 2.71 and submitted 4 VkCommandBuffers per step (dispatch_chain
renders, lavapipe). A render encoder with a log of its calls now takes part in the
encoder fold:

- One whose pass records at its end (draws in a secondary) joins the group before it;
  one whose first instance records inline joins none and may lead a group.
- No barrier records inside a pass: a joined render encoder records one barrier from
  everything of the group's earlier encoders (FoldOrder::everything) at its open,
  counted in command_barriers.
- Color groups, rasterization-rate maps and a depth attachment out of GENERAL take no
  group; segments, fence updates and Overwrites end the group after the encoder.
  Logless devices keep one VkCommandBuffer per render encoder.
- A folded member's layout moves go before its group's first part (GroupPlaces).
- A check splits a group with a render member at its pass's submission (as RUNTIME
  2297 does for blits).
- A group's order is built as its second encoder joins, not as its first ends.

A/B (lavapipe, dispatch_chain, per step, base vs tip): renders 2.71 -> 1.35
VkCommandBuffers begun, 4 -> 2 submitted, GPU 119.5 -> 97.7 us; renders-apart
3.71 -> 1.00, 4 -> about 0, 143.6 -> 94.6 us; passes unchanged in buffers, the
encoder's open about 250-480 ns more on the host (the group an inline pass begins),
the whole pass within the host's noise.

Tests: tests::render_fold (device), tests::held_depth, shadow_runs' rebind expectation
(a rebind encodes a group whole). Docs: encoder_fold.rs, API.md, FAST-PATHS known gap
and ANV row.

Verified (msi, lavapipe): the full runtime suite 2683/2684 at c502efba29, the one
failure the race test fixed in ca5042567b; clippy plain and --cfg m2v_cpu_icd, rustdoc,
fast_paths 0. Negative control (the explicit order removed, renderfold-negctl): the
hazard tests fail on their barrier counts; lavapipe shows no wrong texel because it
completes each command as it runs, so the texel proof is a GPU that overlaps work.
2026-11-14 08:59:50 -08:00
Anees Iqbal a91629c1a6 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 08:57:35 -08:00
Anees Iqbal ca5042567b encoder_fold: the race test waits for the check's failure to be noted, not for its call
a_check_that_fails_a_submission_before_its_group_is_split_keeps_it_failed
let the commit's encodings again go once the check closure signalled from
inside its call. The scheduler notes the failure (State::fail_submission,
which marks the encoders unrunnable) only after the closure returns, so the
encodings again could build their units and splice the blit's in between:
the full lavapipe runtime suite at the render fold's tip (m3-max-29520)
counted 4 encoded again against 3. The blit still ran nothing there (the
failure, noted after the splice, cleared its part), so this is the test's
race, not the product's.

The test now holds the turn until the command buffer's failure is noted
(failure_noted, a test-only reading of State::failure, set under the state
lock after the encoders are marked), then lets the encodings again go.

Verified (msi lavapipe): encoder_fold 22/22; clippy 0 (--cfg m2v_cpu_icd and plain); control
m3-max-29567 (unrunnable marks removed) fails the test (4 vs 3).
2026-11-14 08:56:54 -08:00
Anees Iqbal 1a44a6d198 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 08:55:29 -08:00
Anees Iqbal 51e506adde RUNTIME 2301: an encoder holds once per command buffer what the encoder before it held
Each one-dispatch encoder of a folded group took its own references to every
object its command buffer already held (state, variant objects, the made
pipeline, the argument table's objects: about 7 Arc clones and a boxed holds
entry), and the completion thread then dropped those entries one per state
lock. A folded dispatch cost about twice a serial one on the host.

Now an encoder the program opens starts from what its command buffer's last
ended encoder held lately (16 addresses at most) and holds none of those
again. Encoders recorded apart (segments, encodings again, captures) start
empty and hold everything they name. Only complete_rest removes a command
buffer's retained entries (part completion clears only the SubmittedHolds
counters; failures and re-encodes add entries), so a seeded address names an
object the command buffer holds until it completes, across parts. Release
order is unchanged. Also a cheaper hand-on of the recent addresses at an
encoder's end.

Tests: tests::held_lately (8 encoders over the same objects give 1 holds
entry; an object an earlier part holds lives until the later part completes;
a seeded encoder re-encoded apart after commit_failed Set{1} keeps its
objects alive and writes its output) and a tests::retained unit test.
Negative control (the seed ignored): all four fail (8 vs 1 entries, 3 vs 2,
2 vs 1, 8 holds vs 0).

Verified (msi lavapipe, release, frame pointers, base 3310061de3 md5 d804d4eb
vs tip md5 b8839827, own target dirs, medians of 4 interleaved runs, host ns a
dispatch): long folded encode 4438 -> 3880 (dispatch 2090 -> 1770, end 1404 ->
1298), queue-waiters 661 -> 378; long folded over pages 3710 -> 3613,
queue-waiters 607 -> 480; short folded 3815 -> 3662, queue-waiters 707 -> 590;
short folded over pages even, queue-waiters 774 -> 718; serial unchanged (n=8).
Touched suites 93/93; clippy -D warnings (runtime; plain, m2v_cpu_icd,
m2v_gpu) 0; rustdoc 0.
2026-11-14 08:54:48 -08:00
Anees Iqbal 4c97bf0af1 queue_share: the active hold's test asserts the 2 ms budget only while the queue is active
an_unshared_queue_s_command_buffer_goes_ahead_of_other_queues_held_work
asserted that no head was let go under the 16 ms idle budget. The 2 ms
budget holds only while the unshared queue's last commit is less than
unshared_hold::ACTIVE (50 ms) old; then the 16 ms one does, as for a quiet
queue. In the checks job m3-max-29383 on a loaded msi, lavapipe ran the
'30 ms' long command buffers in 149, 161 and 50 ms: the unshared one was
committed at 1.4 ms, the queue went quiet at 51.4 ms, and the second was let
go at 148.8 ms, the first's expected end (164.8 ms) less 16 ms, under the
idle budget, as unshared_hold.rs specifies.

The test now records when the queue went quiet (its last commit as the
runtime noted it, plus ACTIVE) and asserts what the runtime bounds: a second
let go while the queue was active went no more than 5 ms before the 2 ms
budget lets it (the first's end, or 2 ms before its expected end, whichever
is first; the 16 ms budget is about 16 ms early), and a head was let go
under the idle budget only where one was let go once the queue was quiet.

Verified (msi lavapipe): the old form fails under 192 nice-19 burners (m3-max-29431:
'none let go under the idle budget' 1); the new form passes under the same load and
unloaded (m3-max-29462); clippy -D warnings (runtime) 0 under --cfg m2v_cpu_icd and plain.
2026-11-14 08:39:35 -08:00
Anees Iqbal 8b20339b4b draw_reads and dispatch_chain: commit-to-completion time beside the GPU time
Examples only (neither is a consumer's example). Both now also print, for
the runtime's shapes, the median time from the commit to the command
buffer's completion on the host: draw_reads as wall_us_per_draw,
dispatch_chain as wall_us_per_dispatch. That time also holds the GPU work
the runtime records before the command buffer's own, such as host calls'
staged copies (command_buffer/submit.rs), which the command buffer's
GPU time does not show.

draw_reads also takes --idle MS, which leaves the device idle that long
before each run's encoding, and prints each run's encoding time (encode_ms,
median and most): on a GPU that powers down when idle (the RTX 5080 laptop
GPU after about 20 s) an encoding that waits for it to wake shows there.

These are the figures the arena mirror experiments were judged by; the
mirror itself was dropped (its A/Bs on the 3090 and 5080 left a measured
shape slower in every form). Verified: msi build and clippy follow.

Verified: msi m3-max-29465: release build of both examples 0; clippy -p
metal2vulkan-runtime --all-targets --all-features -D warnings 0.
2026-11-14 08:36:40 -08:00
Anees Iqbal 3310061de3 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 08:21:01 -08:00
Anees Iqbal 76cef9e9af Shadow log: a dispatch's first use of a shadowed texture, and a read twin not in place, with its reason
The shadow log (METAL2VULKAN_LOG_SHADOWS, default off) named a shadowed
texture's first draw only, so a texture bound only by kernels never said
whether its function fetches, samples or writes it; and a read twin whose
texture is not in place was counted (read_twin_textures_not_in_place) with
no reason anywhere. A consumer's runs need both to size the texel-buffer
route for shadows: whether the kernels over 600 list_limit shadows read or
sample them, and why 233 twins are not in place.

- shadow_log::dispatched: the first dispatch that binds a shadowed texture
  names it as the draw line does (one line per texture, whichever command
  bound it first); the draw and dispatch lines share first_binds and
  samplers_named, which now takes a pipeline's modules and layout.
- shadow_log::twin_not_in_place: one line per texture whose read twin is
  not in place, naming the texture, its buffer, offset and pitch, and why:
  the twin's placement (asked again only with the log on) where its making
  made a shadow, or the making's error. The twin's making now runs under
  the call make_twin_texture, so its own shadow line is told apart from the
  program's.
- Off, nothing changes: enabled() is read once. A test-only switch turns
  the log on in a device test's process.

Verified: the msi job (build, clippy -D warnings all features and
targets, read_twin_device on lavapipe) reported with the tip;
the_shadow_log_names_a_twin_not_in_place_and_a_dispatch_s_first_read
asserts a line per twin not in place and the dispatch line exactly where
the texture is a shadow.

Diagnostic only: both lines print only under METAL2VULKAN_LOG_SHADOWS; no product
path changes. Verified: msi m3-max-29434 at the tip: clippy -D warnings (metal2vulkan +
runtime, all targets and features, --cfg m2v_cpu_icd) 0; read_twin_device 15/15 incl.
the_shadow_log_names_a_twin_not_in_place_and_a_dispatch_s_first_read.
2026-11-14 08:20:13 -08:00
Anees Iqbal 5d33e0c74a Device replay tests write the header's binding counts, as the runtime does
SEMANTICS 2111 (eed5f3d84b) made the compute replay read a record's kernel
bindings only below the header's packed count (layout::COUNTS, byte 0). The
runtime's header always carries it: CommandDescriptor::encode_header writes
the descriptor's max_buffer_bind_count there, at the indirect command
buffer's making (indirect_command_buffer/home.rs, indirect_commands/host.rs),
and Metal's setters cannot set a kernel buffer at or past that count, so a
real record never holds a binding the count leaves out.

tests::engine_device_replay built its records' header by hand with the
capacity alone, a count of 0, so after 2111 its replays read no binding and
six tests computed zeros (pin 90b's CORE suite, m3-max-29378, profile
amd-780m-hawkpoint-radv). bind::replay's tests had been given the count in
2111; this file was missed. Its header now carries every kernel binding's
count, as bind::replay::tests' run_preprocess writes it. A test-only change.

Verified next on msi: tests::engine_device_replay, the 72 interpreter tests
of 2111 (engine_indirect_commands, bind::replay), clippy.

Verified: msi m3-max-29430: nextest -p metal2vulkan (engine_device_replay,
engine_indirect_commands, bind::replay) 87/87 incl. pin 90b's six; clippy -p metal2vulkan
-D warnings (all targets and features) 0.
2026-11-14 08:18:18 -08:00
Anees Iqbal c1f0176651 Host-step lane tests expect the staged-records notice where a host step staged records
Since RUNTIME 2294 (5dd3668a4f), a device without unified memory places an
indirect command buffer's records by their first use: records a kernel
writes first lie in device-local memory, and a host step that reads them
while its command buffer holds them stages them through the staging queue,
announced once as staged-indirect-records. The tests in
runtime_lane::indirect_host_steps expected only the host replay and
shared-in-system-memory, so on an RTX 5080 laptop GPU 17 of them failed on
the notice alone ("announced past [...]: [StagedIndirectRecords]"); their
results were right.

on_device_forcing_with now also expects StagedIndirectRecords where the
test's steps staged a records access (WorkCounts::icb_records_staged_accesses
moved), and asserts that a device with unified memory staged none.

Verified: the 5080 run of these tests follows (the 17 failed there at
the mirror branch's tip, whose indirect command buffer code and these test
files are the same as development's).

Verified: 5080 (b5080 m3-max-29429): runtime_lane::indirect_host_steps 20/20 incl. the 17
that failed, icb_records_home, 27/27; msi m3-max-29415: clippy -D warnings (runtime +
validation) 0, lavapipe indirect_host_steps 20/20 (unified memory stages nothing).
2026-11-14 08:14:57 -08:00