Commit Graph
5735 Commits
Author SHA1 Message Date
Anees Iqbal c450efd13e Bench: walk_costs encodes a compositor's frame of 107 render encoders a command buffer, its targets made once the in-place checks answered
Bench: walk_costs encodes a compositor's frame of 107 render encoders a command buffer

walk_costs_frame encodes walk_costs' encoders 107 to a command buffer, as many as a compositor's
desktop frame of the consumer's guest walks holds in one (its 3090 walk at pin 92), and commits it
with commit_and_submit as the consumer's encoding thread does: WALK-FRAME prints the medians of
the encoding thread's CPU a frame, a draw and an encoder, and of the commit, with the frame's
moved work counts. walk_costs_frame_profiled encodes 400 such frames for a profiler.

A measurement, ignored by default; not yet run.

Bench: walk_costs makes its targets once the device's in-place checks answered

walk_costs made its target over host pages right after the device opened, before the
device's in-place checks answered, so the texture took a shadow for good: on the RTX 5080 and on
lavapipe every over-pages frame copied the target in and merged it back each pass
(shadow_attachment_passes 107 a frame, 221 M texels copied in a frame on the 5080), where the
consumer's surface renders in place (on NVIDIA a linear image under
VK_NV_linear_color_attachment). The workload now settles the checks first, as compositor_costs
does, and walk_costs_frame's header prints whether they settled and the textures in place.

Test-only; not yet run.

Verified: job 31048 built the validation crate's lib tests in release under
--cfg m2v_gpu at b582060860; the bench ran on lavapipe (31010) and the 5080
(perdraw8-nvprof). Test-only.
2026-11-14 19:56:25 -08:00
Anees Iqbal 363cd92fd0 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 19:52:33 -08:00
Anees Iqbal ae18097da2 RUNTIME 2330: A render state that supports indirect command buffers begins the draw replay's kernels on the pool
The first frame of a rate-mapped pass whose execution the GPU route takes
spent 95 to 105 ms in its host step on the Iris Xe (job 30970, both sides),
against 12 to 16 ms when the host read the records (job 30850), the step
making no state's pipeline. The route's prework records the draw replay's
preprocess and a merged replay's two passes, the runtime's own kernels,
which a device builds at their first use: inside that step, its SPIR-V
build and three vkCreateComputePipelines calls.

Now the creation of a render pipeline state that supports indirect command
buffers, on a device that reaches buffers by device address, begins the
three on the device's pool, once per device
(Device::begin_draw_replay_kernels). The creation waits for none; a command
that asks for one while the pool builds it waits under the kernels' lock,
as for any kernel another thread builds. A command buffer's first commit
of an execution in its GPU form, which records the same prework, takes
them built too.

WorkCounts::host_step_owned_kernels_made counts the kernels a host step
built itself. The pieces lane prints it, the kernels built, the compute
pipelines' creation time and the state's creation time.

Test: a_gpu_route_s_host_step_builds_no_kernel (the step builds none of
them on the first frame or the second).

Verified: job 31036 at c095494483: clippy for metal2vulkan and the runtime,
the runtime under --cfg m2v_cpu_icd, the runtime and validation under
--cfg m2v_gpu; rustdoc -D warnings; API tests 15/15; the runtime suite on
lavapipe 2744/2744, a_gpu_route_s_host_step_builds_no_kernel among them. A
negative control (the begin call deleted) fails it: "the step built 3
kernels". Job 31038 compiled it in release under --cfg m2v_gpu. The Iris
cold-step A/B (31055) is pending.
2026-11-14 19:51:46 -08:00
Anees Iqbal 7624644602 owned_dot_fixtures_answer_metal decides denormals per kernel
The test asserted that each dot kernel requires
VkProperty::MetalFloatDenormals exactly where the profile takes
DriverDeviation::MetalFloatDenormals. Since SEMANTICS 2116 (497e1f4ec0)
an entry that declares the 16-bit float controls, on a driver whose
profile has DriverWorkaround::FloatDenormalsKeptUnderHalfControls (NVIDIA
on the RTX 3090 and the RTX 5080 Laptop GPU), requires no such property.
The stage records PrecisionNote::DeviceDenormals instead
(pipeline/compile.rs). The dot fixtures compute half lanes, so on the 5080
at pin 96 (b5080 devlegs-devlegs-96-p4) both kernels required no property
where the profile takes the deviation. The test then failed on the old
equality (left false, right true). It had passed there at 94, before the
workaround.

The test now asserts what fused_pairs_answer_metals_nans_and_denormals
asserts per kernel. A kernel requires the property only where the profile
takes the deviation. Where the profile takes it, a kernel that requires
none records DeviceDenormals. The dot, NativeDot and word checks are
unchanged. The printed line also gives the kernel's own answer.
2026-11-14 19:37:57 -08:00
Anees Iqbal d85d807392 render_fold's counts follow the device's split at aliases
On a device whose driver fact ImageUsesMissBufferWritesInOneCommandBuffer
holds (the RTX 3090, RUNTIME 2323), State::join_fold lets a render encoder
join no group whose earlier encoders wrote bytes. Every render_fold lane
opens with a compute encoder that writes the draw's colors, so at pin 96 on
the 3090 (m3-max-30795, 30796, 30797) 9 of the 13 tests failed on their
expected counts. Their texel and colour checks still passed. The counts
read: chain and worker (11, 7, 6) with 6 barriers, against (17, 1, 6);
late resolve (1, 2), against (2, 1); execution and pending (0, 3), against
(1, 2); failed_with (2, 3), against (3, 2); and the rebind folded 0 and
encoded 1 again.

Lane::joins_after_writes reads the device's rule. Each count now follows
it. Where a render encoder does not join, it begins a group of its own,
which the encoders after it join. A pass that leaves work for later leads
none, and only the copies record a barrier at their open. The failed and
checked commits encode again the members of the render encoder's own
group. The derived counts are each the one the 3090 printed where it
printed one. failed_with and the checked commit now print what they
encoded again. Every other assertion is unchanged.
2026-11-14 19:34:54 -08:00
Anees Iqbal 4d147c4d78 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 19:21:04 -08:00
Anees Iqbal e7b9c5bfdc RUNTIME 2329: A GPU route's commands are drawn one draw per command in the replay variant, indexed
The GPU route of a rate-mapped pass's host step drew each command's corners
in its merged variant: a non-indexed draw of every index, which loses the
indexed draw's vertex reuse and looks its command up per vertex. On the
Iris Xe the wide frame's pieces took 74.2 ms against 48.0 ms when the host
read the records (job 30850).

Now the step reads back each command's VkDrawIndirectCommand and its index
entry (the device address of its first index and its index size,
bind::DRAW_INDEX_ENTRY_BYTES, now public), resolves the index address to
its Metal address through the resident set's ranges and the live table's,
and draws each command as the host draws a record it read: indexed where it
is, with its instances, base vertex and base instance, in the state's
replay variant (BufferForms::Replay), each draw pushing the command's own
slot tables at its PushHole::RootTableAddress holes (CommandTables). The
commit's settle begins the replay variants for the routed executions. The
corner cutting in the piece loop goes: an indexed routed draw is cut into
index ranges as any.

Tests: the pixel and depth test asserts indexed draws are recorded on a
routed frame; the count test runs three frames, the host step making no
pipeline on any and nothing made at all on the second and third.

Public: bind::DRAW_INDEX_ENTRY_BYTES (api_signatures, api_surface).

