Commit Graph
7679 Commits
Author SHA1 Message Date
Anees Iqbal 6eb83eabff rt README: a command buffer is scheduled once the one submit thread's earlier calls return, whatever their queue; the Iris Xe's figures
The known gaps of queues gain the rule behind the running-signal case's
declaration. Every queue's command buffers go to the device's one VkQueue,
which takes one vkQueueSubmit2 call at a time, since Vulkan requires a queue's
host access to be externally synchronized. The device's one submit thread
makes every call (submit.rs has one call site, reached only from the thread's
pass), and it schedules a command buffer once its earlier calls have
returned, whichever queue they were for. So one long driver call delays every
queue's scheduling by its length. The API.md accepted difference the
declaration cites now states the same ground.

Measured on an Iris Xe (RPL-P, ANV):
- m3-max-52564: the device's first submission, 192 fills of a new 256 MiB
  block, spent 27-30 ms in vkQueueSubmit2. The other queue's waiter was
  scheduled 0.02 ms after that call returned, in 3 of 3 runs.
- m3-max-52745, the separating run with the probe's block size as a scratch
  switch, never committed: the first call took 2.1 and 2.5 ms with 1 MiB,
  9.1 ms with 64 MiB and 28.4 ms with 256 MiB. Its time grows with the new
  block the submission first uses. The probe's later submissions took at most
  0.18 ms.
