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

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

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

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

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

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

longer described the sources and `the_runtime_sources_are_the_committed_ones`

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

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

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

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

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

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

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

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

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

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

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

longer described the sources and `the_runtime_sources_are_the_committed_ones`

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

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

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

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

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

longer described the sources and `the_runtime_sources_are_the_committed_ones`

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

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

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

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

longer described the sources and `the_runtime_sources_are_the_committed_ones`

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

longer described the sources and `the_runtime_sources_are_the_committed_ones`

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

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

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

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

longer described the sources and `the_runtime_sources_are_the_committed_ones`

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

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

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

SEMANTICS_VERSION 2099 -> 2100, RUNTIME_VERSION 2247 -> 2248.
2026-11-13 16:26:40 -08:00
Anees Iqbal 140e1811ca Re-bless the authored compile census at 69c5ab1de6
The census at the pin-77 tip (m3-max-27075): 2369 cases over 21 profiles, 48670 compiled, 1079
refused, 0 failed, 0 differences, 0 regressions, 348 uncovered cells as at pin 76. 10362 cells'
artifact hashes move with SEMANTICS 2099, each still compiled. Slowest compile 2.2 s, peak worker
232 MB, wall 161 s.
2026-11-13 16:06:55 -08:00
Anees Iqbal e502e81e58 Re-bless the golden tables at 69c5ab1de6
The golden-table bless at the pin-77 tip (m3-max-27074): 59 rows of golden_hashes.tsv move with
SEMANTICS 2099 (a thread-memory load forwarded to its single dominating store once calls are
inlined and again after SCCP); the engine inventory and the air_input printouts are unchanged.
2026-11-13 16:06:51 -08:00
Anees Iqbal 69c5ab1de6 Expect no shared-memory notice in the fill-mode tests that make no buffer
points_need_fill_mode_non_solid expected "not announced: [SharedInSystemMemory]"; on a discrete
device that notice comes only from a Shared buffer, and the test (like the two MoltenVK refusal
branches) makes only Shared textures, so on the RX 7900 XTX it failed on the expectation alone
(m3-max-26943, 4/5). The three now expect no notice. Test only.

Verified (fillpoints, d4db20618e): XTX (RADV NAVI31, 27021 build, 27032 run) 5/5, XTX_RUN=0:
Points light Metal's 3 vertex pixels, culled front none, back the same 3, fill 45 px, lines 27,
triangle-point-size announced once; fill-lines pixels unchanged.
2026-11-13 15:54:34 -08:00
Anees Iqbal dbcbc704c2 SEMANTICS 2099: forward a thread-memory load to the value its single dominating store wrote, once calls are inlined and again after SCCP
A kernel that keeps values in a private (thread) arena through pointers stored in a closure-like
struct, then read back after its stitched calls are inlined, kept every such slot in memory: on
NVIDIA the arena became local memory (4,304 B on the heaviest authored shape) and the kernel ran
6-10x slower than the same arithmetic in registers.

canon::forward now runs once link, byval, erase, inline and devirt are done, and again right
after the first SCCP and the constant-load folds, over the variant the function constants pick
(SCCP runs again only when forwarding changed the body). A load from a thread allocation becomes
the value its single dominating store wrote where type, offset and length match; allocations with
no read left are dropped; inttoptr(ptrtoint p) read back through such a slot becomes p. A load of
an aggregate that holds a pointer, and a load that would read a thread or threadgroup null
pointer (it exists only in memory), stay memory loads. Plain loads and stores only: volatile,
atomic and non-private address spaces are untouched.

Running forward before SCCP first walked every unspecialized body with all function-constant
variants (peak worker 469 MB, work 10.9 M -> 29.3 M units on the scan cases); forwarding over the
specialized body keeps them at the tip's level.

Verified (ftk2, dff96439f6 on 33de04117d):
- NVIDIA statistics: the heavy kernel's local memory 4,304 B -> 0 (registers 59 -> 64); its
  sibling stays 0 B. Module words: 28078 -> 14358, 15253 -> 11962, 8132 -> 6846.
