Commit Graph
5508 Commits
Author SHA1 Message Date
Anees Iqbal 4b37878cda RUNTIME 2265: staging queue grows its command-buffer ring to 128 rather than wait on the host past 8
A staging submission that found its queue's 8 command buffers all pending
waited on the host for the oldest, under the staging lock, on whichever
thread submitted: the scheduler's among them, inside a batch's submission
(flush_staging), which held every queue's submissions until the staging
queue ran. On a device whose staging queue is of compute work that can be
as long as the program's kernels run.

Now the staging queue makes another command buffer instead, up to 128
(MOST), and frees those past the 8 it keeps once the host saw their
submissions complete, at the next submission. Past 128 it waits as before.
The fill queue keeps its 8: its batches submit only after they found room.
The doc comment says why 128 and what it costs (ANV below Xe-HP: a 64 KiB
binding-table block per command buffer, 8 MiB at the cap).

Counted: WorkCounts::staging_buffers_grown (made past the 8) and
staging_buffer_waits (host waits for a command buffer to come free, either
queue), classified as submission work in the conformance cost table.

Tests: a unit test of the ring's choice (reuse the oldest complete, free
the other complete ones past 8, grow below the most, wait at it), and a
device test that holds 20 staging submissions on the GPU and checks every
round's command buffer is submitted meanwhile with no host wait, then that
the ring is back to 8 after one more round. The device test passes trivially
on a device without a staging queue (lavapipe).

RUNTIME_VERSION 2265: staging submissions no longer wait on the host for a
command buffer below 128 pending.

Verified (gbkern, at ffd3a51a79 on c796a88d6a): clippy x3, rustdoc, unit 29/29,
api_signatures/api_surface 15/15, lavapipe 4/4, RTX 5080 4/4 (20 staging
submissions held, 12 command buffers made past 8, 0 host waits, back to 8 after).
2026-11-14 00:22:06 -08:00
Anees Iqbal 161e8fe310 leading_snapshots: expect coverage only after a pass that measured both readers
On the RTX 5080 Laptop GPU (b5080 entry nvscroll-tip at 3cdbfe9256) the test failed in its
second pass: Took { leading: 2, by_coverage: 0 } where it expected the whole-plane reader to
split by coverage. Its first pass recorded the readers once the pool made their pipeline
(pipelines pooled 1), and such a recording measures nothing (render.rs: a measured reader
records inside its query only where its pipeline was made at the draw), so the second pass
had no count yet. The lane in the same entry shows coverage weighing the same readers
(host pages, full coverage: 7.47 of 8 readers a frame over half, split).

