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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
71d767c904 made intrinsics::Access public (it was test-only) without its row, so
api_surface::the_table_matches_the_source failed on development from 391db1e57a on (matrix round
391db1e57a, lavapipe leg m3-max-51983: 12520/12521). The row is additive.
Verified: the air api_surface test in the job that compiles this commit.
The plays' counts of skipped pipeline states (skipped_render_states and skipped_compute_states,
a refusal under the identity domains included) read 0 on five recorded streams: three to their
end (1,047, 1,100 and 1,129 frames) and two to their line-width stop (frames 379 and 394), in
native's jobs m3-max-51725, 51726, 51757 and 51772 (players at 951b93a645) and replay's 51839
and 51840 (player 81cd25a623c2 at 9f9744827d), as main relayed them. No tool translates every
pipeline state of the recorded streams under the identity domains without a GPU, so the line
scopes the count to those streams and frames. The streams stay unnamed.
Verified: doc only; the counts are the relayed job results, not runs of mine.
The planner ruled that the runtime answers argumentBuffersSupport as Tier 2, with the forms the
translator's identity domains do not lower yet recorded as known gaps by form.
- The fourth argument_tier device test asserts the typed refusal: a state over ab_tier2's
ab_indexed (thread g reads the texture of element g of the argument buffers a pointer member of
the bound one reaches) is Error::Translation of Unsupported{IdentityDomains, NotImplemented},
naming "an encoder value the function reads as RootTableAddress": its plan reads the
texture handle through the root table, whose address the identity domains do not push.
- The README's known gaps of pipeline states list, by form, what argument buffers take under
either tier that the identity gate refuses: tier 2's pointer indexing to a texture (the
translator test and this device test); a sample, gather or comparison of an argument buffer's
texture, and a depth texture of one compared and sampled plainly; an argument buffer's
sampler and an array of samplers; an argument buffer's texture of a type the identity arrays
hold no element of, read through another numeric type or as raw extended-range texels, and a
handle that reads its table entry beyond its element. Those have no test yet. The tier's
README line no longer claims the pointer-indexed read and points at the gaps.
Verified: the refusal and its form are those of probe job m3-max-52000 (gem10, lavapipe and M3
profiles); the device test's run is the next check job.
The identity gate (lower::select's identity_admits) answered Unsupported{IdentityDomains, NotImplemented}
for every plan it does not admit, with nothing saying which of its conditions failed. It now
names the first form the plan holds, in the refusal's symbol (diagnostics only), by what a
program does that takes it: a stage off the floor's push window, an encoder value it reads as a
push field outside the identity set, a buffer argument not reached by its device address, an
argument buffer's texture of a type, depth comparison, raw or cross-type read the identity arrays
do not take, a handle that reads its table entry beyond its element, a texture argument with
state beyond its resource ID, a sampler form (a texture argument sampled through a sampler the
identity sampling does not take, a sample of an argument buffer's texture, an argument buffer's
sampler, an array of samplers, a bicubic filter, a specialized sampler argument), a runtime fact
of bound state, or a descriptor. The checks and their conjunction are unchanged
(identity_refusal is None exactly where every condition held), so an admitted plan is lowered as
before; only the refusal's symbol is new, and only under the identity domains, which the new
runtime alone takes.
A test confirms which form argument buffers tier 2's pointer indexing takes (engine/ab_tier2's
ab_indexed: thread g reads the texture of element g of the argument buffers a pointer member of
the bound one reaches): on lavapipe and the M3 profile its plan reads the root table
(PushField::RootTableAddress), whose address the identity domains do not push, so it is refused
naming that, while the default domains compile it and the identity domains lower ab_copy and
ab_read. docs/API.md's identity paragraph names the form and says the symbol names the first one.
Verified: probe job m3-max-52000 (gem10, the gate change with the form unpinned) read
"an encoder value the function reads as RootTableAddress" for ab_indexed on lavapipe, and
a_bicubic_kernel_is_refused_under_the_identity_domains passed beside it; refusal_surface --check
is clean. The pinned test's run is the next check job.
Capability item 2, the planner's rule: a capability answer that promises runtime behaviour is
rt's to give, and a device test holds each promise. Apple's "Improving CPU performance by using
argument buffers" sets tier 2 against tier 1's limits. Tier 1 argument buffers can't hold
writable textures, must be immutable and CPU-accessible, and can't be pointer-indexed or point
at other argument buffers. rt had one device test over an argument buffer
(translate.rs, a CPU-written texture ID), so none of those four pieces was tested.
- Device::argument_buffers_support answers Tier2. The floor holds what tier 2 stands on: buffer
device addresses, runtime descriptor arrays, partial binding, and update-after-bind of sampled
and storage images (the translator's own tier rule, device/metal.rs). rt re-exports the
translator's ArgumentBuffersTier.
- tests/argument_tier.rs, one device test a piece:
- a8r_buffers' a8r_held reads and writes the read_write and write textures an argument
buffer holds;
- ab_tier2's ab_copy copies a texture member device to device, and ab_read reads through the
copy;
- ab_read reads through a Private argument buffer that a blit filled;
- ab_indexed's thread g reads through element g of an array of argument buffers that a
pointer member reaches.
- The conformance rt side answers argument_buffers_tier from the getter. The rt README states
the answer; api_signatures.tsv is blessed (+6).
Verified: signatures.py, coverage.py and refusal_surface.py regenerate; build and the device
tests on each GPU follow.
41bc2c1b80 keyed the contract to a vendor ("On NVIDIA the consumer drops..."). The planner ruled one
contract for every device: the consumer drops the device's last handle before the process exits; a
process that cannot, because a handle is still out, quiesces and ends with _exit whatever quiesce
answered. exit() with a live device is supported on no device; NVIDIA's 3 of 9 crashed power-offs
(RTX 3090, 620.70.06, SIGSEGV in the driver's own thread inside exit() after quiesce answered true)
is the evidence, not the condition. The README's and Device::quiesce's doc no longer offer exit()
or an atexit handler as a path, and the 50-of-50 clean atexit exits are scoped to a device that ran
nothing.
Verified: doc text only (README, two doc comments; no link added); cargo fmt. Rustdoc runs in the
tip's check after landing.
The ab_tier2 fixture (caps) landed in this stack without its rows in the golden hash table, the
engine inventory and the air_input printouts, so the landing-set check m3-max-51973 failed
engine_fixtures_match_their_golden_printout (no ab_tier2.txt); the inventory and golden hash
tests would fail the same way on development.
This commit only adds: six golden rows (ab_copy, ab_read and ab_indexed of the .ll and the
.air.ll), six inventory rows (ab_indexed is refused as DereferenceLoadedPointer where a profile
lacks bufferDeviceAddress or shaderInt64, ab_read as ArgumentBufferTextures where one lacks the
descriptor-indexing features, every other cell ok), and the fixture's printout. No existing row
changes.
Verified: blessed on the M3 at 2556d9f693 by bless-job.sh (job m3-max-52152, inventory=0
golden=0 printouts=0); the patch removes no line.
Metal's answers (an Apple M3 Max, macOS 27.0.1 build 26A434, three runs, job m3-max-51921, record
and times in one job): pipeline-facts-render-multisampled-direct answers imageblockSampleLength
12 and imageblockMemoryLengthForDimensions: 1536 at [8, 4, 3], as the multisampled case with
indirect-command support does, and supportIndirectCommandBuffers false. The old runtime replayed
both on the M3 (MoltenVK) exact in the same job. rt's README line on the rule's measurements names
the twin. docs/CONFORMANCE-COVERAGE.md regenerated.
Verified: job m3-max-51921 (BUILD_CONFORMANCE=0, RECORD=0, TIMES=0, REPLAY_OLD=0, both cases exact on
the M3). The new runtime's comparison is the next check job.
The planner ruled on the two pipeline_facts cases the new runtime stops at their state, whose
descriptors ask for supportIndirectCommandBuffers (Gap::IndirectCommandBuffers):
- known-gaps-rt.tsv lists pipeline-facts-render-two-attachments and -multisampled at case/state
on every venue, in words naming the gap and the case that compares the same state's facts.
The rows were unlisted complaints in the rt lavapipe replay of m3-max-51600.
- pipeline-facts-render-multisampled-direct is the multisampled case without indirect-command
support, so the new runtime compares the sample count's factor in imageblockMemoryLength, the
one part of the length rule it has never compared. It keeps the label, so its rt rows are
render-plain's five (device and label the consumer's own, the three tile getters the libs
census). The two-attachment state needs no twin: pipeline-facts-render-depth-stencil already
compares its lengths on rt.
The twin joins the cost-coverage list of cases authored after the last whole-set cost run.
Verified: the build and the recording come from the M3 job that records it.
Metal's answers (an Apple M3 Max, macOS 27.0.1 build 26A434, three runs each, job m3-max-51875,
record and times in one job):
- pipeline-facts-render-narrow-attachments, R8Unorm then RG16Float: imageblockSampleLength 6
and imageblockMemoryLengthForDimensions: 192 at [8, 4, 3]. RG16Float sits at byte 2, its
component's alignment, which is the rule metal::format::color_record holds ([(0, 1), (2, 4)]);
packing tight would answer 5, aligning every texel wider than a byte to 4 would answer 8.
- pipeline-facts-render-depth-stencil, RGBA8Unorm then RGBA16Float with Depth32Float_Stencil8 as
depth and stencil: 12 and 384, the same as the two colors without it, so depth and stencil take
no room.
The old runtime replayed both on the M3 (MoltenVK) exact in the same job.
The case comments and rt's README line on the rule's measurements state the two values.
known-gaps-rt.tsv gains each case's five rows on every venue that pipeline-facts-render-plain
already holds: device and label (the consumer's own) and the three tile getters (the libs census).
docs/CONFORMANCE-COVERAGE.md regenerated.
Verified: job m3-max-51875 (BUILD_CONFORMANCE=0, RECORD=0, TIMES=0, REPLAY_OLD=0, both cases exact on
the M3). The new runtime's comparison is the next check job.
The planner asked for two recordings in the pipeline_facts family, no runtime change:
- pipeline-facts-render-narrow-attachments: color attachments R8Unorm then RG16Float at one
sample. The candidate rules answer differently: 6 where each texel aligns to its component's
size (the rule rt and the old runtime take from metal::format::color_record), 5 where the
texels pack tight, 8 where every texel wider than a byte aligns to 4.
- pipeline-facts-render-depth-stencil: the two-attachment pipeline (RGBA8Unorm then
RGBA16Float) with Depth32Float_Stencil8 as its depth and stencil attachment format, which
holds depth and stencil out of the record.
Both ask for no label and no indirect-command support, so the new runtime, which makes no state
for indirect commands, makes theirs and compares the lengths; the existing two-attachment and
multisampled cases stop at their state there.
The two names join the cost-coverage list of cases authored after the last whole-set cost run.
Verified: the build and the recordings come from the M3 job that records them.
Device tests, under either device cfg, of three things Metal's argument buffers tier 2 adds over
tier 1 (Apple's "Improving CPU performance by using argument buffers"), each a kernel run through
the form and its result checked:
- writable textures in an argument buffer: a8r_buffers' a8r_held reads a read_write member's
texels, then writes it and a write member;
- an argument buffer the GPU writes: ab_tier2's ab_copy copies a texture member from one argument
buffer to another, and ab_read reads through the copy;
- an argument buffer the CPU cannot reach: a Private buffer a blit filled, which ab_read reads
through.
The program writes each texture member as the texture's gpuResourceID.
The tier answer itself (argumentBuffersSupport) is not here: the fourth form, pointer indexing
through a pointer member to other argument buffers, is refused by the translator under the
identity domains (ab_indexed: Unsupported{IdentityDomains, NotImplemented}, job m3-max-51819), and
the planner rules the answer.
Verified: the three passed on lavapipe in job m3-max-51819's device-tests step (at the commit
that held them beside the getter); this commit's own run is the next check job.
Three kernels for the runtime's device test of what tier 2 adds beside writable textures
(a8r_buffers' a8r_held holds those): ab_copy copies a texture member device to device, ab_read
reads texel (0, 0) through an argument buffer's member, and ab_indexed reads through element g
of an array of argument buffers that a pointer member reaches. The companions follow from
scripts/regen-air-fixtures on the M3.
The translator numbers the sampler of a texture write (NumberedSampler::Write) beside its read's,
so each kernel's state asks for two sampler numbers, not one: the test asserted [Read] and answered
one number, and failed on lavapipe in job m3-max-51819 (left [Read, Write], right [Read]). It now
asserts both and answers sampler 0 for each.
Verified: the failure is 51819's device-tests step on lavapipe; the fix's run is the next check
job.
storage_image_choice answers a metal2vulkan::vk::Format, the translator's generated enum, not
ash's; the test imported ash::vk, so comparing the choice with Format::UNDEFINED did not
type-check under either device cfg. It now names the translator's vk module.
Verified: read against StorageImageChoice (pipeline/lower_inputs.rs) and the translator's own
tests, which compare with crate::vk::Format::UNDEFINED; the compile is the next check job.
The planner's capability rule: an answer that promises runtime behaviour is rt's, and a device
test holds the promise. Tier 2's formats are storage images on every device above the floor.
Vulkan requires the four-channel and 32-bit ones, and the floor's
shaderStorageImageExtendedFormats (every floor driver reports it, 6529ce3187) requires the six 8-
and 16-bit single-channel ones. So Device::read_write_texture_support answers Tier2, and rt
re-exports the translator's ReadWriteTextureTier.
tests/read_write_tier.rs: three hand-written kernels, float, uint and int, each over a
texture2d<T, access::read_write>. For each of the 18 formats, a 4 x 4 texture of shader-read and
shader-write usage is loaded with codes every channel moves. The kernel reads each texel into a
buffer, which checks the read's conversion and the missing channels (0, 0, 1). It then writes
back 1 - v (float, normalized) or v ^ 0x5a (integer), and the texture is read back. A normalized
byte's write may land within one of 255 - k, as Vulkan's float-to-normalized conversion allows;
every other comparison is exact. The test counts the formats the translator declared without a
format and those it declared with one, as the device's format-less read decides.
The conformance rt side answers read_write_texture_tier from the getter (a D-list method). The
rt README states the answer; api_signatures.tsv is blessed (+7).
Verified: signatures.py, coverage.py and refusal_surface.py regenerate; build and the device
test on each GPU follow.
memory2's tessellation fix made a leg whose pipeline or pass our side refused answer with that
refusal as the leg's own site, instead of recording the read-back's starting bytes beside a
"pass" leaf. Five other families had the same shape and compared bytes no draw wrote:
discard_hoist, int_attributes, vertex_formats, wide_int_attributes and wide_points. So did
host_page_writes, whose three bytes sites read back after a write the new runtime refuses
(the visibility rows' Counting mode, Gap::Draw of VisibilityResults).
- case.rs now holds the helpers, moved from tessellation_sweeps.rs: pipeline_or_refused,
refused_leg and drawn_or_refused, plus PassOutcome::refusal. The tessellation families import
them from there.
- discard_hoist, wide_points: a row whose pass or read was refused answers with the refusal.
wide_points' written-words roll-up answers with the first refusal when a row was not drawn.
- int_attributes: a row whose pass was refused answers with the refusal.
- vertex_formats, wide_int_attributes: the pipelines are kept as Result. A format whose pipeline
or pass was refused answers with that refusal; its slice holds only the filler.
- host_page_writes: each bytes site answers with the write's refusal, else the refusal of the
copy that fills it.
The other twenty of the twenty-five files memory2 counted already record each piece's answer and
abort at the first refused piece before any read-back, so no bytes are compared there:
compute_render_chains, depth_stencil_space, depth_resolve_pairs, draw_state_changes,
frame_chains, indirect_command_depth, indirect_commands, layered_targets, pass_attachment_pairs,
pass_bound_pairs, pass_start_reads, pass_sequence_actions, primitive_type_crossings,
render_draw_forms, render_chains, render_depth_stencil_state, render_residency, render_state,
stencil_resolve_pairs and stencil_resolved_sample.
Metal's recordings of the six families hold no refused site, so Metal's transcripts are
unchanged; a leg drawn on our side is unchanged.
Verified: build, tests and the lavapipe replays of both sides follow in the check job.
The rows of pipeline-facts-render-plain's maxTotalThreadsPerThreadgroup,
threadgroupSizeMatchesTileSize and requiredThreadsPerTileThreadgroup fields take the libs census
head (11-19, m3-max-51379..51431: 0 tile pipelines over the 17 streams), as the options rows
cite it: a Metal feature no stream uses is a typed refusal until a stream needs it (main's
ruling).
Verified: coverage.py writes the document unchanged.
compute_pipeline_facts and render_pipeline_facts were left at the Side default on the rt side,
so the two pipeline-facts cases whose state rt makes (pipeline-facts-compute-plain and
pipeline-facts-render-plain) refused the whole facts call. Both now answer through the state:
- compute: staticThreadgroupMemoryLength, supportIndirectCommandBuffers (false on every state rt
makes), imageblockMemoryLengthForDimensions: and requiredThreadsPerThreadgroup, the last two
getters present landed in 90792a2bfa;
- render: imageblockSampleLength, imageblockMemoryLengthForDimensions: and
supportIndirectCommandBuffers.
label and device are the consumer's own (rt keeps neither on a state), and a drawing state's
three tile getters (maxTotalThreadsPerThreadgroup, a tile threadgroup's, per Metal's
documentation of the render state's getter, threadgroupSizeMatchesTileSize and
requiredThreadsPerTileThreadgroup) are not rt's, as rt makes no tile render state (the
planner's ruling). Each is a refused Field, so the state's other getters compare.
imageblockMemoryLengthForDimensions: of a compute state is a Field too, as rt answers it with a
typed error for a kernel whose imageblock it does not measure.
Rows: 7, every venue: label and device of both cases (the consumer's own), and the three tile
fields of the render case, in words (rt's README names the tile getters it lacks). The rt
README's tile getter list gains maxTotalThreadsPerThreadgroup. The coverage document gains the
two facts types' field rows.
The other four cases are refused at the making as before (indirect command buffers, and the
kernel that reaches an imageblock).
Verified: coverage.py writes the document; build, tests and the lavapipe replay of both sides
follow in the check job.
The quiesce section's 50-of-50 clean exits were runs that made a device and ran nothing. A consumer
running a guest's work measured otherwise: on an RTX 3090 with driver 620.70.06, 3 of 9 power-offs
crashed with SIGSEGV in exit() after quiesce answered true (0.4-5 ms, every rt thread ended). The
faulting thread is the driver's own (libnvidia-eglcore, near NULL+0x18), and the main thread sits in
the ICD's exit handler waiting on a rwlock; no rt frame is on either. The RTX 2080 was 0 of 4. The
consumer's fix is to drop the device at its last release. The README now scopes the clean-exit
numbers to their runs and states the gap and the two exits that avoid it.
Verified: doc-only; the numbers are the consumer's (reims b264 rt platform, relayed 11-19).
One stream a test, played on the new runtime: vertex buffers bound through a
range draw at their offsets; fragment buffers bound at location 1 fill slots 1
and 2, so an offset of slot 2 plays and one of slot 0 is the runtime's refusal;
a skipped texture bound to the vertex stage at location 1 skips the draws until
a nil at location 1 takes it off; a fragment function reads the texture at the
slot its range names; a kernel reads and writes the textures a compute
encoder's ranges bind. Each fails on the player before the range arms, which
refused the call.
The new runtime's player refused every range form of a buffer or texture bind
("not played on a render encoder"), though rt builds each as a loop of its
single-slot call: setVertexTextures:withRange:, setFragmentTextures:withRange:,
setVertexBuffers:offsets:withRange:, setFragmentBuffers:offsets:withRange: and
the compute encoder's setTextures:withRange:. Each now binds its objects from
the range's location on, through the helper its single-slot form uses, so a
skipped object in a range marks its own slot and skips the draws or dispatches
as a single bind of it does.
The cover tracker (covers.rs, shared by both players) reads the range forms of
texture binds too, so a draw's or dispatch's write through a range-bound slot
still covers what the texture meets in its placement heap.
Clippy's drain_collect refused the drain into a new Vec of the same type
(check m3-max-51969). The ids now come off the list with pop; the order
does not matter, since each buffer is written to its own files.
Verified by the check named when this lands.
The 3090 chain gate compared rt's and the old runtime's plays command buffer by command buffer
through a probe that never lands: whole-object checksums of each buffer a command buffer named,
then a script that asked the probe's dumps of Covers. A whole-object checksum is no compare under
the cover rule: a buffer partly under a texture's write differs under the cover, and a word that
differs outside it shows only as the same mismatch. This lands the compare in the player's own
tooling, on the player's own Covers (94d7c1620c's rule, unchanged).
- Player::dumping(command buffers, dir): once each listed command buffer completed (its wait
seen, before the next call plays), every buffer its encoders named is written into dir as
cbC-objO.bin, with cbC-objO.cover holding the ranges of it the cover rule held covered then, or
cbC-objO.unread where the backend could not read it. A write failure ends the play
(PlayError::Dump). Off unless asked.
- compare_dumps(a, b) (replay/dumps.rs) compares two plays' dumps word by word, leaves out a word
wholly inside a range either play held covered (the old runtime answers no slot access, so its
plays cover less), and reports every other differing word per command buffer and buffer, a dump
one play lacks, and a dump either could not read.
- command-replay: --dump-command-buffers FIRST..LAST --dump-dir DIR on play; compare-dumps --a DIR
--b DIR prints a line per buffer that differs outside every cover and a summary ending agree or
DIFFER, exit 0 / 1 / 2.
- Covers::ranges(object), read-only, for the dump.
- docs/REPLAY-STREAM.md, section 10: the options, the files and the compare's lines.
Tests (no GPU, the player on the test backend, two plays each that differ only in the words at
bytes 0x10 and 0x1800 of a 0x2000-byte heap buffer whose first 0x1000 bytes a texture's write
covers after the command buffer bound it):
- replay::tests::the_dump_compare_reports_a_differing_word_outside_every_cover: the dump's cover
is 0..4096; the word at 0x10 is covered, the one at 0x1800 (word 1536) is reported; DIFFER.
- replay::tests::the_dump_compare_reports_a_word_whose_cover_the_buffer_s_last_write_voided: the
encoder binds the buffer again after the dispatch (a binding counts as a write), the dump holds
no cover, and both words are reported.
- replay::tests::the_dump_compare_agrees_on_alike_plays_and_reports_a_dump_one_play_lacks.
The test backend now keeps a heap buffer's bytes as it keeps a device buffer's, so a write into
one reads back.
Verified: the check job named at hand-over compiles it and runs the replay tests.
The known gap for textures over buffers in imported or exported blocks gets its measured cost for
decoded video: one copy a plane before the first submission that uses a picture, none for a picture
written over before any use; 2 copies and about 8.6 MB a picture used over the replayed decodes
(8-bit 1920x1080 and 16-bit 3840x2160 pictures of two planes), and the copies' GPU time a picture on
four cards. No worst-present figure: a present is a span of records, not a frame.
Verified: replays with the player that fills a picture's shapes at their first use (development
0c36de79d9): vaapi-780m-wd presents 376..1816 on the Radeon 780M (job 52006: 1,440 pictures, 1,415
filled, 19 written over first, 2.00 copies and 0.288 ms of GPU time a picture filled), nvdec-3090-wd
presents 390..1833 on the RTX 3090 (52007: 1,435 pictures, 1,416 filled, 16 written over first,
2.00 copies and 0.653 ms a picture filled); the RX 550 (51913, 0.294 ms a picture) and the Iris Xe
(51922, 0.520 ms) from plays of vaapi-780m-wd with the player at 9f9744827d, whose copies a picture
are the same two.
The planner ruled the Iris Xe's 1.26x on the particle kernel a known gap on Gen12, with the three
remedies already measured and closed. The 2 GiB cap gap's Gen12 sentence now says what the cost
is and how large it measured:
- The cause, read from the GEN assembly ANV compiled for rt's module and the old runtime's (the
pipeline executables' disassembly, job 51999 on the Iris Xe RPL-P, Mesa 26.2.6): Gen12 has no
64-bit integer add, so rt's access through an address takes, beyond the binding-table access
the old runtime makes (add of the offset, one send), a compare for the carry, an add of the
high word and four moves that pack the a64 address into the message, and the bias one 32-bit
add more. The particle kernel's loop, one read an iteration, is 31 instructions against the
old runtime's 24 (one a64_untyped_read against one bti untyped_read).
- The size, measured (job 51999, kalone, the kernel alone back to back, forward and reverse):
best median per dispatch 502.0 us for rt at development a352921d81, 397.0 us for the native
Vulkan program and 429.5 us for the old runtime: 1.26x native and 1.17x the old runtime, the
output bytes' hashes equal across the three.
- Intel's Windows driver on Gen12 is unaudited (no Gen12 Windows host).
Docs only; no ceiling changes.
A gap against the old runtime. Apple's private setLineWidth: has no rt setter, so the rt player
refused the call ("not played on a render encoder") and every rt play of a stream that sets it
stopped at its first call, while the old runtime plays it.
RenderCommandEncoder::set_line_width(f32) keeps the width the encoder's later draws see, Metal's 1
until set, each encoder starting at 1. Every width is accepted, as on Metal. The runtime draws
lines at width 1 alone: its pipelines fix the width at 1, and Vulkan's wider lines are a device
feature (wideLines) that the floor does not require, so no second form is built on it. A draw of
lines or a line strip while the width is not 1 is the new DrawKind::LineWidth, refused at the
draw before anything is recorded; a draw of no vertices records nothing as at any width, and a
draw of triangles runs at any width, as Metal's filled triangles do. A triangle fill mode of lines,
which Metal draws at the width, is already refused where it is set (DrawKind::FillMode).
The player plays setLineWidth: into the setter; a line draw under another width is then the
runtime's gap, skipped and counted like any other.
Also: fill_push's doc comment had landed above `primitives`; it is back on its function.
Docs: the setter's doc names Metal's counterpart (the private setLineWidth: of
MTLRenderCommandEncoder) and what is refused; DrawKind::LineWidth says why; the rt README holds
the width in the encoder's state and the draw in its known gaps. api_signatures gains the method
and the variant. refusal_surface.py regenerates docs/REFUSALS.md with no change: it lists
Gap::Draw by its raise sites, and the new kind is raised in draw, already listed. api_surface pins
the translator's module roots alone, so no row moves.
Tests: tests::draw::on_device::every_device_draws_lines_at_width_1_alone (width 2: a line and a
line strip refused with DrawKind::LineWidth, an empty line draw and a triangle draw; width 1 again
and a later encoder's default: lines draw their rows) and
runtime_lane::rt_replay::a_line_width_plays_and_a_line_drawn_at_another_width_is_skipped (at 1
nothing skipped; at 2 the line is skipped and counted as Draw { kind: LineWidth } at its call).
Verified: the check job named at hand-over compiles it and runs the touched tests.