Verified: job 30942 at the branch tip: clippy for metal2vulkan and the
runtime, the runtime under --cfg m2v_cpu_icd, the runtime and validation
under --cfg m2v_gpu; the two route tests on lavapipe. Job 30922: lavapipe
suites 78/78, API tests 15/15, rustdoc -D warnings; a negative control
(the change reverted but its tests) fails the pixel test with 0 indexed
draws recorded. The Iris and 3090 GPU-time A/Bs are pending.
2026-11-14 19:20:14 -08:00
Anees Iqbal 3db60efc33 Tests that make command queues on three or more threads at once take the queue plan
scheduler_wakes::commits_with_idle_gaps_lose_no_wake makes a command
queue on each of four threads, so three can be live at once; whether
they are depends on timing. The runtime tests' default queue limits
(two round-robin VkQueues) panic there. A lavapipe run of another lane
hit that panic, though this lane's 2740/2740 run at 06b5fe355e did not.

A scan of every spawned thread in the runtime's tests that makes a
command queue found two more of that class, both opt-in benchmarks
compiled only under m2v_gpu: host_ram_contended_fill_bench (CLIPS = 3
threads) and host_ram_block_release_bench (its first queue, the
compositor's and the releases' queue). The others keep at most two
live at once: command_counts, deferred_calls, freed_memory,
heap_set_unlocked, managed_copy_device, fill_waits_bench,
managed_copies_bench, memory_block_bench and memory_make_hold_bench.

They now take the plan (`queue_limits: None`). scheduler_wakes gains
plan_device over a device_of, as the other modules' helpers do.
2026-11-14 19:17:16 -08:00
Anees Iqbal 56ae450542 Test: the quiet compositor's first long one outlasts its expected run
a_quiet_unshared_queue_s_first_command_buffer_waits_behind_the_idle_budget_and_one_batch
failed on lavapipe inside a whole suite's run (pin 96). All five runs let
the second long command buffer go only once the first had ended. Each run
of the same work varied several-fold under load (23.7 to 170.5 ms), while
the queue's expected run (raised at once by a longer run, halved toward a
shorter one) stayed at 63.8 to 217.3 ms. So the 16 ms idle budget
(expected end less 16 ms) never came due before the first's own
completion let the second go.

Under Compositor::Quiet, the run now sets the expected run just before:
- twelve small fills run alone bring any longer run down to a 4096th of
  its excess;
- the warm long one then sets the expected run to its own run;
- the first of the three does three times that work, so it runs past its
  expected end unless the host gets that much faster between the two.
The assertions are unchanged. Compositor::Active and the late-pass test
are as before.

Also in this landing: 3ef078853e Test: the Scheduled test picks the run whose later one read Scheduled soonest.

Proof (m3-max-30924 at 3ef078853e, lavapipe): clippy cpuicd 0; held_step_order, the quiet test and all 20
queue_share_device tests pass. Test-only: no RUNTIME bump.
2026-11-14 19:12:06 -08:00
Anees Iqbal d6db2e4ba6 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 19:02:30 -08:00
Anees Iqbal d62ca65f36 RUNTIME 2328: Scheduled behind a host step waiting at its gate
A command buffer whose remaining batches wait only for its queue's host
step behind work already submitted now reads Scheduled at once, as Metal's
does once its dependencies are resolved, instead of with its last batch
once that work ended (50-90 ms late behind an 89 ms pass on an RTX 3090).

The precedent is hang.rs, whose thread makes the command buffers committed
behind a GPU hang Scheduled early (Scheduling::Behind). The scheduler now
does the same at a look that finds a line's head waiting at its gate
(schedule_behind_steps). It walks the line from the head
(Order::leading_mut), and each batch must wait for nothing else: the head
for its step alone; each later one for no host step, check, decode, rebind
or binary semaphore, with its event values reached, and committed after no
other line's batch. At each command buffer's last batch it calls
CommandBufferShared::schedule_early:
- hang_scheduling becomes Scheduling::Early;
- the kernel end is set now, and the start where no batch began;
- the transition is posted;
- the submission handlers run in that pass's turn.

Not made early: one whose queue has a hang in flight or holding, one with
a storage-form switch riding on it, one already failed, and nothing at all
while a group holds a storage-form command buffer's last batch. Batches
submitted later leave the submitting flag as the early pass set it
(hang::scheduled_early). WorkCounts::scheduled_behind_host_steps counts
these command buffers. It is reported, never gated, in the conformance
cost (a LOOKS count).

held_step_order's (b) test used the long command buffer's kernel end as
the pass's submission time, and that end is now early. It reads the long
work's GPU end instead.

New test command_buffers_behind_a_waiting_step_read_scheduled: the long
command buffer, and a follower with a submission handler on its queue,
read Scheduled within 10 ms of commit while the step waits. The handler
runs first, the counter moves by 2, and the follower's times stay in
life order.

Proof (m3-max-30907, lavapipe): command_buffers_behind_a_waiting_step_read_scheduled passes; 249/250 touched tests
(the one failure is scheduler_wakes under the test queue limits of 58de9ba9a1, not this change). Negative control
(m3-max-30908, schedule_behind_steps disabled): the long one reads Scheduled 118-162 ms after commit and the new test fails.
2026-11-14 19:01:45 -08:00
Anees Iqbal fd25445219 SEMANTICS 2120: a draw replay's variant of one draw per command takes region copies and region viewports
The rate map's region-copy and region-viewport inputs refused a vertex function
compiled under replay_bindings without merged_draws: at commit, the GPU form
draws one vkCmdDrawIndirect per command, which no multi-draw of regions can
expand. A host step that has decoded each command's draw on the GPU
(render/executions/gpu_route.rs) records direct draws, so the variant can take
both. Its vertex function reads its command's buffers through the slot table at
its RootTableAddress push, and its draws' indices are their own, as an
encoder's draw's are.

The refusal goes from plan.rs's region_copy and region_viewport. Their docs and
LoweringInputs' are updated.