- RTX 2080 (26970, runtime CB span, median of 21): the three heavy shapes 0.430/0.470/0.221 ->
  0.044/0.046/0.034 ms (6.5-10.3x); others within -1..+3%. RX 7900 XTX (26972): 0.106/0.144/0.068
  -> 0.019/0.020/0.014 ms (4.8-7.4x); one conv shape +8% (A/B 27033 pending), another -6%.
- Census (M3, 26969): 2369 cases, 48670 compiled, 1079 refused, 0 failed, 0 differences, 0
  regressions, 10362 artifacts moved; peak worker 228 MB, slowest compile 908 ms, wall 116 s.
- Suites (msi 26948/26949) pass but golden_hashes (578 cells, re-blessed on development); clippy
  all features, each alone, m2v_gpu and m2v_cpu_icd 0; rustdoc 0. canon/tests/forwarding.rs fails
  before and passes after.
- Pipeline state creation on the 2080, cold process: 19-25 ms tip, 21-36 ms with the change,
  almost all of it the driver.

SEMANTICS_VERSION 2098 -> 2099.
2026-11-13 15:53:27 -08:00
Anees Iqbal ad32c3bee9 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 15:52:26 -08:00
Anees Iqbal 0ee5fb1b9b RUNTIME 2247: an indirect command buffer's records lie in the runtime's own pages, so a device recovery keeps them
A device recovery's carry of an indirect command buffer whose records lay in pooled host-visible
memory moved them to new memory and reset every command (a lost device's mapped memory has
undefined contents), where Metal keeps a Shared buffer's records across its GPU's restart. On ANV
(i915), whose held host-pointer imports cost every submission, the runtime's own small buffers
never lay in imported pages, so every ICB took that path. The consumer's test (four senders
setting nil vertex and fragment buffers while the device recovers, Iris Xe) read back a suffix of
a command's sets as 0 in 10/10 runs, at pin 75 and with RUNTIME 2245 alike.

Now the records (Device::records_buffer, FreshPages::Always) and the slots past them lie in fresh
pages of their own at any length, whatever a held import costs, where the device imports host
pointers into the Shared class's best type. The carry imports the same pages again
(Contents::Kept): records and contents pointer as they were, the CPU's and the GPU's writes kept.
Such a buffer is parked and taken again as a pooled one is. Only a device without the import, or
a failed import, keeps the pooled placement and its reset, which the recovery notice counts.
docs/API.md's recovery section says so.

Cost: one held import per live ICB, about 0.35 us a submission on ANV i915 (submit_check.rs's
measured figure), by its pages on RADV; an import at creation 17-43 us where no parked one is
taken (fresh_pages.rs).

Verified (carryrace, 362d920e11 on acb4c6780d, msi lavapipe):
- icb_carry_race::a_recovery_keeps_the_commands_the_cpu_encoded (a compute command whole and 64
  render commands' four nil buffers, recover, read back, run): base + test (27027) prints Lost and
  fails (command 0 read [None x4] where [64, 80, 96, 112] was set); the fix (27028) prints Kept,
  80/80 with the ICB, executions, recovery, fresh-page, no-pointer-import and recycling tests.
- Owed: clippy in three configurations, rustdoc, the N-ICB submission cost, the consumer's Iris test.

RUNTIME_VERSION 2246 -> 2247.
2026-11-13 15:51:44 -08:00
Anees Iqbal acb4c6780d Re-bless the authored compile census at bbe2df44e2
The census at the pin-76 tip (m3-max-26984): 2369 cases over 21 profiles, 48670 compiled, 1079
refused, 0 failed, 0 differences, 0 regressions, 348 uncovered cells as at pin 75, 0 artifacts
moved. Only the product digest changes: SEMANTICS 2098's region-copy variant and ARTIFACT_FORMAT
520's codec additions move no authored cell. Slowest compile 2.0 s, peak worker 231 MB, wall
155 s. The golden-table bless at this tip (m3-max-26983) wrote no change.
2026-11-13 15:34:36 -08:00
Anees Iqbal bbe2df44e2 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 15:27:24 -08:00
Anees Iqbal 977c9da12f RUNTIME 2246: setTriangleFillMode: 2 (MTLTriangleFillModePoints, Apple-private) draws a triangle's vertices as points
Apple's GL renderer sends setTriangleFillMode:2 for glPolygonMode(GL_POINT) under its Intel and
Apple-silicon caps tables. The value is not in the public headers. Our TriangleFillMode had only
Fill and Lines, so the consumer's raw-value conversion failed and its host died. Measured on
Metal: an M3 Max and an Intel UHD 630 draw only a triangle's 3 vertex pixels (a Radeon Pro 5300M
fills it); our own probe on the M3 (m3-max-26811) draws 1-px points whether point_size is 4, 1 or
unwritten, culls them with CullMode Front, and draws them with Back.

