The README says in one place what each handle needs for in place, the layout
rule, the copy form's reasons and the one consumer contract. REFUSALS.md and
api_signatures.tsv regenerated by their scripts.
The new runtime's backend played a copy back to the guest's RAM as one
buffer copy per run, word-widened, in the guest's own blit encoder, and a
copy from the guest's RAM as one copy per piece in that encoder. The host
does neither: on the new runtime every staged fill and download is one rt
buffer-to-buffer copy, since rt answers no linear row pitch. In f355 of
the syncview stream the per-run form made 8,029 copies from 28 calls,
with a barrier pair each, which the host never makes.
Now each call is one copy, in a command buffer of the backend's own on
the call's queue, through a Shared scratch of its own (new module
new_runtime/guest_ram.rs):
- copy back: one copy of the whole words the runs span, committed just
after the call's command buffer; a wait for that command buffer waits
for the copy too (the guest sees its RAM written when its command
buffer completes), then the CPU copies each run out of the scratch;
- copy in: the pieces gathered on the CPU into the scratch laid out as
the bytes they span (gaps and edges from the target's mapping), one
copy committed just before the call's command buffer; into a buffer
with no mapping, one copy per run of touching words, so no gap is
written.
Surface texel copies stay in the guest's blit encoder. The work is
counted apart as the stand-in (guest_ram_* counters, guest_ram_gpu_nanos
for its command buffers' GPU time, outside gpu_busy) and the report's
"guest RAM: copy-back played in the one-copy form" line. The old arm is
unchanged. staged_guest_ram_bytes and copied_back_guest_ram_bytes give
way to guest_ram_fill_bytes and guest_ram_download_bytes.
Tests: the copy-back device test now expects one copy of 100 bytes and
two runs copied out; a new device test plays copies in to a Shared and a
Private buffer and reads both back. docs/REPLAY-STREAM.md section 10
describes the form.
fence_orders now loosens one site (case/order/y/words-written on the
new runtime's run, NewRuntimeAccepted), which the coverage document
counts: the_conformance_coverage_document_is_what_the_sources_derive
failed without it (job m3-max-52556). The case names the variant, as
the table lists justifications by variant.
Verified: in the jobs named in the landing's report.
A reader of "0 or 1024" could take it for a race in rt. The docs/API.md
entry and the case's comment now say why 1024 is rt's answer (a writer
whose queue has fewer than three submissions in flight is submitted at
once, so the later reader reads it on every device and run), and that
Metal's 0 there was measured on the M3 Max (jobs m3-max-52432 and, behind
three, m3-max-52415), not documented. The entry's lead-in, and so its
slug, is unchanged.
Verified: in the jobs named in the landing's report.
On metal2vulkan-rt the case read divergent at case/order/y/words-written:
Metal 0, ours 1024 (job m3-max-52528, lavapipe). The writer's queue has
one busy command buffer, below the three at which rt holds a group, so
rt submits the fill at once and the later copy on another queue reads
all of it. Metal's tracking orders only against work it has already
submitted, and on the M3 Max it ran the copy first (5 of 5, job
m3-max-52432). rt's answer is the order Apple describes for a tracked
write (later commands wait for it); Metal's there is timing.
docs/API.md section 10 lists it under a new "Command queues" heading,
citing the rt README's measured line, and the case declares the count
on the new runtime's run alone (AnyOf 0 or 1024, NewRuntimeAccepted):
the old runtime's answers still compare exactly, and every status
still compares on both.
Verified: in the jobs named in the landing's report.
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.
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 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.
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.
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.
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.
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 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.
m2v.externalWriteDone (a decoded picture landed in a receiver buffer) no longer refills the
buffer's shapes at once. As the product's per-shape form does after a video command buffer, every
shape of the buffer owes a fill from it, its own write lost; the first command buffer whose
encoders use a texture of the buffer (a binding, a pass's attachment, a blit, a useResource)
fills every owing shape of the buffers it uses before its commit, by blits in a command buffer of
the player's own committed then. A picture another lands over before any use is never copied.
The eager form copied every picture at its landing, so a burst of pictures landing at one present
was copied there whether used or not.
New counters: surface_pictures_filled (pictures a fill took) and surface_pictures_unfilled (those
another landed over before any use, or whose buffer went first); the surfaces line also gives the
pictures not used yet. The copy-from-guest-RAM comment now names the product's fill from the
pages, not a refill. docs/REPLAY-STREAM.md sections 4 and 10 say so.
Verified: the new device test a_surface_picture_fills_its_shapes_at_their_first_use (two pictures
land before a kernel reads the texture: one fill of one shape, the second picture read, the first
never copied) runs in the check that follows this commit; not yet run. The eager form fails it
(two refills).
What: metal2vulkan-air exported intrinsics::Access only under cfg(test), so the unbound analysis
of 0a810a7ab5 did not compile (E0432). The air crate now exports Access (Form stays test-only),
the type of Texture's public access field. The analysis counts a read or block read through a
loaded texture as a storage access unless the operation declares access::sample or access::read,
so a read that declares no access (an emitter before AIR 2.0) counts, as the fact's 'false is
proven' needs. The interface and API.md docs say so.
Verified: cargo fmt; signatures.py --check gives no diff. The check job compiles it.
What: bug 4's held path. A compute encoder's use_resource with a usage that writes a texture (or a
view of one) made for shader writes with no storage element (Texture::unstored) now makes every
later dispatch of that encoder whose kernel may reach a texture through its storage image beyond
its bound slots Gap::StorageElement, with no slot and the texture's format. A kernel without such
an access dispatches whatever is resident, and use_heap declares nothing (Apple's header: useHeap
declares the heap's resources read only through an argument buffer), so a write through a
resource ID with no write-usage use_resource stays dropped, outside documented Metal.
How: the translator had no fact for that access (writes_unbound_resources with
texture_writing_stages would also refuse a kernel that writes a bound texture and a buffer through
an argument buffer), so StageInterface and PipelineInterface gain unbound_storage_textures,
decided in compile/unbound.rs beside the read and write facts: a texture write or atomic, or a
read of a texture the operation declares access::write or access::read_write, on a handle that
may come from memory, an integer or a call; an intersection or a call the entry cannot see into
counts; indirect-command and acceleration-structure operations touch no texture.
Gap::StorageElement's slot becomes Option<u32>. The render encoder builds no useResource:, so the
draw half has no trigger; the README says it waits for it.
SEMANTICS_VERSION 2190 -> 2191 and ARTIFACT_FORMAT_VERSION 547 -> 548 (one field in
StageInterface and PipelineInterface). docs/REFUSALS.md regenerated; api_signatures gains the
field and the variant's new shape; docs/API.md states the fact; the rt README's known gap says
what is refused and what stays dropped.
Tests: the translator's unbound-facts test states the new fact (an argument buffer's texture
write and a read_write read count, a sample and a read do not); storage_element gains
every_device_refuses_a_declared_write_of_a_texture_with_no_storage_element over RGBA8Unorm_sRGB,
BGRA8Unorm_sRGB, A8Unorm and an sRGB view of an RGBA8Unorm texture, and the same formats in a heap
under use_heap alone.
Verified so far: cargo fmt; refusal_surface.py, signatures.py --check and metal-coverage --check
give no further diff. The build, the suites and the device legs follow in potluck jobs.
The surface form's usage word, as ruled final. A shape no texture over it declares shader
write, shader atomic or Metal's unknown usage for (a plain shape) is made with shader read
and render-target usage alone: rt gives such a texture its format and that format's sRGB
sibling as views, and no storage view, so a plain shape's attachment reads are not refused
and its image carries the short view list. A shape shaders may write keeps the usage Metal
gives a texture whose use it does not know (shader atomic where declared), with the long
view list, so a storage plane's textures of other formats of the same bytes a texel stay
views of it with no copy.
A texture or view of a format other than a plain shape's own or that format's sRGB sibling
is refused (surface_format_refusals), and textures over a plain shape that declare
pixel-format-view usage are counted (surface_plain_format_views). docs/REPLAY-STREAM.md
section 10 says so.
Verified: the new test a_plain_surface_shape_views_as_its_format_and_its_srgb_sibling_alone
(a sibling view found, another format refused as a texture and as a view, counted) runs in
the device suite of the check that follows this commit; not yet run.
surface_order_shapes counts the shapes shaders may write made over a plane that holds a shape
of their extent shaders may not write: the order case, which the storage bit makes another
shape. The doc's counter list reflows. Not yet compiled.
surface_declared_writes counts the draws' and dispatches' surface texture slots whose bound
state's interface writes them, beside surface_usage_writes, those taken as writes by usage
with no interface at hand: together they say which binds write a shape. Not yet compiled.
The planner's storage test is shader write, shader atomic or unknown usage (an image atomic is
a storage image's operation); a shape made for a texture that declares shader atomic carries it.
The idle shapes sort by recency with sort_unstable_by_key, and the overlap drop's count filters
by reference. Not yet compiled.
The rt player's surface form now mirrors the product's per-shape form (reims's
surface cache, shapes.rs): a shape is a plane's (receiver, plane, offset, pitch)
texture of one extent and texel size, and every shape is current over its whole
extent by the product's three rules. A new shape is filled from the buffer once
the dirty shapes are written back; a copy back to the guest's RAM first writes
every dirty shape back; at the end of an encoder that may have written a shape,
the write goes through the buffer into each other shape of its plane that a live
texture views or that is dirty, and the plane's other shapes go. Writes are noted
from pass attachments, blit destinations, the slots the bound pipeline state's
interface writes (texture_accesses), and by usage where no interface is at hand.
The newest-entry rule, its download at a new shape and the older-shape use
counter are gone.
The usage word: a shape is made with shader read, render-target and
pixel-format-view usage, and shader write (a storage view) only for a texture
that declares it or Metal's unknown usage; the shape key carries that bit. A
storage shape serves a later texture of its extent that does not declare it; a
declaring texture over a plane whose shape has no storage is another shape.
The report and counters give overlap copies and bytes, straddled texels,
unordered writes, usage writes and write-backs. The device test now checks a
copy from the guest's RAM reaching both shapes of a plane and a blit through one
shape reaching the other at its encoder's end. Not yet compiled.
A compute state answers the least of Metal's maxTotalThreadsPerThreadgroup for the kernel and
this device's limits for it (maxComputeWorkGroupSize, its subgroups' count, and for emulated SIMD
groups their scratch beside maxComputeSharedMemorySize). A dispatch past that answer was
Refusal::ThreadgroupSize, which states that Metal itself refuses the threadgroup: on lavapipe
compute-threadgroup-simd-scratch's 1024 threads, which Metal runs, were refused as "past the
state's 256" and the suite counted our refusal where the old runtime reports the device's lack
(MaxComputeSharedMemorySize 32768 against 57344).
The interface keeps Metal's own answer beside the state's
(ComputePipelineMetalInfo::metal_max_total_threads_per_threadgroup, or a required size's
threads). A threadgroup past Metal's answer stays Refusal::ThreadgroupSize; one within it and past
the state's is the new Limit::ThreadgroupThreads { size, max }, basis device. The conformance
crate's rt side reads that limit as the venue's lack, as it reads the translator's device gaps.
REFUSALS.md and api_signatures.tsv regenerated.
Verified at this commit: cargo fmt, refusal_surface.py, signatures.py --bless and coverage.py
--check; the build, the suites and the lavapipe replay (where the case should read lacks-feature)
run in the lane's check job.
The new runtime's side refuses two fields of these facts: the device relation of a library and
a function (the consumer's own, device), at 24 cases' case/facts/device, and a function's options
(memory2's libs census 11-19, m3-max-51379..51431: every function descriptor of the 17 streams
has options 0), at 22 cases' case/facts/options. Each row is one m3-max-51389 replay on lavapipe
listed as unlisted, every other field of these cases comparing exactly there; the facts reach no
device, so the rows hold on every venue. The coverage document counts them by field.
Verified at this commit: the rows are those m3-max-51389's rt lavapipe replay lists (46, site and
answer as listed); coverage.py --check.
reims keeps binary archives in its guest bundle: the device's MTLBinaryArchive holds only each
added function's lookup key, serializing and loading use the bundle's own file format, and no
message reaches the host, so neither runtime is ever asked. The planner ruled them the consumer's
own (ConsumerObject::BinaryArchive, "MTLBinaryArchive, binaryArchives", named in rt's README).
Rows on every venue: the six pipeline descriptor cases' binaryArchives field, which the new
runtime's side refuses, and the six binary-archive cases' archive programs (case/program), which
it leaves at the trait's default. The dynamic-library cases and library-from-data share the
archive program and are not archives, so they keep no row.
Verified at this commit: cargo fmt and coverage.py --check; the ledger and the replay run in the
lane's check job.
RtSide left function_facts, function_facts_from_descriptor and library_facts at the trait's
default, so 24 cases ended refused on rt (15, 7 and 2 on the earlier whole-set run). The
runtime's library is the translator's and a function is the translator's function of it, so the
side reads each getter as a consumer holding them does: the library's functions a program makes by
name (a Core Image kernel library's extern functions left out, by the translator's own stage), its
type and install name; a function's reflected properties and constants dictionary, through
Function::properties, or Function::specialized_properties for a function made with constant
values, whose dictionary the translator states is empty, as Metal answers it. The old runtime's
side shares the attribute and constant-value helpers, which move into function_facts.
FunctionFacts takes options and the device relation as Fields, and LibraryFacts the device
relation. The runtime keeps no device on a library or a function, so device is the consumer's
own, as the planner ruled (ConsumerObject::Device, named in rt's README); a function keeps no
MTLFunctionOptions, so options is refused, its rows waiting on memory2's every-stream count of
function options. Failure derives Eq, so every facts type keeps its Eq.
Verified at this commit: cargo fmt only and coverage.py --check; the build, the suites and the
lavapipe replays run in the lane's check job, whose replay names the device rows' sites.
RtSide left Side::shared_event_rises at the trait's default, so shared-event-rising-value ended
refused on rt. The probe's host sets, GPU signals and bounded host waits are the runtime's shared
event's, made as the old runtime's side makes them; the runtime keeps no label, so EventRise's
label becomes a Field the side refuses (the consumer's own, label), with its every-venue row, and
the coverage document counts EventRise by field.
Verified at this commit: cargo fmt only and coverage.py --check; the build, the suites and the
lavapipe replays run in the lane's check job.
A facts call running said nothing of which of its fields were compared, so a field the new
runtime's side refuses read as covered beside its call. The coverage document gains a section
that counts each facts type answering field by field (a struct with a crate::case::Field field)
by field: its fields, the ones a side may refuse, the leaf each records at (read from the type's
node), and the new runtime's ledger rows that refuse each at that leaf, of the cases whose module
calls a Side method answering the type. A Field whose node records it at no leaf this can read
stops the generator.
The six pipeline descriptor cases' label rows (pipeline-descriptor-* and compute-descriptor-*,
every venue: the consumer's own, label) go into known-gaps-rt.tsv. Their binaryArchives rows wait
for memory2's every-stream count of binary archives, which their head will cite.
Verified at this commit: coverage.py --check passes on the regenerated document; the build, the
suites and the lavapipe replays run in the lane's check job.
What: under the identity domains (the new runtime's profile) the translator no longer inserts the
barriers that make Apple's SIMD-group lockstep explicit (`lockstep::order`): `OrderKey::of` is
`None` there and `ordered_entry` takes the specialized entry as it is. The resident-table domains
(the old runtime's) keep the order until the cutover. With no lockstep barrier on the new
runtime's path, its one-row machinery is dead and deleted: `Compiled::rows`, `pipeline::one_row`,
`encoder::Module::Rows`, `keeps_rows` and `choose`'s `rows`, the `OneRow` and `RowLockstep` arms,
and the translator's `CompiledFunction::runs_lockstep_barriers_in_rows` with
`KernelFacts::lockstep_in_rows` (the API signature table; the version numbers rise in the
branch's last commit).
Why: documented Metal orders the threads of a SIMD-group only through barriers and atomics; the
Metal Shading Language calls two of them that conflict between barriers a data race. The order was
an emulation of undocumented Apple-GPU behaviour (owner's rule 1). Its barriers made 1,443 of 5,368
distinct kernels of the recorded streams observe their threadgroup partition, every pair of them
unproven, and they stopped partial-threadgroup dispatches the variant cannot run (rt's frame-320 and
frame-335 refusals of the 30-wide kernels). docs/API.md's accepted differences gain one entry, the
conformance case `simdgroup_lockstep` leaves its output words unchecked against it, and
CONFORMANCE-COVERAGE.md and REFUSALS.md are regenerated.
Tests: the identity-profile one-row test becomes `the_identity_domains_order_no_lockstep_pair`
(barriers under the default domains, none under the identity domains, the partial variant in
tiles); the harness's cells test keeps the old domains' one-row facts and adds the identity
domains' none; rt's one-row tests and the row-lockstep tree test go, and `row_cells` runs every grid
on its tiles' pipeline made with the state.
Verified: cargo fmt; coverage.py and refusal_surface.py regenerated. Clippy and the suites run on
the check job named when the branch is handed over.
Three failures of the landed biased slot word (development's suite, job 51276):
- engine_identity::the_binders_edge_regions_set_multi_region_on_from_queries_and_store_metals_grid
trapped out of bounds at 0x6_8000_0000: the translator's own binder
(BindingPlan::instantiate_*) still wrote SlotGuestBase as gpu_address + offset, while a
pipeline compiled under the identity domains adds 2^31 back to that word. This was a code bug in
the landed change. rt was not affected: it writes its own push (pipeline::address_word) and does
not use the binder. The binder now writes the word less 2^31 (bind::instantiate::guest_word)
wherever the plan's device compiles under the identity domains. The flag is
ResourceTemplate::biased_slot_words, set by the compute and render planners. All three writers
read it: slot_field, the render rebind's bases and its loose words. RUNTIME_VERSION
2538 -> 2539: a run of an unchanged plan pushes another word under the identity domains. The
runtime sources' pin moves with the binder's files.
- engine_identity::a_slot_pointer_used_as_a_value_is_its_metal_address was refused at compile
(Unsupported{IdentityDomains}, not implemented). Its ptrtoint makes the slot pointer a wide
pointer, which reads the root table, a push field identity_admits does not admit. The refusal
is the test's premise, not the bias: select and the plan are unchanged by the bias. The test
now covers two address compares and two loads, one 4 bytes below a bind address, with the two
slots on either side of 2^31: their words lie on either side of 0, so a compare of the words
would answer the other way. A new test,
a_slot_pointer_converted_to_an_integer_is_refused_under_the_identity_domains, pins the ptrtoint
refusal on both profiles, where the default domains compile the kernel. docs/API.md section 5
says so; it no longer claims that a converted pointer reads the bias back.
- pipeline::compile::tests::the_old_render_descriptor_key_keeps_its_value: the key moved only
because SEMANTICS_VERSION and ARTIFACT_FORMAT_VERSION moved (2186/544 -> 2188/546); the
fixture's bytes are unchanged. Re-pinned to the value job 51276 computed.
A gap against the old runtime. rt refused every render state whose fragment
runs the private alpha test (PrivateRenderState::alpha_test_enabled with a
compare function other than Never or Always): the translator pushes
PushField::AlphaTestReference there, and render.rs draws() mapped no value for
it, so new_render_pipeline_state answered Gap::RenderPipeline { DrawInput }.
Nothing drew against an unfilled push word; Never and Always states, which read
no reference, were made and drew right.
Now RenderCommandEncoder::set_alpha_test_reference_value(f32) (Apple's
setAlphaTestReferenceValue: SPI) keeps the reference's 8-bit unorm code in the
encoder's state, Metal's 1 until set, not kept across encoders (the old
runtime's rule, from probes on an Apple M3 Max, macOS 27.0.1); draws() maps the
field to FieldValue::AlphaTestReference, and a draw pushes the code. A change of
code refills the push bytes; an equal one records nothing new. The code is the
translator's: bind::alpha_test_code, now public (api_surface row, docs/API.md
line), so rt and the binder compare as Metal does through one function.
Test: tests::alpha_test draws green at alpha 0.6 (code 153) under Greater, one
quadrant a draw through scissor rectangles: the default reference and 0.75
keep the clear, 0.25 (held across draws) draws, and a second encoder starts at
1 again (its whole-target draw changes nothing) until 0 draws. README and the
API signature table updated.
Verified: build and device legs follow.
Metal's answers (an Apple M3 Max, macOS 27.0.1, job m3-max-51288, record and
times in one job): every word stays as it was in both passes, the pass with no
mode and the pass with Disabled at both words, under Reset (0xaa bytes) and
under Accumulate ([100, 7]), as the lane table in cases/visibility.rs states.
docs/CONFORMANCE-COVERAGE.md regenerated.
The two tessellation streams' render passes set a visibility result buffer and
enable no mode; rt skipped every such encoder (Unheld(visibilityResultBuffer)).
On an Apple M3 Max (macOS 27.0.1, job m3-max-51220) a pass with the buffer and
no mode leaves the buffer's bytes as they were under Reset and under Accumulate,
so the planner's minimal form is exact and carries no note.
- RenderPassDescriptor.visibility_result_buffer: checked for its device
(Refusal::OtherDevice) and kept by the command buffer until it retires, as
Metal's pass holds it. It declares no access and joins no hazard set: no
command of the pass reaches it.
- RenderCommandEncoder::set_visibility_result_mode: Disabled at any offset is a
no-op; Boolean and Counting are Gap::Draw of the new DrawKind::VisibilityResults.
- visibilityResultType is not a field: it decides only what an enabled mode
writes.
- Device test: the pass draws, the buffer's gauge holds after the test's handle
is gone and falls once the command buffer retires, its bytes are unchanged,
and the pass takes the submissions, barriers and passes of one without it.
- Conformance: the rt side passes the buffer and the mode; new cases
visibility-disabled-reset and visibility-disabled-accumulate (no mode in one
pass, Disabled at both words in the next); recordings follow from the M3.
- Player: setPass's visibilityResultBuffer goes into the new field (a skipped
buffer still marks the pass unheld).
- rt README, api_signatures and docs/REFUSALS.md regenerated.
Verified: cargo fmt only so far; builds, clippy and device legs follow as
potluck jobs.
681a736c40 added surface_refill_bytes and surface_refill_gpu_nanos and the longest refill
command buffer on the surfaces line; the doc's list of the counters now names them and says
which frame a refill's GPU time falls in. Doc only.
The rt backend played newTextureWithDescriptor:iosurface:plane: as a substitute, an ordinary
texture whose texels are undefined, so two textures over one surface shared nothing and the
3090 chain's rt plays varied where the old arm, which plays the texture over its receiver
buffer, repeated.
It now plays it as the product makes it: one Device::new_texture_for_views texture (an entry)
per receiver range (receiver buffer, plane, offset, bytesPerRow) and shape (width, height,
bytes a texel), with shader read and write, render-target and pixel-format-view usage, and
every recorded surface texture a view of it at the texture's own index. The receiver buffer
holds the pages' bytes as the stream writes them:
- a new entry is filled from the buffer by a blit in a command buffer of the backend's own,
committed at the making: after every earlier commit, with no wait;
- a new shape over a range first downloads the range's newest entry into the buffer at that
entry's extent, then fills the new entry, so bytes map by byte offset; an older shape's entry
goes once no texture of it lives and is not kept current, and the calls that name such a
texture after a newer shape are counted (surface_older_uses), argument buffers unseen;
- a copy from the guest's RAM into a range also copies the range into its newest entry, and a
copy back first copies the newest entry into the range, both in the copy's own blit encoder:
replace_region would land ahead of the encoders already in the command buffer, and get_bytes
would add a wait the old arm does not have;
- a recorded CPU write into a range uploads the texels it covers (replace_region) until the
buffer's first m2v.externalWriteDone, the new record of another API's write landing (a
decoded picture), which refills every entry of its buffer by a blit committed then; the old
backend plays that record as nothing;
- another call naming a receiver buffer as a buffer is refused, and a texture of a format that
reads across a surface's two planes is skipped (skipped_surfaces_across_planes).
The player leaves a receiver buffer's checks and snapshot ranges uncompared on every runtime
(verdict receiver, a receivers line), as the texels live apart from it; the rt backend reads a
texture back for a check, laid out as the old backend lays it out. The surface substitute key
goes; substitutes_read counts the tiled and gap substitutes (and their views) a call named, the
substitutes line naming the first, and the doc's claim that a substitute makes a play no gate
result, which no code made true, now says what holds. The surface record's keys move to args.rs,
shared by both backends.
Census before building (job 51225, gb-3090-r3): 653 entries made, none after an uncommitted
guest-RAM copy into their buffer, so a fill committed at the making misses no copy there.
Tests: the surfaces unit test (the texels a write reaches); the player's receiver test; the
device test of two formats over one surface, a new extent, a copy from the guest's RAM and an
older-extent use. To be run by the check job.
The stream carries no buffer access, so a buffer binding (set...Buffer...) or a useHeap: of the
object's heap counts as a write and takes a cover off. That errs toward comparing; a residual
difference in such an object's later compares may be the covering texture's bytes, not the
play's. The report's covered line now says how many covers a binding took off.
Verified: the covers unit test gains a fourth round (covered again, then bound) asserting
binding_uncovers 1 and the new line; to be run by its check job.
The known-gap line for the pool side's copy at commit wants the classes of the textures the
device's linear image does not take, per card; the report gave only their count. The backend now
keeps, for each texture over a buffer the runtime held in an image of its own (the gauge rose
across the making), its descriptor's pixel format and usage, and prints them, most first, on a
'textures over buffers in an image of their own, by pixel format and usage' line.
REPLAY-STREAM.md lists it.
The tessellation plays reported skipped_encoders=214 (and 205) with no kind, so whether a pass
met NoAttachment, a storage gap or a property the runtime's descriptor does not hold could not
be told from the report. The backend now keeps each skipped render encoder's kind with its count
and first frame and call, and prints `skipped render encoders KIND N, the first at frame F,
call C`: `ParallelRenderCommandEncoder`, `Unheld(KEYS)` for a pass whose descriptor sets
properties the runtime's does not hold, or the runtime's gap for the pass (Debug). The
skipped_encoders count is unchanged. REPLAY-STREAM.md lists the line.
Metal leaves an aliased resource's contents undefined once another resource is written over
its memory. In a placement heap, a texture write over a buffer's (or another texture's)
recorded range leaves the recording holding its runtime's layout of the texels there, and the
play its own (rt shares the memory as a placement heap does; the old arm makes the heap's
buffers and textures apart and keeps the bytes from before). identity's liveness pass over u4
(to frame 315) found 16,942 covers of a heap buffer's range by a heap texture write and no
read through a covered buffer before its next write or release: the bytes are dead, and a
compare of them is no verdict.
The player now tracks, by structure alone (covers.rs), each object the stream places in a
placement heap (its heap, recorded offset, and length: a buffer's own, a texture's as the
runtime answers its size, read ahead) and the texture writes: a draw's or dispatch's to the
texture slots its pipeline state's interface marks written (Backend::texture_writes; the new
runtime answers from ComputePipelineState / RenderPipelineState::texture_accesses, the old
runtime answers no slot access, so on it only the following count), a render pass's to every
texture its descriptor names, a blit's to its destination, generateMipmapsForTexture:, a
useResource:usage: with write usage and replaceRegion:. A write of a texture over a buffer is
the buffer's. A texture write covers the bytes of every other object placed in its heap that
its range meets; the object is written again by the player's writes into it (m2v.write,
contents at creation, copies from the guest's RAM, a snapshot's bytes before), a blit into it,
and, as the stream carries no buffer access, any binding of it to an encoder, a write-usage
useResource:usage: or a useHeap: of its heap. A check of a covered object reports `covered`
and a snapshot range meeting covered bytes `covered`, neither compared; a `covered N: ...`
line counts the covers and what they left out. REPLAY-STREAM.md says so, and says
gap_pipeline_ids is bookkeeping: nothing is skipped for it.
Test (replay::tests): a placement heap with a buffer and two textures at offset 0; a dispatch
whose state writes slot 0, which holds the first texture, covers the buffer and the second
texture; their checks are `covered`; the buffer written whole is compared again, the second
texture stays covered; a dispatch of a state that only reads the slot covers nothing.
Under the identity domains a buffer slot aligned to its argument was reached as its pushed address
plus the access's 32-bit byte offset sign-extended to 64 bits. The sign extension is what keeps an
offset below the bind address exact, but a device cannot split a sign-extended offset into a
scalar base and a vector offset as it does a zero-extended one. Now rt pushes the slot's address
less 2^31, and an access adds its offset plus 2^31 (modulo 2^32) to that word, zero-extended. That
is the same address for every offset in [-2^31, 2^31), which the 2 GiB buffer cap guarantees, in
one 32-bit add that a device fuses with the index's shift. A unit index x + c with a constant c
folds c into the bias: (x + c) * s + 2^31 = x * s + (c * s + 2^31) mod 2^32. The builder notes
each u32 sum of a value and a constant for that; the note changes no emitted word.
One place on each side:
- rt: pipeline::address_word, used by the compute and render push writers for every
BufferAddress field: a bound buffer, a setBytes copy, or the nil buffer.
- translator: lower::access::pointer.
- biased_slot_address feeds the direct reach.
- slot_address (the word plus 2^31) feeds every other reader: an access from the word below
it, a pointer compare, ptrtoint, the memmove overlap's Metal addresses, and pulled vertex
fetch.
- The bias applies only under the identity domains and only where the word is pushed: a
replay variant reads the true address from its root entry.
Unchanged:
- A texture's or sampler's resource ID and the parameter block's address are not biased.
- A pointer loaded from an argument buffer keeps today's form: the address the buffer holds.
- The default domains, which the old runtime and the golden tables use, take no new instruction:
the readers there load and bitcast the field in the same order as before.
Argument-buffer pointers left in their form (planner's condition):
- They are 19.6% of the corpus's device and constant accesses.
- Time-weighted, they are 0.8% of accesses on the 780M stream gb-780m-u4 and 2.4% on the RTX 3090
stream gb-3090-r5.
- Kernels with any such access take 1.9% and 8.4% of those streams' GPU time.
Slot pointers used as values, in the entry functions of the corpus's 11,580 kernels (census over
the local sources shards):
- 781 (6.7%) use one as a value: 14 convert one to an integer, 46 compare one, and 731 store one.
Every such store but one writes private memory (a pointer cell); the one other writes device
memory.
- 3,511 (30.3%) pass one to a non-inlined function.
- 33 pass one to an air.* call (command encoding, intersect).
A ptrtoint and a compare read slot_address. A pointer parked in a private cell or passed to a
function stays a fat pointer, whose accesses take the forms above. The one store to device memory
makes a wide pointer, which reads the root table, a field identity_admits does not admit. A new
engine test, a_slot_pointer_used_as_a_value_is_its_metal_address,
runs a kernel under the identity domains with biased pushes on the interpreter. It does a ptrtoint
to i64 and to i32, an address compare, and loads 4 bytes below a bind address and 20 above
another, and checks each against the true addresses.
Probe numbers (measured: one particle kernel run alone on RADV 26.2.6, us per dispatch, best of
forward and reverse; the module's two positions accesses changed by hand). Biased form against the
plain zero-extended offset (inexact below the bind address), at subgroup size 32 and at the
driver's 64:
- RX 7900 XTX: 33.6 vs 33.6, 30.8 vs 30.6; at 4x the grid 374.6 vs 374.0, 273.1 vs 272.9.
- PHOENIX 780M: 168.1 vs 168.3, 121.1 vs 120.5; at 4x 2521.9 vs 2522.8, 1744.6 vs 1752.8.
- HawkPoint 780M: 173.3 vs 173.2, 122.5 vs 122.7.
The sign-extended form it replaces measured, at 32:
- HawkPoint: 189.8 (same job), 9.5% slower.
- PHOENIX at 4x: 2735.3 (same job), 8.5% slower.
- XTX: 35.9 (another job), 6.8% slower.
The XOR form with a host-biased word (V7) measured 178.8 on HawkPoint: the add is the one that
fuses.
The tests:
- The identity engine tests push the biased word through engine_word_phases::slot_word.
- rt's three hand-made test kernels (ADD, STEP, WIDE) add 2^31 to each slot word. Their arrays
are regenerated from the doc GLSL with glslangValidator --target-env vulkan1.2 and checked with
spirv-val. Today's GLSL reproduced today's arrays exactly before the edit.
docs/API.md (sections 1 and 5), PushField::SlotGuestBase's doc and rt's README known gap on the
2 GiB cap state the word and the form.
SEMANTICS_VERSION 2186 -> 2188 and ARTIFACT_FORMAT_VERSION 544 -> 546. The identity nolockstep
lane holds 2187 and 545, unlanded; these take the next numbers so the two land separately.
The read direction of an export: another API (a video encoder) reads what a blit
wrote into an exported block. BlitCommandEncoder::release_to_external(&buffer),
which Metal has no counterpart of, records one buffer barrier into the encoder's
command buffer after every earlier command: the whole block's release from rt's
queue family to the acquire's other family (EXTERNAL for an opaque handle,
FOREIGN_EXT for a dma-buf), src ALL_COMMANDS / MEMORY_WRITE. No submission of its
own, nothing on the submit thread, no wait. It is a write use of the buffer for
the encoder's ordering: textures over a buffer in the block copy back first, and
since Vulkan ignores a release's second scope and only ALL_COMMANDS waits for it,
the barrier after it is owed (Building::release_command, beside owe_pass; the
flag owed_pass is now owed_all), paid by the next command or the command buffer's
end barrier. Counted in Metrics::external_releases and Metrics::barriers. A
buffer whose block is not exported is Refusal::NotExported (its doc and Display
now name the release too).
Release after release without an acquire is the spec's own case (7.7.6 NOTE: "It
is valid to never call the acquire operation after a release, and instead simply
start using the resource on any queue (even the releasing queue), but the
contents should be reinitialized before being read"), so the next frame's blit
needs no acquire. The README and the acquire's doc state the read direction's
contract: the other API reads from the command buffer's completion; from the call
until the consumer's next write through the runtime, the runtime reads nothing of
the block and the consumer encodes no read of it.
The export device test now releases through the call, twice in two command
buffers with no acquire between (fill, release, fill, release), and the second
device reads the second fill's bytes; a release of a buffer in a taken block is
NotExported; external_releases grows by 2. REFUSALS.md and the API signature table
regenerated; the replay's metrics name external_releases.
Verified: build and device legs follow (job ids in the lane's report).
The consumer asked for RenderPipelineState's imageblockSampleLength and
imageblockMemoryLengthForDimensions:. Metal's render answer is not 0 without an explicit
imageblock: it counts the color attachments' texels (measured on an M3 Max and an M4, and kept
by the translator as metal::format::imageblock_sample_length: [R8Unorm, R32Float] is 8). rt makes
no state whose fragment function reaches an imageblock (RenderPipelineKind::Imageblock), so a
state's sample is its colors alone, computed once per content from the descriptor's color
formats; the memory length is that times the width, the height and the raster sample count, none
rounded, as the old runtime answers it from the same measurements. A color format with no
measured place in Metal's record answers the gap.
The gap is one variant for both states: Gap::ImageblockMemoryLength { dimensions } becomes
Gap::ImageblockLength, which the compute state answers for a kernel that declares an imageblock
it never reaches (or whose compile kept no reflection to tell) and the render state for an
unmeasured color format. The compute state's imageblock_memory_length_for_dimensions answers u64,
as the render state's does.
Test: every_device_answers_a_state_s_metal_answers also makes a render state of R8Unorm and
R32Float colors: 8 bytes a sample, 512 for 8 by 8 pixels of one sample. README (render states;
the compute paragraph's gap name), api_signatures.tsv and REFUSALS.md regenerated.
Verified at this commit: cargo fmt only. The build and device legs run on the lane's tip.
The consumer counts each Metal answer rt holds but does not give. ComputePipelineState now
answers three more, each from its whole module's translation, kept per content (Answers):
- static_threadgroup_memory_length(): staticThreadgroupMemoryLength, the translator's
ComputePipelineMetalInfo::static_threadgroup_memory_length (rounded up to 16 as Metal reports
it); the threadgroup memory rt adds beside it is not counted.
- thread_execution_width(): threadExecutionWidth, the translator's thread_execution_width, 32 on
every device (the old runtime answers the same value from the translator): a kernel that
observes its SIMD group runs it 32 wide, and one that does not cannot tell its width.
- imageblock_memory_length_for_dimensions(dimensions): 0 for a kernel that declares no
imageblock. rt makes no state for a kernel that reaches an imageblock (the translator records
RuntimeFact::ImageblockSize on its first use, which the interface refuses as Gap::KernelInput),
but the translator plans only used parameters, so a kernel that declares an imageblock it never
reaches does get a state. For it, and where the compile kept no reflection to tell, the answer
is the new Gap::ImageblockMemoryLength { dimensions }: no authored case measures Metal's length.
Whether the kernel declares one is read once per content from the reflection its compile kept
(ComputePipelineDescriptor::reflection over StageSource::Compiled, decoding nothing).
Test: every_device_answers_a_state_s_metal_answers (device cfgs): the harness's block_scan
answers 1024 bytes of static threadgroup memory (256 words), sample_down 0; both 32 wide and an
imageblock length of 0. README (compute states), api_signatures.tsv and REFUSALS.md (26 -> 27
gaps) regenerated.
Verified at this commit: cargo fmt only. The build (clippy of rt under both device cfgs) and the
device legs run on the lane's tip.
They are generated from the whole case set, and the set grew on `development`
while this branch was in flight, so the copy committed here counted a smaller
one.
Verified: regenerating at this tip leaves no change beyond the `Generated at`
stamp.
Metal's answer on all 14 sites is the stride model: each row at its offset plus the row index
times the stride, the bytes between and after the rows 0xcd. docs/CONFORMANCE-COVERAGE.md
regenerated (scripts/conformance-coverage/coverage.py).
What: every buffer and texture placed in one heap takes the heap's id in the compute encoders'
hazard sets, whatever its tracking mode and whatever bytes it reaches. A heap is the one at its
offset in its block (`HeapRange`); `HeapIds` maps each to an id that lives while a resource of the
heap does, the entries of gone heaps dropped once the map doubles (at least 64). Textures placed
by `new_heap_texture` take it at once. Buffers take it through the new
`Device::new_heap_buffer(heap, offset, length)`, `MTLHeap`'s `newBufferWithLength:options:offset:`
(a buffer past the heap's end is `Refusal::HeapBufferPlace`); a buffer placed by `new_buffer` is no
heap's and keeps its own id. Views take their parent's; a texture in place over a heap buffer takes
the buffer's. Only the hazard sets read it: the copies over buffers and a pass's attachments keep
naming resources by their own ids (`Accesses::each(interface, tracked)`). The player places a
stream heap's buffers with `new_heap_buffer` and a stream block's with `new_buffer`; the
conformance crate's heap buffers take `new_heap_buffer`.
Why: Metal tracks a heap's resources as one, "tracking is done at the granularity of the heap"
(MTLHeap.h, hazardTrackingMode), and the old runtime keys a heap buffer's and a heap texture's
hazard identity by its heap (metal2vulkan-runtime heap.rs, tracker.rs). rt keyed them by resource,
so inside one encoder, or after an encoder that only read, a write through one heap resource and a
use of another over the same bytes got no barrier.
Tests: `every_device_orders_a_heap_s_resources_as_one`: two heap buffers over the same bytes take
a barrier between a write and a use and the second sees the first's words; two apart in one heap
take one too; two heaps' none; a buffer past its heap's end is refused; 200 heaps that come and go
leave at most 64 entries. docs/REFUSALS.md and the API signature table regenerated (two records
added: the method and the refusal).
Verified: cargo fmt; refusal_surface.py and signatures.py --bless. Build, clippy and the device
suites on the check job named when the branch is handed over.
The planner's ruling on the twelve old-side RADV rows f1aa961e34 added: the frozen old runtime
takes no new ledger row, so the case's notice-justified bound is scoped to the new runtime and the
old runtime's side keeps what it had, which was no bound.
A new justification, Justification::NewRuntimeNotice (Justification::new_runtime_notice), holds
on metal2vulkan-rt's run as a degrade notice does, where the run announced it; on the old
runtime's run it holds nowhere and faults nothing (Unjustified::OldRuntime, which faults_the_case
excludes beside VenueCompresses), so the site compares as if the case loosened nothing. The venue
says which side ran (Venue::new_runtime: true on the rt side, false on the old runtime's and on
Metal's), and replay hands it to the comparison (Offered::on_new_runtime). compare's check that a
named justification exists treats it as it treats a notice.
The ten BC1 to BC5 decode cases loosen each round's texels by NewRuntimeNotice
(compressed-texel-decode). known-gaps.tsv is the ledger as it was before ae452ee883: the twelve
RADV rows go, and the 89 BC rows that commit's series removed (lavapipe 44, the RTX 5080 Laptop
40, RADV BC4 and BC5 5) and their comment are back, since the old runtime's sites differ again
as they did.
docs/API.md: the catalogue says the cases' bound is the new runtime's alone.
scripts/conformance-coverage: the justification vocabulary reads new_runtime_notice;
docs/CONFORMANCE-COVERAGE.md regenerated.
Test: tests::a_notice_scoped_to_the_new_runtime_leaves_the_old_runtimes_site_its_one_row (the old
runtime's site is its one divergence, unfired for OldRuntime; rt's announced; rt without the
notice faults).
A decoder writes a frame into an exported block through its import of the handle; the
runtime's commands may read it only after the block's ownership comes back from the other
API's queue family. Vulkan's external memory requires that transfer whatever the sharing mode
(section 7.7.6, "Resources shared with external APIs or instances using external memory must
also explicitly manage ownership transfers between local and external queues").
Block::external_writes_done() records the acquire: one buffer barrier of the whole block, from
VK_QUEUE_FAMILY_EXTERNAL for an opaque handle (same device and driver) or from
VK_QUEUE_FAMILY_FOREIGN_EXT for a dma-buf (another driver), to the runtime's family, visible to
every later command. It goes in the upload, as zero_block_range's fill does: submitted ahead of
every command buffer committed after the call, holding the block until it completes, with no
wait for the GPU. The consumer calls it after its own wait on the decoder. A dma-buf names the
foreign family, which VUID-VkBufferMemoryBarrier2-srcQueueFamilyIndex-09099 allows only with
VK_EXT_queue_family_foreign enabled; new_exported_block already refuses a dma-buf export where
it is not (Limit::ExportType { listed: None }), so every exported dma-buf block can name it.
No release back to the other API is recorded. Section 7.7.6: "If an application does not need
the contents of a resource to remain valid when transferring from one queue family to another,
then the ownership transfer should be skipped." A decoder that overwrites the whole block needs
nothing the runtime left in it, so only the decoder-to-runtime direction is a transfer. The
contract, in the rt README beside the two calls: between external_writes_done and the other
API's next write of the whole block, the other API does not access the block, to read or to
write. The old runtime records the same acquire and no release.
Metrics::external_acquires counts the acquires (each also one of Metrics::barriers); the
replay report prints it. A block that is not exported is Refusal::NotExported. memory::Own's
Export carries the handle, which names the family.
docs/REFUSALS.md regenerated; api_signatures blessed.
Tests (src/tests/export.rs, device cfgs): after the second device has read rt's bytes, it fills
the whole block and releases it to the external family; external_writes_done is counted, and a
blit then reads the second device's bytes. An acquire of a taken block is refused typed.
Verified at this commit: cargo fmt only. The lane's build and device legs run on the tip that
carries it.