Test: tests::engine_region_fan_out::a_replay_variant_fans_out, the merged test's
twin over replay_bindings alone (Draw, Probe, DrawFew, RegionCopies, and region
viewports) on lavapipe, the Iris Xe and Pascal descriptions: compiled, L3-valid,
ReplayBindings stated, MergedDraws not, RootTableAddress pushed, settling on its
own key.
2026-11-14 18:49:22 -08:00
Anees Iqbal bd9128e6a3 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 18:38:48 -08:00
Anees Iqbal a9d8a3274c RUNTIME 2327: A GPU route's merged variants are begun at commit, not made at the host step
The host step of a rate-mapped pass draws an execution its GPU route takes
(render/executions/gpu_route.rs) in the merged form, its probe and fan-out
included, but commit's settle (DeferredPass::settle) began only the
large-buffer form's pipelines. So the step made the merged variants' VkPipelines
itself, a hitch on the first frame. On the Iris Xe (Mesa 26.2.6, m3-max-30850,
rate_mapped_pieces_host_step_inherited and its _wide twin), the host step was
137 ms and 170 ms cold, against 12 to 16 ms before the route ("2 (4) pipelines
made there").

The settle now finds the executions the route takes (DeferredPass::route_forms,
the route's own decision, which the step's gpu_routes now calls too) and
settles their draws in BufferForms::Merged, lists alone, with the probe's and
the fan-out's variants. The other executions stay in the large-buffer form.

Test: tests::rate_mapped_gpu_route::a_gpu_route_s_host_step_makes_no_pipeline,
over two frames: the execution is routed where the device fans out, and the
host step makes no pipeline (host_step_pipelines_made 0).

RUNTIME 2327: an unchanged artifact's routed execution no longer makes its merged variants at the host step.
Proof (m3-max-30873): a_gpu_route_s_host_step_makes_no_pipeline (first frame 0 made, second 0); 78/78 lavapipe; clippy
plain + cpuicd 0. Negative control (settle back to BufferForms::Large): first frame makes 4.
2026-11-14 18:38:04 -08:00
Anees Iqbal 90d023e344 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 18:36:04 -08:00
Anees Iqbal a7e519150b RUNTIME 2326: Scheduler: a host step held at its gate gives way but to writers of its reads
What: a batch held for its host step, once the step took its gate, kept its
place in the order across queues, so every later commit of any queue whose
footprint conflicted with it waited host-side until the GPU work before the
step completed and the step recorded. A step whose uses commit could not
bound (shadowed textures, tile memory, a visibility query, an inherited
function table) conflicts with every batch that makes a tracked use, so it
held every queue, the compositor's unshared queues included. On an RTX 3090
a rate-mapped pass executing a GPU-written indirect command buffer held every
queue's commits for the 89 ms pass before it in its command buffer.

Now such a batch gives way, as it already did before its gate (the x86 Macs
take a later commit of another queue first; the M3 keeps commit order), but
for a later commit that writes what the step reads on the host (its
executions' records and ranges), which the gate does not cover, or that
shares a fence with it. The batches after it on its line give way with it.
A step whose host reads are not known (staged gathers and scatters, indirect
dispatches, loop checks, predicated executions, indirect sparse updates)
keeps its place from its gate on, as before.

How: Held keeps the step's host reads as a footprint when the gate is taken
(CommandBufferShared::step_host_reads, step_reads without the bounded-uses
requirement; Footprint::of_uses); place_of answers GivesWay for it; the
order's comparison for a batch that gives way checks fences and, for such a
step, a later write of its reads. Order itself is unchanged. Docs: the
scheduler's and order.rs's rules, gate_of, WorkCounts, and the
host-replayed-indirect-commands notice (degradation.rs, docs/API.md).

Verified: tests::held_step_order on lavapipe, three legs (results in the
report): an unshared queue's fill while the pass waits at its gate, the pass
bounded and not, goes with no look held behind it; a reset of the records the
step reads still waits behind the pass's batch. Before this change the
unbounded leg's fill went 111.40 ms after its commit, 0.2 ms before the pass
(m3-max-30848 at cd77de72d8, 3 looks held).

Also in this landing: cd77de72d8 Test: an unshared queue's fill waits for no other queue's host step.

RUNTIME 2326: an unchanged artifact's later commits on other queues no longer wait behind a host step held at its gate.
Proof (m3-max-30854, lavapipe): held_step_order's unknown-uses leg 0.17 ms after commit, 0 looks held (base 111.40 ms,
3 held); a reset of the step's records still waits. Negative control m3-max-30866 (the old gate condition): that leg
fails, 125.03 ms, 4 looks held.
2026-11-14 18:35:15 -08:00
Anees Iqbal 06b5fe355e rate_mapped_pieces: a host-step frame of commands that inherit the pipeline state
The lane's commands each set their own pipeline state, so the host step reads
every record and the GPU route (render/executions/gpu_route.rs) never runs
there. Two frames now execute commands that inherit the encoder's state
(rate_mapped_pieces_host_step_inherited and its _wide twin): the execution
takes the GPU form but for the rate map, so a fanning-out host step decodes the
records on the GPU. Each line also states the records the host read
(indirect_records_read), the executions routed on the GPU
(rate_map_gpu_routes), the host's wait for their decode
(rate_map_gpu_route_wait_nanos), and the GPU's idle time within the command
buffer (its GPU time less its pieces' and its probes'). Where the frame fans
out, the inherited frames assert no record read, one execution routed and its
wait counted.

The workload of the GPU-time A/B of the route on the Iris Xe and the RTX 3090.
Verified: cargo fmt only so far; the build job follows.
2026-11-14 18:26:06 -08:00
Anees Iqbal 83c4b135c8 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 18:25:12 -08:00
Anees Iqbal 58de9ba9a1 The runtime's own device tests take four VkQueues by default, not the plan's 18
What: in the runtime crate's test build, DeviceOptions::default() carries queue limits of a round
robin of two VkQueues and none for presenting (TEST_QUEUE_LIMITS), beside the staging and fill
queues: four on NVIDIA's families, where the queue plan takes 18. Outside the crate's own tests the
default is unchanged (None, the plan), and on RADV's and lavapipe's one graphics queue the limits
leave the plan as it is. DeviceOptions' Default is now written out (every field named) so that its
queue_limits can be the test default there; the API signature table is re-blessed for the derive
moving to an impl, which changes nothing for a consumer.

A test whose work needs more than the default gives on a device with queues to spare (the
program's third command queue, unshared or not; a presenting queue; reserved or extra queues; a
read of the queue sharing) panics where it asks for it, on every device, and makes its device with
`queue_limits: None`: the runtime lane's LANE_QUEUE_LIMITS rule, whose failure is the device's
metal2vulkan-queue-limits-reached and so is said only on a device with queues to spare. Here the
check reads no plan, so a lavapipe run finds every such test. least_queue_plan and many_devices
measure the plan and take it.

Why: NVIDIA's driver makes and destroys one device at a time across processes, and each VkQueue
adds to both. Measured on the RTX 3090 (620.70.06, a probe build that timed each phase of a
device's opening and teardown, m3-max-30672): alone, vkCreateDevice took 540-575 ms and
vkDestroyDevice 163 ms of a device test's 1.17 s (priming 129-142 ms, loader and instance 93 ms,
the runtime's own phases under 25 ms); at 12 threads 55 device tests took 66.9 s, 1.2 s each, no
less than one at a time, their vkCreateDevice a median of 8.1 s and vkDestroyDevice 2.8 s. On the
RTX 5080 Laptop GPU a device of 2 queues took 145 ms against 445 ms with 17
(DeviceOptions::queue_limits' measurement).

Verified: tests::queue_limits::the_tests_default_devices_take_four_of_nvidia_s_eighteen_queues
(no device: NVIDIA's families give 4 VkQueues under the default, 18 at the plan; fails without the
change, whose default is the plan) and
tests::queue_limits_device::a_default_test_device_fails_where_its_work_needs_the_plan (on the
device the cfg selects: the third command queue, an unshared one past it, a presenting queue, a
read of the queue sharing and a reserved queue each panic under the default, and a plan device
makes each).

Also in this landing (the lane's later commits):
- 1edf6b494a The runtime tests' default queue limits fail a test by its live command queues, not its made ones
- 9a2bfa7bc5 Tests that ask for reserved or extra queues take the queue plan
- b9e7cd775b Tests that keep more than two command queues live take the queue plan

Proof (m3-max-30836 at b9e7cd775b): clippy plain and cpuicd 0; the no-device tests 33/33
(the_tests_default_devices_take_four_of_nvidia_s_eighteen_queues: 4 of 18 placed); lavapipe runtime
suite 2732/2732. Negative control m3-max-30752 (default_queue_limits returns None): fails at the 4-of-18
assert. No RUNTIME bump: the product default is unchanged.
2026-11-14 18:24:24 -08:00
Anees Iqbal 5fba5455a5 heap_trimmed's kernel takes 320,000 steps with 64 values live
The test's kernel of 150,000 fused multiply-adds with 600 values live did not
finish its making within the test's wait on an RTX 3090 (NVIDIA 620.70.06),
alone on its node (m3-max-30563: TimedOut at the first dispatch, the making
still in the driver past 117 s). The 5080's 615 driver had made it in 13 s.

A probe on the 3090 (m3-max-30699, one process making one size after another)
showed the compile time growing faster than the steps with 600 live (40,000:
8.3 s; 80,000: 27.5 s), and the free heap a making leaves growing about 1.25 KB
a step with 64 live, at about 30 us a step (80,000 steps: 2.4 s). The trim
needs more than FREE_FLOOR (256 MiB) free after a large making. 320,000 steps
with 64 live frees about 400 MB by that slope, at about 10 s.

The test's claim and its assertions are unchanged. The module docs give the
measurement behind the size.

Verified: cargo fmt. The proof is the test itself, in a fresh process on the
3090 and um870's 780M, in one exclusive job.
2026-11-14 18:09:28 -08:00
Anees Iqbal ff68ba6764 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 18:03:47 -08:00
Anees Iqbal b585744208 Boxed draws: the constant's numbers count the three draws the patches frame still fanned out
GEOMETRY_TRIANGLE_WORK's doc (5983bb3e72) split the patches frame's boxed piece
time as if the 3 draws still fanned out held 3/64 of its triangles. By the
lane's layout they are its three largest commands (161,820 and twice 89,184
indices, boxes of 110, 99 and 72 regions), 112,356 of its 301,150 triangles; a
simulation of its patches, map and bucket rule boxes the same 61 at 180, into
14,816,646 vertex-regions against the 15,286,908 counted. With their fan-out
taken out, a boxed vertex-region cost 0.49 / 0.48 ns on the Iris Xe, 0.73 ns on
the Radeon 780M and 0.13 ns on the RTX 3090, so a fanned-out triangle's geometry
stage is worth 31 / 32, 29 and 72 of them, not 26, 25 and 49. The boxed draws
held about 84 vertex-regions a triangle and took about 2.5, 2.8 and 1.1 times
their fan-out, as those ratios predict (2.7, 2.9, 1.2).

The constant stays 24, below the least (29.4): a draw it boxes costs at most
about 0.82 of its fan-out on each of the three. The doc, docs/FAST-PATHS.md's
row and the two tests' docs carry the corrected numbers; tests::rate_mapped_boxed_rule
checks the boxed draws' own average (9285 indices, 27 regions a box), fanned out
at 24 and boxed at 180.

Verified: arithmetic from m3-max-30553/30686/30687's warm pieces; the rule test
and clippy in the job that follows this commit.
2026-11-14 18:02:57 -08:00
Anees Iqbal 8c5d761673 Re-bless the authored compile census at pin 96
The census at 9303a1f03f (M3 job m3-max-30743, corpus-triage --audit
authored-compile --bless) moves only the artifacts_at product hash: no
case's artifact changed. The engine goldens' bless (m3-max-30742) left
no patch.
2026-11-14 17:51:24 -08:00
Anees Iqbal 9303a1f03f 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 17:43:09 -08:00
Anees Iqbal 34036eed94 alias_split: note a key's write without borrowing the list twice 2026-11-14 17:42:23 -08:00
Anees Iqbal 123f2fc7e7 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 17:41:28 -08:00
Anees Iqbal f40cc8595b RUNTIME 2325: A rate-mapped pass's host step decodes GPU-written records on the GPU (its GPU route)
A render pass over a rasterization-rate map that executes an indirect command buffer the GPU
may write goes to the host step. There the host read every record, decoded it and drew each
command through the probe and the fan-out routes. On the consumer's RTX 3090 that step took
44.7 ms of a 65.8 ms frame, reading 781 records a frame. The only rule its executions broke was
the rate map's.

At a host step that fans the pass's triangles out, an execution whose records the GPU may write,
and which takes its merged GPU form once the rate map's rule is passed over (the cause.rs
decision), now takes its GPU route (render/executions/gpu_route.rs):
- The step records the form's prework: the head, the preprocess and the two merge passes. It
  copies each command's first corner and the merged draw's two VkDrawIndirectCommands to the
  host, submits that with a fence and waits, as it does for its probe.
- The host reads those words and no record. Each command that draws becomes one direct draw of
  its corners in the state's merged variant, with the merged header pushed
  (RenderLowering::merged_header).
- The probe and the routes take those draws as they take commands the host read: probed, then
  fanned out, boxed, in parts or region by region. A long corner draw is cut into piece-sized
  ranges, as an indexed command is.
- The host reads the records as before where the total reaches MERGED_CHUNK corners, where the
  prefix does not rise to the total, or where the prework did not complete.

RenderExecution::record_gpu's prework moves into RenderExecution::prework, which both paths
share. The replay loop takes a GPU route's corners beside the records the host read (Replayed,
StepCommand). The new counters are WorkCounts::rate_map_gpu_routes and
rate_map_gpu_route_wait_nanos.

Tests:
- New, tests::rate_mapped_gpu_route. Eight commands of a buffer that inherits the encoder's
  pipeline state: grids, one in two instances, one without indices, and the large, medium and
  wide triangles the probe flags. Each command is nearer than the one before, under LessEqual
  depth and half-alpha blending. It asserts no record read, one route, one probe and three
  flagged draws, and that the colour and Depth32Float bytes equal the encoder's own draws.
- Changed, tests::host_step_rules. Its empty command, through the route, counts as
  nothing_to_probe.

Also in this landing (the lane's later commits):
- d2728b735e: the step's commands are one vector of reads or of corners (no per-command enum of 3.3 KB); clippy.
- 51afad9359: HostReplayedIndirectCommands' cost names the GPU route's second round trip (the notice's text changes).

RUNTIME 2325: an unchanged artifact's rate-mapped host step now decodes GPU-written records on the GPU, and the
notice's text changes. Negative controls (m3-max-30703): the plan.rs lifts reverted fail
a_merged_draw_s_variant_fans_out (NotImplemented(RasterizationRateMap)); the route turned off fails
rate_mapped_gpu_route's counts ([8, 0, 1, 3] against [0, 1, 1, 3]).
2026-11-14 17:40:26 -08:00
Anees Iqbal 7222b5cb82 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 17:38:46 -08:00
Anees Iqbal 5983bb3e72 RUNTIME 2324: Boxed draws: a fanned-out triangle's geometry stage is worth 24 vertex-regions, not 180
The boxing rule (RUNTIME 2318) took GEOMETRY_TRIANGLE_WORK = 180 from the pieces
lane's bands frame, whose 22-by-10-pixel triangles cost 132 ns each fanned out on
an Iris Xe: mostly their fragments, which every route shades, not the geometry
stage boxing saves. Its 61 boxes on the patches frame (2-pixel quads, about 18
regions a box) lost on every device measured, the pass's warm piece:
  Iris Xe (Mesa 26.2.6)    4.64 ms fanned, 9.21 / 9.06 ms boxed  (m3-max-30553)
  Radeon 780M (Mesa)       6.47 / 6.46 ms, 13.57 / 13.57 ms      (m3-max-30687)
  RTX 3090 (620.70.06)     2.80 / 2.77 ms, 3.01 / 3.00 ms        (m3-max-30686)
On that frame, whose fragments cost little, a fanned-out triangle cost 15.4,
21.5 and 9.3 ns, a boxed vertex-region 0.59, 0.87 and 0.19 ns: 26, 25 and 49
units. The constant is the least, 24.7, rounded down, so a draw it boxes costs
no more than its fan-out on each of the three; a lower constant only boxes
fewer draws than 180 did. The doc and docs/FAST-PATHS.md's row carry the numbers.

tests::rate_mapped_boxed_draws: the 120-by-40 strip across ten regions (50
units a triangle, the patches frame's boxes about 55) is now fanned out, and a
patch across four regions' corner is boxed in its place, so the test still
boxes a draw across region borders: counts [1, 0, 3, 4, 4]. At 180 the strip is
boxed and the counts fail. tests::rate_mapped_boxed_rule checks the rule on the
patches frame's average draw: 18 regions fanned out, 4 boxed. The lane's patches
frame no longer asserts that it boxes a draw.

RUNTIME 2324: an unchanged artifact's rate-mapped draw that boxed at 180 fans out at 24.
2026-11-14 17:37:51 -08:00
Anees Iqbal 84dd5beebe 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 17:36:56 -08:00
Anees Iqbal acd25fd445 RUNTIME 2323: NVIDIA's RTX 3090 image uses miss a buffer's write in the same VkCommandBuffer: such a use goes in a new one
runtime_lane::heap_textures::a_buffer_write_shows_in_an_overlapping_texture,
a_heap_texture_metal_compresses_keeps_the_driver_s_compression_by_default and
an_adopted_device_stating_host_image_copy_aliases_its_heap_textures failed on the RTX 3090
(NVIDIA 620.70.06) at pins 93b and 94 (m3-max-30259, 30260, 30491, 30492): a Shared heap's
64x64 RGBA8Unorm texture, a linear image in the heap's memory, read all 4096 texels as they were
after a copy into a buffer over the same bytes. The encoder trail (each encoder its own
submission) passed at the same archive (30469), and so did the trail half of 30552 at
c6a823ff13, whose folded half failed.

A scratch probe (not landed) ran the copy and the read four ways on the 3090 (m3-max-30571):
in two blit encoders (folded into one VkCommandBuffer) and in one blit encoder, a global
TRANSFER_WRITE -> TRANSFER_READ barrier between them, 4096 of 4096 texels left alone three times
each; in two VkCommandBuffers of one submission (an MTLFence keeping the encoders apart) or two
command buffers, none. 1024x1024 and 16x16 (a Tiled shadow read through buffers) left none in any
form. Vulkan defines the answer (a buffer and a linear GENERAL image over the same memory are
host-accessible aliases, ordered by a memory dependency), so it is the driver's defect, shown by
blit folding (RUNTIME 2293) and present before it in one blit encoder. NVIDIA's 615.71.09 on the
RTX 5080 Laptop GPU answered every form right (b5080 batch m3-max-30599), so it is not listed.

Now:
- DriverFact::ImageUsesMissBufferWritesInOneCommandBuffer, one MEASURED row: NVIDIA on the
  RTX 3090, its measurement in the module docs, the reverse direction named unmeasured.
- On a device with it (DeviceShared::splits_at_aliases), an encoder notes the bytes its commands
  write into its current VkCommandBuffer (alias_split.rs, at most 32 keys apart, a key's
  writes joined), an encoder that joined a group starting from the group's FoldOrder byte
  writes. A command through command_observing whose uses name an image of a key whose noted
  bytes meet the image's place (UseRange::shares_memory) ends the VkCommandBuffer and goes on in
  a new one, its barrier first; a folded encoder so goes on in its own after the group's tail,
  which its part's submission orders after the group's first part, the measured fence form. A
  render encoder joins no group whose order wrote bytes there. Counted:
  WorkCounts::command_buffers_split_at_aliases. Elsewhere nothing is noted.
- heap_textures' alias round trip also copies and reads in one blit encoder, and the alias test
  asserts the split count is nonzero exactly where the fact holds.
- tests::alias_split (any host): the measured shape meets; a place apart, another key, a buffer
  read, a write through an image and a new VkCommandBuffer do not; a joining encoder meets the
  group's write; past 32 keys every image use meets; only the fact's devices split. And
  device::tests::driver_facts: the 3090 takes the row at every release, the 5080 Laptop and
  desktop do not.

No new Degradation kind or notice: the split is exact. RUNTIME 2323: on the 3090 an unchanged artifact's command buffer now splits where it did not.
Verification: the msi check job and one 3090 rerun, reported with the landing.
2026-11-14 17:36:04 -08:00
Anees Iqbal a02b41dfc4 The placing-wait device test drops the buffer on a runtime thread while the placing is held
The landed test (7765813cb4) let go of the indirect command buffer through a
command buffer's completion and expected its home's drop to wait for an unseen
placing submission. On the RTX 3090 (m3-max-30646) the completion let go of the
buffer last (1 completed where seen), but 0 drops waited: by the drop, a poll of
the staging queue had already seen the placing submission complete, so the drop
made no driver call. The test passed on the device for a reason other than its
claim, and failed its assertion there.

The test now places the records through a command buffer it never commits, so
only the program holds the buffer, and moves the buffer's last hold to a thread
of the runtime's (exit_guard::spawn), which drops it while the placing
submission is still held on the GPU (Device::hold_staging_submissions). The test
signals the hold only after that thread starts. The host cannot have seen the
submission complete before the drop, whatever polls the staging queue. It
asserts that the records were placed with no hold left, and that exactly one
drop on a runtime thread waited for the unseen placing submission.

Verified: cargo fmt. The device runs and the negative control (the same test
without Home::drop's section) are reported with the landing.
2026-11-14 17:25:49 -08:00
Anees Iqbal d32c12af29 Re-bless the engine goldens and the authored compile census at ebfd1b311d
The engine goldens' bless (M3 job m3-max-30664) moves the hashes of 19
rows: the indirect command buffer encode shaders (icb_copy_encode,
icb_inherited_dispatches, icb_mesh_encode, icb_replay_encode,
icb_reset_encode, icb_routed_writes) and mesh_commands, in both their
.ll and .air.ll forms, plus the profile row. The census (m3-max-30665,
corpus-triage --audit authored-compile --bless) moves the product hash
and, in 228 rows, two variant artifacts' hashes; no row gains or loses
an artifact. Both ran at development's tip after SEMANTICS 2117-2119.
2026-11-14 17:22:25 -08:00
Anees Iqbal ebfd1b311d SEMANTICS 2119: A merged draw replay's vertex function draws regions several at a time
A rate-mapped pass draws its draws region by region through a multi-draw, each region's
viewport at the draw's index (VariantKey::region_viewports). A merged draw replay's vertex
function now takes that variant too. Its corner is its VertexIndex and InstanceIndex's, which
each draw of a multi-draw gives from its own first vertex. Its viewport is its DrawIndex's, which
the merged read does not touch. Only a replay of one draw per command (replay_bindings without
merged_draws) is still NotImplemented(RasterizationRateMap). A host step that draws a
GPU-decoded merged replay's commands region by region needs this, as it needs the region
copies (SEMANTICS 2118).

tests::engine_region_fan_out::a_merged_draw_s_variant_fans_out now also compiles the merged
region-viewports variant on lavapipe, the Iris Xe and the Pascal. It checks L3 on every module,
both facts stated, the viewport index stored, and the plan settling on itself.
2026-11-14 17:15:37 -08:00
Anees Iqbal 47100120d1 SEMANTICS 2118: A merged draw replay's vertex function takes region copies
A rate-mapped pass draws a merged draw replay (VariantKey::merged_draws) through region copies
as it draws an encoder's draw: the region-copy vertex function's corner is its VertexIndex and
InstanceIndex's, which a multi-draw's draws each give from their own first vertex, and its region
its DrawIndex's, neither of which the merged read moves. Only a replay of one draw per command
(replay_bindings without merged_draws) stays NotImplemented(RasterizationRateMap). This is the
translator half of drawing a GPU-written render ICB's merged replay in a rate-mapped pass on the
GPU.

tests::engine_region_fan_out::a_merged_draw_s_variant_fans_out compiles the merged variant in
each fan-out mode on lavapipe, the Iris Xe and the Pascal: L3 on every module, the header's
address pushed, the region box pushed by a region-copy variant, and the plan settling on itself.
2026-11-14 17:12:05 -08:00
Anees Iqbal 5a619026c0 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 17:09:01 -08:00
Anees Iqbal c42dbfa163 RUNTIME 2322: Host RAM copies: one dispatch for up to 30 imports, through a descriptor array
What: a copy of word runs between a guest RAM and a buffer recorded one dispatch of the pages
copy per import its runs touch (and per window of the buffer), each binding that one import.
Where a RAM's chunks are 64 MiB pointer imports (NVIDIA, lavapipe: no listed plan), a surface
whose guest pages lie across an 8 GiB RAM touched ~35 chunks, so ~35 dispatches a copy (the
consumer's walk: 55,778 dispatches for 1,574 copies on an RTX 3090, ~35 on an RTX 2080, 1.2 on
RADV, whose copies go through run lists of their own pages).

How: `bind::pages_copy_module`'s scattered binding is now a descriptor array of
`PagesCopyModule::imports(device)` storage buffers, and each table entry (now four words) names
its run's element. The element is read once per workgroup from the workgroup's entry, so it is
dynamically uniform within the invocation group (Vulkan: for shaders with workgroups the
workgroup is the invocation group), which `shaderStorageBufferArrayDynamicIndexing` allows; the
module declares StorageBufferArrayDynamicIndexing and requires that feature where the array holds
more than one, and needs no NonUniform. `imports` is 1 where the device does not enable the
feature (the array indexed by the constant 0), else the room the device's
maxPerStageDescriptorStorageBuffers, maxDescriptorSetStorageBuffers, maxPerStageResources and,
with push descriptors, maxPushDescriptors leave beside the two other bindings, at most 30 (so a
push set holds at most 32 descriptors, maxPushDescriptors' minimum). The runtime's owned kernels
take a first storage-buffer binding of several descriptors (layout count, pool needs, pushed and
allocated writes by binding and element); `plan` groups the runs by `slot / array` and window;
each dispatch binds its group's imports, the elements past them its first import again, so every
descriptor is valid without partiallyBound.

Expected: n chunks touched -> ceil(n / 30) dispatches on every device here (maxPushDescriptors
is 32 on NVIDIA, RADV and lavapipe), ~35 -> 2.

Tests: the device tests' counts over two chunks are now `dispatches_over(device, 2)` (1 where the
array holds more than one; they said 2 before); `plan` unit tests for arrays of one, two and an
import past an array; the pages copy module's interpreter test of one dispatch over three
elements both ways, and its validity on every committed profile at the profile's array length
and at one, the dynamic-indexing feature required exactly where the array holds more than one.

Verified (lane hostcopy, msi, at a9a2aba8de; the two later commits only rename one device
test): lavapipe host_ram + owned_pushes suites (--cfg m2v_cpu_icd) 92/92 (m3-max-30625),
the 3 count tests expecting 1 dispatch over 2 imports among them; hand negative control
steelbrain/hostcopy-control (m3-max-30626) fails exactly those 3 on the count (2 vs 1);
clippy -D warnings plain (m3-max-30622) 0; translator bind::pages_copy tests 6/6;
api-signatures --check 0. The 3090 release bench follows on development.
RUNTIME 2322: what a host-RAM copy records changes (one dispatch for up to K imports).
Public API: bind::pages_copy entry() takes the import index and returns [u8; 16],
ENTRY_WORDS 3 -> 4, new PagesCopyModule::imports(&Device). No Degradation kind or WorkCounts field.
2026-11-14 17:08:10 -08:00
Anees Iqbal 4ba0b1ecc4 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 17:07:13 -08:00
Anees Iqbal 7765813cb4 RUNTIME 2321: An indirect command buffer's home waits for its placing inside an exit-guard section
Home::drop waits on the host for the staging submission that placed the records in
device-local memory. The drop runs wherever the buffer's last hold lets go, and
that can be a command buffer's completion on its queue's waiter or a handler
thread. When the host had not seen the placing submission complete, the wait's
vkWaitSemaphores ran there outside any section. In debug builds exit_guard::check
ends the process at such a call: the XTX abort of
runtime_lane::resource_ids::an_indirect_command_buffer_s_id_is_held_as_metal_holds_it
at pin 94 (queue-wait-0, complete_rest's drop of the residency).

The wait now runs inside a section, as texture/staging_copy.rs's Flushed::drop
does. While the process exits no section starts: the drop returns without
waiting, and the records' buffer stays to the end, as release.rs leaves every
object then. exit_guard::check is unchanged. vkWaitSemaphores is already in the
sections' call table.

Verified: cargo fmt. The device runs of the previous commit's test are reported
with the landing.

Test: Device test: a command buffer's completion that lets go of an indirect command buffer last waits for its placing.
On a device that places indirect command buffer records in device-local memory, a
buffer the program lets go of while a command buffer that uses it is in flight goes
as that command buffer completes, on a queue's waiter or a handler thread. Its
home's drop then waits for the staging submission that placed the records. When the
host has not seen that submission complete, the wait calls vkWaitSemaphores, which
the exit guard requires to run inside a section on the runtime's threads.

The test holds the staging submissions on a test timeline
(Device::hold_staging_submissions), places a Private buffer's records through a
compute encoder's useResource, commits, lets go of the buffer, then signals the
timeline. The command buffer completes only after the placing submission, and
nothing waits for it on the host before the drop. A test-only count in Home::drop
(RUNTIME_PLACING_WAITS) records a wait for an unseen placing submission on a
runtime thread, so a pass on a placing device is not vacuous. A device that keeps
records in the host's memory says so and passes.

This commit has the test alone. On a placing device, without the section the next
commit adds, the drop's call ends the process (exit_guard::check): the XTX abort of
runtime_lane::resource_ids::an_indirect_command_buffer_s_id_is_held_as_metal_holds_it
at pin 94.

Why: on the RX 7900 XTX at pin 94 (m3-max-30428), runtime_lane::resource_ids::an_indirect_command_buffer_s_id_is_held_as_metal_holds_it
aborted in a debug build: "the runtime's thread metal2vulkan-queue-wait-0 reached the device outside an
exit-guard section". The queue waiter's completion dropped the last Arc of an indirect command buffer, and
Home::drop's wait for the staging submission that placed the records (vkWaitSemaphores) ran with no section.

Verified (lane devlegs, msi m3-max-30615): clippy -D warnings, runtime crate, plain and --cfg m2v_gpu 0;
the m2v_gpu archive at the fix built. Landed (main) at once: the 5080 negative control (test without the
fix aborts, with it passes) and the 3090 run follow on development.
RUNTIME 2321: an exiting process's last drop no longer waits for a placing it cannot guard.
2026-11-14 17:06:15 -08:00
Anees Iqbal 12ae9f668b 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 17:05:06 -08:00
Anees Iqbal 7c223b02e4 RUNTIME 2320: A host step's notice names every GPU-form rule its pass breaks; rate-mapped steps that probe nothing are counted by why
What: where `commit` keeps a pass whose indirect commands the GPU may write from the GPU form,
and the `host-replayed-indirect-commands` notice of that first rule is to be announced
(`Device::announces_host_step`, a peek that counts nothing), the decision runs again passing over
each rule once named (`render/executions/cause.rs`'s `Passed`, `DeferredPass::rules_past`), and the
notice names every rule past the first that the pass breaks too, each judged as though the rules
before it were kept: the rate map's as though the pass had none. A rule the rest takes its answer
from (the commands' one primitive type, the pipeline state and its kind, the inherited state's
tessellation, vertex function and tile memory, the buffer's size, a refusal) is never passed over.
The commit path is unchanged where the notice was announced already: the first rule decides, as
before. Three WorkCounts fields count the rate-mapped passes a host step records without a probe:
`rate_map_steps_unfanned` (no fan-out: policy, features, memoryless attachment, shadowed texture),
`rate_map_steps_nothing_to_probe` (no command read) and `rate_map_steps_probing_none` (commands
read, no draw probed); with `rate_map_probes` they count every such pass once.

Why: the consumer's walk of a 3D renderer sees one notice, naming the rate map, so whether a GPU
form for rate-mapped passes would cover its pass (rules past the rate map) is unknown; and about
half a host step a frame there probes nothing, for no counted reason.

The notice's text changes (a RUNTIME bump at landing). API: three public WorkCounts fields
(api_signatures.tsv blessed); nothing removed.

Verified: tests::host_step_rules on lavapipe (an indexed triangle and an empty command of a
GPU-written buffer, executed in a rate-mapped pass: the rate map's notice names that rule alone;
with a visibility result mode set, the notice names the visibility rule, then the rate map past
it, which fails without this change; the counts: probed once each, the empty command's pass
probing none).

Also: host_step_rules: the buffer inherits the encoder's pipeline state; Degradation::HostReplayedIndirectCommands says its notice names the rules past the first.

Verified (lane icbgpu, msi m3-max-30616 at eec7881980, lavapipe): clippy -D warnings plain
and --cfg m2v_cpu_icd 0; 74/74 over host_step*, icb_*, indirect_command_buffer*,
notice_command_buffers, rate_map*, rate_mapped*, degradation*, trail_gpu_forms and
draw_shape_notices, the new host_step_rules among them; api-signatures --check clean.
Landed (main) at once: the hand negative control, gpucfg clippy and rustdoc run after.
RUNTIME 2320: the notice's text and what a run records change. WorkCounts gains
rate_map_steps_unfanned, rate_map_steps_nothing_to_probe, rate_map_steps_probing_none.
No Degradation kind.
2026-11-14 17:04:25 -08:00
Anees Iqbal fac8049bd1 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 16:22:29 -08:00
Anees Iqbal 257bdd7d14 SEMANTICS 2117 / RUNTIME 2319: GPU-written ICB records naming released or reused state IDs run what a Mac runs
What: two changes to how an indirect command's record names a pipeline state the program
released.

1. A record's state word gains a bit, KERNEL_PIPELINE (layout::KERNEL_PIPELINE = 2,
   CommandRecord::kernel_pipeline, RecordView::kernel_pipeline). A kernel's pipeline setter writes
   it wherever the token names a state. A kernel's copy carries it with the pipeline word, and its
   "reports" test now reads RETAINED alone. A kernel's compute reset keeps the bit beside RETAINED.
   Metal's reset leaves the command executing with the pipeline it had (measured on the M3 Max and
   the M4: reported cleared, run by the next dispatch). For a kernel's write, that pipeline is the
   state the write resolved, so the retained pipeline keeps saying the kernel wrote it. The CPU's
   compute reset does the same. The CPU's pipeline setter clears the bit, and a record the CPU
   wrote never carries it. The replay's state-word check and decode accept the bit; either bit
   beside no pipeline is still malformed. Where the bit is set, the runtime's host step, getter and
   identifier ignore the state the CPU set and resolve the ID by its holder as the GPU last could
   write it.
   Case 4 (the CPU set x, x released, y took the ID, then a kernel writes the state) now runs y, as
   the M3 Max and the 5300M do; before, it ran x, announced. Case 5 (the kernel writes only the
   buffers) runs x unannounced, as every Mac does. The host step no longer guesses, so the
   "Unsure" announcement and may_name_another are gone.

2. The device keeps the program of each freed pipeline state ID's last holder (FreedPrograms):
   one per ID, dropped when any state takes the ID. Every live indirect command buffer of the
   device holds the store and the device holds it weakly, since a program holds its device. A
   buffer the GPU may write takes the store's programs at its first such write. Case 1 (x released
   before the write, its ID taken by no one) now runs x, as the M3 Max and the UHD 630 do; the
   Radeon Pro 5300M fails the command buffer instead. Where Macs disagree, the cheaper answer is
   taken: failing the CB would need a failure path decided mid-flight in a host step. Bound: one
   program per freed ID that no state retook, so at most the peak count of live
   supportIndirectCommandBuffers states plus placed IDs, kept only while an ICB of the device
   lives. Still announced (ReleasedCommandState, the command runs nothing): a state released while
   no ICB of the device lived, and one past the ID's last four holders.

SEMANTICS_VERSION 2117: kernels that set pipelines now write the state-word bit, so their SPIR-V
and golden hashes change (re-blessed on development). api_signatures blessed for the new field and
method. No new Degradation kind. RUNTIME_VERSION is left to the landing.

Tests: indirect_commands::tests::records (a_kernel_s_pipeline_is_told_from_the_cpu_s, plus the
random field round trip with the bit). The engine_indirect_commands expectations of kernel writes
carry the bit, and the kernel reset keeps it. Runtime: released_programs (the freed store's one
program and its release on take) and notice_command_buffers (a host-step Unrun now reached through
a kernel's write of a state released while no ICB lived). Validation runtime_lane:
indirect_host_steps (case 1 runs the template; the forced notice past four holders and while no
ICB lived; case 4 runs the flat template; case 5 runs the template unannounced) and
indirect_executions (the GPU-writable copy case no longer announces). Run on lavapipe in the
lane's msi job; the results go in the lane report.

Also: Pin the notice of a state released while no buffer of commands lived; Replay tests: the kernel's pipeline bit runs, an unknown bit faults.

Verified (lane relstate, msi m3-max-30537): clippy --cfg m2v_cpu_icd exit 0; runtime tests
24/24; validation tests 113/113 on lavapipe, the new released-state cases 1, 4 and 5 among
them. Landed (main) at once: the plain clippy and translator rerun (m3-max-30546) and the
hand negative control (m3-max-30555, steelbrain/relstate-nc) run after landing; the engine
golden hashes of kernels that set pipelines are re-blessed on development.
RUNTIME 2319: what a GPU-written record naming a released or reused state runs changes.
2026-11-14 16:21:41 -08:00
Anees Iqbal b6109709ec 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 16:06:12 -08:00
Anees Iqbal 8a374ba0e5 RUNTIME 2318: Rate-mapped draws whose triangles lie in few regions are boxed, not fanned out
At a host step under RateMapRegionPolicy::FanOut, a probed draw the probe flags nothing of
goes through the fan-out variant, and so does a flagged draw's fanned part. Its geometry
stage emits a copy of each triangle per region it touches. On the pieces lane that stage costs
a fanned-out triangle what 371 to 739 vertex invocations for one region cost. On an Iris Xe
that is 130.7 ns a triangle, against 0.352 ns an index-region through the region-copy variant.
On a 3D renderer's frame there (tm91-iris), about 68 of the 125 ms of rate-mapped pieces a
frame tracks the probed and fanned geometry, which is 383 fanned draws a frame.

Such a draw is now boxed when that holds no more work: drawn through its region-copy variant
into the boxes of the regions its triangles reach by the probe's bounds (fan_out::run_boxes of
Probed::reach, a part's from its own blocks), as a run is.
- The rule: rate_mapped_pass::boxes_cheaper, regions x (vertices + REGION_DRAW_WORK) <=
  GEOMETRY_TRIANGLE_WORK x triangles (a direct draw; a strip's triangles counted at
  vertices / 4).
- GEOMETRY_TRIANGLE_WORK = 180: about half the least that a fanned-out triangle cost against a
  vertex for one region on the four devices measured (Iris Xe 371-500x, Radeon 780M 739x,
  RX 7900 XTX 570x, RTX 3090 654x; the constant's doc has the numbers). The rule is
  device-independent, keyed to no app, map or shader.
- No new pass, variant or readback. fan_out_asked asks for the region-copy variant (settled at
  commit already) and the recording takes the boxes (RenderLowering::boxed_reach).
Pixels: the routes already share a pass and put a vertex at one window position. A pixel lies
in one region, whose copies keep the draw's order of instances and primitives in either route.
The bounds are widened as the probe's are, so a box holds every pixel a copy would cover: the
same pixels and depth wherever today's routes agree.
A boxed draw rides whole in its piece, as a fanned-out one does; its work is no more than its
fan-out's.
Counts: WorkCounts::rate_map_boxed_draws and rate_map_boxed_vertex_regions (CopyRoute::Boxed).
A boxed part is not a run, so rate_map_region_runs and rate_map_parted_region_triangles leave
it out.
Test: tests::rate_mapped_boxed_draws, 6 commands blended at half alpha:
- boxed: a 10-pixel patch, a 120x40 strip across region borders, a patch of two instances,
  and a patch without indices;
- fanned out: a whole-target grid and one wide quad.
It checks probes 1, flagged 0, fanned 2, boxed 4, region-copy draws 4, and boxed vertex work
under the whole table's. The pixels equal the encoder's bit for bit. Under Exact nothing is
boxed.

Also (2f82e025be): The pieces lane draws each command's own patch: rate_mapped_pieces_host_step_patches; (01d8344d2a): A command's settle at commit boxes no draw; the boxed test's counts keep their function's name.

Verified (lane ratemap3, msi m3-max-30513 at 01d8344d2a, llvmpipe): rate_map|fan_out
26/26, the new rate_mapped_boxed_draws among them (probes 1, flagged 0, fanned 2, boxed 4,
region-copy draws 4, boxed vertex work 10752 against the whole table's 997056; pixels equal
the unboxed execution; nothing boxed under Exact); rate_mapped_fan_out, region_boxes, pieces
and depth_equal unchanged. Landed (main) at once: clippy x3 (m3-max-30514), the Iris A/B
and the hand negative control run after landing.
RUNTIME 2318: what a run records and draws changes. No Degradation kind.

API: two WorkCounts fields added (rate_map_boxed_draws, rate_map_boxed_vertex_regions);
api_signatures.tsv blessed. A consumer building WorkCounts by struct literal must name them.
2026-11-14 16:05:31 -08:00
Anees Iqbal f4205b38f9 Integration tests start the crate's tools at nextest's run-time path
The nineteen validation integration tests that spawn one of the crate's own
tools (corpus-pipeline, corpus-vulkan, corpus-moltenvk, corpus-triage,
corpus-index) named it with env!("CARGO_BIN_EXE_<tool>"), the path Cargo
bakes in at build time. A nextest archive reused on another machine
extracts its binaries into its own directory, so on every device leg
those tests found no file (ENOENT) and failed. They passed only where the
build's own target directory still existed.

A bin_exe! macro in tests/integration/main.rs now reads nextest's
run-time NEXTEST_BIN_EXE_<tool> (set from cargo-nextest 0.9.15, remapped
to the extracted archive) and falls back to the baked path under cargo
test. All 27 call sites use it. The SERVING constants become functions,
because the path is no longer a compile-time constant.

Verified: cargo fmt. The build, clippy and a remapped-archive rerun of the
integration binary on a node without the build's target directory are
reported with the landing.

Landed (main) at once: its build and clippy (m3-max-30499) and the um870 780M rerun of the
integration binary from a remapped archive run after landing. Test-only: no RUNTIME bump.
2026-11-14 15:52:19 -08:00
Anees Iqbal 6f50a4666d Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-14 15:48:51 -08:00
Anees Iqbal 2432c48e06 Compute dispatches keep their read-twin proofs with what their state planned
On a device where any buffer took a read twin (`read_twin.rs`), every compute dispatch worked out
again which slots its plan only reads (`binding::TwinProofs::proven`), a walk of the plan's uses
and, for each slot, of its uses and descriptor writes again: `compute::record` made a fresh
`TwinProofs` at each dispatch. On the consumer's Iris Xe, a guest compute benchmark's timed pass
spent 0.23 CPU-s in that walk (1.6 to 2.2 us a dispatch in four workloads), 0.33 with the
per-slot checks around it. Render draws already keep their proofs once per plan
(`render/plan_facts.rs`).

Now `pipeline::Planned`, which holds the dispatch's plan and which its pipeline state keeps for
its latest direct dispatches (and an encoder's dispatch memo shares), keeps the proofs
(`Planned::twins`), worked out the first time a dispatch of it asks. They are a function of the
plan alone (its uses, descriptor writes and vertex buffers), which no call changes while the
entry lives; what a command binds at a proven slot (whether its buffer or texture has a read twin
now, whether an earlier command of its command buffer may have written it) is still asked at each
dispatch (`TwinProofs::slots`). No WorkCounts field, Degradation kind or public item changes.

Test: resident_uses' `dispatches_work_their_plan_s_twin_proofs_out_once`: on a device with a read
twin (a bit-24 no-copy buffer), one kernel dispatched in five command buffers: the first dispatch
walks its plan (`binding::plan_walks`), the four later ones, which take what it planned, none.
The twin buffer's setup is shared with the render test beside it (`twinned`).

Landed (main) at once: its job m3-max-30477 (clippy plain and cpu_icd, the touched tests,
the new test failing on steelbrain/gbtwins-ctl 3779974291) runs after landing. No RUNTIME
bump: answers, recorded commands and WorkCounts are unchanged; only the work done is.
2026-11-14 15:48:10 -08:00
Anees Iqbal c6a823ff13 Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-14 15:45:03 -08:00
Anees Iqbal 497e1f4ec0 SEMANTICS 2116: NVIDIA's float denormals under the 16-bit float controls are the device's, noted
What: a new DriverWorkaround, FloatDenormalsKeptUnderHalfControls, with rows for NVIDIA's driver on
the RTX 3090 and the RTX 5080 Laptop GPU (the GPUs its MetalFloatDenormals rows name). In an entry
that declares the 16-bit float controls (narrow::controlled_modes) on such a profile, the float
operations the deviation covers record PrecisionNote::DeviceDenormals and the module requires no
VkProperty::MetalFloatDenormals. An entry that declares no float-controls mode keeps the
deviation, and so does every other driver.

Why: runtime_lane::driver_deviations::fused_pairs_answer_metals_nans_and_denormals failed on the
RTX 5080 Laptop GPU (615.71.09) and the RTX 3090 (620.70.06) at pin 93b. The same 33 of 4,096
words in each fixture kept a denormal where Metal answers zero (thread 0x11: 1e-20 * 1e-20 gives
0x116c2; thread 0x29: the smallest denormal times 2^30 gives 0x04000000). That held for the lone
product a * w as much as for the fused pairs, so the fused pairs are not the cause. The fixtures
compute half in 16 bits, so their entries declare RoundingModeRTE, DenormPreserve and
SignedZeroInfNanPreserve for 16 bits. The deviation's probes (nan_denormals,
nan_denormals_fast) declare no mode and flush on the same GPUs. Vulkan leaves 32-bit denormals to
the implementation when no 32-bit mode is declared (the NVIDIA profiles report independence ALL),
and NVIDIA states no shaderDenormFlushToZeroFloat32. So the device's answer stands (owner rule 1),
scoped and noted; nothing is flushed in the shader. RADV on the Radeon 780M (Phoenix and Hawk
Point, Mesa 26.2.6) declares the same modes there and passed the test at pin 93b, so it keeps the
deviation. MoltenVK states no shaderDenormPreserveFloat16, so its entries declare no 16-bit mode.

The device test now decides "Metal's" per kernel (requires_property), as the float_denormals tests
do, and asserts DeviceDenormals where the kernel does not require the property. The new unit test
float_denormals_under_the_half_controls_are_the_devices_where_its_driver_keeps_them checks the
5080 Laptop GPU, the 3090, the desktop RTX 5080 and the 780M against fmx_fma_precise,
fmx_fma_fast and nan_denormals. It fails without the rows.

Docs: the workaround's doc, the DEFECTS and MetalFloatDenormals table docs, the deviation and
property docs, PrecisionNote::DeviceDenormals, docs/API.md's device-denormals entry,
docs/FAST-PATHS.md's denormal row, the signature table. SEMANTICS_VERSION 2116: NVIDIA modules'
notes and requirements change. No new Degradation kind.

Landed (main) at once, before its check: the lane's check (clippy plain
and cpu_icd, the touched unit tests, the two denormal device tests on
lavapipe) and the NVIDIA device proof run after landing.
2026-11-14 15:44:20 -08:00