Now TriangleFillMode::Points (2) exists. The generator (scripts/regen-metal-enums) takes a
PRIVATE line for it, with its evidence, and a PRIVATE_DOCS doc comment (metal_enum! accepts
variant attributes); generated.rs stays generated and `--check` passes. The runtime draws it as
VK_POLYGON_MODE_POINT. It needs fillModeNonSolid (refused otherwise:
Feature::TriangleFillPoints) and, on a portability-subset device, pointPolygons
(VkFeature::PointPolygons; MoltenVK withholds it, so it refuses Points). New degradation
TrianglePointSize ("triangle-point-size"): Vulkan sizes the points by the PointSize the vertex
function writes, where Metal draws 1 px. An ICB command still refuses set_triangle_fill_mode, as
before. New lane module runtime_lane::triangle_points.

Verified (fillpoints, 6b9927c402 on 25be73dddf):
- lavapipe lane 30/30: points light {(3,3),(3,12),(12,3)} (Metal's 3 vertex pixels); culled
  front none, back the same 3; fill 45 px (the M3 lit 45); lines 27; fill/lines unchanged.
- msi: clippy plain, m2v_gpu and m2v_cpu_icd 0; rustdoc 0; touched tests 102/102.
- Owed: the XTX leg (m3-max-26943).

ARTIFACT_FORMAT_VERSION 519 -> 520 (VkFeature appended to the codec), RUNTIME_VERSION 2245 -> 2246.
2026-11-13 15:26:44 -08:00
Anees Iqbal 7de85991e5 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 15:18:11 -08:00
Anees Iqbal 71e088b900 RUNTIME 2245: an ICB setter's write under the lock reads the records' bytes under it
RUNTIME 2242 (20d04dbd5e) made an indirect command buffer's setter read the records' storage
pointer once, when its batch is made, and edit_locked wrote through that pointer after taking
the `pipelines` lock. A setter that waited on the lock while a device recovery carried the buffer
then wrote into the lost generation's memory, which the recovery had already released (records
lost, every command reset), and recorded its state in the carried table: the write was lost and
the table and record disagreed, or the process faulted. Before 2242 the edit read the bytes
under the lock.

Now edit_locked reads the records' bytes after it takes the lock. A test-only hook
(hold_next_set, under test with m2v_gpu or m2v_cpu_icd) holds a set after its batch is made.

Verified (carryrace, c7ea201189 on 522a8245e2, msi lavapipe llvmpipe):
- tests::icb_carry_race::a_locked_set_held_across_a_recovery_lands_on_the_recovered_records:
  a first dispatch (locked) held across recover_for_test lands on the recovered records
  (locked/unlocked writes moved by 1/0), answers its threads and runs once its state and
  buffers are set. ICB + recovery suites 26930 TESTS=0 (48 passed); wider with executions 26942
  ICB_SUITE=0 (55 passed).