The test now runs three passes and expects the coverage form only in a pass after one whose
coverage queries counted both readers, and asserts that a device that leads and measures
weighed a pass so at least once.
2026-11-14 00:16:02 -08:00
Anees Iqbal ba09eb533d Re-bless the authored compile census at c796a88d6a
The census (m3-max-28383 at c796a88d6a, pin 85: cases 2369, compiled 48670, refused 1079,
failed 0, differences 0, regressions 0, moved artifacts 0, slowest compile 1917 ms) moved only
its artifacts_at product stamp (the translator sources' doc-link fixes in RUNTIME 2262).
2026-11-14 00:12:49 -08:00
Anees Iqbal cfe6bb2bde 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 00:04:19 -08:00
Anees Iqbal 1443135ad8 RUNTIME 2264: readers after a barrier of a texture without feedback-loop usage take leading snapshots, weighed by area and learned coverage
On NVIDIA's drivers a linear image takes no feedback-loop or input-attachment usage, so a draw
that read such a color at its own pixels after a memory barrier split the pass and copied the
texture's scissor box (the whole surface for a guest that sets no scissor) before the new
instance: in a consumer's autoscroll on an RTX 2080 about 21 readers a present each copied a
3648x2038 surface, ~29 ms of a 45 ms take-to-show.

Such a reader now splits the pass with no copy: its snapshot draws record in an instance of
their own ahead of the reader's (LOAD/STORE_NONE, empty masks), a "leading snapshot". The device
enables VK_KHR_load_store_op_none, else VK_EXT_load_store_op_none, below Vulkan 1.3 (the
runtime's instance is 1.2, so STORE_OP_NONE was core on no device); the version comes from the
device's properties.

A leading snapshot reads the texture at every pixel its draw covers, so over host pages it is
not cheaper than the split at every area: on an RTX 5080 Laptop GPU (split_parts, 8 readers a
frame over a 2648x1658 surface over host pages) whole-surface readers took 22.98 ms a frame
leading against 17.99 split, quarter-surface readers 6.06 against 8.55; the forms cross near
half. weigh_snapshot takes whether the reader leads and skips over_bytes for it, so the area
rule weighs its first pass and, where the device measures readers (occlusionQueryPrecise),
learned coverage decides from the second: a reader keeps the leading form within the existing
bound (SNAPSHOT_PIXEL_COST 20: 20% of a 4-byte color) and splits above it. A rebound kept reader
weighs with the same flag. New WorkCounts: reading_draws_snapshotted_leading,
reading_draws_leading_covered_within / _to_half / _over_half (where the guest's readers fall
against the bound). docs/FAST-PATHS.md's row records the 5080 A/B.

Also: the split_parts lane (ignored by default, run by name) measures what split readers cost and
reads its fixtures from the crate directory the runner names.

From steelbrain/nvscroll (81915c28de..3cdbfe9256, 11 commits). Verified on potluck at 3cdbfe9256:
clippy gpu (28377), cpu_icd and plain (28379) 0; rustdoc -D warnings 0; api_signatures and
api_surface 15/15; lavapipe 478/478 (copy form unchanged there). 5080 A/B nvscroll-ab-233300
(kind t). The tip's 5080 device test and lane (b5080 batch 28393) are pending; the 2080 and XTX
runs wait for um790.
2026-11-14 00:03:40 -08:00
Anees Iqbal c796a88d6a 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 23:45:01 -08:00
Anees Iqbal 3697a412e9 Name each batch submission that holds its thread 5 ms or longer, phase by phase
What: under METAL2VULKAN_QUEUE_TIMES (a default-off diagnostic that already notes queue head
and submit-return times), a batch submission that took 5 ms or longer from its start to its
vkQueueSubmit call logs one line (id name metal2vulkan-slow-submissions, through the device's
message sink, else stderr): its place in its command buffer, its VkQueue slot, the span split
into the prologue, the first work's take, the staging queue's flush (its waits for the staging
queue's lock and for one of that queue's command buffers counted apart) and the planning and
recording, then the call's own time. slow_submissions.rs holds the watch; submit.rs enters the
phases; device/staging.rs counts the two waits through a thread-local only while a watched
submission runs on the thread. Off, a submission reads one flag; no clock read, no line.

Why: in a guest's Feature Matching trace on the RX 7900 XTX, two one-dispatch command buffers
spent 23.6 ms and 323 ms between kernelStart (submit.rs's kernel.begin) and their driver call,
on the scheduler's thread, holding back every later commit; the trace cannot say which phase.
One rerun with this on names it.

Verified: not yet run; a lavapipe test (kernel_end_device) holds a submission 30 ms at its first
work's take (a new trace::Point::FirstWork) and checks that one line names it with that phase's
time, that a straight submission adds none, and that without queue times none is printed.
2026-11-13 23:43:47 -08:00
Anees Iqbal b97499df16 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 23:41:44 -08:00
Anees Iqbal 1f20452b37 RUNTIME 2263: an execution's compute commands order by their records' barriers alone, in either kind of encoder
Metal's reference for MTLIndirectComputeCommand concurrentDispatchThreadgroups (and
concurrentDispatchThreads): "Compute commands encoded into an indirect command buffer don't
automatically serialize access to resources with other commands in the indirect command buffer.
Use barriers to serialize access to resources within a range of commands." and "If dispatchType
is serial, the compute command encoder adds a barrier before and after the range of commands. If
dispatchType is concurrent, then the compute command encoder does nothing". MSL 6.17.2: "In an
ICB, dispatches are always concurrent." The runtime ordered a serial encoder's execution as the
encoder's own dispatches: a barrier wherever their uses met (the host step and commit's
recording) or between every two commands (the GPU form).

Now a command runs after the earlier ones of its range only where its record sets a barrier, in
either kind of encoder; the segment's barriers from everything before and to everything after it
are the serial encoder's before and after the range (Execute loses `ordered`; ComputeKey loses
`ordered`, so a kept chunk runs in either kind of encoder; the GPU form puts a barrier between
two commands only where a route may set one in the records, CommandWrites::BARRIER; the
tracker's ordered_everything goes). docs/API.md's accepted difference quotes Metal's text. Not a
speed-for-accuracy choice (Metal's contract), so no FAST-PATHS row.

Also: kept_commands' compute tests note each command's own output window as an apart write
(the layer reported write-after-write between disjoint windows); trail_gpu_forms requires a GPU
form's scratch in device-local memory only without unified memory (a Private buffer lies in
system memory before the carve-out by design on the 780M), fixing the 780M lane failure.

From steelbrain/icbbarrier (b3f5e50f94, 7c5e5e60b2, fdfc1e412a; icbinherit). Verified on potluck
at fdfc1e412a: lavapipe 275/278 (28026; the 3 failures were lvpfails-owned and fixed by RUNTIME
2261 on development), clippy plain/m2v_gpu/m2v_cpu_icd and rustdoc 0 (28027), negative control
27962 (both new tests fail on the old runtime). XTX and 780M legs: not run (um790 down), owed at
the next pin's device legs.
2026-11-13 23:41:05 -08:00
Anees Iqbal 799e3dcd0a nextest: the lane's index pool handler test runs alone
a_completed_handler_waits_for_no_pool_block_made_meanwhile holds a
completed handler to less than half a block's making after its command
buffer completed: a bound on a thread's wake, which other test processes'
CPU use stretches. In pin 84's 780M legs (15 other lane processes beside
it, two other GPUs' partitions on the host, load average 18 on 16
threads) round 1's handler ran 13.5 ms after its completion, 6.5 ms
before the 23.5 ms making ended (so it waited for no making's end), and
failed the bound. Run alone at f6a19accbe on the same 780M with the
other GPUs' partitions still on the host (load average 14, potluck job
m3-max-28326), all 12 rounds' handlers ran within 0.53 ms.
2026-11-13 23:38:37 -08:00
Anees Iqbal 3976ecbeff blend16 lanes: an interlocked draw's notes come from the profile's MetalHalfStorageWrites
The blend16 lanes asserted that a draw through the pixel interlock
announces none of their notes. A float output's blend is converted to
half by the storage image's store: Metal's conversion (toward zero) where
the profile takes DriverDeviation::MetalHalfStorageWrites, else the
device's own, which the translator records as
PrecisionNote::DeviceColorConversion (lower/fragment/fetch.rs). The
RTX 2080 is not among that deviation's measured rows (the 3090 and the
5080 Laptop GPU are), so its float cases announced device-color-
conversion and four tests failed, though their texels were Metal's
(4096/4096).