- In the same job, the 256 MiB run (the case's own shape) read Committed and
  the case's declaration fired at both MTLEvent sites, verdict 'announced'.
2026-11-19 08:21:53 -08:00
Anees Iqbal 3955d3bd01 docs: CONFORMANCE-COVERAGE re-derived for the running-signal case's declaration; the generator names NewRuntimeAccepted
The running-signal case now loosens two sites with Loosening::AnyOf on rt's
run, so the derived counts move: 11 SDK items move from 'no case reaching it
loosens anything' to 'loosens some site', and the tolerances grow from 15 to
17. The generator mapped each Justification constructor to its variant except
new_runtime_accepted, and that is the first one a case module names. It now
maps it to NewRuntimeAccepted.

Verified: the_conformance_coverage_document_is_what_the_sources_derive failed
in m3-max-52651 before this commit. coverage.py --selftest passes.
2026-11-19 08:21:53 -08:00
Anees Iqbal 1e583d5e0c conformance: the running-signal case's MTLEvent reading may be Committed on rt alone, where its submit thread is still busy
On the Iris Xe, event-wait-behind-a-running-signal's MTLEvent row read the
waiting command buffer Committed with no handler run, where the M3 Max had
scheduled it while the signaller ran. This held in 3 of 3 runs (m3-max-52564).
The trace showed why. The waiter's wait was met at once by the signal's
staging. rt's one submit thread was still inside the signaller's
vkQueueSubmit2, the device's first submission, which took 27-30 ms on ANV. The
waiter was scheduled 0.02 ms after that call returned. Apple defines Scheduled
as all dependencies resolved and the command buffer scheduled for execution,
and promises no time between the two. The planner ruled this a timing
difference and not a conformance bug.

The case now declares, on rt's run alone (Justification::NewRuntimeAccepted),
that the MTLEvent row's waiting status while the signaller runs may be
Committed or Scheduled, and its handlers none or the scheduled one. The
declaration cites a new accepted difference in docs/API.md, 'The new runtime
schedules a command buffer once its submit thread is free'. The shared event's
row is not loosened: both runtimes hold its waiter until the value is reached.
The old runtime's run compares both sites exactly.

New test: a_wait_met_by_a_running_signal_may_read_committed_on_the_new_runtime_alone.
It checks that the Iris answers are no divergence on rt and are rows on the old
runtime, that the shared event's sites still diverge, and that a status other
than the two still diverges.
2026-11-19 08:21:39 -08:00
Anees Iqbal 7469fe748d rt README: a fragment function's lane-reading group operations are refused, rt enabling shaderQuadControl on no device; the ledger lists the case
discard-quad-sum-placement is refused on rt at its first shape's render
pipeline state. Its fragment functions call simd_sum, and the translator
(lower/simd full_quads) refuses any fragment function whose group operations
read, combine or count other lanes unless the profile has shaderQuadControl.
That covers every SIMD-group and quad group function and the SIMD-group matrix
multiply-add. Metal runs a partly covered quad's helpers into those operations,
which Vulkan gives only under RequireFullQuadsKHR, and rt enables
VK_KHR_shader_quad_control on no device: it is in neither the floor nor the
optional extensions.

The README's known gaps of render pipeline states now say so. The ledger row
(venue *) takes the reason 'no stream uses it yet', from a census of the 26
replay streams. Each newLibraryWithData library whose bytes name an
air.simd_, air.quad_ or air.simdgroup_matrix function was disassembled with
llvm-dis. No module listed in !air.fragment calls one (m3-max-52530, 52531,
52532, 52557, 52604; counts only, the streams stay on their nodes). The
libraries that call quad functions, 2 to 5 a stream, call them from no fragment
function. A control over one stream's 35 libraries (52543) found 226 fragment,
4860 kernel and 81 vertex modules, so the stage test reads them.

The refusal reads the same on lavapipe, the RTX 3090, RTX 2080, RX 7900 XTX,
RX 550, both 780Ms and the Iris Xe (m3-max-52172..52174, 52305, 52418).
2026-11-19 08:21:39 -08:00
Anees Iqbal 6fccd785c8 matrix: the 780M's create_64MiB/first_take row leaves the status list, within its limit on every leg
Round 940f37188b (10 of 11 legs pass; the UHD 630 venue unstable) lists the row among the status
entries within their limits: within its limit on every leg of its card that timed it. gem10's
leg (52484) read 1.004 on the five interleaved samples (rt 6829.1 against old 6802.4 us medians)
and um870's 1.00 (6969.6 against 6987.5). The row's earlier 1.08 (round 391db1e57a) was one
reading.
2026-11-19 08:20:05 -08:00
Anees Iqbal 441b9dbfd2 AGENTS.md: rule 3 names the exported surface's plane texture as the second exception
The owner allowed one more exception to optimal images, exactly a plane texture of an exported
surface: a linear image on the surface's own exported memory at the export's pitch and plane
starts, and the copy form of the same call, counted and recorded as a known gap, where the device
offers no such image or cannot meet the layout. The Shared-buffer exception is kept word for word.
Checked against Device::new_exported_surface as built: in place, each plane's image is bound to
the surface's exported memory (a dma-buf's per-plane import of it, or the opaque handle's one
allocation) at SurfaceExport::planes; otherwise SurfaceForm::Copy, counted in
Metrics::surfaces_copied, its gaps in the rt README.
2026-11-19 08:09:13 -08:00
Anees Iqbal 5b782cc68c rt README: the known gaps name each copy form of a surface the build found
The copy forms of Device::new_exported_surface, each with its reason and card: a dma-buf
surface without the modifier extension (the RX 550, NoModifier), a dma-buf surface on NVIDIA
(the RTX 3090, Start; no consumer path uses it, the opaque fd surface is in place there), and a
layout a device cannot meet (a 4,096 pitch multiple takes Pitch on the 780M, the 3090, the Iris
Xe, the RX 550 and lavapipe). Each was measured by the surface device test at the code of this
branch; docs only.
2026-11-19 08:09:12 -08:00
Anees Iqbal 3c28266762 rt surface: the layout's verdicts are pure functions, each copy reason reached by a unit test
Tiling, Dedicated and MemoryType come from no lab device's answers; the
verdicts over the query's and the images' answers are now functions the
default suite runs on synthetic answers, Pitch and Start among them.
2026-11-19 08:09:12 -08:00
Anees Iqbal 0cec7c5184 rt README: the floor's extension table lists the DRM format modifier 2026-11-19 08:09:12 -08:00
Anees Iqbal 37adfb0756 rt surface docs: the guide's exported surfaces, the dma-buf copy-form gap, the refusals and the API table
The README says in one place what each handle needs for in place, the layout
rule, the copy form's reasons and the one consumer contract. REFUSALS.md and
api_signatures.tsv regenerated by their scripts.
2026-11-19 08:09:12 -08:00
Anees Iqbal 825bfe0247 rt surface tests: each form's three pictures, encode round and render round on every device
The VA-API row (dma-buf, 256 pitch, 4 KiB starts, rows of room), the NVENC
row (opaque handle, pitch multiple 4, planes directly below) and the copy-form
row (opaque handle, pitch multiple 4096, which no driver's fixed pitch of these
pictures meets), each checked against the layout rule, with the make's wall
time printed. Unverified: first run pending.
2026-11-19 08:09:12 -08:00
Anees Iqbal 11d0183aa5 rt surface: the overlong layout's limit names the device's longest block 2026-11-19 08:09:12 -08:00
Anees Iqbal f4cad4f245 rt: Device::new_exported_surface, a picture's planes in place or in the copy form
A surface lays its planes at one pitch and exact starts. A dma-buf's planes
are DRM_FORMAT_MOD_LINEAR images on their own dedicated imports of one
exportable allocation, freed once the imports and the handle exist; an opaque
handle's are LINEAR images in one exportable allocation. Where the queries or
the made images do not hold the layout, the surface is an exported block with
textures over a buffer in it, and the answer names why. Surface acquires and
releases plane images GENERAL to GENERAL. Unverified: first compile pending.
2026-11-19 08:09:12 -08:00
Anees Iqbal 4a89438e2b runtime test: a turn run whose held head went at a sleep slice is made again, as a late commit is
The frozen old runtime's queue_share_device test
a_later_queue_s_command_buffer_takes_its_turn_ahead_of_another_queue_s_burst failed three times
on msi's lavapipe under load (50518, 51548, 52475: "no held head waited for a sleep slice", 1
against 0) and passed 64/64 three times on gem10 (51697) and at 4197923467 (50582). On a CPU
device whose rendering takes every core, the scheduler's thread can wake past the 100 ms slice,
so the slice lets the head go first. The test already makes a run again when the test's own
thread is late; a run with a slice rescue is now made again the same way, up to TURN_RUNS (5).
A wake that never comes puts every run on the slice and still fails.