- Negative control (26931, the batch's pointer put back): the new test dies with SIGSEGV
  (NEG_TESTS=100); the recovery's notice says the records were lost (every command reset).
- The unlocked setters' race with a recovery's release (use-after-free) is not fixed here; it
  follows.

RUNTIME_VERSION 2244 -> 2245.
2026-11-13 15:17:25 -08:00
Anees Iqbal 9ec2b198f3 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 14:53:11 -08:00
Anees Iqbal b741f93b9e SEMANTICS 2098 / RUNTIME 2244: a rate-mapped pass's region-by-region draws copy each region in the vertex function, scissored, so Equal depth matches the fanned-out route
Under RateMapRegionPolicy::FanOut a draw was drawn two ways: fanned out (a geometry stage's copy
of each triangle per region, window position a*x + b*w through one viewport), or region by region
(each region through its own Vulkan viewport). The two rounded a vertex's window position
differently, so a pass testing depth Equal against depth the other route stored failed along whole
surfaces: the consumer's black blotches on lit surfaces in Apple's Modern Rendering sample on the
RTX 3090. The depth-Equal repro left 44,666 of 89,483 pixels red on lavapipe whenever the prepass
and the Equal pass took different routes; 0 under Exact or on one route.

Now on a fanning device the region-by-region draws take a region-copy variant
(RegionFanOut::RegionCopies), with no geometry stage. Its vertex function computes region
RegionFirst + DrawIndex of the table, stores its position through the region's line and four clip
distances by the one emitter the fan-out stage's copies use (pipeline::link::fan_out::region_copy:
NoContraction arithmetic, Position and ClipDistance Invariant), and its draw index as
ViewportIndex. Each recording sets as many viewports as one multi-draw takes, every one the
fan-out's over the render area, with each region's scissor at its index (bind::fan_out::scissors),
so off-region triangles are scissored, not clipped. The settle keys the pipeline with the same
viewport count (fan_out::copy_viewports). The variant replaces the regions variant, so no pipeline
is added per state. A device without multiViewport, shaderOutputViewportIndex and
shaderDrawParameters keeps the per-region-viewport route (FAST-PATHS known gap). Exact is
untouched. New: bind::fan_out::scissors, WorkCounts::rate_map_region_copy_draws and
rate_map_region_copy_recordings, PushField::RegionFirst; cache codec variants (artifact format).

Verified (blotch, steelbrain/blotch 1fd68a45c0..16d5c2404f):
- lavapipe at 16d5c2404f: rate_mapped_depth_equal + rate_mapped_fan_out 4/4, 0 red in all 10
  depth-Equal lines (mixed pairs included), 0 pipelines made at the host step; clippy CPUICD,
  GPU and plain 0; rustdoc 0. Translator suite at 8ad673ffba 3562/3563, the one failure
  golden_hashes (re-blessed on development).
- 780M and XTX at 8ad673ffba (differs from the tip by the settle fix only): 0 red in all 10
  lines. E->E GPU cold/warm: 780M 4.99/4.97 ms against Exact 1.68/1.65; XTX 1.14 ms/650 us
  against 569/265 us. Creation (shader cache off): 780M 1.32 ms/state (Exact 0.92), XTX 1.30
  (Exact 0.68).
- Owed: the same numbers at development's tip without this change (the GS fan-out), the
  clip-distance probe, and the 780M/XTX runs at 16d5c2404f.

SEMANTICS_VERSION 2097 -> 2098, ARTIFACT_FORMAT_VERSION 518 -> 519, RUNTIME_VERSION 2243 -> 2244.
2026-11-13 14:52:26 -08:00
Anees Iqbal 522a8245e2 Re-bless the authored compile census at 25be73dddf
The census at the pin-75 tip (m3-max-26807): 2369 cases over 21 profiles, 48670 compiled, 1079
refused, 0 failed, 0 differences, 0 regressions, 348 uncovered cells as at pin 74, 0 artifacts
moved. Only the product digest changes (RUNTIME 2240 to 2243 change no translation). Slowest
compile 1.5 s, peak worker 227 MB, wall 121 s. The golden-table bless at this tip (m3-max-26806)
wrote no change.
2026-11-13 14:33:47 -08:00
Anees Iqbal 25be73dddf Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 14:26:48 -08:00
Anees Iqbal 5bf7ae2eae RUNTIME 2243: a committing command buffer counts as uncommitted until the scheduler holds its batches
The consumer's Iris walk at pin 73 (appwalk10 w-iris-26) failed one guest command buffer during
login with the runtime's own invariant "a batch's end recorded where the batch does not end"
(command_buffer/submit.rs), read as VK_ERROR_UNKNOWN (-13): the first tagged sighting of the -13
seen untagged three times on the 3090 and the 780M since pin 59.

Cause: a texture's face turn (texture/faces.rs turn_face) and a storage-form switch need the
device's Uncommitted count at 1 and the scheduler holding nothing. Both held for a command buffer
B in commit_now between slot.committed() and scheduler.commit(), where B's end is folded into its
last command buffer (face_swaps.any() false). Interleaving: B encodes an attached-read pass that
copies into the texture's other face G; B commits and folds its end; before B reaches the
scheduler, A opens a pass that turns the texture F -> G; at B's submission record_face_fixes finds
A's record and pushes a back copy G -> F after B's folded command buffer, so work.last() is not the
folded one and the command buffer fails. The same back copy would also have written stale texels
over B's rendering in F.

