Metal makes texture buffers of A8Unorm, the four 8-bit sRGB formats, RGB9E5Float, the
four packed 16-bit formats, BGR10A2Unorm and the four extended-range formats, for reading,
writing and both (M3 Max, macOS 27.0.1, jobs m3-max-79872 and m3-max-79879). The runtime
refuses each as Gap::TextureFormat on some or all devices, because Vulkan offers no
texel-buffer format for them.
The owned fixture tb_word_formats reads, writes, and reads then writes texture buffers of
five texels with eight threads. The new device test checks each format's answers against
the CPU's decode of the bytes:
- reads in bounds, exact, or within 2^-12 through the sRGB transfer;
- writes of each texel's value store its code, with neighbouring texels in one word kept;
- past the width, the zero texel is read and nothing is written, the rest of the last
word included;
- the widths are 5.
This is the red half: every format is expected to fail at Buffer::new_texture
(Gap::TextureFormat). The run that shows it is in the handover.
The player moved every written word whose value lies in a buffer noted
escaped (AddressMap::move_noted), whatever the buffer it was written into.
In rec-m3-max-80463 it moved 3 RG8 mask words of no-copy buffer #1960,
which the program reads only as texels through texture #1962 over it. Each
play wrote its own host address there, so two plays read different texels
(audit lane, m3-max-81898 and m3-max-81914).
Now the move is decided by the stream's structure:
- read_ahead, which already walks the whole stream, notes each buffer's
life, keyed by the object and its making's position (as recorded_ids
is):
- whether a texture is made over it (it receives
newTextureWithDescriptor:offset:bytesPerRow:, the tiled form or the
linear form);
- whether any call names it as an argument, at any depth of lists and
maps, but a copy between a buffer and a texture (copyFromBuffer:...
toTexture:..., copyFromTexture:...toBuffer:...), whose bytes are texels.
A buffer with a texture over it and no such naming is reached only as
texels.
- At an object's making the play marks it live as such, or unmarks the id.
- place_words takes the write's target (none for set*Bytes data). Into a
buffer reached only as texels, the words move_noted would move play as
recorded and are counted as texel_only_words (AddressMap::count_noted,
which shares move_noted's pass). The census is unchanged.
- Unchanged: a buffer with no texture over it, including one the stream
never names (the existing noted-word test), set*Bytes data, and any
buffer bound, encoded, used, copied buffer to buffer or added to a
residency set.
texel_only_words is a new stream counter: in FIXED, frame and group lines,
and the report's addresses line. Docs: REPLAY-STREAM.md section 5's
noted-word paragraph and section 10's counts and addresses line. The
counter lists the replay tests spell out gain it.
Two lavapipe plays of rec-m3-max-80463 differ (audit lane, jobs
m3-max-81898 and m3-max-81914). In frame 3 the player moves 3 words of the
stream's write into no-copy buffer #1960, at offsets 24344, 73104 and
74240. They are RG8 mask bytes whose value falls inside an escaped
buffer's recorded range, and AddressMap::move_noted rewrites them to each
play's own address. #1960 is read only as texels, through texture #1962
over it, so the texture reads other bytes in each play. A shader loads an
address only from memory its command reaches as a buffer: bound, encoded
into an argument or indirect command buffer, or made resident by
useResource:, useHeap: or a residency set. Each of those calls names the
buffer.
New test in replay/tests.rs,
a_noted_word_in_a_buffer_reached_only_through_a_texture_over_it_plays_as_recorded:
- An authored stream makes a buffer, a texture over it
(newTextureWithDescriptor:offset:bytesPerRow:), notes the buffer escaped
(kind 0) and writes into it a word inside its own range.
- Reached only through the texture, the word is to play as recorded, and
be counted as texel_only_words, not noted_words.
- The same buffer also bound by setBuffer:offset:atIndex: still moves the
word.
Expected red: today the word moves in both arms.
The engine inventory, the golden hash table and the air_input printouts, re-blessed at
3ecfe8f034 on the M3 (potluck job m3-max-82095: inventory=0, golden=0, printouts=0, and the
metallib half of committed_air_fixtures_parse_and_link un-skipped, linkhalf=0). The draw
patches and indexed draw patches work since the last bless added the icb_merged_patches and
icb_merged_ipatches fixtures and moved SEMANTICS_VERSION to 2328, so the four bless-due tests
(engine_fixtures_match_their_golden_printout, inventory_lists_every_fixture_in_order,
golden_hashes_match_the_table, llvm_as part 8) read red until this commit.
Files: golden_hashes.tsv, public_fixture_expectations_engine.tsv, and the two new printouts
air_input/icb_merged_patches.txt and air_input/icb_merged_ipatches.txt. Nothing else.
a3fb852de3 (a heap makes texture buffers in place) sizes a heap's texture buffer through the
format's texel form, which takes a format whose buffer features hold both the uniform and the
storage texel buffer. On the Iris Xe, whose ANV holds A4R4G4B4_UNORM_PACK16 so, the heap's size
and alignment of the format-footprints-plain-stragglers BGRA4Unorm texture buffer now answers
(Metal's 128 at 16), and the case reaches its makes-texture site, which the runtime's side refuses
as Refusal::TextureBufferNotOverBuffer, the consumer's contract. The ledger's one row for every
venue refused the size-and-align site, so the Iris's conformance replay went red at pin M
(m3-max-82006: an unlisted makes-texture refusal) while the RTX 3090's held (m3-max-82034).
Now:
- the size-and-align row is one per venue whose device lacks the storage texel buffer of both of
the format's Vulkan formats (NVIDIA, RADV, llvmpipe, Apple M3 Max, UHD Graphics 630), naming
a3fb852de3;
- the Iris Xe has a makes-texture row with the consumer's-contract reason the other texture
buffers' rows carry, naming a3fb852de3;
- each says Metal's validation layer refuses this format for a texture buffer, so what such a
texture reads is outside documented Metal and no value comparison is owed for it;
- the runtime's README says a texture buffer's answer, the heap's size included, follows the
format's texel-buffer features: the devices differ by query, not by form.
docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py; --check
clean), as are the metal-coverage and refusal-surface checks.
On a device that keeps two copies of a Managed buffer, the runtime now takes a range named by
didModifyRange to the device copy at the first commit whose encoders name the buffer (a slot, a
declaration, an indirect, index or other draw buffer, a blit's buffer, a texture over it), not at
the next commit, and a buffer's first bytes at the next commit whatever it names. A run of an
unchanged artifact may therefore submit and record other copies under an unchanged key. None of
the validation crate's runtime inputs changed, so runtime-sources.sha256 holds. SEMANTICS_VERSION
does not move: nothing compiled changed. 2553 is taken by another row landing beside this one.
Verified: the value alone changes; the gate at this tip follows.
`conformance times --runs 8 --write` over the five cases, built --release at a2f2cad217, on the
Apple M3 Max, macOS 27.0.1 (26A434), job m3-max-81954 (the build: job m3-max-81941). Each
recording gained one time record (native Metal, 8 rounds), a recorded hole whose stopped reason
is the cases' own: the oracle keeps one copy of a Managed buffer, so its leg is forbidden. A
comparison of the JSON before and after shows `times` the one key added and every other key
equal. This is what times::every_case_is_timed::every_case_carries_its_timing asked of the new
cases (it failed in m3-max-81916 at c098a9848e). docs/CONFORMANCE-COVERAGE.md, regenerated,
does not change.
Each recording holds the case's carried answer as record mode writes a carried case's: the
transcript of the reader's content as an AMD Radeon Pro 5300M under macOS 26.7.1 read it, 8
rounds a reader (jobs 81602 and 81644), measured_on amd-radeon-pro-5300m, validated not run. The
compute slot, the declaration, the vertex slot and the blit source read the bytes as of the
reader's commit; the reach through the address alone reads the bytes the GPU's copy last took.
The oracle's own run is forbidden by the cases (one copy), so nothing here ran on Metal.
They were written by record::carried and record::write, the calls record mode makes for a
carried case, through a scratch test of a CPU-only job's own workspace (job m3-max-81916, at
c098a9848e), never committed. docs/CONFORMANCE-COVERAGE.md is regenerated with them
(scripts/conformance-coverage/coverage.py): 192 case modules, 1347 recordings, 85 carried.
Verified: in the same job the conformance suite ran 1050 tests, 1048 passed; the two failures are
the coverage document, regenerated here, and the cases' missing Metal time records, which the
oracle's times run adds next.
Clippy named the chunks_exact of a constant 4 (as_chunks reads each word as an array, with no
conversion that can fail) and the unused import of call.
Verified: clippy of the conformance crate in job m3-max-81909 (CPU-only build) failed on both;
the next job runs it again.
Clippy's drain_collect named the collect of the made entries into a vector of their own; the loop
now drains them directly, its other borrows being of the change list's other fields.
Verified: clippy of the conformance crate's dependencies in job m3-max-81865 (CPU-only build)
failed on it; the clippy job follows.
A commit takes its named ranges through Seconds::take, which answers none where its command
buffer named no buffer with a range, so nothing calls named. The release build of the player warned
of it as dead code.
Verified: the warning is in the player's release build of the frame-396 play job m3-max-81847
(lavapipe); no caller in the tree (grep of seconds' calls). The clippy job follows.
The reader's own helper took the name of the side's kernel stage helper, a duplicate definition
on RtSide. It is now compute_state, built on that helper, and the render reader takes its two
stages through it as well.
Verified: the recording job m3-max-81836 (a CPU-only build, at the commit before the rebase)
failed to compile the conformance crate on the duplicate; the next job compiles it.
Watching forwards every Side method, so a watched run of the managed-named cases answers what the
side it wraps answers rather than Unavailable. The suite's test that compares Side's methods with
Watching's forwards names the missing one without it.
Verified: expected from the forwarding test's name sets. The conformance suite run follows.
The test every_device_places_a_managed_buffer_s_device_copy_where_the_consumer_says named the
whole buffer, then read the block through a commit that kept only another buffer over the
Private block. Under the rule that a named range is taken at the first commit whose encoders
name the buffer, that commit takes nothing, so the two-copy form read the old bytes. The read's
commit now names the Managed buffer as well.
Verified: lavapipe rt suite job m3-max-81780 at f864a75d35 failed this test alone (958 of 959
passed, 4 skipped) at the copy-in assertion; the rerun follows.
Five cases, one a reader, each of the same sequence: a Managed buffer's red
contents written, named and taken by a blit; green written and named, then a
commit of a blit that fills another buffer; the reader encoded, blue written
with no second name, the reader's command buffer committed. The site holds
which of the three the reader read. Readers: a compute slot
(scale_and_offset), useResource: (ab_address), the address alone (ab_address,
no declaration), a vertex slot with a draw (colored_vertex), a blit copy's
source.
Metal's answer is carried from an AMD Radeon Pro 5300M table under macOS
26.7.1, 8 rounds a reader (jobs 81602 and 81644): the readers that name the
buffer read the bytes as of their commit (blue), the address-only reader the
bytes the GPU copy last took (red). The oracle keeps one copy, so record mode
may not replace the table (carried_only), and the case names the chip
(recording::AMD_RADEON_PRO_5300M; the known-families list in
a_carried_answer_taken_on_another_chip_names_it grows by managed-named-).
The runtime's side runs the sequence in the form the device's memory-type
query picks. On a device that keeps one copy the address-only row answers the
venue's gap (a device copy of each Managed buffer), as that row asks what a
second copy holds; the other rows read the bytes as of their commit in either
form, as the 5300M and the one-copy UHD Graphics 630 (jobs 81603, 81645) did.
Recordings follow from a record job on the oracle. Not yet compiled.
The first-naming-commit rule (baf1c8a8c9) also held a new Managed buffer's
first `copied` bytes until a commit named the buffer, so a reach before then
read the device copy's old bytes. Metal's device copy holds a buffer's bytes
from its making. Those bytes now go in at the next commit whatever its encoders
name (Changes::made, taken by every commit, merged with the buffer's named
ranges where the same commit takes both); ranges did_modify_range names still
wait for a commit that names the buffer. The made entries are swept as the
named ones are.
Texture::image_bytes, a test helper, now commits a compute encoder that
declares the texture by use_resource, so its commit takes the named ranges of
the buffer the texture lies over.
Lavapipe's full runtime suite at baf1c8a8c9 (m3-max-81741: 957 passed, 2
failed, 4 skipped) failed managed::every_device_places_a_managed_buffer_s_
device_copy_where_the_consumer_says and over::every_device_holds_a_texture_
over_a_buffer_in_place on these two; this fixes both. Not yet compiled.
The runtime now takes a Managed range at the first commit whose encoders name
its buffer, as Metal on an AMD Radeon Pro 5300M does (jobs 81602, 81644). The
player's own second copy, which a two-copy stream's Managed buffers take on a
device with unified memory, took every range named at the next commit of any
command buffer; it now follows the runtime's rule.
- second.rs: Seconds keeps, for each command buffer not yet committed, the
buffers with a second copy its encoders named, themselves or through a
texture over one (made over the buffer, a tiled one, or a view of one), and
a commit takes only those buffers' ranges. A released buffer with ranges
pending stays only while a command buffer not yet committed that named it,
or a texture over it, can take them; otherwise its place goes back at once.
A command buffer released uncommitted takes nothing.
- mod.rs: each encoder call's named objects, a render pass's attachments,
resolve textures and visibility result buffer at its encoder's making, and
the textures and views made over a second copy feed it. render.rs keeps the
pass's resolve textures and visibility result buffer by stream id.
- encoders.rs: copy_named takes the committing command buffer's ranges alone.
- stale.rs: a didModifyRange: is pending until a commit whose uses name the
object takes it, with the bytes written by then (an indirect command
buffer's command takes it where it is encoded); writes between the
announcement and that commit are not stale.
- docs/REPLAY-STREAM.md says so.
Tests: rt_replay a_two_copy_stream_s_announcement_is_taken_at_the_first_
commit_that_names_the_buffer (zeros announced, a commit of another buffer, 7s
written with no announcement, a copy of the buffer reads the 7s); tests
an_announcement_is_taken_at_the_first_commit_that_names_its_buffer (the
census counts one stale use where it counted two). Not yet compiled.
On a device that keeps a device copy, did_modify_range named a range and the
next commit of any command buffer took every range named since. A consumer
that names a range, commits a command buffer that does not use the buffer,
writes the range again with no second name, then commits the command buffer
that binds it had the GPU read the first bytes. Metal on an AMD Radeon Pro
5300M (macOS 26.7.1, 8 rounds each, jobs 81602 and 81644) takes a named range
at the first commit whose encoders bind the buffer (a compute slot, a vertex
slot with a draw), declare it by useResource: or read it in a blit copy, with
its bytes as of that commit; an unrelated commit takes nothing; a buffer named
to no encoder and reached by address keeps its last synced bytes. The Intel
UHD Graphics 630 keeps one copy (jobs 81603 and 81645).
A commit now takes only the ranges of the buffers its command buffer keeps,
which is every way an encoder names a buffer in the runtime:
- a slot of any stage: compute set_buffer, set_vertex_buffer,
set_fragment_buffer;
- use_resource on a compute or a render encoder (the runtime has no
use_resources);
- an index buffer; the indirect arguments of a draw, an indexed draw or a
dispatch; a patch draw's index and control-point buffers and an indirect
command buffer's range buffer, kept by the same line of the draw as the
index buffer and the arguments;
- the tessellation factor buffer and the pass's visibility result buffer;
- a blit: a copy's source or destination, a fill, a copy into or out of a
texture, a synchronize;
- a texture over the buffer, or a view of one, wherever the command buffer
keeps it (a slot, use_resource, an attachment, a resolve, a blit).
A heap use names none: Metal refuses a Managed heap (jobs 81602, 81603).
A pending range holds its buffer weakly. The pending list sweeps the entries
of buffers gone once it holds twice the entries its last sweep left (at least
64), so it stays bounded by the live buffers with ranges pending.
Tests (tests::managed): the consumer's six calls (red at e1fbce1486 on
lavapipe's two-copy view, m3-max-81614, and on an RTX 2080, m3-max-81606);
each way above, through compute, render and blit encoders and a texture over
the buffer, with a reach by address alone taking nothing; a buffer no encoder
names keeps the bytes taken last; a narrow named range takes its own bytes
alone (unaudited on Metal); a declaration alone takes, a commit with no
commands takes nothing. over_texture's capture commit now names its buffer.
The did_modify_range doc and the runtime README state the rule and its jobs.
Not yet compiled; the green runs follow.
A consumer writes zeros into a Managed buffer and names the range. It commits a command buffer that
does not name the buffer, and that command buffer completes. It encodes a kernel that reads the
buffer, writes a table over the zeros with no second didModifyRange:, and commits. The test expects
the kernel to read the table, in either form.
Metal on a discrete Mac GPU (an AMD Radeon Pro 5300M) takes a named range at the first commit whose
encoder binds its buffer (Buffer::did_modify_range's doc). The runtime takes it at the next commit of
any command buffer, so with a device copy the kernel reads the zeros. A guest's argument buffer
written this way held a null pointer in the device copy, and its vertex function read through that
pointer.
Red runs follow in the next commit's message.
Gap::MemorylessTexture's basis read "render passes are not built", which stopped being true
when render passes were built. It now names the reason the refusal stays: a memoryless
attachment keeps its contents for the whole render encoder, across the renderings the runtime
ends and restarts inside one encoder (barriers after writing draws, the feedback-loop barrier,
copies for textures over buffers and Managed copies, shadow copies), and the image that would
hold them is not built. docs/REFUSALS.md regenerated (scripts/refusal-surface).
Docs only: no behaviour changes. refusal_surface.py --check exits 0.
Buffer::texture_copy_cause (and new_texture_in_place's TextureNotInPlace cause) now says
which of its answers come from the device's queries of the descriptor and the buffer's kind of
memory alone: HostMemory, DmaBuf, DmaBufs, Dedicated, Surface, Linear and LinearFeatures, all
decided in check_over before any place is read (memory_cause, the external or linear image
query, the linear tiling's features). Spilled, Pitch, Alignment, RenderReach and ImageMemory
depend on the buffer and its place (the block's spill, then in_place_fit's laid image). A
consumer may keep a kind-only answer per descriptor and kind of memory instead of importing
another buffer to ask again; the consumer's census meets four such refusals a run on the M3,
each paying a map and an import first.
Docs only: no behaviour changes. Verified by reading check_over, memory_cause and over_cause at
this commit's parent.
every_device_places_each_vector_access_at_its_own_address gains a run binding vwp_vec16's a 4
bytes past a multiple of 16 and b at 0: one argument of alignment 16 at a multiple of 4 below its
alignment beside one at its alignment, the shape a guest kernel's refused bind had (index 0 at
offset 1871700, 4 past a multiple of 16, alignment 16). Each run now prints how many of its two
dispatches ran with their buffers bound (Metrics::bound_dispatches) and how many at their
addresses (Metrics::address_dispatches), so a card run shows which form served the bind.
Verified: the test passes on lavapipe (llvmpipe, LLVM 23.1.1), job m3-max-81994, with clippy
-D warnings under --cfg m2v_cpu_icd clean: every run's two dispatches at addresses (lavapipe has
no bound form), the a-at-4, b-at-0 run included. On the RTX 3090, job m3-max-81997, the same run's
two dispatches both ran bound (a in the variant that keeps its address, b through its binding),
the a-at-4, b-at-8 run one bound and one at addresses, and every other run two bound; every
buffer held Metal's words on both.
dc126ab306 lowers render_command's draw_indexed_patches (it wrote a refusal before) and grows every
command's record tail by 8 bytes: the stride is index() + 48 (was + 40), the sequence index lies at
index() + 24 (was + 16) and the draw's arguments at index() + 28 (DRAW_AT, was 20). So a kernel that
writes, resets or reads any command of an indirect command buffer translates to other words under
an unchanged key. The golden tables are re-blessed on development.
Verified: lavapipe m3-max-81663 (red, then green); 2080 m3-max-81688, XTX and 780M m3-max-81689, lavapipe m3-max-81691 (engine, rt indirect and the 6 range rows against Metal's recording m3-max-81637 on the Apple M3 Max); Iris Xe m3-max-81890 (no VK_EXT_device_generated_commands: refused by name); states-only play m3-max-81856 0 refused; suites and lint m3-max-81855.
Metal's answer for the indexed-patch-draws range row, recorded on the Apple M3 Max (macOS 27.0.1,
26A434) by job m3-max-81637 at 992794d8bd (the AIR commit, d244877fb2 after the rebase onto
685bde8009, the same patch), with its times (8 rounds, the same job). The execution completes, and
commands 1 to 5 draw rows 2 to 11 whole: each command's quad, whose four corners are stored out of
order and named in order by its 16-bit control-point indices, covers its two rows. Each texel
holds the command's mark, the patch index i, the instance and the base instance i, the patch-draws
row's texels exactly.
The ledger's Iris Xe row is the Extension refusal, as for the other range rows: the Iris Xe lists
no VK_EXT_device_generated_commands. CONFORMANCE-COVERAGE.md is regenerated.
The owner's 3406 order, the planner's next indirect command kind: MTLIndirectCommandTypeDrawIndexedPatches.
The records (pipeline::IndirectDrawLayout) grow by 8 bytes a command for every kind. The
control-point indices' address is a third u64 that an execution pushes, and VUID 11103 asks each
token's offset to be at or past the one before it, with the draw token last (VUID 11100). So the
address cannot go after the draw; it lies past the index token's 16 bytes, at index() + 16.
Every command's tail is now 16 + 8 + 4 + 20 = 48 bytes: the stride is index() + 48 (was + 40),
the sequence index's place index() + 24 (was + 16), and the draw's arguments index() + 28 (the
translator's DRAW_AT, was 20). The cost is 8 bytes a command in every buffer: 160 bytes for 7
vertex and 7 fragment slots (was 152, 5% more), 48 for none (was 40), 544 at most (was 536),
which the floor's stride and token-offset limits are checked against. One record shape for every
kind stays: a kernel cannot know a buffer's kind when it is translated, so it writes one shape
whatever buffer it reaches. The main lane accepted this on the condition that the
already-landed kinds' rows run again at the new layout.
Translator (lower/access/icb.rs): a render_command's draw_indexed_patches writes what
draw_patches writes (the draw's VkDrawIndirectCommand of patches, the factors' and the patch
indices' Metal addresses) and the control-point indices' Metal address at the new place
(CONTROL_POINTS_AT, IndirectDrawLayout::control_point_indices). Its operands are draw_patches's,
with the control-point indices at operand 6.
Runtime: Device::new_indirect_command_buffer takes DRAW_INDEXED_PATCHES alone
(CommandDraw::IndexedPatches), refused as patch draws are on a device whose executions run no
tessellation stage (TessellationStages). Its layout pushes the control-point indices' address
where the control stage reads it (FieldValue::ControlPointIndices), holds no index buffer token,
ends in TOKEN_DRAW and names the tessellation stages. An execution checks the state's
control-point index type against the buffer's kind, as a direct draw checks it against the call:
patch draws with a state of an index type are Refusal::PatchDrawWithIndexType, and indexed patch
draws with a state of none Refusal::IndexedPatchDrawWithoutIndexType. This replaces the patch
draws' check through an empty PatchReads.
Docs: the runtime README's ICB section (records, tokens, refusals, floor limits); the API guide's
section 1; METAL-COVERAGE (coverage.tsv); CONFORMANCE-COVERAGE and REFUSALS.md regenerated (the
two refusals gain the draw site); the API signature table blessed for control_point_indices.
Tests: the red commit's engine and runtime device tests; the layout's unit tests at the new
offsets, the reset command's control-point place among them; a unit test of the indexed patch
tokens.
The engine test of a kernel's patch draws compiles and validates icb_merged_ipatches too, whose
kernel encodes indexed patch draws with 16-bit control-point indices of its own, on every profile.
The runtime's patch-draws device test becomes one body for both kinds. Its new arm,
every_device_draws_encoded_indexed_patch_draws_as_their_draws_direct, uses a state of
icb_merged_ipatches's functions: a float2 corner at attribute 0 of vertex buffer 2, stepped per
patch control point, under the UInt16 control-point index type. Each patch's corners are stored
out of order, and its indices name them in order. The arm asserts that four indexed patch draws
the kernel encodes draw what the same draws direct draw, in the four executions of the patch
draws' arm, and that indexed patch and patch draws together are CommandTypes.
Red: the translator refuses a render_command's draw_indexed_patches
(GpuEncodedIndirectCommands), and the runtime refuses a buffer of DRAW_INDEXED_PATCHES
(CommandTypes).
Regenerated by scripts/regen-air-fixtures icb_merged_ipatches on the Apple M3 Max (macOS 27.0.1,
Apple metal version 32023.922, macOS SDK 27.2), job m3-max-81619: the .ll and .air.ll of the owned
source, and the fixture's line in TOOLCHAIN. The engine inventory, the golden tables and the
air_input printouts take the fixture when they are re-blessed on development.
The next indirect command kind after patch draws: MTLIndirectCommandTypeDrawIndexedPatches.
icb_merged_ipatches is an owned fixture. Its kernel encodes command i as one quad patch of four
control points from patch i, with no patch index buffer, 16-bit control-point indices and
level-1 half factors, one instance for an even command and two for an odd one, from base
instance i, with vertex buffers 0 to 2 of its own. The post-tessellation vertex function reads its
four corners through a PerPatchControlPoint layout at vertex buffer 2. The points are stored out
of order and the indices name each corner, so a patch that covers its rectangle read its
indices. Each texel then holds its command's mark, the patch index, the instance and the base
instance.
indirect_ranges.rs gains the row indirect-range-gpu-written-indexed-patch-draws: commands 1 to 5,
written by a blit's copy before the pass, as the patch-draws row is. EncodedRange carries the
commands' pipeline's vertex descriptor and tessellation state where a row states them; both
sides set them on that pipeline (the Metal side's tessellation fields through one helper, the
runtime side's through the fields module's descriptors). The fixture's AIR, the Metal recording
and the ledger row follow in their own commits.
Gauges::releases_waiting counted a release only while it waited for work
in flight. An object then handed to the reaper thread stopped counting
before the reaper freed it, and an imported or exported block or memory of
its own given back to the block-maker thread never counted. So a read of no
release waiting and no command buffer live could find objects still
counted, freed a moment later. The harness's churn rows, the replay
player's settled reads and the matrix take that read for every release
done. Round K's churn_all_day failed so on the RTX 2080 (m3-max-81680: an
iteration's plane stand-in, its export, 4 textures and 3 attachment views
still counted at the 200th read) and on the RTX 5080 (m3-max-81692: a
whole iteration's set counted at the 100th read).
Now a release counts until it is done:
- Reaper::give counts a free or a released image as it queues it, before
the reaper can take it; the reaper's run and its drain at the core's drop
count it done once its free ran. A teardown job is no release.
- Pool::give_back_own and give_back_loose count the block given back
before the block-maker thread can take it; the block-maker thread and
free_all count it done once it is freed and an import's release ran.
- A release that waited for work and goes on to the reaper rises at the
give and falls for its wait after, so it counts without a gap.
No sleep and no retry: the settled read waits on the same gauge, which now
covers every queue a release passes through.
Docs: Gauges::releases_waiting and the runtime README's gauge list say what
it counts and that a read of 0 with no command buffer live comes after every
release made before it is done.
Test: argument_tier's every_device_holds_a_release_until_the_work_committed_before_it_retires
holds the reaper across the releases; it now waits for the index to be
vacated, expects the texture's image handed to the held reaper to still
count, and expects the gauge at 0 once the reaper goes on.
Round K's 2080 leg (m3-max-81680) failed the harness's churn_all_day: from
the 100th iteration to the 200th, textures 0 -> 4, attachment_views 0 -> 3,
blocks 8 -> 9, exports 0 -> 1, plane_stand_ins 0 -> 1, and nothing live at
the device's drop. Round K's 5080 leg (m3-max-81692) failed it the other
way, a whole iteration's set read at the 100th and gone at the 200th. The
row's settled read waits for no release waiting, no command buffer live and
two reads 20 ms apart that agree. Gauges::releases_waiting stops counting an
object once the block-maker thread hands it to the reaper thread, before
the reaper frees it, and never counts an imported or exported block given
back, which the block-maker thread frees. A reaper busy with another job or
a look at the pipeline cache, or a block-maker thread busy with a free or a
make, leaves the read settled with the objects still counted.
New device tests, tests/releases_done.rs:
- every_device_counts_a_view_the_reaper_has_not_freed_as_a_release_waiting:
with the reaper held in its look at the pipeline cache (Caches::look_hold),
a texture view dropped with nothing in flight and nothing waiting is still
counted in textures, and is to count as one release waiting; let go, both
fall together.
- every_device_counts_an_import_the_block_maker_has_not_freed_as_a_release_waiting:
with the block-maker thread parked before its first work
(MakerTest::Park), a host import given back is still counted in imports
and its release has not run, and it is to count as one release waiting;
let go, the release runs and both fall together. A device that imports
no host memory says so.
Expected red: today each reads no release waiting while the object is
still counted.
b3ee209881 lowers render_command's draw_patches (it wrote a refusal before), and compiles a
post-tessellation vertex function of a state made for indirect command buffers under
LoweringInputs::indirect_range, so a kernel that encodes patch draws, and such a vertex function,
translate to other words under an unchanged key. The golden tables are re-blessed on development.
Main's ask for the new public field IndirectCommandLimits::tessellation_stages: the ICB section
now states what the floor reads before it enables the two extensions, and each limit it keeps,
with the field that holds it. docs/API.md describes no indirect command limit (the translator's
guide), so it is unchanged. REFUSALS.md regenerated with no change: it lists Gap variants and
their sites, and the new kind is a value of Gap::IndirectCommandBuffers's kind at a site it
already lists (new_indirect_command_buffer).
The 2080's replay of indirect-range-gpu-written-patch-draws (RTX 2080, NVIDIA 620.70.06, job
m3-max-81601 at 20105bb4bf) compared every texel with Metal's and diverged at case/notices alone:
the tessellating pipeline announced tessellation-winding, tessellation-factor-edge-cases and
tessellation-triangle-order, which every row that draws a patch declares. The row now declares
them through tessellation_sweeps::tessellation_notices. None moves a texel of a quad patch of
level 1, whose two triangles cover its rectangle in any order and winding.
The same job ran the runtime's indirect tests on the 2080, 27 passed, the patch draws' test
among them, and the four other range rows announced and justified as before.
CONFORMANCE-COVERAGE.md regenerated with no change.
The owner's 3406 order, the planner's next indirect command kind: MTLIndirectCommandTypeDrawPatches.
Translator (lower/access/icb.rs): a render_command's draw_patches writes VkDrawIndirectCommand (the
patch count, the instances, the patch start and the base instance) where a plain draw's goes, and
in the index token's 16 bytes, which a buffer of patch draws does not read as a token, the
tessellation factors' Metal address and the patch indices' (0 for the null pointer). The records
stay one shape for every kind (pipeline::IndirectDrawLayout::factors and ::patch_indices name the
two places). The control-point count is not read, as a direct patch draw does not read it; the
factors' instance stride and the factor scale are read only under a per-instance step function or
tessellationFactorScaleEnabled, which the runtime refuses at the pipeline state. A
post-tessellation vertex function of a state made for indirect command buffers is compiled under
LoweringInputs::indirect_range (pipeline/compile.rs), so each evaluation tests its command against
the execution range as a plain vertex function does.
Runtime: Device::new_indirect_command_buffer takes DRAW_PATCHES alone, the buffer's kind
CommandDraw::Patches. Its command layout pushes the factors' and patch indices' addresses where
the state's control stage reads them (FieldValue::TessellationFactors, FieldValue::PatchIndices),
holds no index buffer token and ends in TOKEN_DRAW; the layout and each execution name the
tessellation control and evaluation stages beside the vertex and fragment ones
(dgc::PATCH_STAGES). An execution of patch draws draws a patch list with a post-tessellation state
and reads no tessellation factor buffer of the encoder's; a state that is not post-tessellation
is Refusal::PatchDraw, as is a post-tessellation state with a buffer of other draws, and a state
of a control-point index type Refusal::PatchDrawWithIndexType, as for a direct patch draw.
VUID-vkCmdExecuteGeneratedCommandsEXT-supportedIndirectCommandsShaderStages-11060 requires the
bound stages in the device's supportedIndirectCommandsShaderStages, so the floor reads whether
they hold the tessellation stages (IndirectCommandLimits::tessellation_stages) and a buffer of
patch draws is refused without them, a new kind, IndirectCommandsKind::TessellationStages.
Mesa's source answers VK_SHADER_STAGE_ALL_GRAPHICS on RADV and VK_SHADER_STAGE_ALL on lavapipe.
Two draw kinds together, DRAW_INDEXED_PATCHES and the rest stay CommandTypes.
Docs: the runtime README's ICB section and refusal line; the API guide's section 1; METAL-COVERAGE
(coverage.tsv); CONFORMANCE-COVERAGE regenerated; the API signature table blessed for the new
field, methods and variant. REFUSALS.md regenerated with no change.
Tests: the red commit's engine test and runtime device test, with the device test's arm for the
TessellationStages refusal; a unit test of the patch tokens; the floor's limits test reads the
tessellation stages.
The owner's 3406 order, next kind after plain draws: MTLIndirectCommandTypeDrawPatches. Today
the translator refuses a kernel's draw_patches (Unsupported{GpuEncodedIndirectCommands,
NotImplemented}), and the runtime refuses a descriptor of DRAW_PATCHES (Gap::IndirectCommandBuffers,
CommandTypes).
- Engine: icb_merged_patches compiles and validates under the identity domains on every
profile. Red: refused today.
- Runtime, under a device cfg: four patch draws the kernel encodes draw what the same draws
direct draw. Each has three vertex buffers, one quad patch of one control point from patch i,
no patch index buffer, level-1 factors, one or two instances and its own base instance. The
arms are all four commands, commands 1 and 2, the range 2 and 3 a buffer holds, and
executions around a direct draw. A buffer of patch and plain draws together is refused,
CommandTypes. Red: the buffer of DRAW_PATCHES is refused today.
- Conformance: the row indirect-range-gpu-written-patch-draws and its Metal recording are in
a4dde5f4b0.
Jobs: the red runs are named in the hand-over.
Metal's answer for the patch-draws range row, recorded on the Apple M3 Max (macOS 27.0.1,
26A434) at 0616460f73 by job m3-max-81499, with its times (8 rounds, the same job). The
execution completes, and commands 1 to 5 draw rows 2 to 11. Each texel holds the command's
mark, the patch index i, the instance and the base instance i. The instance a post-tessellation
vertex function reads counts from the base instance: an odd command's second instance reads
i + 1, an even command's only instance reads i.
The ledger's Iris Xe row is the Extension refusal, as for the other range rows: the Iris Xe
lists no VK_EXT_device_generated_commands. CONFORMANCE-COVERAGE.md is regenerated.
Red: the runtime refuses an indirect command buffer of DrawPatches (CommandTypes), so the
row's replay meets a refusal that the ledger does not list.
scripts/regen-air-fixtures/regen-air-fixtures.sh icb_merged_patches on the Apple M3 Max (Apple
metal version 32023.922, macOS SDK 27.2 26B118), job m3-max-81495: icb_merged_patches.ll and
.air.ll, and the fixture's TOOLCHAIN line. The engine inventory and the air_input printouts take
the fixture when they are re-blessed on development.
The next indirect command kind after plain draws: MTLIndirectCommandTypeDrawPatches.
icb_merged_patches is an owned fixture. Its kernel encodes command i as one quad patch of one
control point from patch i, with no patch index buffer and level-1 half factors, one instance
for an even command and two for an odd one, from base instance i, with vertex buffers 0 to 2
of its own. The post-tessellation vertex function lays patch p over the rectangle from xy[2p]
to xy[2p + 1]. Each texel then holds its command's mark, the patch index, the instance and the
base instance.
indirect_ranges.rs gains the row indirect-range-gpu-written-patch-draws: commands 1 to 5,
written by a blit's copy before the pass, as the plain-draws row is. The fixture's AIR, the
expectations, the Metal recording and the ledger row follow in their own commits.
Owner 3406 follow-up to L212. A copy between two buffers whose ranges meet
in one block was refused (Refusal::BufferCopyOverlap, basis "ours"). Two
buffers placed over each other in a heap are aliases. Metal's validation
names copies between buffers among the defined copies between aliases in
a placement heap (job m3-max-81493), and plain Metal on an Apple M3 Max
gives memmove's bytes for them (probe overlapping_alias_copies.m, job
m3-max-81544).
Form (blit.rs):
- buffer_to_buffer takes whether the two are one buffer and answers
BufferChunks.
- Ranges apart are one chunk.
- Two buffers' ranges whose bytes meet are chunks no longer than the shift
|to - from|, the last chunk the rest. The chunk at the end the shift
points to goes first: the last first where the destination lies past the
source, else the first. So no command's source and destination share a
byte (VUID-vkCmdCopyBuffer-pRegions-00117, which each one-region command
meets on its own), and no chunk reads a byte an earlier one wrote.
- copy_from_buffer_to_buffer records one vkCmdCopyBuffer a chunk with the
slabs' execution barrier (between) between two, each counted as a blit
barrier. Every hazard between two chunks is a write after a read.
- Two ranges on the same bytes copy nothing.
- One buffer's overlapping ranges stay Refusal::BufferCopyOverlap. Its basis
is now metal-documented: Apple's page for the copy allows the same buffer
only "if size is less than the distance between sourceOffset and
destinationOffset". The conformance case buffer-blit-overlapping-copies
is one buffer, so its ledger row holds. Only its note's wording changed;
coverage.py regenerated with no change.
- A shift of n bytes takes size/n commands, rounded up. That is the fewest
any form without an intermediate takes.
Unit test a_copy_between_buffers_takes_ranges_inside_both_and_cuts_two_buffers_bytes_that_meet
(renamed) expects the chunk orders both ways, a partial last chunk, and
nothing for the same bytes. The rest of its cases are unchanged.
Docs: the copy's doc, BufferCopyOverlap (REFUSALS.md and basis.rs
regenerated), the runtime README's blit encoders, the tests' module doc.
Verified: refusal_surface.py --check exits 0. Green under the validation
layer, which fails a test on any message, so each one-region chunk met
VUID-vkCmdCopyBuffer-pRegions-00117 on these devices: the 27 blit tests pass
on lavapipe (llvmpipe, LLVM 23.1.4; job m3-max-81597), the AMD Radeon 780M
(RADV PHOENIX; m3-max-81592), the NVIDIA GeForce RTX 2080 (m3-max-81600) and
the AMD Radeon RX 7900 XTX (RADV NAVI31; m3-max-81671). The runs built the
series before its rebase onto development; the patches are the same.
Owner 3406 follow-up to L212. The runtime refuses a copy between two
buffers whose ranges meet in one block (two buffers placed over each other
in a heap) as Refusal::BufferCopyOverlap, basis "ours". Metal's validation
names copies between buffers among the defined copies between aliases in
a placement heap ("blitting between aliasing resources is defined on a
placement heap only when using a blit method copying entire texture
surfaces, or when copying between buffers"; job m3-max-81493). Plain Metal
on an Apple M3 Max gives memmove's bytes for such copies (probe
overlapping_alias_copies.m, job m3-max-81544): 64 KiB, the destination 4
or 4096 bytes past the source, and the reverse.
New device test every_device_copies_between_buffers_whose_bytes_meet_as_memmove:
- Three heap buffers over one Shared block: two at offset 0, one at 256.
- Copies 4 bytes on and back (1024 bytes), and 256 bytes on and back (1024
and 1000 bytes). Each expects the heap's bytes to be memmove's, every
other byte kept.
- Each expects a blit barrier a chunk more than a copy's one: 256 chunks
for the 4-byte shifts, 4 for the 256-byte ones. No byte is copied of the
runtime's own.
- Two ranges on the same bytes copy nothing and record no barrier.
- One buffer's overlapping ranges stay Refusal::BufferCopyOverlap.
Red as expected: every meeting case is refused today. The test fails on
lavapipe (llvmpipe, LLVM 23.1.4; job m3-max-81597), the AMD Radeon 780M
(RADV PHOENIX; m3-max-81592), the NVIDIA GeForce RTX 2080 (m3-max-81600) and
the AMD Radeon RX 7900 XTX (RADV NAVI31; m3-max-81671), with "4 bytes on: a
copy of 1024 bytes from 0 to 4 reads bytes it writes". The runs built the
series before its rebase onto development; the patches are the same.
Owner 3406 follow-up to L212: copies between buffers that alias in a
placement heap. Job m3-max-81544, an Apple M3 Max, macOS 27.0.1.
- With the API validation off, every buf-* case gave memmove's bytes in 8
of 8 rounds: two buffers at offset 0 of a Private placement heap, 64 KiB
with the destination 4 or 4096 bytes past the source, and the reverse.
One buffer into itself, 4 bytes on, gave the same.
- With MTL_DEBUG_LAYER=1, the one-buffer control runs with the same bytes.
Every two-buffer case ends the process inside the layer's own aliasing
check: "-[MTLDebugBuffer width]: unrecognized selector sent to instance",
from validateResourceAliasing under -[MTLDebugBlitCommandEncoder
copyFromBuffer:sourceOffset:toBuffer:destinationOffset:size:]. That is the
layer's fault, not a refusal. The layer's own assertion text, quoted
above it, names copies between buffers among the defined copies between
aliases.
Verified: the job's log, read whole.
Metal's API validation says a copy between aliasing resources in a placement
heap is defined "when copying between buffers". The runtime refuses two
buffers that overlap in one block as Refusal::BufferCopyOverlap.
The new buf-* cases measure Metal's answer:
- 64 KiB copied between two buffers at offset 0 of a Private placement
heap, the destination 4 or 4096 bytes past the source, and the source
past the destination;
- as a control, one buffer copied into itself 4 bytes on. Apple's page for
the copy allows that only where the size is less than the offsets'
distance.
A third buffer over the same bytes writes them first and reads them after.
Each round counts the bytes that hold memmove's answer.
Verified: xcrun clang -fsyntax-only -Wall -Wextra, no diagnostics.
Row L212. The test copies between Surface::buffer and its own plane, into
the plane and out of it from a row on. It ran only where the surface was in
place, so the copy form was not tested on any device.
The test now runs the copy form too, after the in-place form:
- A pitch multiple of 4096 asks every device for the copy form, as
tests/surface.rs's "copy-form" row does. In that form the plane is a
texture over the block's buffer in an image of its own, and crate::over
carries the bytes between them.
- Each form expects every byte of the surface to be the source's from before
the copy, every other byte kept.
- The copy form also expects no refusal and at least one counted over copy
(Metrics::over_copies, every cause), so the run shows the path ran. Not
Metrics::over_copies_surface: memory_cause gives that cause only where the
memory's kind keeps the image from lying in place, and a plane at a pitch
of a multiple of 4096 is in the copy form for its pitch
(Copy(Pitch { plane: 0 })). An assertion on over_copies_surface failed on
lavapipe (job m3-max-81576) after the bytes had matched.
- The line printed per device gives each case's submissions and copies.
- The in-place counts are unchanged.
The doc cites the M3 Max's answer from probe overlapping_alias_copies.m,
job m3-max-81486: the source's bytes from before the copy between an
IOSurface's no-copy buffer and its own plane, a row on each way and 8 texels
along, into and out of the plane, with the validation layer passing each.
No product change. Verified, device tests under the validation layer, each
printing OpaqueFd, Copy(Pitch { plane: 0 }), rows 4096 apart, (submissions,
copies) [(1, 2), (1, 1)], 27 of 27 blit tests passed:
- lavapipe (llvmpipe, LLVM 23.1.4): job m3-max-81597;
- AMD Radeon 780M (RADV PHOENIX): job m3-max-81592;
- NVIDIA GeForce RTX 2080: job m3-max-81600;
- AMD Radeon RX 7900 XTX (RADV NAVI31): job m3-max-81671.
The runs built the series before its rebase onto development, with this
assertion's fix as a commit of its own; the patches together are the same.
Row L212. Metal's API validation stops a copy between aliases in a placement
heap unless it copies between buffers, between linear textures of one row
stride, or entire texture surfaces. Source: probe overlapping_alias_copies.m
on an Apple M3 Max, macOS 27.0.1, jobs m3-max-81486 and m3-max-81493. The
runtime refused all of these as Gap::OverlappingCopy. It now refuses what
Metal stops as Refusal::AliasingCopy, and records nothing for it.
Form (blit.rs):
- buffer_copy: a region that meets a heap texture's memory, either way, is
Refusal::AliasingCopy (Metal: "blitting between aliasing resources is
defined on a placement heap only when using a blit method copying entire
texture surfaces, or when copying between buffers").
- texture_copy: two textures whose memory meets, one placed in a heap, that
are not both heap textures copying a whole level into a whole level
(whole_level: origin 0, size the level's extent, the view's first level
taken off) are Refusal::AliasingCopy. A texture in place over a heap
buffer against a heap texture is refused even for a whole level (Metal:
"... only when both textures are linear and have the same
bufferBytesPerRow value").
- The whole level between two heap textures stays Gap::OverlappingCopy,
counted, per the planner's ruling. That is how the consumer reaches
copyFromTexture:toTexture:, which Metal's validation takes and the M3
answers with the source's bytes at 0, 128 and 8320 bytes apart. No copy
command and no cut reads no byte it writes
(VUID-vkCmdCopyImage-pRegions-00124). The form through an image of the
runtime's, counted, is built once a guest's run counts the gap.
Docs: blit.rs's module and copy method docs; error.rs's Gap::OverlappingCopy
(REFUSALS.md regenerated); Metrics::overlapping_copies_refused; the runtime
README's blit encoders and their known gaps, which carry the M3's answer
and the VUID. The README also cites the M3's answer for a surface's buffer
and its own plane (job m3-max-81486). No conformance ledger row covers
these shapes.
Verified: refusal_surface.py --check exits 0. Green under the validation
layer, which fails a test on any message: the three tests pass, with the
rest of the 27 blit tests, at the series' tip on lavapipe (llvmpipe, LLVM
23.1.4; job m3-max-81597), the AMD Radeon 780M (RADV PHOENIX; m3-max-81592),
the NVIDIA GeForce RTX 2080 (m3-max-81600) and the AMD Radeon RX 7900 XTX
(RADV NAVI31; m3-max-81671). The runs built the series before its rebase
onto development; the patches are the same.
Row L212. These copies were all Gap::OverlappingCopy: a copy between a
texture placed in a heap and a resource whose memory meets it.
On an Apple M3 Max, macOS 27.0.1, the conformance probe
overlapping_alias_copies.m (jobs m3-max-81486 and m3-max-81493) shows that
Metal's API validation stops most of these shapes with
"blitting between aliasing resources is defined on a placement heap only
when using a blit method copying entire texture surfaces, or when copying
between buffers":
- a buffer and a texture over its bytes, either way;
- the region method between two heap textures that alias.
It stops a heap texture and a linear texture over a heap buffer at its
bytes with "... only when both textures are linear and have the same
bufferBytesPerRow value". It passes copyFromTexture:toTexture: between two
heap textures that alias. The consumer copies that as whole levels through
copy_from_texture.
The new Refusal::AliasingCopy (Basis: metal-measured) names the shapes
Metal stops. docs/REFUSALS.md, error/basis.rs and api_signatures.tsv are
regenerated. A whole level into a whole level between two heap textures
stays Gap::OverlappingCopy, per the planner's ruling. Nothing produces the
new variant yet.
Tests:
- textures_whose_memory_meets_where_one_is_laid_out_by_the_device_are_refused_or_copy_in_no_order
(unit, renamed) expects the two heap textures' whole-level copy still to
copy in no order. It expects part of a level, either way and at an offset,
and a texture in place over the heap texture's bytes, either way, to be
Refusal::AliasingCopy.
- a_buffer_copy_over_its_texture_s_own_bytes_copies_in_slabs_or_in_no_order
(unit) expects a region meeting a heap texture's memory, into it and out
of it, to be Refusal::AliasingCopy.
- every_device_refuses_a_copy_between_heap_resources_whose_memory_meets
(device) expects the whole level onto its alias to be the counted gap,
and part of a level onto its alias and the heap buffer either way to be
Refusal::AliasingCopy. Nothing is recorded, and one refusal is counted.
Verified: refusal_surface.py --check exits 0, and signatures.py --bless adds
the one variant row. Red as expected, under the validation layer, on
lavapipe (llvmpipe, LLVM 23.1.4; job m3-max-81597), the AMD Radeon 780M
(RADV PHOENIX; m3-max-81592), the NVIDIA GeForce RTX 2080 (m3-max-81600) and
the AMD Radeon RX 7900 XTX (RADV NAVI31; m3-max-81671): the three tests
fail. The device test says "part of a level onto its alias:
Err(Unsupported(OverlappingCopy { pixel_format: RGBA8Unorm }))", the unit
tests "not a refusal: it was checked". The runs built the series before its
rebase onto development; the patches are the same.
Row L212. The probe header now records the two oracle jobs on an Apple M3
Max, macOS 27.0.1: m3-max-81486 (heap-* and surface-*) and m3-max-81493
(tex-*).
- With the API validation off, every copy between aliases gives the
source's words from before the copy, in 8 of 8 rounds each.
- Metal's API validation ends the process at these copies:
- a buffer and a heap texture over its bytes;
- the region method between two heap textures that alias, over the whole
level or a part of it;
- copyFromTexture:toTexture: between a heap texture and a linear texture
over a heap buffer at its bytes.
The header quotes each assertion's text.
- Metal's API validation passes copyFromTexture:toTexture: between two heap
textures that alias, and every copy between an IOSurface's no-copy buffer
and its own plane.
Verified: the two jobs' logs, read whole.
Row L212. On an M3 Max, the first round (job m3-max-81486) found these
answers under Metal's API validation:
- A copy between a heap buffer and a heap texture over its bytes ends the
process: "blitting between aliasing resources is defined on a placement
heap only when using a blit method copying entire texture surfaces, or
when copying between buffers."
- copyFromTexture:toTexture: between two identical textures at one offset
passes the validation.
The new tex-* cases ask which texture-to-texture copies count as "entire
texture surfaces", and what the M3 gives for them:
- copyFromTexture:toTexture: with the second texture one alignment on, and
half its bytes on;
- the region method over the whole level, at offset 0 and half on;
- the region method over a quarter of the level;
- a heap texture and a linear texture over a heap buffer at the same bytes,
each way.
Verified: xcrun clang -fsyntax-only -Wall -Wextra, no diagnostics.
Row L212. Two copy shapes have no M3 answer on record:
- A texture placed in a placement heap and a buffer or texture of the heap
placed over its bytes. The runtime refuses this as Gap::OverlappingCopy.
- An IOSurface plane's texture and a no-copy buffer over the surface's own
bytes. The runtime copies this a row at a time from the source as it was
before the copy (Surface::buffer and its plane).
overlapping_alias_copies.m runs each shape as one blit command alone, one
case a process, 8 rounds each. Each round prints, word by word, whether the
destination holds the source's bytes from before the copy, and for the
surface, the word an in-place copy front to back or back to front would
leave. It also has controls with the heap's second resource placed apart.
Verified: xcrun clang -fsyntax-only -Wall -Wextra, no diagnostics. No
measurement yet.
85b8af89a4 lowers render_command's draw_primitives of triangles (it wrote a refusal before),
so a kernel that encodes plain draws translates to other words under an unchanged key. The golden
tables are re-blessed on development.
5781011f02 gave indirect-range-gpu-written-plain-draws its point-size notice allowance and left
docs/CONFORMANCE-COVERAGE.md one line behind it (coverage.py --check: not what the suite's
sources and recordings derive). Regenerated; --check now says as derived.