Test only; the old runtime's code is unchanged.
2026-11-19 08:04:14 -08:00
Anees Iqbal 264e689462 replay: the guest-RAM copies owed by a command buffer sit in two maps, as clippy asks
Clippy refused draining a command buffer's fills into a new vector. The fills
and the copies back each command buffer owes now sit in maps of their own, so
each is taken whole at its commit.

Checked by the follow-up check job named in the landing message.
2026-11-19 08:01:21 -08:00
Anees Iqbal 8c3fae2243 replay: the rt arm plays guest-RAM copies in the host's one-copy form
The new runtime's backend played a copy back to the guest's RAM as one
buffer copy per run, word-widened, in the guest's own blit encoder, and a
copy from the guest's RAM as one copy per piece in that encoder. The host
does neither: on the new runtime every staged fill and download is one rt
buffer-to-buffer copy, since rt answers no linear row pitch. In f355 of
the syncview stream the per-run form made 8,029 copies from 28 calls,
with a barrier pair each, which the host never makes.

Now each call is one copy, in a command buffer of the backend's own on
the call's queue, through a Shared scratch of its own (new module
new_runtime/guest_ram.rs):
- copy back: one copy of the whole words the runs span, committed just
  after the call's command buffer; a wait for that command buffer waits
  for the copy too (the guest sees its RAM written when its command
  buffer completes), then the CPU copies each run out of the scratch;
