every_device_writes_its_lowerings_off_the_creating_thread_and_drops_them_past_its_queue hung on
lavapipe after 7a9458f983 (capover's check m3-max-64386: SLOW past 300 s; it passed at 8bef47758f
in m3-max-64358). The stall made the reaper pop a file and then spin in write_kept, so the queue
could be empty when the test set its bound to the bytes waiting. Since 7a9458f983 an empty queue
takes a file of any size, so the second kernel's lowering was kept, not dropped; the assertion
failed with the writes still stalled, and the device's teardown waited forever on a reaper spinning
in write_kept.
Now the stall is taken where the reaper takes a write: next_write answers none while stalled, the
queue keeps every file handed over, and the test pokes the reaper when it lets them go. The
product path is unchanged (the stall is test-only).
The room rule's paragraph said a run not yet known passes the 16 ms test. It does not:
an unknown run counts as u64::MAX (submit::room, and a group's run saturates), so a queue
whose command buffers have not yet retired with their GPU times has room for two
submissions only, and its third command buffer waits for one seen complete. That is what
the Iris A/B's frame_5cb_from_idle (+4.0%, about 6 us, m3-max-64375) reads as the room
rule's price from idle.
Verified: docs only; the check is fmt, Rustdoc and the API reference.
What: a didModifyRange: capture's copy-in no longer records the copies back owed to the textures
over its ranges in images of their own at the commit. The submission that takes the copy-in takes
them (CopyIn::backs, by the existing rule for submitted writes, ManagedOvers::backs_before) into the
upload that leads it, ahead of the copy-in. A command buffer that would take a copy-in over a
Managed buffer, a texture over which a command buffer of its queue's group held wrote, leads its
own group (Captured::names_written), so the write is submitted, and owes its copy back, first. The
split fires only then: a group held that holds a write of a texture over a Managed buffer's device
copy, and a later command buffer joining it that takes a copy-in captured after the group's last
lead over that same buffer.
Why: Metal's device copy keeps a GPU write outside a didModifyRange:'s range, and a command buffer
committed after the capture reads that write and the range's new bytes (MTLBuffer.h). The copy-in
copies the texture's whole range from the device copy into its image, so a write that runs before
it must be copied back first. Taken at the commit, only writes already submitted were copied back:
a write committed before the capture and still held (in its queue's group held, or held for room)
ran before the copy-in and was overwritten. Which writes run before the copy-in is known only as the
submission that takes it goes: a write of another queue not yet submitted runs after it, and taking
its copy back at the commit (the commit-time form) would copy an image never filled over the device
copy and drop the write's own copy back.
How verified: before, at d910296ac6 on the RTX 5080 (job m3-max-64324), both forms of
over_write_before_a_capture failed: R read the buffer's old bytes outside the named row, the new
bytes in it, with two copies, an image of its own, its buffer's entry owing it, and W not yet
submitted as R's commit took the capture. A third arm,
every_device_keeps_a_managed_texture_over_s_write_held_behind_a_passing_capture, runs the copy-in
ahead of the write (B1 passing A's group held with A3 the writer) and checks B1's read, A4's and the
buffer's after. The after-runs are in the lane's report by job id. The capture tests now read W's
submission state before R's commit, which takes the capture: W's group may now go as R is staged.
What: over_write_before_a_capture, in two forms. Behind the busy gate, W copies a pattern into a
texture over a Managed buffer in an image of its own and is held (in the queue's group held, or held
for room behind UNSEEN_JOINS joins); then the consumer writes and names the texture's last row and
R, committed after on the same queue, takes the capture and reads the whole texture. R must read
W's pattern outside the named row and, with two copies, the consumer's bytes in it. The test prints
the path: two copies, an image of its own, owed by its buffer's entry, W held for room, the
queue's submissions in flight and group held as R commits, and W not yet submitted as R's commit
took the capture.
Why: Metal's device copy keeps a GPU write outside a didModifyRange:'s range, and the range's new
bytes reach a command buffer committed after it (MTLBuffer.h). Read from the code: the capture's
copy-in takes only the copies back of submitted writes (ManagedOvers::backs_before), then copies the
texture's whole range from the device copy into its image, so a write committed before the capture
and not yet submitted is overwritten once it runs.
How verified: its run on the RTX 5080 at this commit is in the lane's report, by job id.
What: section 10's Draws entry on a filled primitive past a viewport edge that crosses a pixel. It
said a Vulkan device covers such a pixel where its sample lies in the clipped primitive; it now says
what was measured: RADV (RX 7900 XTX, two Radeon 780Ms, RX 550) and NVIDIA's driver (RTX 3090,
RTX 2080, RTX 5080) cover every pixel the viewport overlaps, as Metal on the M3 Max does; lavapipe
covers such a pixel only where its sample lies in the clipped primitive; the Iris Xe (ANV) covers
every pixel the near edges cross and none the far edges cross, the accepted difference where that
pixel's sample is outside or on the edge and a driver bug (the runtime README's known gap) where it
is inside.
Why: the entry claimed more than was measured; seven GPUs show no difference at all.
How verified: replays of fractional-viewport-coverage through the runtime, each differing pixel
printed against Metal's recording: m3-max-64279 (XTX), 64288 (780M 1002:15bf), 64280 (780M
1002:1900), 64323 (RX 550), 64286 (3090), 64287 (2080), 64282 (5080): 0 differing pixels;
m3-max-64281 (Iris Xe): 120 pixels, all far columns and rows; lavapipe's 344 elements from its
ledger row. The entry's bold lead-in (the allowance slug) is unchanged.
What: the reaper's write queue (cache::Pending) refused any lowering that would take it past
PENDING_BYTES (8 MiB), even when it was empty, so a single lowering larger than 8 MiB was never
written to the cache directory and every later device lowered it again. An empty queue now takes a
file of any size; one larger than the bound waits alone, and the next is dropped until it is taken.
Why: the consumer's cold launch of a modelling app (Radeon 780M) remade its pipelines after the
fills and translated again for exactly the three heaviest kernels (661, 934 and 1114 ms, weights
742,949, 628,489 and 489,281), while the five lighter ones hit in 12 to 30 ms. A cache that drops
its heaviest entries drops the ones that cost the most to make again. Memory stays bounded: the
queue holds 8 MiB of lowerings or one larger lowering, bytes already in memory before the push.
Verified: the queue's unit test gains an empty-queue push of a file past the bound (kept), a push
behind it (dropped) and room again after the pop; it fails without the change by construction (the
old check refused any push past the bound). Docs: the module doc, PENDING_BYTES, keep_translation,
Metrics::cache_writes_dropped and the README's cache paragraph say the same.
What: one row of known-gaps-rt.tsv, fractional-viewport-coverage on the Iris Xe at case/drawn/texels
(480 elements differ (F32), the largest difference 12), and docs/CONFORMANCE-COVERAGE.md re-derived
(the ledger's row count and the case's gap list).
Why: the case postdates the last round's replays, so no GPU venue had replayed it, and the next round
holds every GPU venue to the ledger. The Iris site mixes two causes, so the one row splits them by pixel:
- 240 elements, 60 pixels (the far column and row of the arms ending 0.7 into a pixel): each centre lies
inside the viewport and is undrawn, ANV's truncated scissor far edge (Mesa update_scissors), a driver
bug, the runtime README's known gap of render encoders; not an accepted difference.
- 240 elements, 60 pixels (the far column and row of the arms ending 0.25 into a pixel and on a pixel
centre): each centre lies outside the viewport or on its far edge, the accepted difference of
docs/API.md section 10 (Draws).
The Iris draws every arm's near partial column and row, as Metal does.
How verified: both cases replayed through the runtime on each GPU venue the round replays, with a probe
(never landed) that printed every differing pixel against Metal's recording, built at 8dc5ebbe9f
(development 0b73ac76e5 plus the probe bin), m3-max-64275:
- Iris Xe (ms01) m3-max-64281: fractional divergent as above; lines-fill-past-the-viewport announced
(equal to Metal under its notice).
- RX 7900 XTX m3-max-64279, 780M HawkPoint m3-max-64280, 780M Phoenix m3-max-64288, RX 550
m3-max-64323, RTX 3090 m3-max-64286, RTX 2080 m3-max-64287, RTX 5080 m3-max-64282: both cases
announced, 0 differing pixels; no row.
With held work going only by room (3f2be1ea4d), the test that a parked completed handler
let IN_FLIGHT + 2 later command buffers all submit asserted the removed busy flag's
behaviour: past the room, the later ones now wait for the handler to return, which
every_device_holds_work_for_room_while_a_completed_handler_runs asserts. The test now
commits two later command buffers, each once the one before it went, and asserts each is
submitted while the handler is parked (a queue with fewer than two in flight has room),
none completes before it returns, and all complete in order after.
Verified: m3-max-64303 (lavapipe) failed this test at 3f2be1ea4d's tip (60 s within at
command.rs:191); the rebased tip's check follows.
The XTX sized A at 26, 28 and 44 fills in arms of one job (m3-max-64241, 64283): the three
single fills that size it ran at the clock an idle GPU starts at in some arms. A warm-up of 256
fills now runs first on the sizing queue, and the least of five fills sizes A.
Each part also times A's GPU time a command buffer, from its first's start to its last's end
over their count (a_per_cb, wait_a_per_cb): the planner's "A's whole backlog drained" check
compares it between arms.
The completion thread set Done::busy and then woke the submit thread (complete.rs, at each
round), and a pass that read busy held nothing: every held group and every command buffer held
for room went to the VkQueue at once. The wake that announces a completion is sent right after
busy is set, so whether room held was a race between a round's length and a thread wake: on the
3090 it mostly held, on the Iris and on the XTX's short arm the backlog flooded past room (A/B
jobs m3-max-64198, 64241: B's p90 two to three of A's command buffers).
The planner's ruling (A): busy goes. Done::busy, its two stores, the read in pass and the
parameter through next_ready, waits_for_room, hold's callers, step, Fifo::goes and unheld are
deleted; held work goes when a completion leaves room, at teardown, or on a send-through (a host
wait, send_now, a fence's updater). `completed` is still raised before the submit thread's mark
is read, so a completion is never missed. While a round runs it sees no completion, so held work
waits for the round's end: a completed handler or listener longer than the work in flight
leaves the GPU idle for the rest, where Metal would go on. The README records that known gap
beside the scheduled-handler one and drops "a slow completed handler holds no later
submission".
Test: every_device_holds_work_for_room_while_a_completed_handler_runs parks the completion
thread in a completed handler, commits three on a queue with room for two, and finds the third
held in a group, two submissions sent, once a later commit on another queue is scheduled. With
busy it went at once (3 in flight). The waits for !busy in the two_queues and behind_busy
helpers and the upload test's trace are gone with it.
A's GPU idle before each of its command buffers was the gap from the end of the one before,
and B's small command buffers that ran in that gap counted as idle. With the room rule B lands
between A's (A keeps two on the VkQueue, not its whole backlog), so the gap grew by B's runs on
the new arm alone: 62-65 us against 22-26 us on the 3090, 77-131 against 23-24 on the XTX (jobs
m3-max-64240, 64241). The idle is now the gap less the parts of B's runs within it.
The signalled part had B commit every 16.7 ms a waiter on A's last committed count. Each of
those waited for A's whole backlog, so B kept about nine uncompleted and B's own queue held
its later waiters: they reached the GPU behind more of A's work, on the old arm and the new
alike (the 3090 OLD read 20 ms at p50 in two of three arms, the Iris NEW in one of three; jobs
m3-max-64199, 64198). That measured B's depth, not the signal's path.
Now, as the consumer's writer and its waiter do, A's thread commits on B, right after each of
A's command buffers (its fills, then the signal at its tail), a waiter on that signal; the main
thread only lets it run as long as the first part's frames. Both parts also time A's GPU idle
before each of its command buffers, from the end of the one before (a_gap_p50, a_gap_p90;
wait_a_gap_p50, wait_a_gap_p90): where room arrives later than the GPU needs it, that idle
grows.
The authored compile census re-blessed. Its 290 differences against the old table are the texture-buffer work
landing since the last bless: 230 cells now compile (texture-buffer cases the translator and the runtime now
make), and 60 refusals changed their requirement lists (texture_buffer dropped where the case still refuses
for another requirement, ulong_texture_atomic among them). failed 0, regressions 0.
Verified: census job m3-max-64248 on the M3 at 80b54178df (2376 cases x 10 profiles = 23760 cells; compiles
18740, compiled 17689, refused 6071, failed 0, differences 290, regressions 0). No translator, AIR or
validation source changed between 80b54178df and this commit's parent 0b73ac76e5, so the table holds here.
The texture over a buffer in an image of its own that two queues read is made over a Shared buffer
too (a pitch a texel past its row, which no device's linear image lays): the Shared rules copy it in
for each submission's own commands, so B1, passing A3's group held, reads the buffer's bytes as A3
does. The setup helper makes either kind and prints which.
What: the known gap of NVIDIA's driver's execute cost says its figures ran on one card, an RTX
3090 (620.70.06), that the harness frame's microseconds are its own draws' and not a guest
frame's, and that on a Radeon RX 7900 XTX (RADV) a guest's frame of that shape at a held camera
pose took 4.305 ms of GPU time with its executions against 4.372 ms with the same draws direct,
the executions 1.5% under, so the driver's execute cost is measured on NVIDIA's driver alone.
Why: the gap's scope, as the planner ruled it: rung 4 for the driver's share, its shares kept as
the harness's microseconds (the driver's 539.0 of the 720.9 us gap; the splits about 117 to 128
and the empty parts about 54 to 65), and no percent of a guest frame, since the harness frame's
gap is larger than a guest frame's whole gap and the two do not map one to one.
Verified: README only; the harness figures are job m3-max-64194's (unchanged); the XTX figures
are the consumer's two walks at the held pose, jobs m3-max-64076 (executions) and m3-max-64084
(direct), each a separate run. Docs check: fmt and workspace Rustdoc -D warnings (job below).
two_queues takes whether A holds a group and how many command buffers it holds for room since
0a35c20f4b; the passing pair's A holds A3 in a group and A4 and A5 for room.
A texture over a Managed buffer's device copy in an image of its own owes a copy in at its making
and after submitted device work wrote the buffer (ManagedOvers). That copy was taken as a command
buffer that reads the texture was staged into its queue's group, and the copy rode the group. A
command buffer of another queue committed later could be sent before that group (it passes a
group held), find no copy owed and read the image before the copy ran: on an RTX 5080 B1 read
zeros where the buffer held its bytes (job m3-max-64193; before rule R too, at fbaa5bb777, job
m3-max-64213). Metal's contract: a command buffer committed after the bytes were named and
committed reads them.
Now the copy is taken as a group goes (WorkState::close), for each command buffer of it with
commands that keeps the texture: the device's one VkQueue runs submissions in the order they go,
so the first submission that reads the texture makes the copy, of whichever queue, and nothing
later owes one. Where nothing passes, the one copy is made as before.
Taking the copy at the send would let a capture of a didModifyRange over the texture, committed
between a reader's staging and its send, swallow the copy that reader still needs, as it already
did for a reader held for room: the capture copies the texture in only ahead of the command
buffers numbered at or after it. So the capture no longer clears the owed copy; it records its
commit number on the entry, and a reader numbered at or after it takes none (the capture's copy
runs ahead of it), while one numbered before it takes its own. Device work's later write clears
the number with the copy it owes again.
Two device tests behind the busy gate on one queue: R reads a texture over a Managed buffer in an
image of its own whose first copy in its making owes; the consumer then writes and names the
texture's last row, and C, committed after on the same queue, takes that capture and reads the
texture. R runs before the capture's copy in and must read the buffer's bytes outside the named row
(Metal leaves the named row undefined for it); C must read the new bytes. R is either in the
queue's group held or, behind four command buffers that join that group first, held for room.
The passing pair (two_queues) now prints and asserts A's submissions in flight and group held as B1
commits, and the shared setup (the Managed buffer, its capture and the texture over it) is one
helper that asserts and prints the texture's form.
Two device tests on qroom's two-queue kit: a texture over a Managed buffer in an image of its own
(a pitch a texel past its row, which no device's linear image lays), made once the buffer's named
bytes were captured, is read by A3 (in A's group held) or A4 (held for room), the first of queue
A's to read it, and by B1 of queue B, committed after and run before it. Both must read the buffer's
bytes. On a device with two copies the texture's first copy in is owed by its buffer's entry
(ManagedOvers); each test prints the form, the run order and what each reader read.
What: the known gaps of indirect command buffers gain the RTX 3090's measured costs of an
execution over a range a buffer holds: the driver's own execute cost (a new gap), the split's
cost (about 11 us of GPU time an execution) and a part with count 0 (about 10 us a part).
Why: an execution over a GPU-written range cost more GPU time a frame than the same draws direct
on an RTX 3090. Measured apart, three quarters of that is inside the driver's
vkCmdExecuteGeneratedCommandsEXT, which no form of ours changes (the workaround ladder's rung 4);
the rest is the split around the count kernel and the parts the count leaves empty.
Verified: a probe row (never lands, steelbrain/icbperf-probe 3ad97ab2bd on fbaa5bb777, compile
job m3-max-64187) times a frame of 11 executions over ranges a buffer holds in 6 passes
(buffers of 8,162, 785 and 289 commands, 2,132 commands in range) against the same draws direct,
on an RTX 3090 (NVIDIA 620.70.06, um870, Thunderbolt 3 link, validation layer off), job
m3-max-64194: 6 arms alternating over 9 rounds, each turn at least 300 ms (204 to 334 frames),
every turn at P0 with the SM at 1950 MHz and the memory at 9751 MHz, every image matching its
reference. GPU us a frame, medians of 9 turns: direct 386.0; the runtime's form 1106.9; one
part an execution 1041.7; counts written as the command buffer records, no split 978.9; both
925.0; explicit preprocess 263.9 + executes 592.9 (1080.4 in all). Counts a frame: 11
executions, 11 count kernel dispatches, 11 splits, 17 parts (6 with count 0), 25,305,344
preprocess bytes, against 2,132 draws direct.
Scheduled handlers run on the device's one submit thread, so every queue's later submissions
wait while one runs, held groups and command buffers held for room included. A handler that
blocks outside the runtime (the runtime's own waits are refused in it) until such a command
buffer completes therefore never returns, where Metal runs it on a thread of its own. The gap
predates the room rule (any group held behind full in-flight work); signals now waiting for room
widen what can be held, which is how the event-chain test's parked handler hung at 0a35c20f4b
(job m3-max-64168). The README said "the queue's later submissions"; it is every queue's.
Docs only.
The lavapipe rt suite at 0a35c20f4b (job m3-max-64168) hung two tests that held the old rule,
a signal always staged at once:
- The shared-event chain parks the submit thread in a scheduled handler after its links are
committed; its third link on one queue, behind two links of unknown run, now waits for room
and could not go while the thread was parked. Each queue's expected run is now set to 1 ms,
so each has room for its links, and the test's own claims (every link submitted and Scheduled
before the first runs, none held for a value, the links in order) hold as before.
- The three-deep signal test asserted that a held group never keeps back a signal. It now
asserts the rule: the signal waits for room with the group, Scheduled, its waiter on another
queue Committed, nothing more submitted before the busy work ends; then all three go and the
waiter ends after the signaller, held once for its value. Renamed for what it now shows.
A segment that signals an event sends its group at once, so a command buffer that signals
went to the VkQueue whenever no group was held, or when the group held would take it: a queue
whose every command buffer signals kept all of it on the VkQueue, and another queue's later
work could not pass it. The lavapipe run of the harness's two-queue row showed it: with each of
A's command buffers signalling, 0 held for room (job m3-max-64136).
Now a head that signals in any segment waits unstaged for room (WorkState::waits_for_room):
with no group held, until its queue has room for it; behind a group held, though the group
would take it. Its signal is staged only then, and as a waiter takes a staged signal as
submitted, a wait for it waits with it: no waiter is submitted ahead of its signal. Covered:
work then a signal at the tail (one segment), a wait at the head (no split: command.rs
Building::wait splits only a segment with commands or signals), and a signal after a wait that
follows work (a later segment). A partly staged command buffer's later signal still goes at
once: one command buffer at most. The fence's held-updater scan no longer needs the other queue
to hold a group, and the completion wake stays on while a queue's head is held for room.
Tests: A's every command buffer signals at its tail (work, then the signal), or after a wait
that follows its work; B1 runs after A1 and A2 as behind unsignalled work, A3 to A5 held for
room. The two_queues helper takes whether A holds a group and how many it holds for room.
Its order of A1 to A5 then B1 held on the base before the room rule (5ccd158e6d + the tests,
job m3-max-64094), where every signal went to the VkQueue at once; there only A's held count
failed. Its doc now says so, and names the two-queue and fence tests as the ones that carry the
rule's own order, so nobody reads it as that proof.
Comment only.
What: a public RefusalBasis (MetalDocumented, MetalMeasured, Ours, Device) and Error::basis, which
answers Refused, Limit and Unsupported from the variant's own basis, BelowFloor and
NoDirectDriverLoading as Device, and None for Translation, the platform's and Vulkan's failures and
the consumer's own block, stage or quiesce. Refusal::basis, Limit::basis and Gap::basis live in
crates/metal2vulkan-runtime/src/error/basis.rs, which scripts/refusal-surface/refusal_surface.py
writes from the `Basis:` line each variant's doc comment ends with: 131 arms (Refusal 82, Limit 17,
Gap 32), one per variant in declaration order, no `_` arm. The doc comment stays the one source.
Why: a consumer's census of the refusals its guests meet could only match names, so 67 refusals
whose basis is ours counted as "Metal refuses it". A typed basis tells them apart.
How: the script enumerates the enums structurally (rt_refusal_enums), reads each variant's pattern
(`Name`, `Name(..)`, `Name { .. }`) with enum_arms, and maps the basis value to the RefusalBasis
variant it names. It fails where the enum has no such variant (metal-takes and unknown have none:
the value comes with the first variant that needs it) and where a name is too long for rustfmt to
keep its arm's pattern on one line. It writes the file as `cargo fmt` leaves it (one line per arm,
else rustfmt's block form past 100 columns), so no rustfmt run is needed. `--check` fails where
basis.rs is stale, as for docs/REFUSALS.md, and one run regenerates both. `--selftest` gains three
cases: the arms and the block form, two Basis lines give two files, a missing value fails.
Verified: refusal_surface.py --check and --selftest, signatures.py --check and cargo fmt --check
pass on this tree. The generated forms were checked against rustfmt at five name widths and three
variant shapes. The compile job and the lavapipe rt suite are named in the lane report. Without
the change, the new tests do not build: RefusalBasis is unresolved and `basis` is not found.
Queue A keeps 8 command buffers uncompleted from a thread of its own, each sized by fills of a
256 MiB Private buffer to about 20 ms on the GPU (one fill's run, the least of three on a queue
of its own); queue B commits 60, one every 16.7 ms, each one 4 KiB fill. Unrelated, B's
commit-to-completed p50, p90 and most, and A's GPU run, are its times (b_p50, b_p90, b_max,
a_run). With each of A's signalling a shared event with its count and each of B's waiting first
for A's last committed, the GPU start of B's after its signaller's GPU end at p50 and p90
(wait_p50, wait_p90). Both parts print Metrics::held_for_room's growth. Every command buffer is
to complete and each waiter to end after its signaller, or the row fails; the harness's rt test
runs it on the cfg's device.
It measures the room rule's landing rows: B's wait behind A's work in flight, and that a waiter
on a signal held for room starts no later after its signaller.
A wait for an event's value is met once a signal of it is submitted (staged); a signal its
queue holds for room is not yet staged, so its waiter reads Committed for as long as the
signaller's queue takes to reach it. The Scheduled doc, newSharedEvent's and docs/API.md's
accepted difference now say so: within the M3 Max's own hold, which keeps a shared-event
waiter at Committed until the value lands.
The README's 2019 MacBook Pro sentence now states what job 64081 showed and no more: on the
Radeon Pro 5300M an unrelated read of a second process completed 0.99 to 1.97 ms after its
commit beside about 160 ms of another process's submitted work; a dependent read completed
after its writer and 19.06 to 19.26 ms before the first of 4 command buffers committed after
the write (committed, not shown submitted); the UHD 630 ran both processes first in, first
out in all 18 rounds, so its reader-after-writer is not told apart from that order.
Docs only.
A send-through (send_now, a host wait, a fence's updater) that reached past a full group's
held-for-room command buffers sent the first of them alone, then the next: each now opened a
group of its own that the send-through sent at once, where with room they had joined one group.
A group now goes on a send-through only once no held command buffer is behind it; the next
step takes that one, held ones always ready, or sends the group first where it does not fit.
Found by the lavapipe rt suite (job m3-max-64092): the unseen-joins test sent three groups
for two (6 against 5).
Recorded by the consumer on a 2019 MacBook Pro (job 64081): the
Radeon Pro 5300M completed a second process's read of a shared surface
0.7 to 0.8 ms after the writer, behind its whole backlog, then passed the
writer's later work; the UHD 630 ran first in, first out. The room rule
follows the 5300M's order.
A queue sends a group only while it has room (submit::room): with fewer
than two submissions not seen complete always, and with fewer than
IN_FLIGHT while the expected runs behind the oldest, the group's with
them, stay within GROUP_RUN (16 ms). Without room, a command buffer the
held group does not take (by GROUP_RUN, UNSEEN_JOINS or GROUP) waits in
its queue's list, not staged, with the queue's later commits behind it;
the submit thread skips that queue and other queues' later commits go on.
Each held command buffer is scheduled as it would be in a group, in
commit order once its waits are met, its scheduled handlers run: only
its vkQueueSubmit2 waits for room (WorkState::hold). One that presents a
drawable, has nothing for the GPU, or ended sends its queue through to it,
as its group would go at once. Everything that sent a group still sends
it: a signal as staged, a host wait or send_now, stop, a busy completion
thread, an empty command buffer, a conflict with a texture copy.
A group no longer goes at its sixteenth command buffer: the seventeenth
finds it full and waits for room. A queue whose expected run is not yet
known has room for two.
Fences: a wait on another queue also goes after an update in a command
buffer held for room there, scheduled before the waiter was; that queue
goes through to it first. A held head with no group is staged before any
other command buffer, the earliest held first, so the order of holds is
the order fences read.
abandon ends the queue's command buffers not yet scheduled in place, in
the queue's order behind those held for room, which go at once.
Metrics::held_for_room counts the command buffers scheduled while held
for room (api_signatures row).
Why: one queue's backlog no longer delays another queue's command buffer
by more than about GROUP_RUN of that queue's expected GPU time.
The known-gaps bullet and Gap::StorageElement's doc name the undeclared argument-buffer or
resource-ID write to a texture buffer whose format's buffer features lack the formatless write
bit as outside Vulkan's valid usage (VUID-vkCmdDispatch-OpTypeImage-07029), beside the image
precedent for the undeclared formatless read: the atomic's R32ui class and the formatless class
are one storage texel-buffer element (pipeline/link.rs identity_set, binding 6 for every class of
the type; rt arrays.rs STORAGE_TEXELS_BINDING).
A slot a texture atomic updates is declared R32ui or R32i (atomic_format), so its accesses need
none of VK_FORMAT_FEATURE_2_STORAGE_{READ,WRITE}_WITHOUT_FORMAT_BIT (VUID-vkCmdDispatch-
OpTypeImage-07027 to -07030 ask them only of an access declared without a format). The runtime
asked them of every storage slot: TextureSlot folds an atomic into read and write, so pipeline.rs
counted the atomic as a formatless read, and a texture buffer had a storage element only where its
format's buffer features hold the formatless write bit. On the Windows UHD 630 (driver 101.2145,
job m3-max-64024: R32_UINT's buffer features hold STORAGE_TEXEL_BUFFER and its atomic, and no
format's hold either formatless bit) the texture-buffer atomic test was Gap::StorageElement at
slot 0 (jobs m3-max-63951, m3-max-64074) though the device runs it. The image side has the same
count in code: an R32Uint texture's atomic was refused wherever R32_UINT's optimal tiling lacks
the formatless read bit, which Vulkan leaves to a device without
shaderStorageImageReadWithoutFormat (no device in the cluster lacks it).
- TextureSlot::declared_format: the slot's storage image is declared with a format (from its
declaration). ARTIFACT_FORMAT_VERSION 590 for the codec field; no SPIR-V changes.
- The runtime checks a format's formatless bits only at slots declared without a format
(Interface/Draws `formatless`), for compute and render alike. A written texture buffer's
storage element is made wherever its format holds the storage texel buffer, and a formatless
write of one whose format lacks the write bit is refused (unwritten()), at its slot and after a
use_resource write declaration.
- Tests: DeviceOptions gains a device-test hook, `described`, an edit of the translator's
description before Device::from_queries (the Vulkan device is the same). The texture-buffer
atomic test runs on each device's own answers and as a device with no formatless texel-buffer
bit (the UHD's answer); a new 1D R32Uint texture atomic test runs on its own answers and as a
device without shaderStorageImageReadWithoutFormat and without R32_UINT's optimal read bit.
Both edited runs refuse before the fix.
- Gap::StorageElement's doc and the runtime README say what holds now: a texture buffer at an
atomic's slot runs on the UHD 630; an undeclared resource-ID write to a texture buffer whose
format lacks the formatless write bit is outside Vulkan's valid usage, as such a read already was.
On the Iris Xe (ANV, Mesa 26.2.6) a viewport whose far edge lies inside a pixel loses that row or
column even where its pixel centre is inside the viewport. Metal draws it: the conformance case
fractional-viewport-coverage, recorded on the M3 (m3-max-64012).
The cause is ANV's own scissor. update_scissors in src/intel/vulkan/genX_gfx_state.c (lines
2164-2169, the same in mesa-26.2.4 and mesa-26.2.6) clamps the hardware scissor to the viewport
and stores the far edge as an integer, MAX2(vp->y, vp->y + vp->height) - 1, truncated. A far edge
at 7.7 keeps rows through 6, so row 7 is not drawn, though its centre 7.5 is inside. That is the
row the old raster test lost on the Iris: its viewport ran from y -0.3 to 7.7 (m3-max-63429,
round ce998742d7).
The planner's ruling: rung 1 has no form and rung 2 no query, so rung 3 (a minimal Vulkan repro
and a report draft, staged outside the tree for the owner to file) and rung 4, this line. The
conformance case's Iris row is added when the next round's replay writes it. The Windows UHD 630
is not named until its own replay row shows the cut. The partial-pixel coverage where the centre
is outside the viewport is a separate accepted difference (docs/API.md) and is not mixed in.
Verified: cargo fmt; the entry adds no link and touches no README section a test reads (the
floor test reads "## Floor" alone).
Two reds of the Windows UHD 630 leg at the pin 5ccd158e6d (job m3-max-63951).
Texture buffers. vulkaninfo on that device (job m3-max-64024, Intel UHD Graphics 630,
driver 101.2145, Vulkan 1.3.215): shaderStorageImageReadWithoutFormat false,
shaderStorageImageWriteWithoutFormat true; R32_UINT's bufferFeatures hold UNIFORM_TEXEL_BUFFER,
STORAGE_TEXEL_BUFFER, STORAGE_TEXEL_BUFFER_ATOMIC and VERTEX_BUFFER, and no format's buffer
features hold STORAGE_READ_WITHOUT_FORMAT or STORAGE_WRITE_WITHOUT_FORMAT (the spec requires
them of image formats only). The read-and-write test's written slot is declared without a
format, so its write needs the buffer write bit (VUID-vkCmdDispatch-OpTypeImage-07029): the
runtime's Gap::StorageElement there is right, and the test expected success on every device.
It now reads R32_UINT's buffer features and expects the refusal at slot 1 exactly where they
lack the bit, success elsewhere. Gap::StorageElement's doc and the runtime README's known gaps
name texture buffers written or read through access::read_write; docs/REFUSALS.md regenerated
(unchanged).
Ring. ring.rs's chunks() is a try_lock that asserts the ring's lock is free. Under
MakerTest::Fail each take that leaves fewer than a block's chunks free asks the block-maker
thread, whose answer (Ring::unasked) takes the ring's lock on its own thread whenever the
host's scheduler runs it; the test read chunks() right after such takes. The test now awaits
the block-maker thread's answers (pool.await_internals) before each read, as the other ring
test already does.
The planner's ruling on Metal's recorded answer (fractional-viewport-coverage, m3-max-64012):
MTLRenderCommandEncoder.h's setViewport: states only that fragments outside the viewport are clipped,
not which a pixel the viewport's edge crosses is; the M3 covers every pixel the viewport overlaps, a
partly held pixel included, and a Vulkan device covers a pixel where its sample lies in the clipped
primitive. Rule 1 does not emulate what Metal leaves unstated, and a static note would be decided by a
viewport's value at the draw, so docs/API.md's Draws list gains the entry beside the point's and the
lavapipe row's reason becomes it. The GPU venues' rows come with the next round's replays.
Metal on the M3 covers every pixel a viewport overlaps for a draw that reaches past it, a pixel the
viewport holds only part of included; the runtime clips at the Vulkan viewport's own edges and
lavapipe covers only pixels whose centres the clipped primitive holds (344 F32 elements, largest
difference 11.25; replay m3-max-64022 at 44c96aa50c). The row names the open bug, which waits on a
ruling: an accepted difference beside a point's, or a clip band past the viewport with a scissor at
its pixel-rounded rectangle. The coverage document is regenerated.
Recorded on the M3 (macOS 27.0.1) by job m3-max-64012 at d55df02bcf: `conformance record` and
`conformance times --runs 8 --write` for the two cases (record-exit 0, times-exit 0, 2 cases carry
their timing). The coverage document is regenerated.
What: the recorded texels split by as_chunks (clippy chunks_exact_to_as_chunks); the cover
rectangle corners are held by their signs rather than a constant assertion
(assertions_on_constants).
Why: clippy -D warnings, all three configurations, on 84d9b840d9 (job m3-max-63978).
What: KEPT_BAND moves into the tests module; the two docs that linked it name the band in words.
Why: the lib build read it as dead code (clippy -D warnings, job m3-max-63964 on 9cddd2e673).
What: one module, cases/viewport_cuts.rs, of two cases. Each is one pass into an RGBA32Float
target cleared to -7.5, every draw its own colour (tob_renders: tob_rect, tob_triangle,
tob_solid), the whole target read back.
- fractional-viewport-coverage: a filled draw over four viewports whose edges lie inside a
pixel, each in a 12-pixel cell of a 48 by 24 target: far edges .7 into a pixel from an edge on
a pixel boundary; .3 and .7; .75 and .25 (near and far pixel each a quarter inside, neither
centre held); both edges on a pixel centre. Each viewport is drawn twice: a rectangle reaching
to clip 1.25 (inside the 1.5 w band point-viewport-coverage found Metal keeping points in) and
a triangle reaching to clip 6 (past it).
- lines-fill-past-the-viewport: setTriangleFillMode Lines, three triangles each through an
integer 8 by 8 viewport in a 16-pixel cell of a 48 by 16 target: one corner inside and two past
the right and bottom edges, inside the 1.5 w band; the same shape past the band; and a triangle
the viewport lies wholly inside, every edge more than a pixel outside it.
Why: a fractional viewport's far row or column, whose pixel centre lies inside, is cut on one
Vulkan driver, and a triangle under the Lines fill mode larger than its viewport has no Metal
recording. Both need Metal's own answer before anything is ruled. The M3's next recording batch
records them; until then the replay reports each as "no recording" and nothing is ledgered.
Tests (no device): every viewport lies in its own cell with unreached pixels around it; each
arm's near and far pixel lies against its viewport as its docs say; the geometry reaches past the
viewport inside and past the band; every colour is its own; the line triangles cross or surround
their viewport; every line edge passes at least 1/16 pixel from every pixel centre and diamond
corner of the target. Once recorded, Metal's target is held to what every viewport rule gives
(a pixel held whole is drawn, a pixel not reached is the clear), never to one rule.
docs/CONFORMANCE-COVERAGE.md regenerated (case modules 181).
The authored-case requirements section still said a bound texture buffer carries texture_buffer, which
the runtime does not make. Texture buffers (817463704e) are made by the runtime, and ed4f8976a5 retired
the texture_buffer and texture_buffer_member requirements; 49eebb4d7f made the census compile the
argument-buffer member. Doc only; found by lane censustb.
The authored compile census failed one case, 2631f2da (the public fragment
case reading abt_frag_texel_buffer's texture_buffer member), on every
profile with "argument-buffer texture 2 is a texture buffer, which no heap
array holds" (census job m3-max-63908 at d274b0b474). Since ed4f8976a5
retired texture_buffer_member, the case is no longer refused by a
requirement; a run draws it through the runtime
(runs_render_through_runtime), which makes texture buffers, and the Metal
oracle's observation of it is committed. Only the census still reached the
executor's own bind state: case_compile builds its request's bind shape
with graphics::render_shape -> bind_state -> argument_buffers::used_texture
(argument_buffers.rs:279-283), which refused a texture buffer untyped.
The member is now what Metal's useResource makes resident: a used texture of
Metal's TextureBuffer type and its pixel format
(resources::texture_facts, which bound_texture now uses for image
textures), with its resource id. The translator already plans such a used
resource: bind::heap's members make no heap member of a texture buffer
(heap.rs:931-934), and under the identity domains the census compiles for
(DevicePolicy::default, the runtime's) a texture-buffer member is a set-1
texel-buffer element (817463704e). The executor's own context still
refuses a case holding one, typed, before it binds
(own_context_refuses_members), since its resident-table heap holds no such
member; its docs now say why there rather than in used_texture.
No version moves: ENGINE_EXECUTOR_ABI's rule exempts a change no recorded
row can observe. The runtime route builds no bind state, the own context
refuses the case before binding, and the census never caches a failed
cell, so no recorded row or cached cell held this shape. The case's census
cells change from failed to what the compile gives when main blesses.
Tests: argument_buffer_members_are_written_into_their_owner asserts the
texture buffer member's used texture (type, format, token, resource id)
and that compute_shape plans it (it asserted the refusal before);
the_census_compiles_a_texture_buffer_an_argument_buffer_holds compiles
every committed case holding one through compile_case on lavapipe under
the identity domains, expecting one compiled cell each (the failed cell
before).
What moved, each from a commit since the pin 5a04298008, none blessed in its change:
- golden_hashes.tsv (100 lines) and public_fixture_expectations_engine.tsv (6 cells, runtime-floor
Unsupported{ArgumentBufferTextures} -> ok: rlm_member_texture_buffer and abt_descriptor_sets' texel-buffer
entries): texture buffers (817463704e) and the runtime-floor profile's texel-buffer features.
Bless job m3-max-63907 on the M3 at d274b0b474 (inventory=0 golden=0 printouts=0).
- opened_chains.txt, 22 contexts: 20 from 3d841759a8 (the engine contexts no longer enable
VK_EXT_device_generated_commands; each of the ten profiles listing it loses one member and one
extension), 2 runtime-floor contexts from 817463704e (four texel-buffer descriptor-indexing members).
Job m3-max-63909 (bless_opened_chains) at d274b0b474.
- the_old_render_descriptor_key_keeps_its_value: 78157ab4... -> 8f9bcf94..., the value job m3-max-63918
printed at 3a6d244ae2; the device key moves with the runtime floor's texel-buffer features.
Not here: the authored compile census. At d274b0b474 (m3-max-63908) it has one case failing on every
profile (the validation executor's argument-buffer encoder refuses a texture-buffer member untyped since
ed4f8976a5 retired texture_buffer_member), so it writes nothing; its fix and re-bless follow.
The row now asserts an absolute bound at both reads (881f559999), not that
its gauges stay flat between them; the module doc said flat.
Verified: rides the compile job of 881f559999's stack.
releases_under_work allowed each gauge to grow by eight iterations' worth
between its reads at iterations 100 and 200. A leak of one texture per
iteration passes that. The row now asserts an absolute bound at both reads,
in what the first iteration added:
- releases_waiting and textures: IN_FLIGHT + 1 = 4 iterations' worth (128
and 64), one for each command buffer in flight and one for the one being
made;
- texture_block_bytes: 2 * IN_FLIGHT - 1 = 5 iterations' worth (655360 for
8 images of 16 KiB). In today's runtime an image is held by the upload
that zeroed it until its own command buffer retires, then its release is
queued against every command buffer committed so far, so images stay 5
iterations where views stay 3. A runtime that frees the image sooner only
lowers the reads.
The row's line prints each gauge's two reads and its bound.
Checked against every recorded read of the row (rounds 5a04298008 and
7c1baad228, 17 legs): the highest were textures 56, releases_waiting 96
(hawkpoint and the Iris Xe) and texture_block_bytes 557056 (34 images; the
2080 and the 3090), all within the new bounds. A four-iteration bytes bound
would have failed those two. The test keeps its name; the round selects it.
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.
Texture buffers (817463704e) made runtime-floor the first committed profile that lists texel-buffer
update-after-bind features with robustBufferAccess and without robustBufferAccessUpdateAfterBind,
so recommended_enables keeps robustBufferAccess and leaves those two out by
VUID-VkDeviceCreateInfo-robustBufferAccess-10247. recommendations_are_closed_fixed_points_on_every_
committed_profile asserted the recommendation left out nothing on any committed profile, an
observation over the profiles, which no longer holds; it now names runtime-floor's pair. The
runtime enables those features and never robustBufferAccess (floor.rs), so no product change.
recommended_enables' doc said the core does not read the buffer update-after-bind features. Since
texture buffers it reads the two texel-buffer ones; the doc and docs/API.md now say a device made
from the recommendation on such a device gets no texture buffers, each refused naming the feature,
and how to have them. A new test builds runtime-floor's device from its own recommendation and
shows the typed refusal (Unsupported ArgumentBufferTextures, needs
DescriptorBindingUniformTexelBufferUpdateAfterBind), and the same member compiling once the
features are enabled without robustBufferAccess, as the runtime does.
What: 20 rows in known-gaps-rt.tsv, at case/hsw_buffer/texels and case/hsw_held/texels of
norm-storage-codes-{rgba8unorm, rgba8snorm, rgb10a2unorm, rgba16unorm, rgba16snorm}: ten on
NVIDIA, ten on the Iris Xe. Each carries its card's hsw_write row's reason, with one more
sentence:
- the route answers as `hsw_write` does: the same count, the same largest difference, the same
first differing element;
- the case's pipeline records `device-color-conversion` and `device-nan-encoding` on that card.
docs/CONFORMANCE-COVERAGE.md is regenerated.
Why: texbuf (817463704e onward) builds texture buffers, and the case's `hsw_buffer` route reaches
the device. Its `hsw_held` route answers on the GPU cards too. Their lavapipe rows came with
b7e3247961; the GPU cards' rows did not.
- The bytes are the card's own normalized conversion at a tie (rule 1), the conversion the
texture route already ledgers:
- NVIDIA stores the lower code at a unorm tie: Metal 0x1010101, ours 0x0 (rgba8unorm).
- At an snorm tie NVIDIA stores the code toward zero: Metal 0x81818181, ours 0x82828282.
- ANV rounds ties to even.
- The RX 7900 XTX (m3-max-63842) and the 780M (63840) answer Metal's bytes on all four routes.
- The store lowering is the texture's own (lower/texture/mod.rs, `ImageDim::Buffer` included):
it calls `norm_storage_facts`, which records `DeviceColorConversion` for a slot whose storage
choice is a normalized format of the identity class, or that has none.
Verified: the compile job and the replays on the 3090 and the Iris Xe, named with the sha.
What: blend-interaction-format-srgb8's case/blended/one-one-subtract row ("81 elements differ (U8),
the largest difference 3") is re-keyed. Its venue was "llvmpipe (LLVM 23.1.1, 256 bits)" and is
now "256 bits) on x86-64 AVX2", the same key the fetch-ordered sRGB x3 rows use. Its reason gains
one sentence saying the count follows the ISA.
Why: ms01's lavapipe (LLVM 23.1.4 on an AVX2 host, Mesa 26.2.6) answers 81 elements, max 3
(m3-max-63645), the AVX2 answer. No row named that venue:
- the 81 row named LLVM 23.1.1, msi's AVX2 lavapipe;
- the 78 row is "on x86-64 AVX-512", the um790 and gem10 hosts at LLVM 23.1.4.
99b3fc685c had moved the old "LLVM 23.1.4" row to the AVX-512 key when only AVX-512 hosts ran
23.1.4. The answer is the device's own (rule 1) under `device-color-conversion`, which the row
already cites. Not a drift: no earlier full lavapipe conformance replay on ms01 is in the job logs.
Verified: the coverage document is unchanged (--check passes; the row count is the same). The
lavapipe replays on msi (AVX2, LLVM 23.1.1) and ms01 (AVX2, LLVM 23.1.4) are named with the sha.