Now a committing command buffer stays in the Uncommitted count until scheduler.commit holds its
batches (Slot::handed; held.open still drops at committed(), so slot_wait is unchanged): no turn
or storage-form switch lands between the fold and the submission. Only turn_face and
storage_form_switch read the count, and both refuse rather than wait (Unturned::Busy and the
copy-in path; no switch), so nothing waits on it.

Verified (batchend, 42e70c6642 on 33de04117d), lavapipe on msi: new device tests holding B at a
new trace point Point::Committing while A's pass opens. Negative control (the tip without the fix,
26731): the folded test panics on the invariant (submit.rs:1145), the apart test finds B's pixels
clobbered (4096 bytes differ). Tip (26755): 6/6, finale folded 1 / apart 1 as built, Moved {swaps
0, busy 2, fixes 0}, B's pixels right at every step. Turns still happen: the existing
a_texture_s_faces_take_turns_for_its_attached_reads shows swaps 1 in each of its turn cases, the
same at base and tip. clippy --cfg m2v_cpu_icd (26758), --cfg m2v_gpu (26726), plain (26693) and
rustdoc (26725) 0. The command_buffer/submission/queue/storage_form/attached-read suites on
lavapipe (26759) and the XTX leg follow on development.

RUNTIME_VERSION 2242 -> 2243.
2026-11-13 14:26:06 -08:00
Anees Iqbal 761f2666fe Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 14:25:13 -08:00
Anees Iqbal 20d04dbd5e RUNTIME 2242: an ICB's setters write through one batch, mostly without the lock; set_render_command and set_compute_command
An indirect command buffer's CPU setters, after RUNTIME 2238's dense table and one hold: every
setter write now goes through one per-command batch (one storage pointer, one count of the writes
made without the lock), written into in place rather than handing back a ~180-byte plan (which
made a first form slower than before). The written flag (SEMANTICS 2097) is set in the one write
helper, write_field, by the rule unchanged: every setter write sets it, a write of the reset
record clears it. A draw, a dispatch, a set barrier and a cleared barrier the edits' summary
already holds, like a buffer slot before, take no lock where the GPU may not have written the
buffer, checked against an atomic mirror of the summary set under the lock; a pipeline state the
command already names is set again with no lock and no CallHold (an atomic (id, serial, kind)
mirror per command; a recovery's carry forgets it, so the next set redoes every check). New
public calls IndirectCommandBuffer::set_render_command / set_compute_command (an index and a list
of sets, no handle and no Arc clone; index and kind refusals at place 0) and the handle's
set_each; borrowed RenderAt/ComputeAt views. docs/API.md says which setter writes take no lock;
the carry docs say a write made without the lock does not wait for a carry (as buffer slots'
did; a set racing a device recovery may write through the old mapping).

Verified (icbset, f403b6e922 on 33de04117d), ns a command, median, 16384 commands, msi lavapipe
(26658, two passes), development e93b3f192e -> tip: full render slot 142.6/147.6 -> 100.7/100.1;
compute slot 119.3/123.0 -> 77.5/77.5; three fields 77.1/78.8 -> 71.8/71.9; draw only 43.5/43.9 ->
34.0/34.0; set_render_command 94.7, set_compute_command 78.9. 780M (26754, 256 commands): full
slot 154.3/167.7 -> 111.0/117.0, compute 123.3/122.7 -> 93.1/87.8. lavapipe ICB set 154/154,
including a test of which way each write went and set_each/set_render_command against one setter
at a time; negative control (a whole-record read-modify-write in write_field) fails the
strengthened two-thread test (26658). 780M: the 6 ICB device tests and set_states pass. clippy
plain / --cfg m2v_gpu / --cfg m2v_cpu_icd and rustdoc 0 (26682, 26756).

RUNTIME_VERSION 2241 -> 2242.
2026-11-13 14:24:31 -08:00
Anees Iqbal fe048e0a64 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 14:23:39 -08:00
Anees Iqbal a308b1b409 RUNTIME 2241: kept draws survive fence updates and waits and resource and heap uses; the calls that let them go are counted
On the consumer's XTX Launchpad walk ~40 inline render encoders a present end keeping nothing
though none of their draws was counted unkept (keepdraws' read of lp72-xtx): every logged call
but a direct draw, a bind, a pipeline state set and a render state set forgets the encoder's kept
draws (render/replay.rs log -> forget_again), and the guest orders its heaps between encoders
with fences (updateFence after the last draw, useResource(s)/useHeap(s) before).

A kept draw, and those set aside, now survives:
- update_fence: it records nothing;
- wait_for_fence where the encoder used no shadowed texture (a wait over a shadowed texture marks
  it written, so later commands take its copy again: that wait still forgets);
- use_resource(s) / use_heap(s), but a memoryless use (which fails the command buffer): a use
  that changes the residency gives it a new generation, which Under holds, so the next draw takes
  every step; a repeat use changes nothing.
Every other logged call still forgets. New WorkCounts: kept_draws_kept_across_{fence,use},
kept_draws_let_go_{fence,use,barrier,store_action,visibility,other} (the kept draw a logged call
let go, by kind), encoders_last_draw_empty.

Verified (keepdraws, 77437d3277 on adaccf2367): lavapipe debug 64/64 over kept_across_calls,
draw_again, carried_draws, snapshot_reader, deferred_calls (26714); the new
tests::kept_across_calls 2/2 (draws after updateFence, waitForFence, a new useResource, the same
use twice, a new useHeap, the same heaps, updateFence, against the same calls plus a forgetting
call: pixels and commands equal; kept across fence 3 and use 5, drawn again 3, unlike_kept_under 2
for the two residency-changing uses; a barrier test let_go_barrier 1, encoders_last_draw_empty 1).
Negative control (26721: a draw again recording its Vulkan draw twice) fails the pixel test (48
vs 36 a channel). clippy plain / --cfg m2v_gpu / --cfg m2v_cpu_icd and runtime rustdoc 0 (26715).
An XTX run follows on development.

RUNTIME_VERSION 2240 -> 2241.
2026-11-13 14:22:58 -08:00
Anees Iqbal 6437276690 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 14:22:01 -08:00
Anees Iqbal e3ee3d7f5e RUNTIME 2240: a draw that reads its own color through snapshots is kept: drawn again, rebound and carried
On the consumer's XTX Launchpad walk ~59% of render encoders end keeping nothing though they would
fit the next encoder (WorkCounts::encoders_none_kept_next_fits, RUNTIME 2229), and ~75 draws a
present read their own color attachment through a snapshot (render/snapshot.rs), a draw that kept
nothing and so took every step each time.

A direct draw that reads through snapshots (not in place), pins nothing, and otherwise meets every
plain-draw condition (records into its instance as it stood, a pipeline made ahead, one push, one
Vulkan draw, whole draw state, its only push hole SnapshotPhase, no write but its snapshots' uses)
now keeps a Kept with a reader part (slots, feedback colors, the phase hole, the pipeline's own
write masks, its layout). A draw again records exactly what the first did, the snapshot draw
(masks 0, phase 1) then the drawing draw (own masks, phase 0), with their barriers and query,
re-deriving only what changes with no call (the reader's ordinal, its learned coverage and the
area/coverage decision, peeked first; if it would no longer take the snapshot the draw takes every
step). A rebind re-derives the reader decision through side-effect-free cores of the functions
every step runs (in_place_wanted, snapshot_wanted, area/coverage, snapshot_holds, snapshot_apart),
binding::rebind_into rewrites a changed slot's SnapshotTexels source, and record_rebound records
the two recordings with their pairs. A carried reader's snapshot conditions are checked at its
rebind beside carried_stale (WorkCounts::draws_carry_stopped_snapshot), begin_carried passes its
feedback to inline_begin, and a carried draw retains its pipeline objects into its encoder.
Set-aside kept readers are exempt from a reader's forget of its colors' readers: their reads go
through their own pair, whose first barrier orders every earlier color write. In-place readers,
pinning readers and readers recording into a new instance stay unkept. New WorkCounts:
reading_draws_snapshotted_again, draws_rebind_stopped_snapshot, draws_carry_stopped_snapshot.
A lane bench (runtime_lane reader_costs) measures the CPU per draw of encoders ending in a reader.

Expected reach (keepdraws' read of the consumer's lp72-xtx counters): readers never sit in an
unsplit inline pass, so this reaches the ~22 fitting encoders a present that are not inline.

Verified (keepdraws): clippy plain / --cfg m2v_gpu / --cfg m2v_cpu_icd and rustdoc 0 at adaccf2367;
lavapipe 43/43 (no snapshot path there: pixels only); XTX and 780M debug at e4961c98ee 91/92, the
one miss (a carried draw's later draw again) fixed by 8e219f8bad. XTX/780M reruns at the tip,
negative control and the release bench are queued and follow on development.

RUNTIME_VERSION 2239 -> 2240.
2026-11-13 14:21:20 -08:00
Anees Iqbal 33de04117d runtime_lane: an indirect dispatch's split is expected where the runtime splits it
Two runtime_lane indirect_dispatches tests (an_indirect_dispatch_reads_the_arguments_the_work_before_it_wrote,
an_unaligned_offset_reads_at_the_multiple_below) expected a SplitDispatch notice on every device. A
10x3 grid in 4x2 threadgroups runs on the kernel's partial-threadgroups variant where the device
compiles it (compute.rs partial_direct), as Metal runs the dispatch its arguments state with partial
threadgroups, so nothing splits; on the RTX 5080 both failed on the notice alone, their outputs
matching the direct dispatch's, at 045c6fedf9 (26552) as at e93b3f192e (26537).

ragged_splits(device) compiles the fixture's kernel through the public compile layer under
VariantKey::partial_threadgroups (the variant settle_partial asks for) and answers "split" where
that compile is refused, which is what makes the runtime keep the split; the kernel uses no
simdgroup function and binds plain buffers, so that key is the runtime's. The two tests expect
SplitDispatch where it holds; an_indirect_dispatch_runs_as_the_direct_dispatch_of_its_arguments
expects it where ragged_splits holds or maxComputeWorkGroupCount[1] < 65536, so its 65536-group case
still checks the split notice on the 5080 (limit 65535).

Verified (radvcompile, 1eb49b23b6 on e93b3f192e): clippy -p metal2vulkan-validation --all-targets
--all-features --cfg m2v_gpu = 0 and the gpucfg test build = 0 (26569); RTX 5080 runtime_lane::
indirect_dispatches 10/10 (26585). The predicate's "split" side has not run on a device yet (CI's
lavapipe device job runs it). Test only; no version bump.
2026-11-13 13:34:21 -08:00
Anees Iqbal 50cdea6eb8 Re-bless the authored compile census at e93b3f192e
The census at the pin-74 tip (m3-max-26572): 2369 cases over 21 profiles, 48670 compiled, 1079
refused, 0 failed, 0 differences, 0 regressions, 348 uncovered cells as at pin 73. 88 cells'
artifact hashes move with SEMANTICS 2097 (indirect command buffer encoders store each command's
written flag), each still compiled. Slowest compile 2.6 s, peak worker 235 MB, wall 161 s.
2026-11-13 13:33:08 -08:00
Anees Iqbal 61516952b9 Re-bless the golden tables at e93b3f192e
The golden tables at the pin-74 tip (m3-max-26571; inventory, golden and printout blesses each
exit 0): 88 golden hash rows move under unchanged keys, every one an indirect command buffer
encoding fixture (engine icb_*_encode, icb_merged_*, icb_replay_*, icb_reset_encode,
icb_routed_writes, mesh_commands, resident_draws, kernel_icb_encode_*), with SEMANTICS 2097: the
lowered encode operations and copy_command store each command's written flag. The inventory and
the printouts are unchanged. Test data only.
2026-11-13 13:33:07 -08:00
Anees Iqbal e93b3f192e Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 13:16:56 -08:00
Anees Iqbal 67fb4a7902 SEMANTICS 2097 / RUNTIME 2239: an ICB's blit reset writes only the commands written since the last
An indirect command buffer's records live in Shared host memory by design (the host step reads
them on the CPU, and plain Metal lets the CPU write a Private ICB's commands), so a blit's reset
of a whole ICB was a vkCmdFillBuffer over every record across the link: on the consumer's Modern
Rendering sample (45k commands, 101 MB of records) 56.9 ms of GPU time a frame on an RTX 2080
over PCIe x4, against 0.26 ms for the same fill in device-local memory, while the sample writes
~1.3k commands a frame.

Each command now has a u32 written flag in an optional tail after the records (16 +
capacity*2248 + 4*i; CommandBuffer::initialize and decode unchanged). The lowered encode
operations and copy_command store 1 through the contained wide_at (no tail: the sink; a faulting
operation stores nothing); the CPU setters and edit mark it, and a CPU write of the reset record
(reset_with_range) clears it; a blit copy fills the destination's flags with 1. A blit reset is
one dispatch of the new owned kernel bind::icb_reset_module per run of commands, a workgroup a
command that zeroes a flagged record with 8-byte stores and clears its flag; the overflow clear
stays a fill. The carry copies the whole storage, flags included; a lost carry rewrites the header
and zeroes the flags.

Verified (radvcompile, at 273dbba28c on 045c6fedf9):
- 2080 (26425, 26442; 45k commands): old reset 56.8-56.9 ms in every shape; flagged reset 0
  written 0.256 ms, ~1.3k written 1.736 ms, all written 60.47 ms (+6.5%: 8 bytes is the widest
  store every record allows; recorded in blit_indirect.rs "What a reset costs"). A culling-shaped
  encode kernel (45k render commands, 3 operations each): 19.80 -> 20.11-20.16 ms.
- msi 26494: engine and interpreter round trips with flag asserts and the reset kernel's tests
  59/59, runtime unit tests 1536/1536; clippy workspace all features, each feature alone, runtime,
  --cfg m2v_gpu all 0; rustdoc -D warnings and the API reference check 0.
- RTX 5080 (26478, the change before the rebase): 281/282, both new device tests passing
  (a_reset_resets_what_each_writer_wrote_since_the_last on the host step;
  an_execution_on_the_gpu_alone_runs_what_a_reset_left); the one failure, a getter test's old fill
  count, fixed in this commit. Negative control (26505, the kernel's flag store removed): both new
  tests fail. A device rerun at the landing tip is queued.

SEMANTICS_VERSION 2096 -> 2097 (the lowered encode operations store the flag), RUNTIME_VERSION
2238 -> 2239.
2026-11-13 13:16:16 -08:00
Anees Iqbal 045c6fedf9 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 13:03:46 -08:00
Anees Iqbal ed9b745d20 RUNTIME 2238: an ICB's per-command pipeline states in a dense table, and one hold a pipeline set
An indirect command buffer's CPU setters cost ~290 ns a command in the runtime alone on lavapipe
(the consumer's icb_slots_cost at pin 72: 16384 render commands of 5 fields; a Mac does ~5 ns),
the largest frames CallHold's drop, the setters' edit, and a BTreeMap<u32, CommandState> insert per
command. Two cuts:
- The per-command state is a dense table: a u32 a command indexing a small table of distinct
  CommandStates, each counted by the commands that name it (set_states.rs); a set checks the last
  state it set, then a map. A recovery's carry walks the distinct states. An entry goes when its
  count reaches 0, so nothing is held past what the map held.
- A render or compute pipeline set took 4 CallHolds (the setter's, program(),
  can_encode_indirect_commands(), indirect_command_writes()), 8 mutex takes; it now takes one, and
  a set of a state the table already names reads no program at all.
Also: icb_encode_bench gains a full render slot (pipeline + 2 vertex + fragment + draw) and a
compute slot (pipeline + 2 kernel buffers + dispatch) a command.

Verified (icbset, msi lavapipe release, one A/B job m3-max-26475, binaries alternated, two passes,
host load ~20 so passes drift; median ns a command at 16384 commands): full render slot base
232.7/291.6 -> dense 215.7/253.9 -> + one hold 135.2/185.8 (-42%/-36%); compute slot 212.0/263.4 ->
196.8/217.6 -> 116.6/151.5 (-45%/-42%). ICB, released-program, write-route, recovery and kept tests
on lavapipe running (26484) at the branch tip. The batched setter (set_each) and the unlocked
action/pipeline setters follow after the ICB reset's dirty flags land.

RUNTIME_VERSION 2237 -> 2238.
2026-11-13 13:03:06 -08:00