- copy in: the pieces gathered on the CPU into the scratch laid out as
  the bytes they span (gaps and edges from the target's mapping), one
  copy committed just before the call's command buffer; into a buffer
  with no mapping, one copy per run of touching words, so no gap is
  written.
Surface texel copies stay in the guest's blit encoder. The work is
counted apart as the stand-in (guest_ram_* counters, guest_ram_gpu_nanos
for its command buffers' GPU time, outside gpu_busy) and the report's
"guest RAM: copy-back played in the one-copy form" line. The old arm is
unchanged. staged_guest_ram_bytes and copied_back_guest_ram_bytes give
way to guest_ram_fill_bytes and guest_ram_download_bytes.

Tests: the copy-back device test now expects one copy of 100 bytes and
two runs copied out; a new device test plays copies in to a Shared and a
Private buffer and reads both back. docs/REPLAY-STREAM.md section 10
describes the form.
2026-11-19 08:01:21 -08:00
Anees Iqbal ea04fc8925 conformance: CONFORMANCE-COVERAGE re-derived for case 6's declaration
fence_orders now loosens one site (case/order/y/words-written on the
new runtime's run, NewRuntimeAccepted), which the coverage document
counts: the_conformance_coverage_document_is_what_the_sources_derive
failed without it (job m3-max-52556). The case names the variant, as
the table lists justifications by variant.

Verified: in the jobs named in the landing's report.
2026-11-19 07:53:00 -08:00
Anees Iqbal 0fa1b8f14c conformance: case 6's declaration says why rt reads 1024 and that Metal's 0 was measured
A reader of "0 or 1024" could take it for a race in rt. The docs/API.md
entry and the case's comment now say why 1024 is rt's answer (a writer
whose queue has fewer than three submissions in flight is submitted at
once, so the later reader reads it on every device and run), and that
Metal's 0 there was measured on the M3 Max (jobs m3-max-52432 and, behind
three, m3-max-52415), not documented. The entry's lead-in, and so its
slug, is unchanged.

Verified: in the jobs named in the landing's report.
2026-11-19 07:52:59 -08:00
Anees Iqbal 57a33a11e9 conformance: fence-none-tracked-behind-one declares the new runtime's word count, an accepted difference
On metal2vulkan-rt the case read divergent at case/order/y/words-written:
Metal 0, ours 1024 (job m3-max-52528, lavapipe). The writer's queue has
one busy command buffer, below the three at which rt holds a group, so
rt submits the fill at once and the later copy on another queue reads
all of it. Metal's tracking orders only against work it has already
submitted, and on the M3 Max it ran the copy first (5 of 5, job
m3-max-52432). rt's answer is the order Apple describes for a tracked
write (later commands wait for it); Metal's there is timing.

docs/API.md section 10 lists it under a new "Command queues" heading,
citing the rt README's measured line, and the case declares the count
on the new runtime's run alone (AnyOf 0 or 1024, NewRuntimeAccepted):
the old runtime's answers still compare exactly, and every status
still compares on both.

Verified: in the jobs named in the landing's report.
2026-11-19 07:52:59 -08:00
Anees Iqbal ec6f4696aa rt: a write on an idle queue goes ahead of another queue's later read, and the README says Metal orders no more
The group-hold question is closed: rt keeps per-queue groups. What rt
must still hold by structure is that a command buffer of a queue with
nothing running is submitted at once, so a command buffer of any queue
committed after it runs after it on the device's one VkQueue. The
device test commits a fill on such a queue while a third queue's busy
work holds the GPU (and puts three submissions in flight across the
device), sees it submitted, commits a copy of the filled buffer on
another queue, sees that submitted, then lets the GPU go: the copy
reads the fill. A runtime that grouped on the device's count would
hold the fill and fail.

The README's paragraph on grouping now says each queue groups on its
own count, that a command buffer held in its queue's group may be
passed by another queue's later one, and what Metal's hazard tracking
was measured to order (M3 Max, macOS 27.0.1, tracked buffers, no
fence, five runs each): the later copy read the fill where its queue
had nothing ahead of it (m3-max-52432; m3-max-52186 with compute), and
none of it behind one long command buffer (m3-max-52432) or three
(m3-max-52415).

Verified: in the jobs named in the landing's report.
2026-11-19 07:52:59 -08:00
Anees Iqbal 3ebfb0c382 rt: the three cross-queue counters go: nothing reads them
Metrics::groups_beside_another_queue, lone_submissions_across_queues
and forced_flushes_across_queues counted what per-queue groups add
beside another queue's, to decide whether one group across queues
should replace them. That question is closed: Metal's own hazard
tracking orders a write against work already submitted only (the M3
Max, jobs m3-max-52415 and m3-max-52432), so per-queue groups stay, and
forced_flushes_across_queues counted the wrong thing (its test omitted
three reasons of the group's own queue).

Nothing reads them: not the replay player's report, not the matrix,
not the conformance suite. reims prints every Metrics field at exit
through Debug, which names none of them. The one test that read them
counted them, and goes with them; the submit thread's work state no
longer holds the device's counters, which only they used.

For a consumer: the three public fields of Metrics are gone
(api_signatures.tsv blessed).

Verified: in the jobs named in the landing's report.
2026-11-19 07:52:59 -08:00
Anees Iqbal f5ff8ba0a5 conformance: the rt ledger drops the two stale shared-event rows of event-wait-behind-a-running-signal
The case's shared-event waiting status and handlers while the signaller runs
were listed as an rt bug (rt Scheduled, Metal Committed and ran nothing). rt
now holds a command buffer that waits for a shared event's value until the
value is reached, and the command buffers behind it on its queue stay
Committed (deca5649b3, 80bebc8c3f), so it answers Metal's Committed and ran
nothing. The replay reported both rows as no longer diverging.

The hold lasted in those runs: every rt run read
signal-landed-before-the-reading false, as Metal does. The rows went stale
because rt's answer changed, not because the hold ended early.

Verified before this commit: the case was exact on rt lavapipe in m3-max-51600,
51819, 51973, 52171 and 52418, and on the 3090, 2080, XTX, RX 550 and both
780M legs, each run reporting the two rows as no longer diverging. The Iris Xe
leg (52174) diverged on the MTLEvent rows, which these two rows never covered.
2026-11-19 07:25:24 -08:00
Anees Iqbal d2f25a8804 conformance: the six fence cases' Metal times, from the M3 Max
conformance times --runs 8 --write over the six (job m3-max-52450): each recording now carries its
timing, which every_case_carries_its_timing asks (it failed in m3-max-52426 without it).
2026-11-19 07:18:22 -08:00
Anees Iqbal 1241509a65 docs: CONFORMANCE-COVERAGE re-derived for the six fence cases
scripts/conformance-coverage/coverage.py, run locally; the_conformance_coverage_document_is_what_the_sources_derive failed in m3-max-52426 without it.
2026-11-19 07:18:22 -08:00
Anees Iqbal 94359c9a62 conformance: the six fence cases recorded on the M3 Max
Job m3-max-52432, five runs each, macOS 27.0.1, one outcome per case.
- fence-across-queues: Y 1024/1024.
- fence-held-updater: the waiter completed before the release, the updater Committed then, Y 0.
- fence-empty-waiter: X 1024/1024 when the waiter's completed handler ran.
- fence-none-tracked, no busy work: Y 1024/1024.
- fence-none-tracked-behind-one: Y 0.
- fence-none-tracked-behind-busy (three): Y 0.

GPU times in ms from the updater's GPU start, from a scratch print in the job (not committed):
- No busy work: the waiter starts 0.004 to 0.065 after the updater ends.
- Behind one or three: the waiter runs 1.08 to 1.26 before the updater starts. The updater runs
  beside the first busy command buffer, starting 0.03 to 0.22 after it.
Metal's tracking ordered the reader after a writer already submitted, and not after one queued
behind its queue's busy work.
2026-11-19 07:18:22 -08:00
Anees Iqbal a4b09a699d conformance: the fence cases count written words through as_chunks, as clippy asks
clippy::chunks_exact_to_as_chunks (m3-max-52426's clippy step) on written_words.
2026-11-19 07:18:22 -08:00
Anees Iqbal c248d8202f conformance: two more tracked fence-free cases, behind no busy command buffer and behind one
The planner wants to separate the two causes behind fence-none-tracked-behind-busy's answer (Y
held none of the updater's words): the blit form, or the busy work queued ahead of the writer.
- fence-none-tracked: the same blit form with nothing ahead of the writer.
- fence-none-tracked-behind-one: the same with one busy command buffer ahead.

FenceShape::TrackedBehindBusy becomes FenceShape::Tracked { busy }. The busy count is in the
shape's input words, so the three tracked cases record apart. All six re-record together on the
M3.
2026-11-19 07:18:22 -08:00
Anees Iqbal 7863757c83 conformance: the four fence cases recorded on the M3 Max
Job m3-max-52415, five runs each, macOS 27.0.1, one outcome per case:
- fence-across-queues: Y holds all 1024 of the updater's words; both Completed.
- fence-held-updater: the waiter completed before the release while the updater read Committed,
  and Y holds none of the words; both Completed once released.
- fence-empty-waiter: when the waiter's completed handler ran, X held all 1024 of the updater's
  words.
- fence-none-tracked-behind-busy: Y holds NONE of the updater's words. Metal's tracking did not run
  the waiter after an updater committed behind three busy command buffers of its queue, in this
  blit form.

The four join the cost bill (AFTER_THE_LAST_RUN) until a whole-set cost run covers them.
2026-11-19 07:18:22 -08:00
Anees Iqbal 384d312253 conformance: four cases of what a fence orders between two queues, and tracking without one
The planner's four durable cases from the cross-queue fence probe
(probes/cross_queue_fence_held_update.m, which lands with the fence change). Each is one
Side::fence_order call. An updater on one queue fills X and updates a fence; a waiter on another
queue, committed after it, waits on the fence and copies X into Y.
- fence-across-queues: X and Y untracked, the updater runs a long job first. Metal: Y holds the
  updater's words.
- fence-held-updater: untracked, the updater held at a shared event the probe raises later. Metal:
  the waiter completes before the release and Y holds its initial words.
- fence-empty-waiter: the waiter's encoder only waits. Metal: it completes after the updater; its
  completed handler counts X's words written.
- fence-none-tracked-behind-busy: no fence, X and Y tracked, the updater committed behind three
  busy command buffers of its queue. Metal: Y holds the updater's words.

The probe used compute dispatches. These cases use blit encoders, fills and a copy instead, so no
shader is compiled and no loop runs on the GPU; the long job is fills. The recordings state what
Metal answers for that form.

Every wait is bounded, and the one held command buffer is released by a guard (rt) or by the
probe itself (Metal).

The rt side has no hazard-tracking mode: X and Y are its buffers. The old runtime's side answers
the trait default (unavailable).

Not yet recorded or run: the recordings come from the M3 next.
2026-11-19 07:18:22 -08:00
Anees Iqbal 21f29241dc replay: the rt player's hang record names the waited command buffer and its queue
A wait of the new runtime's player that timed out wrote "the replay's wait for a command
buffer" into the hang record, so a GPU hang in a play could not be traced to the command buffer
it waited on. The operation text now carries the command buffer's stream ID and its queue's
(0 for the play's own), taken at the commit, before a release can drop the queue mapping.
Verified: clippy and rustdoc of the validation crate; the plays that use it are the check.
2026-11-19 07:12:11 -08:00
Anees Iqbal d4d1b5ff05 rt README: the no-copy imports have no read-only form; the ledger lists Metal's bit 24 as that gap
The planner's ruling on Metal's private read-only no-copy option (bit 24 of MTLResourceOptions):
no options word, no new Gap. Instead, one README sentence in Imported blocks and a ledger row
citing it.

Each clause was checked before it was written:
- import_host_memory's safety contract takes "host memory mapped readable and writable"
  (import.rs).
- Vulkan's host-pointer import (VkImportMemoryHostPointerInfoEXT: sType, pNext, handleType,
  pHostPointer) and its fd import carry no access of their own; the spec's Host External Memory
  section defines no read-only import.
- MTLResource.h's MTLResourceOptions has no bit 24: its fields are the CPU cache mode at shift 0,
  the storage mode at 4 and hazard tracking at 8.
- Over imported pages a GPU write reaches them (the import is the pages, no copy), where Metal
  drops it (host_pages.rs, the M3 Max recordings).

The rows: host-page-writes-kernel-store-read-only and host-page-writes-visibility-read-only, both
refused at case/host-buffer with the Side's Unavailable naming the call with bit 24, venue *. The
same answer was held on all eight runs: lavapipe m3-max-52171; XTX, 2080 and 780M m3-max-52173;
780M and 3090 m3-max-52172; Iris Xe m3-max-52174; RX 550 m3-max-52305.
2026-11-19 07:05:23 -08:00
Anees Iqbal 0c2826fb09 rt: close's comment names the reasons its forced-flush test omits
The comment said the test holds each reason step and unheld send a
group for; it omits a command buffer that cannot join the group and a
segment that leans on a copy, as the counter's doc now says.
2026-11-19 07:04:21 -08:00
Anees Iqbal 7e59bca6ef rt: forced_flushes_across_queues says what it counts: its test omits three of the own queue's reasons
The counter's doc said no path of the submit thread sends a group with
no reason of its own queue's, so it stays 0. A boot on a 780M read 119.
Its test in close omits three reasons step sends a group for, all of
the group's own queue: a command buffer that cannot join it (its
queue's expected run not known, or the group at GROUP_RUN or
UNSEEN_JOINS), and a segment that leans on a copy for a buffer an
earlier segment of the group wrote. So it counts with one queue too.
The doc now says so, and that a group sent for another queue's fence
waiter is not counted (it goes as a host wait would send it).

Verified: a scratch device test (never lands) on lavapipe, one queue,
six commits held behind its busy work: forced +1 and submissions +1
while held, the fifth commit past UNSEEN_JOINS sending the group of
four (job m3-max-52396).
2026-11-19 07:04:21 -08:00
Anees Iqbal a2253cdb50 rt: device tests for a render encoder's wait across queues and a wait on a fence never updated
A guest's cross-queue waits are all on render encoders, and several of
its waits are on fences no encoder updated. The first test holds an
update on queue A in a group and has a render encoder on queue B wait
on its fence before a blit copies what A wrote: the copy reads the
fill. The second has queue A hold an update of one fence while queue B
waits on another that nothing updates: an encoder that only waits
completes at once, and a command buffer with work after the wait goes
in one submission of its own, A's group staying held.

Verified: lavapipe and a 780M, in the jobs named in the landing's
report.
2026-11-19 07:04:21 -08:00
Anees Iqbal 5e2c3cfc98 rt: a command buffer's queue is read by the device tests alone 2026-11-19 07:04:21 -08:00
Anees Iqbal b6a9317dac rt: the submit thread reads a FIFO's committed head through one method 2026-11-19 07:04:21 -08:00
Anees Iqbal 4ee7d2f850 rt: a retired command buffer drops its fence lists with its other kept objects 2026-11-19 07:04:21 -08:00
Anees Iqbal 1f0b5c65d2 rt: the cross-queue fence device tests, one for each case, and the deadlock shape
The held-group cases split into three tests by name (a wait after an update held in a
group; a wait released from an event after an update joined a held group since; a wait
with nothing for the GPU after the update), each checking the update completed before
the wait. The corner test states Metal's measured rule and adds the deadlock shape: A's
update waits on an event that a command buffer B commits after the waiter signals; all
three complete, the wait first.
2026-11-19 07:04:21 -08:00
Anees Iqbal 407b5a1078 rt: a fence orders encoders across queues; Gap::FenceOtherQueue goes
A fence used on a second queue was refused (Gap::FenceOtherQueue): 18 refusals in a
live boot on a 780M, every one a fence update on a second queue. The rule was ours,
from a replay census in which no fence crossed queues, not Metal's contract: the headers
say a fence update and wait are each "evaluated at kernel submission to maintain global
order and prevent deadlock", and MTLFence.h says nothing about queues.

What Metal does, measured (probe cross_queue_fence_held_update.m, M3 Max, macOS 27.0.1,
jobs m3-max-52186, m3-max-52188, m3-max-52194, plain and under the validation layer):
a wait on queue B waits for an update on queue A submitted before it (untracked
buffers: B starts 0.3-1 us after A ends and reads all its words; with no fence B runs
beside A and reads none); a wait with no work after it waits too (its handler 0.11-0.16
ms after A's GPU end); an update in a command buffer Metal holds, at an MTLSharedEvent
or MTLEvent wait, behind one held so, or behind an uncommitted enqueue, is not waited
for (B completes in 0.2-3.5 ms without A's writes, A still Committed).

Every rt queue submits to the device's one VkQueue and each segment ends with a
barrier, so a wait sees every update submitted before it. B passes A in four places:
(i) A's head held at an event wait, (iii) behind an uncommitted enqueue, both Metal's
own behaviour per the probe, so no hold and no gap; (ii) A's command buffer in a group
the submit thread holds while A's submissions run, and (iv) held groups released in
FIFO order rather than commit order, both rt's own. For those: each command buffer
keeps the fences its encoders wait on and update (empty, nothing allocated, when it
uses none); before a segment of a command buffer that waits on a fence is staged, the
submit thread sends first any other queue's held group (member or partial head) that
updates one, by send_through as a host wait does. A command buffer with nothing for the
GPU that waits on a fence retires no earlier than the last submission carrying an
update of it (the fence keeps that progress value, set in close). Same-queue fence use
is unchanged in submissions; no fence: one empty-Vec test per staged segment.

Tests: the two other-queue cases turned to accept; a new device test with A held in a
group behind the busy gate: (1) B's wait committed after reads A's fill, (2) B's wait
held at a shared event, released after A's later update joined the group, reads it,
(3) B's fence-only wait does not complete before A's update; and a corner test: a wait
on B runs while A's update is held at an event wait or behind an enqueue, without its
write, then A runs once let go. Docs: fence.rs, the three encoder sites, the rt README,
REFUSALS regenerated, api_signatures.tsv loses the variant.
2026-11-19 07:04:20 -08:00
Anees Iqbal 9370a9e636 conformance: the cross-queue fence probe records what it measured on the M3
Jobs m3-max-52186, m3-max-52188 and m3-max-52194 (M3 Max, macOS 27.0.1, three runs a
case, plain and under the validation layer): a fence wait on queue B waits for an update
on queue A submitted before it, a wait with no work after it included; it does not wait
for an update in a command buffer Metal holds at an event wait, behind one held so, or
behind an uncommitted enqueue.
2026-11-19 07:04:20 -08:00
Anees Iqbal ebd103a3fa conformance: the cross-queue fence probe asks whether a waiter with nothing for the GPU waits 2026-11-19 07:04:20 -08:00
Anees Iqbal d64fc36df9 conformance: the cross-queue fence probe takes untracked buffers, so only the fence orders 2026-11-19 07:04:20 -08:00
Anees Iqbal 413ce42818 conformance: a probe of a fence wait on one queue after an update held on another
A fence update in a command buffer Metal holds (at an event wait, behind one held so,
or behind an uncommitted enqueue), waited on by a command buffer of another queue
committed after it: whether the wait waits. Controls with nothing held, with and without
the fence, report the waiter's GPU start against the updater's GPU end.
2026-11-19 07:04:20 -08:00
Anees Iqbal 3078d5db90 validation: a dumped command buffer's buffers include those placed in a block
The per-command-buffer dump (`--dump-command-buffers`) kept the buffers
it may dump by their maker's selector, and spelled a buffer in a block
`m2v.newBufferInBlock`, which no record is: the stream's selector is
`m2v.newBufferInBlock:offset:length:options:`. Every buffer in a block was
therefore left out of every dump. The gate's play pair over
glbench-780m-r2's command buffers 58254..58416 (m3-max-52237) dumped 168
(command buffer, buffer) pairs a play where the probe gate, which took
every `m2v.new…Buffer…` maker, dumped 321.

The maker test now takes the selector's prefix, as the player's cost
table does. The host's padded and exported buffers reach it as
`newBufferWithLength:options:` already (`plain`).

Test: replay::tests::a_listed_command_buffer_dumps_every_buffer_it_names_whatever_made_it:
a command buffer binding a plain buffer, a buffer in a block and a host's
padded buffer, and a texture, dumps the three buffers and not the
texture. Before this change the block's buffer had no dump.

Verified by the check named when this lands; the listing of the probe's
and this player's dumped pairs on the gate's range is named with it.
2026-11-19 07:02:13 -08:00
Anees Iqbal 0e9889dfaa replay: the rt backend reads a Private buffer back through a blit into a Shared buffer of the play's own
The new runtime's player backend refused every read of a Private buffer
("a Private buffer": it has no contents). The gate's per-command-buffer
compare (`--dump-command-buffers`, `compare-dumps`) therefore read none of
them on rt: its play pair over glbench-780m-r2's command buffers
58254..58416 on the 3090 (m3-max-52237, development b8ea291aa5) left 41
dumps unread on rt, among them every buffer the probe gate had found
differing, and the compare said DIFFER for that alone. The probe had read
them through a blit of its own that never landed.

NewRuntime::read now copies a Private buffer's bytes with one blit into a
Shared block the play takes for the read and gives back, on a queue of the
play's own made at the first such read, and waits for the copy. The
player reads only after the work that writes the buffer completed. A
length that is not a multiple of 4 stays the copy's own refusal. The
stream's checks never named a Private buffer (a refused read ends a play),
so only the dumps change.

Test: rt_replay::a_private_buffer_reads_back_through_a_copy: a blit fills
a 16-byte Private buffer with 0x5a; the backend's read answers those
bytes. Before this change the read was refused.

Verified by the check named when this lands.
2026-11-19 07:02:13 -08:00
Anees Iqbal 2f4c9fc9dc conformance: a new texture's fresh read is unchecked on metal2vulkan-rt, where Metal is silent
rt answers a new texture with whatever its memory last held. Metal's two texture-making sentences
say nothing of a new texture's contents: MTLDevice.h gives newTextureWithDescriptor: only
"Allocate a new texture with privately owned storage.", and Apple's page only "Creates a new
texture instance.". The page for newBufferWithLength:options: promises zeros ("Creates a buffer
the method clears with zero values."). An Apple M3 Max on macOS 27.0.1 read zero from new Shared
and Managed textures.

What changes:
- A new justification, Justification::NewRuntimeAccepted(slug): an accepted difference of
  docs/API.md that holds on the rt run alone. On the old runtime's run it is
  Unjustified::OldRuntime, which faults nothing, so the old runtime's answers still compare.
- The declaration replay::new_texture_contents(site) leaves the site unchecked under the new
  docs/API.md entry "The new runtime's new textures read what their memory last held". It carries
  the four facts above and the words "silent", never "undefined".
- It is named at the fresh site of every texture row:
  - fresh-texture-* and fresh-chain-*, every storage mode;
  - fresh-pattern-*;
  - texture-round-trip-*;
  - each format-footprints round trip.
- It is not named by any buffer row or texture-over-buffer row: Metal promises those zeros, and
  they stay exact on rt. The written sites and the statuses stay exact on both runtimes. rt writes
  nothing to pass a row.

Why: these rows' fresh sites follow process history on rt. m3-max-52251 (lavapipe, rt) ran plain
development at ed2d2295ce and 391db1e57a and the set at be7ff19f8a:
- 73, 74 and 74 rows divergent, all at fresh sites.
- texture-round-trip-1/12/13/14 are exact each alone in a process and divergent after other cases.
- Which Shared/Managed fresh-texture rows read the released texture's 0xa5 changes from run to
  run, even alone.

Tests:
- a_new_texture_s_fresh_read_is_unchecked_on_the_new_runtime_alone: the bytes are unchecked on rt
  and are the site's one row on the old runtime. A written-site difference stays a row. An
  unknown slug fails the case.
- The fresh rows' allowance test now holds the declaration on every texture and pattern row and
  on no buffer row.
2026-11-19 06:55:22 -08:00
Anees Iqbal b9969c9987 conformance: the rt ledger lists 555 refusals the same on every venue as known gaps
The rt replay's unlisted refusals of nine cases (point-viewport-coverage, the vertex-format
family, integer-vertex-attributes, host-page-writes-visibility-writable) become rows, venue *:
a draw of points (295), a pass with no attachment (248), a visibility result mode (4) and the
FloatRGB9E5 vertex format (8). Each row names the refusal's exact answer, which the ledger key
matches exactly (a_ledger_row_covers_only_the_refusal_it_names), and cites the rt README
sentence that records its gap: Gap::Draw's and Gap::RenderPass's in the known gaps of render
encoders, and FloatRGB9E5's in render pipeline states.

Venue * because every run that ran these cases held each refusal with the same answer: lavapipe
(m3-max-52171, at conf3-abtier) and the RX 7900 XTX, RTX 2080, 780M (m3-max-52173), 780M and
RTX 3090 (m3-max-52172), Iris Xe (m3-max-52174) and RX 550 (m3-max-52305).

Left unlisted in these cases, with no README sentence: newBufferWithBytesNoCopy's read-only
option (host-page-writes-kernel-store-read-only, 2) and SubgroupOperations
(discard-quad-sum-placement, 1).
2026-11-19 06:50:46 -08:00
Anees Iqbal 5c8bc944a6 conformance tests: a ledger row covers only the refusal it names
The planner's condition for listing the rt replay's unlisted refusals as known-gap rows is that a
row names its refusal exactly and nothing else satisfies it. The ledger already keys a row by
case, verdict, site and answer (known_gaps::against), and the_ledger_fails_on_a_new_refusal_and_on_one_that_is_gone
covers a new refusal, a refusal listed as a divergence and a refusal that went away. This test
adds the case it did not: the same site refused for another reason is a new gap (Unlisted), and
the row's own refusal is no longer held (NoLongerHeld), so a listed refusal never stands for a
different one.

Verified: the test runs in the next check job.
2026-11-19 06:50:46 -08:00
Anees Iqbal 905b16b79a command-replay: --gpu-wait-timeout bounds the play's device waits
The replay command took only the 10 s default for every device wait, so a play on a CPU
device (lavapipe) whose command buffer takes longer than 10 s ends with status 86 though
nothing hangs. It now takes --gpu-wait-timeout SECONDS (1..=600) as the other device-executing
commands do, applied before any device opens; a value outside the range is an error line and
status 2. Needed for the CPU-ICD repro of a GPU hang (docs/VALIDATION.md, the suspected-hang
protocol). Verified: clippy and the player build; the lavapipe play that uses it is the check.
2026-11-19 06:46:48 -08:00
Anees Iqbal b74e8387d7 matrix: the UHD 630's sampling_deep_64x64x16 row leaves the status list, within its limit on every leg
Round 391db1e57a reported the entry stale: the row was within its limit on every leg of its card
that timed it. Ruled by the planner on 2026-11-19 with the round's other readings.

Verified: matrix-unit.sh.
2026-11-19 06:45:09 -08:00