interlocked_notes names what an interlocked draw announces from the
profile's own predicate: device-color-conversion for a float output
where the profile does not take the deviation, nothing else. The
assertion is now equality with that list, in blend16.rs and narrow.rs
(zero.rs and nans.rs share blend16's sweep).

Seen in pin 84's 2080 legs. Verification follows.
2026-11-13 23:38:36 -08:00
Anees Iqbal 6e8a946749 Lane: tests whose work makes a second command queue take one queue or the plan
On the RTX 2080 (NVIDIA, 16 graphics queues: a plan of 14 round-robin
VkQueues) four lane tests failed on metal2vulkan-queue-limits-reached,
which fails a run by design (runtime_case's Messages::sink): under the
lane's limits (one round-robin VkQueue) the program's second command
queue shared VkQueue 0 where the plan gives it one of its own. RADV's
one graphics queue leaves the plan as the limits do, so the XTX and the
780M said nothing.

- generic_pointers and sampler_tables made a queue per dispatch: each
  test now makes one queue per device and dispatches through it.
- depth_executions' frame commits on two queues on purpose: both tests
  that draw it make their device with the plan (at_plan).
- rate_mapped_passes' counted_draw makes a queue per draw: the two tests
  that call it more than once take fresh_with(at_plan), as the file's
  other multi-queue tests do.

Seen in pin 84's 2080 legs (archive e30c91de8a): generic_pointers_answer
_as_metal, a_frame_s_executions_at_a_fixed_stride_run_on_the_gpu,
a_sampler_table_read_at_a_dynamic_index_samples_as_metal and
a_viewport_over_part_of_the_screen_draws_only_the_regions_it_reaches.
Verification (build, the 2080 and lavapipe runs) follows.
2026-11-13 23:38:36 -08:00
Anees Iqbal 4fc0ed0e3e FAST-PATHS: the unshared hold's cost in a game's frames on the RX 7900 XTX
The consumer's game on the XTX counted 5.5 ms a frame of batch_hold_nanos, all of it the
unshared isolation hold, beside a 12 ms gap between its frame and its GPU time. queue_share's
pairs mode runs that shape on the runtime alone: the hold keeps the next batch out of the
VkQueue while the one ahead runs, and the GPU stays busy under both policies (idle 1.9% against
1.4%, a 0.18 ms against 0.12 ms gap before each frame at the median), so the hold is recorded as
costing that, not the frame's gap.

Verified: m3-max-28278 on homelab-um790-xtx-1's XTX, the four pairs runs exiting 0.
2026-11-13 23:14:39 -08:00
Anees Iqbal 54b8b75d45 queue_share: a pairs mode, a game's two command buffers a frame beside a compositor's queue
A consumer's game on the RX 7900 XTX (RADV, one graphics VkQueue) ran a frame of two command
buffers (about 9.5 ms and 0.3 ms of GPU time, two frames in flight) at 22 ms a frame against
9.9 ms of GPU time, its batches held 5.5 ms a frame for the compositor's unshared queue
(WorkCounts::batch_hold_nanos, heads_held_for_unshared_isolation). This mode runs that shape
on the runtime alone: the frame period, GPU time and GPU idle share, each command buffer's
commit to kernel start, the GPU gap before each frame, the completion's lateness, and the
device's hold and scheduler counts a frame, under either UnsharedIsolationPolicy, with the
compositor's queue committing nothing or a draw every --period-ms.

Verified: cargo fmt; built and run on the XTX in the following jobs.
2026-11-13 23:14:39 -08:00
Anees Iqbal 0742582882 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 23:14:17 -08:00
Anees Iqbal 3805039770 RUNTIME 2262: distinct textures sharing one resource key at bytes apart share no memory; private intra-doc links resolve on x86-64
Two members of the false-overlap class that RUNTIME 2257 closed for heap-placed images remained:

- A pass drawn in color groups refused a resolve target set in its first group's encoder
  (RuntimeGap::ColorAttachmentGroups) wherever a draw had read anything with the target's key:
  check_group_resolve compared ResourceKeys only. A heap-placed target, or one made over a
  buffer, apart from the bytes the draw read was refused although Metal runs it. First.read is
  now a per-key list of UseRanges (byte ranges joined where they touch), and the refusal stands
  only where the target's use shares memory with a noted read.
- A texture made over a buffer (Storage::Alias, Owner::Buffer) took the buffer's key with a WHOLE
  place, so attached_levels, cleared_copy and snapshot_color counted every texture over one
  buffer as the same image: a pass rendering one and sampling another at other bytes took the
  attached-read route, and after a load-ordering barrier before the first draw the sampled
  texture's copy read the attachment's clear (4096 of 4096 texels wrong). Owner::Buffer now
  carries the texels' ImagePlace (Texels::place, in Buffer::tracked's offsets) and Image::place()
  returns it.

True overlaps keep their routes: the tests' controls refuse a target over the read bytes, and a
texture over the attachment's own bytes still takes the attached read and reads the clear.

Also: CI's "Private intra-doc links" step (ceiling 0 for every crate) failed on x86-64 Linux
with 16 links whose targets exist only under some cfg (runtime 10, metal2vulkan 4, air 2); they
are plain code spans or paths that resolve under every cfg now. Doc comments only.

From steelbrain/falseov (9e7367e451..b77784c0b4). Verified on potluck:
- before the fix, lavapipe (msi): m3-max-28285 at 9e7367e451 failed 3/3 (both targets refused,
  apart read attached=1); m3-max-28297 with the fix reverted: the barrier case 4096/4096 texels
  wrong.
- after: lavapipe touched filter 175/175 (m3-max-28304); XTX RADV carried m2v_gpu archive 175/175
  (m3-max-28303; asserts aliases_buffer() and color_group_passes ran).
- clippy -D warnings plain (28314), m2v_gpu (28299), m2v_cpu_icd (28301): 0; rustdoc
  --document-private-items 0 for all six crates on x86-64 (28311), public cargo doc 0.
No new Degradation kind, WorkCounts field or refusal kind; docs/REFUSALS.md unchanged.
2026-11-13 23:13:37 -08:00
Anees Iqbal f6a19accbe Re-bless the authored compile census at e30c91de8a
The census at the pin-84 tip (m3-max-28187) covered 2369 cases over 21 profiles: 48670 compiled,
1079 refused, 0 failed, 0 differences, 0 regressions. 121 cells' artifact hashes moved with
SEMANTICS 2107 (a kernel's static threadgroup memory length is reported rounded up to 16 bytes);
each is still compiled. Slowest compile 2.1 s. The golden-table bless at the same tip
(m3-max-28186) wrote nothing.
2026-11-13 22:18:58 -08:00
Anees Iqbal e30c91de8a Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 21:59:50 -08:00
Anees Iqbal b3d844f9fb RUNTIME 2261: a commit returns while its batch waits for a held VkQueue; kept draws carry only into passes of the same sample positions and layer count; the lavapipe and AMD lane failures
Runtime fixes, each with a test that fails before:
- A command buffer's queue slot lives apart from its state lock (d159e7a2f1, 78d5a44df2).
  commit() handed its slot over under the command buffer's state lock, which the scheduler
  thread held across vkQueueSubmit; that submit waited for a VkQueue someone else held (a
  compositor sharing the queue), so the program's commit waited as long as the queue was held
  (gdb, m3-max-28123: the lane's checked-commit tests ended in SendError after 60 s). Test:
  tests::scheduler_wakes::a_commit_returns_while_the_thread_submits_its_batch_to_a_held_vk_queue
  (lavapipe, fails before in 20 s: m3-max-28149).
- A render encoder at custom sample positions carries no kept draw (1da568fc43): a kept draw's
  VkPipeline has the positions baked in, and carry_ends never compared the ending pass's, so a draw
  kept from a pass at custom positions was carried into a later pass of the same shape at the
  default ones (runtime_lane::sample_positions on the XTX and the 780M, draw_again.rs:1320).
- A kept draw carries only into a pass of the same renderTargetArrayLength (430fad72b8): the
  layered passes' kept draws were carried across layer counts (runtime_lane::layered_passes, both
  tests, on lavapipe and AMD). The debug check that caught both now names the parts that differ
  and whether the draw was rebound or carried (8bfeebe929, 3973769b86, 9da59ae9e3).

Test fixes (the expectation follows the runtime's documented behaviour):
- runtime_lane::degrade_notices::dispatches_degrade_once_per_kind expects a split where the device
  splits the ragged grid (1b58b69953's partial-threadgroups variant runs it whole elsewhere).
- handed_objects x2 and host_memory: a held import's deallocator runs once its command buffer
  completed, posted to the free thread (41b5430f6a) or not, as Metal's may run after the waiters.
- queue_order's host-step order test commits B once A's gate was taken (b46459080d: a batch whose
  host step has not taken its gate gives way, the order the x86 Macs keep).
- The two dispatches past 2^32 threads compile only under m2v_gpu: a CPU device runs each past the
  watchdog's 20.2 s (docs/VALIDATION.md).
- The held-wakes tests begin once the device's own checks answered.

Verified: lavapipe suite at 430fad72b8 6019/6020 (m3-max-28179; the one failure the runtime-sources
pin this landing re-pins). The XTX and 780M legs (m3-max-28177, 28178) run after the landing.
2026-11-13 21:59:11 -08:00
Anees Iqbal fa9799ce9e Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 21:47:46 -08:00
Anees Iqbal a397a8b366 RUNTIME 2260: a rate-mapped pass of one piece times its piece
The pieces' GPU times (WorkCounts::rate_map_piece_gpu_nanos) counted only
passes recorded in two or more pieces, so a frame's single-piece
rate-mapped passes were untimed: on the Iris guest frame only about half a
multi-piece pass a frame was timed, and the Offscreen time outside the
pieces could not be split from the counters.

PieceTimes::take now times any piece count above zero, and the executed
pass's recording takes it only for a rate-mapped pass (one of its
executions has a map), so a pass without a map still writes no
timestamps. Two timestamps a pass, where the device times pieces at all.

Test: rate_mapped_pieces' uncut execution now asserts its one piece timed
where PieceTimes::timed_on; verification follows on potluck.

Also: the pieces lane gains the wide frame without a map and each frame's host steps (e640147b9a),
and the pieces device test loads its fixture where the run's manifest lies, so it runs from a
carried archive (1c01beec35; it failed so on the 780M, m3-max-27994).

Why: on the Iris guest's rate-mapped sample (asp78-iris) about 93 ms a frame of the Offscreen
pass was untimed, because rate_map_piece_gpu_nanos timed only passes cut into two or more pieces;
the next Iris run splits the whole pass.

Verified at 1c01beec35: clippy plain exit 0 (m3-max-28152); lavapipe 6/6 rate_mapped device
tests, the uncut pass's one piece timed ("pieces 12 timed 13") (28151); release m2v_gpu archive
builds (28150). clippy under m2v_gpu and m2v_cpu_icd and rustdoc passed on the tip that carried
these same changes.
2026-11-13 21:47:07 -08:00
Anees Iqbal 2dfa05ffdf Re-pin the runtime sources at the landing tip
The landed packet changed a runtime-sources input, so the committed digest no

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 21:44:59 -08:00
Anees Iqbal 1895fe40d6 RUNTIME 2259: a use's range stays 32 bytes: an image's place in its heap counts 64-byte granules
What: tracker::ImagePlace, which RUNTIME 2257 added to UseRange::Image so that
images placed apart in one heap (one tracker key) share no memory, held its
bytes as two u64s, growing UseRange from 24 to 40 bytes. It now holds two u32
counts of 64-byte granules (PLACE_GRANULE), rounded out (start down, end up),
so UseRange is 32 bytes; a place past what u32 granules count (256 GiB) is
WHOLE, the key's whole memory. Rounding out only adds bytes, so places whose
bytes meet still meet; two that share a granule alone are taken to meet, at
most a needless barrier or copy.

Why: every use of every command copies and compares a UseRange
(EncoderUses::note's map, command_uses_into, the kept uses). The XTX's
per-draw bench (walk_costs, exclusive, tip/before alternating, m3-max-27858)
put the no-barrier draw path about 1.2 us a draw (8-12%) above the build
before RUNTIME 2257, the barriers shape unchanged. This change narrows the
range back toward its old size. Whether it recovers the cost is the XTX
confirm's question; the commit claims only the size.

Verified: tests::tracker 76/76 including a_use_range_stays_32_bytes, clippy plain exit 0, lavapipe
heap_placed_reads, heap_placed_targets, attached_levels, color_groups and tracker 82/82
(m3-max-28099). On the XTX (m3-max-28098, exclusive, release walk_costs, tip/before/compact
twice and once under perf) the timings were bimodal in every build (frames at ~185 or 250-285 us),
wider than the 8% effect, so they settle nothing; the encoding thread's cycles:u profile puts the
tip's extra samples in RenderLowering::draw_rebound (51 against 18 before) and
State::shadows_to_carry (23 against <6), both copying and walking uses, and the compact build at
17 and 9: one perf run a build, evidence rather than proof.
2026-11-13 21:44:18 -08:00
Anees Iqbal 12fa641450 Tests: a surface plane over declared padding follows its placement answer where the driver refuses the pitch
What: tests::padding_unobserved's surface plane leg asks
Buffer::texture_placement_with_iosurface_plane before making each texture. A
declared plane is the DRM_FORMAT_MOD_LINEAR image at the pitch exactly where the
query answers NotHostPages; elsewhere it must be a shadow the device refused
(Shadow(Refused(_))), never one of the check's verdicts. Undeclared, a shadow as
before. The answer is printed.

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

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

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

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

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

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

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

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

longer described the sources and `the_runtime_sources_are_the_committed_ones`

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

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

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

longer described the sources and `the_runtime_sources_are_the_committed_ones`

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

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

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

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

longer described the sources and `the_runtime_sources_are_the_committed_ones`

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

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

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

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

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

longer described the sources and `the_runtime_sources_are_the_committed_ones`

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

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

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

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

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

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

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

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

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

Test infrastructure only: no version bump.

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

longer described the sources and `the_runtime_sources_are_the_committed_ones`

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

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

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

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

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

longer described the sources and `the_runtime_sources_are_the_committed_ones`

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

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

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

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

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

longer described the sources and `the_runtime_sources_are_the_committed_ones`

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

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

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

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

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

longer described the sources and `the_runtime_sources_are_the_committed_ones`

would fail. Recomputed over the same inputs and committed by land-pkt.sh.
2026-11-13 18:16:29 -08:00