The executed counters take the runtime's commit_lock_wait_nanos, so a frame's line gives its
commits' waits for the work lock, summed; the backend's lines give commit_lock_wait_max_nanos,
the longest wait in the play, which is a maximum and no frame's counter. The runtime has no
product metric of the other calls' waits for the lock (the surface make's included): only the
device tests' per-thread total times those (crate::submit::waits).
Read with it (player built at this change's first form, 307b1998f9, job m3-max-55631; no
validation layer; the player commits from one thread, so these say only that the runtime's own
threads, submit, completion and block maker, hold no caller long):
- syncview-4k-780m, whole (1501 frames), Radeon 780M (RADV), job m3-max-55670: 0.609 ms of waits
over 8066.2 ms of frames (0.008%), the mean frame's share 0.007%, the worst frame's 0.301%
(0.022 of 7.436 ms), the longest wait 23.3 us, no frame's waits past 1 ms;
- glbench-3090-r2 to frame 300 (301 frames), lavapipe, job m3-max-55669: 3.680 ms over
39383.2 ms (0.009%), the mean frame's share 0.007%, the worst frame's 0.431% (0.015 of
3.370 ms), the longest wait 1.367 ms, in the one frame whose waits passed 1 ms (1786.6 ms long).
Verified: see the check job named in the landing.
A checked access (an access of a slot the identity domains check, at an offset the module does
not hold as a constant) emitted the normative check whole: m + before, len >= n, len - n, a
compare and an and, five instructions (25 words) per access. Two of them depend only on the
slot and the access size. The check is now at = m + before; at < limit, two instructions (10
words), under the slot's limit for n-byte accesses, psb::limit: len - min(len, n - 1), an
OpExtInst UMin and an OpISub (12 words; the length itself for 1-byte accesses), made once per
slot and size. EmitCx::slot_limit makes it in the function's first block where the bounds are
split there (load_push_fields), through FunctionBuilder::in_entry_block, which appends to the
entry block before its terminator, so every checked access of that size in the function
recalls it; elsewhere it is made in the open block. Both check sites (emit::prepare and the
pulled fetch's address_read) take it.
Exact: where len >= n the limit is len - n + 1, and at < len - n + 1 is at <= len - n; below
that the limit is 0, which no offset is under. len is at most 2^31, so nothing wraps.
Tests: psb::tests::an_offset_under_the_limit_is_one_the_normative_check_admits runs the form on
the interpreter harness (offsets around the buffer's ends and near 2^32, n 1, 2, 4, 16, both
widths, buffers of 0 to 64 bytes) against contain::in_bounds;
engine_identity_contain::a_checked_slots_limit_is_made_once_per_size_in_the_first_block reads
the contain kernel's module on every identity profile: two limits in the first block, three
compares under them.
Docs: docs/API.md section 5 and PushField::SlotBounds say how the check is computed.
SEMANTICS_VERSION 2197 (every checked module changes); ARTIFACT_FORMAT_VERSION 553 with it.
python3 scripts/conformance-coverage/coverage.py at ddf7a8ccd2 (job
m3-max-55493 on msi, which then ran the conformance crate's suite on
lavapipe against this document: 1087 tests run, 1087 passed; clippy
-D warnings and rustdoc -D warnings of the crate clean). One more case
module and recording, one more module that loosens a measured value (the
long-of-infinity elements).
The planner's ruling: MSL 8.6 promises round toward zero and NaN to 0 and
nothing past the range, so the translator keeps saturating, the case keeps
every past-range row compared, and declares the long-of-infinity pair under
docs/API.md's row.
The row (the plain-fptosi line this lane added) now says what it covers: a
float past an integer's range converts to the nearest bound, Metal on the
M3 Max answering the same at every width but long, whose two infinities it
converts to 0 (job m3-max-55436), and the plain LLVM cast is the device's
own. Its lead-in moved, so its slug is new; nothing else names it.
The case loosens exactly those elements: at each of the four long-of-float
and four long-of-half sites, the bytes of input 14 (+inf) and 15 (-inf),
each to any of 0 and its bound (AnyOf), justified by that entry. A test
holds the two inputs to be the infinities and the entry to be in the
document.
The translator lowers LLVM's plain fptosi/fptoui to a bare OpConvertFToS or
OpConvertFToU, whose answer for a NaN or an out-of-range value SPIR-V
leaves undefined, while MSL 8.6 sends a NaN to 0. No accepted difference
said so.
Metal's compiler never emits the plain cast: probe job m3-max-55309 compiled
int(), uint(), static_cast and two-lane vector casts of float and half in a
kernel and in fragment functions, with fast math on and off, and every one
is an air.convert call (which the translator saturates). Over the indexed
corpus (29446 modules, job m3-max-55344) and the replay streams on every
node that holds them (jobs m3-max-55344, 55346, 55348, 55349, 55350, 55351)
no function holds a plain fptosi or fptoui; the same walk counting
air.convert float-to-integer calls finds 35606 in the corpus and 19840 in
the M3's streams (job m3-max-55356), so the scan reads real IR.
So the plain cast stays the device's conversion, stated in docs/API.md's
accepted differences under Conversions.
Metal's domain for a buffer argument is the buffer: an access before the bind offset reads the
buffer's bytes there. The containment check measured the offset from the bind offset against
the bytes from there to the buffer's end, so a checked access before the bind offset read zero
and a store there did nothing, where Metal reads and writes the buffer.
- PushField::SlotRemaining (u32) becomes PushField::SlotBounds (uvec2): the buffer's bytes
before the bind offset (the bind offset), then its length; a set*Bytes copy 0 and its length;
nil 0 and 0. The check is psb::in_buffer: (len >= n) && (m + before <= len - n) in u32, m the
offset from the bind offset read as signed. Before the buffer's start the sum wraps to at least
2^31, past every length (no buffer is longer than 2 GiB). One add more per checked access and
one more pushed u32 per checked slot.
- Offsets are signed on every identity form: the word-below form (psb::prepare_at, also the
pulled fetch's) now sign-extends the offset instead of reading it from the slot's window start,
as the direct form already did through its 2^31 bias.
- The new runtime's encoders push the bounds (encoder::bounds, Tables::bounds); the old runtime's
binder writes them from the bound buffer and still refuses ZeroAddress.
- The old runtime's lowering is unchanged; SEMANTICS_VERSION 2195.
Tests: engine_identity_domain (new, interpreter): on both identity forms a run-time -4 at bind
offset 16 reads the word at 12 and at bind offset 0 reads zero, a constant -4 at bind offset 16
reads the word at 12, and the default domains read the word at 12 as docs/API.md says.
engine_identity_contain adds an access before the bind offset (inside the buffer: read and
written) and one before the buffer's start (outside). The identity tests push the bounds.
Docs: API.md sections 1 and 5 and the new runtime's README state the domain and the cost.
On the floor a fragment function's push fields started at the vertex function's push end rounded
up to 8. Where that end is a multiple of 4 and not of 8, the four bytes below the base went
unused, and a fetching fragment function placed its four-byte element index
(PushField::FetchedColor) after its eight-byte fields: a pair that fits the floor's 256 bytes
with those four bytes used was pushed past them. The fragment base is now the vertex function's
push end, and FetchedColor sorts after SlotBindOffset and before the slot addresses
(SlotGuestBase): a fragment function that pushes no parameter block's address places it in those
four bytes. Each field is still placed at the next offset aligned to it, so a fragment function
whose first field is eight bytes, the spilled block's address included, starts where it did, and
the vertex function's window still ends at 248. The fixed windows read no base: the old runtime's
modules are unchanged.
The docs that stated the rounding say the base is the vertex function's end: the push module,
VERTEX_FLOOR_END, LoweringInputs::push_base, docs/API.md section 5, rt's README, and the render
identity test's notes; the spill test reads the base unrounded (its vertex function ends at 248).
A surface plane whose texture is a shader-read render target takes the feedback
usage where the handle's image format query offers it with the export features
alike (Query::plane; a D3D11 import's query the same), and the in-place make
retries without it where the images with it do not hold the layout; a plane
without it reads through its shadow, the counted copy. The fetch and the texture
read choose the loop or the shadow by the image, not the device.
Metrics::attachment_loop_reads counts every draw that reads an attachment of its
own pass through the loop. Device tests (tests/fetch.rs): N fetching draws exact,
N-1 barriers or copies more than one; a surface plane of each fetched format.
RenderPipelineKind::FramebufferFetch removed. SEMANTICS_VERSION 2193,
ARTIFACT_FORMAT_VERSION 550 (PushField::FetchedColor). REFUSALS.md and
api_signatures regenerated; README and API.md.
Draft: the old render key re-pin follows the compile check.
docs/REFUSALS.md and the API signature table regenerated for the resolve
items (m3-max-54897's REGEN and BLESS). Refusal::ResolveFormat's basis named a
device the cluster has no record of; it now cites what metal2vulkan-runtime's
RenderPassProblem::ResolveFormat records: Metal's validation assert for an
integer resolve target. The color resolve test's target took SHADER_READ,
which a texture made without an index refuses (lavapipe, m3-max-54897); a
resolve target needs RENDER_TARGET alone.
Verified: see the check job named in the landing.
A store action that resolves (MultisampleResolve, StoreAndMultisampleResolve, and
Unknown where the attachment names a resolve texture) resolves in the same rendering:
the attachment's VkRenderingAttachmentInfo names a view of the resolve texture's
resolveLevel and resolveSlice and a resolve mode, so the pass adds no pass, copy or
barrier of its own. Color resolves by AVERAGE, the mode Vulkan requires of a float,
normalized or sRGB format, under the new static note PrecisionNote::DeviceRoundedResolve
(RenderPassDescriptor::precision_note) on every device. Depth resolves by its
MultisampleDepthResolveFilter: Sample0 always, Min and Max where the device's
supportedDepthResolveModes has them; stencil by Sample0. Refused as Metal refuses them:
a resolving action with no resolve texture (Refusal::ResolveTexture) and an integer
format's resolve (Refusal::ResolveFormat). Gaps: RenderPassKind::Resolve (another
format, one sample, an emulated encoding, two depth-stencil views), ResolveFilter
(a mode the device lacks, DepthResolvedSample, an unpaired aspect) and LateStore (a
later store that does not resolve an attachment that began resolving).
The old runtime maps the new note to its device-rounded-resolve degradation; the
validation allowance, the conformance suite's rt side and the replay player carry the
resolve fields and filters.
Evidence, draw_full_4x: 64 full-screen draws in one pass into a 4-sample RGBA16Float
target, resolved as the pass ends (MultisampleResolve) into the 1-sample texture the row
checks texel by texel against the draw colour before its timed runs. Each arm records, a
run, 64 draws, 1 pass, 1 barrier and no copy: new's Metrics::resolves 1; old's 1 render
pass instance, 1 vkCmdBeginRenderPass, 64 draws, 1 barrier, no image copy or blit
(m3-max-55061). GPU p50 in us, old,new then new,old, one harness build each:
780M new 259.0/258.7 against old 1933.6/1827.4, new is 86% faster; RX 550 new
1643.5/1643.8 against old 7207.8/7209.3, new is 77% faster (harness at 1ff6574894,
m3-max-55050, 55061); RTX 3090 new 170.0/171.0 against old 188.7/190.0, new is 10%
faster; Iris Xe new 1006.4/1007.7 against old 1022.1/1019.8, new is 1.4% faster
(harness at 5af66e2c4e, m3-max-54928, 54938, 54939). Why old is slower on AMD is not
traced.
Verified: see the check job named in the landing.
The new runtime takes no form of the SPI newTiledTextureWithDescriptor:offset:bytesPerRow:, and the
player made an ordinary texture in its place whose texels were not the program's: on lavapipe the
two runtimes' plays of one stream first parted at the frame whose draws first read such a
texture. Those texels now come from the buffer, as the old runtime gives them.
What the old runtime does, read from its code:
- crates/metal2vulkan-runtime/src/buffer_texture.rs:534-591 (Buffer::new_tiled_texture) and
shadow.rs:228-250 (the module's "Copies taken at use"): a texture of more than one level is one
image of its own. The first command of an encoder that uses any of its levels after the making
(or after did_modify_data, or a replace_region of the first level) takes the copy, before that
command and inside its command buffer. The take copies every texel of the first level from the
buffer at the offset, rows bytesPerRow apart, then makes each later level from the first as
generate_mipmaps makes it. It reads no level past the first from the buffer.
- shadow.rs:386 (LevelsCopy) and :404 (LaterLevels): the later levels come from generate_mipmaps'
plan for the format (the device's blit chain, the compute filter, or the integer picks). For a
format that generate_mipmaps leaves as it is or refuses, they are kept.
- buffer_texture.rs:537-538: a texture of one level is the texture over the buffer that
new_texture makes.
The stand-in, through the runtime's public API only:
- An ordinary texture of the descriptor.
- At the first use since its making, the take is owed to that use's command buffer. A use is an
encoder's command or a render pass's attachment naming the texture or a view of it, skipped
encoders included.
- The take runs as one blit encoder (copy_from_buffer into level 0, then generate_mipmaps) in a
command buffer of the play's own. It is committed on that command buffer's queue, after its
copies from the guest's RAM and just before it, so it reads the bytes as they are when that
command buffer runs. A format the runtime refuses mipmaps of (MipmapFormat, MipmapFilter)
keeps its later levels.
- Counted apart from the stream's work: tiled_textures, tiled_takes, tiled_take_bytes,
tiled_mipmap_generations, tiled_levels_kept, and tiled_gpu_nanos (its GPU time, in no frame's
gpu_busy, as the guest RAM's copies are). The report has a "tiled textures over a buffer" line.
- A tiled texture of one level plays as the public texture over the buffer.
- A replaceRegion of a tiled texture's first level is refused. On the old runtime it writes the
bytes and owes another take; no stream played here has one.
Where it differs from the old runtime: the take runs ahead of the whole command buffer, not just
ahead of the using encoder, so what an earlier encoder of that command buffer writes into the
bytes or the texture lands after it.
The tiled kind leaves the substitutes: substituted_tiled_textures is gone. The "substitutes read"
line now counts gap substitutes alone.
Tested by:
- rt_replay::a_tiled_texture_takes_its_buffer_s_bytes_and_levels_at_first_use (lavapipe, both
runtimes): a 128x2 two-level tiled texture whose 2x2 squares hold one colour each. Blits of both
levels read the buffer's texels and the squares' colours, with equal digests on both runtimes
and one take counted.
- The unit test of the substitute lines, now gaps alone.
The planner's ruling on the replay matrix's rule (c): besides a first parting draw traced to a
function that carries a static precision note, one traced to a counted player substitute (an
ordinary texture the play makes in place of one the runtime cannot make, whose texels are not the
program's) is accepted with its size printed, and its row says where the replay substitutes what.
Docs only.
A digest play that checks a present (--check-presents) now also keeps the shown texture's bytes
as presents/frame-F.bytes in its --out directory, with a `shown ID frame F format P width W
height H` line from the backend's shape of the texture (Backend::texture_shape, old and new
runtime). compare-plays, with no --frame, prints for each frame whose digests differ and whose
bytes both plays kept the texels that differ and their share, the largest difference of each
channel in the format's units (8-bit unorm, 10:10:10:2 and half-float layouts; bytes for
another), and the box the differing texels lie in. The bytes stay on the host that played them.
Each frame's end line gains unix_nanos, the system's clock at the frame's end, so a job wrapper's
own timestamped device samples can be set beside the presents.
REPLAY-STREAM.md gains both, and the planner's two rules: a picture difference at the judged
frame is accepted only when sized and its first parting draw is traced to a function with a
static precision note and no state difference; an NVIDIA time row bins presents by the covering
clock sample's state, at least 30 an arm, else "not comparable by time" with the counts.
Tests: replay::tests::a_kept_present_writes_the_shown_texture_s_bytes_and_each_end_its_time,
a_picture_difference_is_sized_by_texels_channels_and_box,
two_plays_kept_pictures_that_differ_are_sized.
Under the identity domains a vertex or fragment function whose push fields passed its share of
the floor's one 256-byte range was refused (Unsupported{IdentityDomains} needing
maxPushConstantsSize). Once containment added each checked slot's length (SlotRemaining) and the
zero range's address (ZeroAddress), pairs reached 272 bytes and were refused: 3 render states of
windrag-780m-b2 (223 draws) and 4 of syncview (259 draws), and the guest's GL-layer pipelines on
reims's walks. A render function now spills as a kernel does: it pushes its parameter block's
address first (PushField::ArgumentTableAddress) and reads every field past its window from the
block, each loaded once, in the function's first block (EmitCx::load_push_fields). The refusal and
its REFUSALS.md row are gone.
- Order: the check's fields are last in the derived Ord of PushField, after
TessellationFactorAddress (ZeroAddress, then each SlotRemaining), so what every access reads is
placed ahead of what only a checked access reads, and the check's fields are the first to move
to the block. The codec's list is unchanged.
- The vertex function's floor window is [0, 248) (push::VERTEX_FLOOR_END). A vertex function is
lowered without knowing its fragment function, and a fragment function that spills pushes its
block's address (8 bytes, 8-aligned) from the vertex function's end, so the vertex function
leaves that room. Cost: only a vertex function whose own fields pass 248 bytes spills where it
used to fill the last 8.
- metal2vulkan-rt: Draws holds each field's place (the push range or its function's block) and
each function's block (length, the push offset of its address). A draw that fills its pushed
values anew writes each block into the parameter ring and its address into the range;
ring_writes counts it. A block longer than a ring chunk stays Gap::RenderPipeline(DrawInput).
- SEMANTICS_VERSION 2194 (placement changed).
Tests: push.rs's edges (a vertex function ending at 248 with a spilling fragment function, whose
address goes at 248; a fragment base of 244, whose address is still at 248; a vertex function
whose fields would reach 252, which spills); engine_identity_spill: a vertex function of 25 slots
pushes its block's address first and every slot's address, spills only the check's fields, passes
L3, and loads each spilled field once in its first block; the pair with a fragment function from
248 compiles and validates on every identity profile; on the interpreter its sums are Metal's, and
lengths pushed one word short, in the window and in the block alike, read zero.
Docs: push.rs's module text, docs/API.md (section 1) and the rt README state the shares, the 248
and its reason, and the spill.
docs/API.md: the policy's identity-domain text and section 5 state SlotRemaining and
ZeroAddress, the normative check in u32, what an outside load, store and atomic do, that an
offset before the bind offset is outside, and what stays unchecked (constant offsets, pointers
loaded from memory or made from integers). The rt README's known gaps say the same for buffer
arguments, the nil buffer's length 0, and the pulled fetches.
A check of a Private texture (a stream's m2v.check, or the shown texture of a present that
--check-presents lists) read it with getBytes, which the runtime refuses for a Private texture as
Metal does, so a digest play on the new runtime stopped at the first listed present whose texture
is Private ("the CPU reaches no Private or Memoryless texture"; syncview plays on Iris and the
3090 stopped at frame 296). The old runtime's play reads every texture through a blit. The new
runtime's now copies a Private texture's first level into a Shared block on its read queue, as it
reads a Private buffer, and waits for it; a texture the CPU reaches keeps getBytes.
Test: rt_replay::a_private_shown_texture_is_checked_through_a_copy clears a Private 4x4 RGBA8
texture to red, shows it at present 0 and lists that present; the check's sha256 is the 16 red
texels'.
Under RADV (Mesa 26.2.6) an RX 7900 XTX's memory allocated with
VK_MEMORY_ALLOCATE_ZERO_INITIALIZE_BIT_EXT read earlier processes' bytes, so the
form's zeros are not the zeros Metal's newBufferWithLength:options: and a new texture
owe. Metal says a new buffer is zeroed; the runtime now writes those zeros itself on
every device, with no per-device exception and no start check.
The extension leaves the optional list; its feature, the allocation flag and the
zero-initialized image layout go, with Capabilities::zero_initialize_memory,
Features::zero_initialize and ZeroInitializeDeviceMemoryFeatures. BlockInfo::zeroed
and the zeroed-take and zeroed-texture metrics lose their source and go. A placed
texture is cleared in its upload on every device (texture_clears); the harness zeroes
every buffer through new_buffer's zero_from; the player's judged zeroed-texture
metrics are the clears alone. The rt README records why the extension is unused.
Verified: see the check job named in the landing.
Recorded on the M3 Max, macOS 27.0.1 (26A434), by `conformance record` in job m3-max-54229, three
runs each. Metal's side makes the same surface for these cases as for the VA-API ones, and each
recording's outcomes equal its VA-API twin's. CONFORMANCE-COVERAGE.md regenerated.
The surface make now submits and waits for nothing (9c4eca8313): each in-place plane image leaves
the undefined layout in the runtime's next submission, a move that may discard the memory's bytes,
and the consumer calls Surface::wait_until_ready before the other API's first write. The player's
rt arm made video surfaces without that wait, so its plays of a video recording did not do what the
product does between a surface's make and its first picture. It now waits once at the make (the
earliest the player knows the surface's format and size), before any m2v.externalWriteDone
acquires it, and the report's executed counters carry the runtime's surface_waits.
docs/REPLAY-STREAM.md section 10 says so.
Test: runtime_lane::rt_replay::a_video_surface_is_waited_for_at_its_ready_point_once (Unix: one
surface for two plane textures, two acquires, surface_waits equal to the surfaces made in place).
Recorded and timed on the M3 in job m3-max-54332 at 0cd13ee9f9 (record, then times --runs 8
--write, both legs, 8 rounds; Metal's validation ran the case). The coverage document is
regenerated.
A timing verdict between two plays (compare-plays) needs equal digests at the judged frame, and a
stream without m2v.check records (the desktop-and-video recording has none) gave no frame a
verdict. command-replay play --check-presents F,... now checks, at the m2v.present of each listed
frame, the texture the present shows, as an m2v.check of it with no recorded checksum would: a
check line of that frame, which compare-plays reads as the frame's digest. A present of nil
checks nothing. The readback is the player's own work (uncounted) and its time is the frame's
read, so the digests come from a play apart from the timed ones; docs/REPLAY-STREAM.md says so
in the player's section and in the verdict rule.
Test: replay::tests::a_listed_present_checks_the_shown_texture (no checks unlisted; checks at
frames 1 and 3 of the listed 1, 2, 3, frame 2's present being nil; the line's digest is the
backend's bytes; every present still ends its frame).
docs/REPLAY-STREAM.md section 10 now says how the new runtime's backend plays a buffer made as a
video surface's pages (one surface through Device::new_exported_surface, its plane textures' views,
the acquire at m2v.externalWriteDone, no shapes or refills), what --video-handle picks (dma-buf with
the VA-API layout, opaque-fd with NVIDIA's), what the video-surfaces report line and the video_*
counters count, and how the old runtime's backend plays the same buffer; section 4's table says the
same for the two records. Docs only.
Metal on the M3 Max (macOS 27.0.1, job m3-max-53825, three runs, one
outcome) answers metal2vulkan_devtools::threadgroup_start::answer in each
of the six dispatches: no word of the declared array or of the
[[threadgroup(0)]] region read nonzero before the program wrote it, in
the later threadgroups of 2048 of 16 KiB and in the second dispatch;
every pattern read back (0xffa00000); its SIMD groups of 32 in thread
order. docs/API.md states that answer, the engine fixtures' README lists
tgz_reads, and CONFORMANCE-COVERAGE.md is regenerated.
On the new runtime's profile every Workgroup variable that holds a
function's threadgroup memory has a null initializer: the threadgroup
arena (declared threadgroup variables, [[threadgroup(n)]] regions and the
imageblock, memory::arena) and the typed threadgroup objects
(lower::access::local). One form on every device: the Vulkan 1.3 floor
requires shaderZeroInitializeWorkgroupMemory; a profile without it
refuses such a function, Unsupported{ZeroedThreadgroupMemory}.
Device::new's profile is unchanged (ProfileFacts::ROWS keeps
ThreadgroupStart::Unwritten), so the old runtime's SPIR-V is too.
The translator's own Workgroup words get none, as it writes each before
any read: the emulated SIMD-group scratch and vote word, the object
stage's mesh grid, the mesh wrapper's count and staged indices, the
emulated payload and the binder's scan and merge kernels.
The builder refused a null of an array whose length is a specialization
operation (spirv/ir/constant.rs, ConstRule::NullType); an arena with
regions, and the emulated scratch, have such lengths. spirv-val's
IsTypeNullable reads an array's element type alone, so the builder now
takes it. That refusal is what made rt report a probe's emulated variant
as missing (Gap::PartialSimdgroups after Later::lower's Refused).
The profile verifier also refuses a Workgroup initializer other than a
null (VUID-StandaloneSpirv-OpVariable-04734).
docs/API.md states the form with Metal's words on threadgroup memory;
SEMANTICS_VERSION 2192; REFUSALS.md and api_signatures regenerated.
Tests: engine_zeroed_threadgroup (null initializers through from_queries
on four profiles, zeros on the interpreter in both orders and two
threadgroups, the emulated variant's arena zeroed and scratch not,
Device::new uninitialized, the vk12 floor refused),
a_specialization_sized_array_has_a_null, a_workgroup_initializer_is_only_a_null,
the profile facts' fingerprint.
Metal's contract for a Managed buffer (MTLBuffer.h, didModifyRange:): a CPU write makes the range
undefined for the GPU until a didModifyRange: and a commit of the command buffer that reads it,
and it does not reach a command buffer committed before. The capture ring met that by copying
the bytes on the committing thread into 64 MiB of Shared staging, and the commit then waited for
the GPU whenever the ring was full. One recording on an RTX 3090 waited 258 times for 6.7 s
(m3-max-53409). The ring also kept a Managed buffer over an imported dma-buf, a block the runtime
does not map, refused (Refusal::ManagedBlockNotShared). On the XTX that refusal bound nil 2,804
times, and 28.8 million draws were then refused.
The planner ruled one form. The commit records the copy-in into a command buffer of its own:
vkCmdCopyBuffer of each named range from the consumer's block into the device copy, ahead of the
command buffer's commands in its submission, after the copies back owed to textures over the
ranges and before the copies into them. Vulkan's host write ordering guarantee makes the
consumer's writes made before the submission visible to the copies. The copy reads the bytes as
it runs, so a write after the commit may reach it, which Metal leaves undefined. The copy-in
holds each consumer's block and device copy until the command buffer retires.
What goes with the ring:
- capture.rs keeps the named ranges and the copy-in, and loses the ring, Chunk, Overflowed and
the staging blocks of its own;
- submit.rs loses the commits' turn (capture now records under the work lock), the streams of
ring-fulls, the waits and the ring's spans;
- the counters lose capture_waits, capture_streams, capture_overflows, capture_overflow_bytes,
capture_copy_nanos, capture_wait_nanos, Gauges::capture_bytes and the capture ring's site, and
managed_bytes_captured counts the bytes the copies take;
- the player's report and the API table lose the same fields.
A Managed buffer's bytes may be in any Shared block, mapped or not: contents is None over an
import. A Private block is refused as Refusal::ManagedBlockPrivate, since a Managed buffer has a
CPU-side copy ("the data pointer of this buffer's shared copy", MTLBuffer.h) and a Private block
has no pages the consumer can write. docs/REFUSALS.md is regenerated. The rt README's memory
contract says when the copy runs, and its known gap of the ring's waits goes.
Tests:
- the snapshot tests now hold the header's contract: write, didModifyRange:, commit, and that
command buffer reads the bytes, here also behind an event wait with the consumer's handles
gone before it runs. Nothing is asserted of a write under a pending command buffer;
- the ring's tests go;
- a range of three 16 MiB units arrives whole at one commit, with no staging and no allocation;
- a Managed buffer over an imported, unmapped dma-buf (Shared, contents None) reads what the
consumer wrote through its own mapping, on a two-copy card and on a unified one;
- a Managed buffer over a Private block is refused;
- the first named range allocates nothing at any site;
- the commit's lock-wait test marks the start of its count with a test-only flag, where it read
the turn.
Verified: see the check job named in the landing.
A render pipeline record without the tessellation key comes from a recorder
that did not carry it (glbench-3090-r2, glbench-3090-r3 and glbench-780m-r1
hold 19 post-tessellation records, none with the key; the newer recorders
write the key on every record, the defaults included), so the program's
tessellation state there is unknown and the player draws with Metal's
defaults in its place. The new runtime's backend marks each such state at its
making, carries the mark to the encoder at setRenderPipelineState:, and counts
the patch draws it plays through one: patch_draws_unrecorded_tessellation in
each frame line and the total, and a report line saying the state is unknown.
A released state drops its mark. REPLAY-STREAM.md says a record without the
key does not hold the program's state.
Test: a_record_without_the_tessellation_key_is_unrecorded (the key check and
the line). Checked by a potluck check job on msi (clippy in three
configurations and the touched tests).
A frame's `end` line gave only `gpu_busy`, the union of the GPU intervals of the command buffers
the frame waited for, so no report could say how long one submission ran: a frame of 1871 commits
with 12.7 s of GPU time could be one long command buffer or many short ones.
The player now keeps, beside the union, the longest single interval among those it already reads
(`Backend::gpu_interval`, the runtime's completion record) and that command buffer's stream id,
and the line prints them as `gpu_longest=N gpu_longest_cb=ID` after `gpu_busy`: the first of equal
ones, 0 and 0 where the runtime gives none. No query, wait or submission is added.
docs/REPLAY-STREAM.md section 10 states the two fields.
Tests: a new fake-backend test, replay::tests::a_frame_end_names_its_longest_command_buffer, and
the end-line assertion of a_frame_end_counts_overlapping_gpu_intervals_once, which takes the new
fields.
The rt backend's report lumped every translator refusal of a pipeline state under one
`Translation` key, so a play's `skipped render states` and `skipped compute states` lines named
only the first refusal's WHY, and counted gap substitutes with no kind at all. A census that joins
a play's refusals against open refusal sites needs each one's kind.
- `skipped render states` and `skipped compute states` key a translator refusal as
`Translation(KIND)`: `Unsupported(FEATURE)` with the refused feature as Rust prints it for
debugging, `LimitExceeded(LIMIT)`, `Internal(KIND)`, or the error's variant alone. Never a symbol
or a location, which name the program's functions.
- A new `substituted textures KIND N, the first #ID` line per kind of substitute: `Tiled`, or the
runtime's gap as Rust prints it (`TextureView { kind: TextureType }`). The counters
`substituted_tiled_textures` and `substituted_gap_textures` stay as they were.
- docs/REPLAY-STREAM.md section 10 states both.
Tests: two device-free tests in replay::new_runtime::tests. The refusal test fails on the old
single `Translation` key; the substitute test does not build without the per-kind count.
Device::import_d3d11_surface was a typed refusal (Gap::D3d11Surface). It now imports each plane's
NT handle (VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT) into a dedicated allocation bound to
an optimal image of the Direct3D 11 texture's own format, mutable and listing the descriptor's
format where the two differ (two formats a plane: R16Uint under RG8Unorm), into the first
device-local type the handle's properties and the image's requirements share. Usage is each of
sampled, rendered, copied and storage the import query offers and the view format's features
hold. Each import counts in Gauges::surface_imports, now on every host.
No submission and no wait at the make: Vulkan 1.4 section 12.5.2 says such images "can be
assumed to be in that layout when they are accessed in Vulkan after external access", and its
table gives the D3D11 texture handle VK_IMAGE_LAYOUT_GENERAL. The plane textures start homed in
the general layout; external_writes_done acquires from VK_QUEUE_FAMILY_EXTERNAL in GENERAL
(VUID-VkImageMemoryBarrier-srcQueueFamilyIndex-12332) and release_surface_to_external releases to
it in GENERAL (dstQueueFamilyIndex-12331). No keyed mutex. The consumer's precondition (Direct3D
11 wrote the plane before rt's first use, and external_writes_done follows that work) is stated
in the call's doc and the rt README.
Surface gains an imported kind: Surface::handle is Option<ExportHandle> (None for the import),
and Surface::buffer is Gap::D3d11SurfaceBuffer, its planes lying in memories of their own.
ImportHandle::D3d11Texture names the handle in Limit::NoImport and Limit::ImportType.
Refusal::SurfacePlanes covers no plane or more than four. REFUSALS.md and the signature table
are regenerated.
The tests: on every device, the import's typed refusals (no plane, five planes, a one-byte image
format under a two-byte view). Under m2v_gpu on Windows, two shared Direct3D 11 textures (R8_UNORM
64x32, R16_UINT 32x16 viewed as RG8Unorm) on the DXGI adapter of the device's LUID, bound by hand
from the SDK headers' vtables: the import submits nothing; Direct3D 11 writes picture 1 and rt
reads it exactly; Direct3D 11 writes picture 2, unlike picture 1 at every byte, and rt reads it
exactly and unlike picture 1 at every byte (the negative control); rt writes picture 3 and
releases it, and Direct3D 11 reads it exactly through staging copies.
A timing verdict between two plays of one stream (old against new, or two commits) needs both
plays by a player that serves every read class the stream has, equal player-side counts at the
judged frame and equal digests there. Nothing in the tree checked any of it: the rows were made
by hand from two reports.
The report gains a `managed reads on two copies` line. Counted from the stream's calls alone,
alike on every runtime and device, it gives the GPU's reads of Managed bytes that no
announcement took to the GPU copy, in two kinds apart:
- made-with reads, of the bytes a buffer was made with, which the player serves on both
runtimes since d88af7befe (the line says "served");
- stale reads, of bytes an m2v.write put in with no didModifyRange:, which Metal leaves undefined
and both runtimes play by one rule ("played as recorded").
With no identity record, a no-copy buffer's writes before its first use are served
(fb183b48f7) and not counted. A one-copy identity record counts none. The count lives in
replay/stale.rs and is fed from the player's make, write, commit and release.
Each check line now names its frame (`check #ID frame F SHA ...`), so a digest can be matched to
the frame it judges.
`command-replay compare-plays --a REPORT --b REPORT [--frame F]` (replay/compare.rs) reads two
reports and prints:
- whether each player serves every read class (it has the managed reads line);
- the frames whose player-side counts differ: stream calls, draws and dispatches, and every
executed skip and refusal count;
- the frames whose digests differ, naming the stale reads as the first suspect on a two-copy
play;
- with --frame, the verdict (GPU-busy and wall time, "b is P% faster|slower than a") or why there
is none.
docs/REPLAY-STREAM.md states the verdict rule as the planner ruled it. Stale reads bar no
verdict.
Tests (replay::tests):
- a_two_copy_stream_s_managed_reads_are_counted_by_kind
- a_no_copy_buffer_s_writes_before_first_use_are_not_stale_with_no_identity
- two_plays_compare_for_a_verdict_only_where_counts_and_digests_agree
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.
Recorded and timed on the M3 (53768 at 280632f1bd: record, then times --runs 8 --write; Metal's
validation ran every case). Each of the 1,200 recorded samples is the colour its way cleared at the
level and slice under it, which every_recorded_sample_is_the_colour_its_way_cleared now holds. The
coverage document is regenerated.
Verified: built and tested in the jobs the landing message names.
The replay streams' gap substitutes were all one view: newTextureViewWithPixelFormat:
textureType:levels:slices:swizzle:resourceIndex: as a 2D array of a cube's six faces, which rt
answered Gap::TextureView (TextureType) and the old runtime makes. Vulkan views a cube-compatible
image, as a cube's and a cube array's are, as a 2D, 2D array, cube or cube array of its layers, and
any image as a 2D array of one layer, with no query, so each is one form on every device.
Texture::new_texture_view now builds those of Metal's casts (Apple's makeTextureView page): a cube
or a cube array to a 2D texture, a 2D array, a cube or a cube array, a cube array's whole cubes as
a cube array, and a 2D texture to a 2D array of its one slice, beside the 2D array to 2D it built.
A cube or cube array view of a 2D array needs a cube-compatible image the 2D array is not made as,
and stays a gap that says so (TextureViewKind::CubeOfArray). A slice count the view's type does not
take (one for 2D, six for a cube, a multiple of six for a cube array) is Metal's validation's stop,
now Refusal::TextureViewSlices where it was a gap. The descriptor answers Metal's: the type, the
extent of the first level, the levels, and the array length in cubes for a cube type.
The device test every_device_views_a_cube_s_faces_as_metal_casts_them makes seven such views and
reads each one's first level and slice by a blit against the parent's bytes under them; the old
expectations move with the rule. REFUSALS.md, the API signature table and rt's README follow.
Verified: built and tested in the jobs the landing message names.
The new runtime's backend plays a stream with no identity record under
--managed two-copy by its first-use rule. A no-copy Managed buffer made with
no bytes is fresh until the command buffer that first names it commits, and
a write into it while fresh reaches its GPU copy too (did_modify_range). That
write is the nearest record the stream has of the buffer's bytes at its
making (docs/REPLAY-STREAM.md, Managed buffers). The old backend had no
such rule. Those writes reached only its CPU copy, so on a device that keeps
two copies its GPU copy read zeros where the new runtime's read the bytes.
The old backend now follows the same rule. It notes each encoder's command
buffer, marks a buffer's first use when an encoder names it, drops the mark
at that command buffer's commit, and announces a fresh buffer's writes. Its
managed line counts the buffers whose contents came from first use, as the
new runtime's does. docs/REPLAY-STREAM.md states the two-copy rule for both
runtimes: which writes before first use reach the GPU copy, and what an
identity record changes.
Found by a synthetic stream of our own on the RX 550 (m3-max-53813): with no
identity record under --managed two-copy, rt read the write and old read
zeros. Recordings it touches: gb-3090-r2 (641 Managed objects read without
them, the first in frame 0) and windrag-780m-b2 (15), where played as two
copies.
Test: a_two_copy_stream_with_no_identity_gives_a_no_copy_buffer_its_writes_
before_first_use (replay_streams), which fails without the fix on a device
that keeps two copies. The made-with test's managed line now carries the
count.
docs/REPLAY-STREAM.md says a Managed buffer that plays with two copies has
a GPU copy that starts from the bytes it was made with: a copied buffer's
contents, or a no-copy one's bytes at its making. Neither backend did so.
The player stripped every newBufferWithDescriptor: descriptor's contents
before the backend's making and wrote them afterwards as a CPU write. So
the new runtime's new_buffer, written to take them, never got them, and the
old backend made every such buffer zeroed. Under two copies neither GPU
copy held the bytes, and a draw reading the buffer before any
didModifyRange: read zeros where the recording's GPU read the bytes.
This changes the new runtime's plays too, not only the old runtime's. The
player now passes the descriptor to the backend with its contents and still
writes them once the buffer is made. The new runtime's backend takes them
as it was written to. The old backend's making takes them, both a
descriptor's contents and newBufferWithBytesNoCopy's pages. Where the buffer
plays as the runtime's Managed buffer, it writes them and announces them
(didModifyRange: over them).
Found by synthetic streams of our own on the RX 550 (m3-max-53813): under
a two-copy identity record, a no-copy and a copied Managed buffer made with
7s read zeros through a blit on both backends. The GPU-free count has the
recordings this touches: glbench-3090-r2, r3 and r4, gb-3090-r3, r4 and r5,
web3d-3090-r2 and r3, nvdec-3090 and nvdec-3090-wd.
Tests: a_two_copy_stream_s_managed_buffers_start_from_the_bytes_they_were_
made_with, in rt_replay (new runtime) and replay_streams (old runtime). Both
play one stream, rt_replay::made_with. They fail without the fix on a
device that keeps two copies.
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.
A device test reads and writes a block over three dma-bufs of one memfd (one, two and one
granule) across both chunk boundaries: add reads across the first and writes across the second
through the GPU addresses, then a blit reads across the second and writes across the first through
the buffer; every byte of the memfd is checked after. Refusals (no dma-buf, a length off the
granule) import nothing; a device with no granule refuses typed. A second device test times
vkQueueSubmit2 beside 40 live dma-bufs of one block and beside 40 one-dma-buf blocks against none.
A unit test holds the granule rule.
README (imported blocks, the extension table, sparseBinding beside the optional features, the
known gaps with the Iris's dma-buf type), REFUSALS.md, api_signatures, and the player's
sparse_binds counter.
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.
A stream recorded with one copy (its identity record's hasUnifiedMemory, or
--managed one-copy) keeps every Managed buffer's CPU writes visible to the
GPU with no didModifyRange:. The new runtime's backend plays such buffers
as Shared (docs/REPLAY-STREAM.md, Managed buffers); the old backend took
the trait's no-op and played them as the old runtime's Managed buffers,
which on a device without unified memory keep a GPU copy that m2v.write
never reaches. On the RX 550, syncview f355's quad index buffer (#49287, a
no-copy descriptor-form Managed buffer written once by m2v.write) read
[0, 0, 0, 0] on old's GPU copy against [1, 0, 2, 3] on rt's, so old's
draws were degenerate strips that drew nothing: old timed less work than
the program asks for on every discrete card for such streams.
The old backend now takes recorded_unified_memory and --managed, makes a
Managed buffer or block Shared under one copy, and says so in its report's
managed line. Device test: a one-copy stream's Managed buffer written with
no didModifyRange reaches a blit's read (replay_streams.rs), which fails
without the fix on a device that keeps two copies.
The Windows surface import's public shape, so a consumer can build against it now:
#[cfg(windows)] Device::import_d3d11_surface(&self, planes: &[D3d11Plane<'_>]) ->
Result<Surface, Error>, with D3d11Plane { handle: BorrowedHandle, image_format, descriptor,
index } per plane: the Direct3D 11 texture's shared handle and own format, and the texture rt
makes over it. Until the import is built every call answers the new Gap::D3d11Surface (basis
ours), whose Metal counterpart is a texture over an IOSurface's plane.
A Windows device test holds the refusal for no plane and for one. REFUSALS.md and
api_signatures regenerated; the rt README's surfaces section names the call.
The planner's ruling: one new object of the consumer's own, the eight MTLResource getters
metal2vulkan-rt keeps none of (label, device, cpuCacheMode, hazardTrackingMode, resourceOptions,
heap, heapOffset, isAliasable). Its text says who answers each and from what: an echo of what the
program gave at the make, each default resolved by the consumer, or the consumer's own object
(the device, the heap, its placement and its record of makeAliasable). It says nothing of what
Metal answers. rt's README names it in what the consumer implements. If rt ever answers one of the
eight, that getter is split out as storageMode is in the commit before.
The 17 sites of resource-aliasing, resource-labels and resource-own-getters where the rt side
answered resource_facts Unavailable take one row each, naming which of the getters the case reads
there and that storageMode compares at the storage-mode site beside it. The three cases are
re-recorded on the M3 (53582 at 40ff1a0a10): each recording gains its storage-mode sites and
nothing else changes. The coverage document is regenerated.
Verified: built and tested in the jobs the landing message names.
The six cases recorded by m3-max-53501 at e9205c330c (macOS 27.0.1, three runs each, Metal's API
validation layer on in the validated leg, which ran clean): every texel getBytes: and the blit read
back is the byte replaceRegion: wrote, over each surface's plane. A test holds the recordings to
that. The conformance coverage document regenerated for the new recordings.
A new family, surface_textures: BGRA8Unorm over a 'BGRA' surface, RGBA16Float over 'RGhA', and
R8Unorm and RG8Unorm over a '420v' surface's two planes, R16Unorm and RG16Unorm over an 'x420'
surface's. Each case makes the texture with newTextureWithDescriptor:iosurface:plane:, writes
every texel with replaceRegion:, and reads them back with getBytes: and with a blit into a Shared
buffer. The suite's existing surface cases are all Apple-private forms (framebuffer-only rotated
targets, and Metal's two-plane YCbCr formats); these are the form a consumer's surfaces take,
textures of ordinary formats over one plane. The x420 planes take the 16-bit formats, whose texel
is the plane's element.
The sides: Side::surface_texture. Metal's side lays the surface as the case states and reads it
back before a texture lies over it (metal_surface's single-plane surface may now state its
OSType). The old runtime's side takes a buffer standing for the surface, as the runtime takes an
IOSurface. The new runtime's side makes an exported surface of the planes
(Device::new_exported_surface), in the first of a dma-buf, an opaque fd and an NT handle the
device exports, at VA-API's 256-byte multiples; the case's texture is its plane's. The rt replay
prints each case's surfaces_in_place and surfaces_copied, the evidence of the form a venue took.
The rt side's other surface answers name what it lacks: a rotated target's setRotation: (or
setFramebufferOnly: at rotation 0), and a two-plane YCbCr texture over a surface's plane.
Verified: built and tested in the jobs the landing message names; the cases are recorded on the
M3 in a later commit.
Check m3-max-53356 at 73b58c77fc (msi):
- clippy 0, and the attachment-note tests 0;
- the conformance crate's tests 1 failure of 1075: the_conformance_coverage_document_is_what_the_sources_derive.
The DontCare rows' texel declarations (73b58c77fc) are a new module that loosens a measured value:
the document's tally reads 16 modules and 18 tolerances where the sources derive 17 and 19. Its
buffer_target_clears row now names the NewRuntimeAccepted tolerance.
Regenerated with python3 -I scripts/conformance-coverage/coverage.py at c2deff73b7. Only those
three lines change.
The three buffer-target-clears-*-dont-care cases were divergent on every rt venue at
case/buffer-after-the-pass: 64 elements, the target's 16 texels. Metal (Apple M3 Max, macOS
27.0.1) left the buffer's pattern there. rt stores the clear: its README says a DontCare store
stores, "one of the outcomes Metal allows".
Metal's documents. MTLRenderPass.h says only that DontCare is the default store action. Apple's
page for MTLStoreAction.dontCare: "The GPU has permission to discard the rendered contents of
the attachment at the end of the render pass, replacing them with arbitrary data." and "Some
GPUs may still store the contents back to the texture, but you can't rely on that behavior. You
need to assume that GPU discarded the texture's contents." So Metal documents those texels as
arbitrary, and the fix is the case's, not a ledger row.
The fix:
- A DontCare row declares each of its 64 texel bytes Unchecked, at case/buffer-after-the-pass/
<offset>, under the new accepted difference "The new runtime's DontCare store writes what the
pass rendered" (docs/API.md, render passes; it quotes the page and the M3's answer).
- The justification is NewRuntimeAccepted, so the old runtime's run, whose answer is the M3's,
still compares every texel exactly. The padding and the bytes before and after the target
compare on both runtimes.
Test: a_dont_care_row_leaves_its_texels_unchecked_on_the_new_runtime_alone. Against the M3's
kept bytes and ours with the clear in every texel, it expects:
- no divergence on rt's run, and no bad allowance (the slug is in docs/API.md);
- one 64-element divergence on the old runtime's;
- a divergence on rt for a moved byte at 0, just before the target, just after a row, or the
last byte;
- no declaration for a Store row.
metal2vulkan-rt's conformance side read shared-exponent-store divergent on the Radeon 780M at
case/drawn/texels (16 words, Metal 0x6e020080 where the device kept 0xa00c0401; whole-set
m3-max-52928, then 53116): Metal's tile store writes an RGB9E5Float word whose largest mantissa is
below 256 back normalized, and the device's pass keeps the word. The case loosens that site on
the `shared-exponent-kept` notice, but only the old runtime announces it, at the draw, from its
encoder (render.rs); rt has no such encoder step and the translator recorded no note, so the
device's answer went unannounced. A missing static note is a bug (rule 1). Its twin,
SnormMinimumKept, already has the static form; this gives the shared exponent the same one.
- `PrecisionNote::SharedExponentKept` (appended): the note of a render pipeline that draws
single-sampled into an RGB9E5Float color attachment.
- `pipeline::private_state::note_tile_store` (was `note_snorm_minimum`) records it as it records
SnormMinimumKept: on the fragment stage (the vertex stage where there is none), whatever the
pass loads, and only where the profile's existing `SnormMinimumNote::Noted` says so, which is
`Device::from_queries`. No new fact, switch or device check: `Device::new`'s modules, keys and
the old runtime's announcement are unchanged.
- The old runtime's `Degradation::from_precision_note` maps the note to its existing
`shared-exponent-kept` kind: one arm, which its exhaustive match requires to compile, as
DepthDenormals and CompressedTexelDecode did. It adds no switch, fact row or device check to the
frozen runtime, and nothing it does changes.
- The codec takes the variant; ARTIFACT_FORMAT_VERSION 548 -> 549. fast_paths lists the note under
Elsewhere. Validation's comparison allowance is Unbounded, as for the other device-answer notes.
api_signatures gets the two variant rows and the macro row. docs/API.md's `shared-exponent-kept`
entry says where the static note is recorded.
Test: engine_private_render_state's
a_shared_exponent_attachment_notes_the_words_metal_s_pass_normalizes. On lavapipe and moltenvk-m3
the note is on the fragment stage alone through Device::from_queries, on no stage through
Device::new, and on none at four samples or into RG11B10Float, RGBA16Float or RGBA8Snorm. The
conformance case shared-exponent-store on the 780M through the rt side is the end-to-end test.
The replay player prints, on the new runtime, the matrix's judged metrics of a play: one
`M2V-MATRIX metric replay-rt/STEM/RANGE/NAME N` record per metric, `N` the play's executed total
(`Report::total`) of submissions, passes, barriers less `texture_clear_barriers`, bytes copied and
pipelines created, and of the new textures zeroed, the clears and the zero-initialized ones as one
count and their bytes as one. The split between a clear and a zero-initialized texture follows
where the pool places it and may differ between two plays of one stream, so the two are judged
summed, and the barrier after an upload's clears is left out of the barriers. A play that did not
finish its range (it stopped, or ended before frame F's present where it plays to F) or whose
backend skipped anything prints none (`judged_records`).
The matrix's rule holds a `replay-` metric equal to the base's, failing a change either way, and
fails a leg that lacks a record its base has: a short play does not pass (`EQUAL_METRICS`). The
counters' docs say the split may differ between two runs of one program; VALIDATION.md and
REPLAY-STREAM.md say what the judge does.
Tests: the judged totals on the fake backend (the net barriers, the summed zeroings, a counter
not reported as 0, no other counter, the range in the key), a short play, a stopped one and a
skipping one printing nothing, and the rule's equality and missing-record cases in
test_results.py. Verified: cargo fmt; `python3 -m unittest discover -s scripts/matrix` (84 tests,
OK). The Rust build, clippy and tests run in the checks dispatched at this commit.
What: Surface::buffer() answers a Buffer over the surface's memory, of the export's size, at the
layout the SurfaceExport states. In place it is made at the first call, never at the surface's
make: of an opaque handle, a buffer bound at the first byte of the one allocation the planes are
bound in (memory::surface_view; the allocation now takes device addresses, which the buffer's
binding needs); of a dma-buf, a buffer on one more import of the dma-buf (import::surface_import)
into the memory type the planes' imports took, through a duplicate of an fd the surface keeps,
attempted only where the device's buffers import a dma-buf and the fd's query and the buffer's
requirements list that type. The copy form answers its block's buffer. The first call records
the buffer's acquire from the other API's queue family; external_writes_done acquires it with
the planes and release_surface_to_external releases it with them, writing back the copies of
textures over it first.
The surface, its planes and their views, and its buffer are one unit in the hazard sets: the
planes take a HeapId::unit at the make and the buffer takes the same one, so a kernel's write
through the buffer orders the next kernel's read through a plane as a heap's resources do.
Counted in the new Gauges::surface_buffers (a dma-buf's also in surface_imports); refused with
Limit::ExportType, Limit::NoImport and the new Error::Fd (no duplicate of the fd). The doc comment
quotes Vulkan 12.11 Memory Aliasing and the fd import's multiple-import sentence, and names the
same-instance reading the dma-buf form takes.
Test: every_device_carries_each_form_of_surface gains the buffer round (two pictures the second
device wrote read through the buffer, one at its make and one after external_writes_done, with a
one-byte-off negative control; a picture blitted into the buffer read through the planes and the
handle) and, on 1080p with llvm-as, the compute round (a kernel writes through the buffer, the
next reads plane 0 through a view; texels exact, and in place one barrier more than a control
whose first kernel writes a buffer of its own). Each device prints whether its buffers import a
dma-buf. Not yet run.
docs/REFUSALS.md and api_signatures.tsv regenerated; the rt guide states the contract.