Commit Graph
10050 Commits
Author SHA1 Message Date
Anees Iqbal 2fe776acf3 rt test: the plain-draws test matches the mixed buffer's error alone, as the buffer is not Debug (red still)
Job m3-max-81201 (msi, lavapipe) at 2ce4455b36 did not compile the runtime's tests: the match on
new_indirect_command_buffer's Result printed its other arm with {:?}, and IndirectCommandBuffer
is not Debug. The check now matches the Result's error, an Option. The engine leg of that job
was red as meant: a_kernels_plain_triangle_draws_into_commands_compile_under_the_identity_domains
failed and the four other engine tests passed.
2026-12-02 21:06:02 -08:00
Anees Iqbal e9efa22405 Tests: a kernel's plain triangle draws into an indirect command buffer draw as their draws direct (red)
The owner's 3406 order: every unbuilt indirect command kind Metal gives every Mac device is a
refusal to build, and the planner ranked MTLIndirectCommandTypeDraw first. Today the translator
refuses a kernel's draw_primitives (Unsupported{GpuEncodedIndirectCommands, NotImplemented}) and
the runtime refuses a descriptor of DRAW (Gap::IndirectCommandBuffers, CommandTypes).

- Engine: icb_merged_draws's icb_merged_triangles compiles and validates under the identity
  domains on lavapipe and moltenvk-m3 (red: refused today). Its points and lines kernels stay
  refused, since an execution draws one topology.
- Runtime, under a device cfg: four plain triangle draws the kernel encodes (three vertex buffers
  each, their own vertex starts, one or two instances and base instances) draw what the same draws
  direct draw: all four, commands 1 and 2, the range 2 and 3 a buffer holds, and executions around
  a direct draw. A buffer of DRAW and DRAW_INDEXED together stays CommandTypes, until the planner
  rules on that mix. Red: the buffer of DRAW is refused today.
- Conformance: a fourth GPU-written range row, indirect-range-gpu-written-plain-draws: eight
  plain triangle draws the kernel encodes, commands 1 to 5 in a range a blit writes. The range
  rows now state their command type (EncodedRange::command_types); the three indexed rows keep
  their inputs byte for byte. The Iris Xe's ledger row is the same Extension refusal as the other
  three range rows. Metal's recording follows in its own commit, taken on the M3. Red: the
  runtime refuses the buffer, CommandTypes, a row the ledger does not hold.

Jobs: the red runs are named in the hand-over.
2026-12-02 21:06:02 -08:00
Anees Iqbal a6f34a7fbe Runtime README: the make's time on the Radeon 780M and the Iris Xe beside the M3's
The known gap's make time now names three integrated devices: a 1920 by 1080 BGRA8Unorm
texture in place over host memory takes, median and largest of 16 makes in microseconds, 848 and
1149 on the Apple M3 Max, 720 and 1426 on the Radeon 780M and 3499 and 3927 on the Iris Xe; a
16 by 4 one 436, 278 and 420; a make that is the counted copy 25 to 60.

Verified: host_make's lines from the seam test at the commit before, whose tree differs from this
one by this paragraph alone: Radeon 780M (RADV, Mesa 26.2.6) job m3-max-81798, 18 of 18 passed;
Iris Xe (ANV, Mesa 26.2.6) job m3-max-81801, 18 of 18 passed. The M3's figures are from job
m3-max-81753 at the RUNTIME_VERSION commit, 12 of 12 passed.
2026-12-02 20:38:26 -08:00
Anees Iqbal 105ab7b18f Runtime README: the make's measured time beside the host-memory known gap
The restore pair inside a make of a texture over host memory copies the texture's bytes out and
back, so the make's time grows with the texture's size. The known gap now gives the make's time on
the Apple M3 Max under KosmicKrisp 26.3.1: a 1920 by 1080 BGRA8Unorm texture in place, 848
microseconds (median of 16, largest 1149); 16 by 4 texels, 436; a make that is the counted copy,
25. The paragraph is reflowed to the README's width.

Verified: the figures are host_make's lines from the seam test at the commit before, job m3-max-81753
(12 tests run, 12 passed).
2026-12-02 20:20:22 -08:00
Anees Iqbal de200dc009 Translator: RUNTIME_VERSION 2552 for a texture over host memory restored inside its make
The runtime now makes a texture over host memory's import in place on an integrated or CPU
device, restores its bytes in a submission of its own inside the make, counts that pair under
OverCause::HostMemoryRestore, and offers Buffer::new_texture_in_place with its refusal
TextureNotInPlace. A run of an unchanged artifact may therefore submit and record something else,
and refuse something else, 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.

Verified: Gate job m3-max-81765 (clippy in three configurations, Rustdoc, the runtime's private
Rustdoc, and the runtime, translator, validation and conformance suites) passed with the series'
final code, the runtime guard among the validation suite's tests.
2026-12-02 20:17:48 -08:00
Anees Iqbal d10970077e Runtime test: the seam test times sixteen makes of a 1920x1080 BGRA8 texture over host memory
The restore pair inside a make copies the texture's bytes out and back, so a make's time grows
with the texture's size, and the 16x4 timing does not show it at a video frame's size. The test
now also makes a 1920x1080 BGRA8Unorm texture over an import of its own sixteen times, prints the
median and largest make, whether the frame was in place and the restore copies and bytes counted
across the sixteen, and asserts that an in-place frame's make counted its pair (32 copies) by its
return.

Verified: the 1080p make's median and largest, in microseconds: Apple M3 Max 848 and 1149 (job
m3-max-81753), Radeon 780M 720 and 1426 (m3-max-81798), Iris Xe 3499 and 3927 (m3-max-81801),
lavapipe 4249 and 14654 (m3-max-81750), each in place with 32 restore copies of 265,420,800 bytes in
all; the RTX 3090, the counted copy, 35 and 969 (m3-max-81792) with none.
2026-12-02 20:17:48 -08:00
Anees Iqbal 1e11b4e959 Runtime: new_texture_in_place with index None is reached through its views alone
The consumer makes a surface shape's image with no index of its own (Reach::Views), each guest
texture over it a view at the guest's index, and needs the in-place image made the same way. The
planner agreed that this rides N, one call: new_texture_in_place maps index None to Reach::Views
for any usage, as the crate-private Buffer::new_plane_texture does; Some(index) stays
Reach::Index, given exactly where shaders reach the texture, as new_texture takes it. The decision
whether the texture is in place is unchanged and still shared with new_texture.

Its doc says what None means against Metal: Metal gives every texture made from a buffer a
gpuResourceID of its own; one made with None has none (gpu_resource_id answers index 0, Metal's
nil texture to a shader, and a bind to a texture slot is Refusal::TextureWithoutIndex), and the
consumer answers the program through a view at the program's index. None is never
Refusal::TextureIndex. The runtime README says the same.

Verified on lavapipe, job m3-max-81750: tests/in_place_views.rs failed at the commit before (the
make in place alone with no index was refused) and passed two commits on, at the RUNTIME_VERSION
commit, with ShaderRead and with ShaderRead and PixelFormatView: views at an index in the image's
format, its sRGB sibling and R32Uint, retargets from it and onto it, and blits into and out of it.
With the series' final code (runs at its README commits, which change no code), the touched device
tests with in_place_views passed on the Apple M3 Max under KosmicKrisp 26.3.1 (job m3-max-81753, 12
of 12), the Radeon 780M (job m3-max-81798, 18 of 18), the Iris Xe (job m3-max-81801, 18 of 18) and
the RTX 3090 (job m3-max-81792, 18 of 18), each in both usages; gate job m3-max-81765 (clippy in
three configurations, Rustdoc, the runtime's private Rustdoc, and the runtime, translator,
validation and conformance suites) passed with the series' final code.
2026-12-02 20:14:11 -08:00
Anees Iqbal a87d4b0fd9 Runtime test: a texture made in place alone with no index is reached through its views (red)
The consumer (video2) makes a surface shape's image with Device::new_texture_for_views
(Reach::Views): it takes no resource index of its own, and each guest texture over it is a view
at the guest's own index. To make that image in place it needs new_texture_in_place to take
index None the same way, as the crate-private Buffer::new_plane_texture maps None to
Reach::Views; today None is Refusal::TextureIndex for any usage shaders reach, and an index of the
consumer's own would take one outside the guest's numbering.

The test (tests/in_place_views.rs), on every device: an RGBA8Unorm texture of 8 by 8 at the
device's pitch over a Shared buffer, made by new_texture_in_place with index None, with ShaderRead
usage and, where the device makes it in place, with PixelFormatView too. It is in place with no
index of its own, and takes what a shape's image takes today:
- a view at the guest's index in its own format, which a draw samples texel for texel, and views
  in its sRGB sibling and (PixelFormatView) R32Uint, whose blit copies out read the buffer's bytes;
- a retarget from it: a blit copies it into a Private image for views, whose view takes the
  index, and a draw sampling the index reads the copy;
- a retarget onto it: its view takes another Private image's view's index, and a draw sampling
  the index reads its texels;
- a blit copy into it writes the buffer's bytes at the pitch, read back by a copy out and a draw.

Expected red on every device: index None is refused with TextureIndex.
2026-12-02 20:13:03 -08:00
Anees Iqbal 16f7bc942e Runtime: a texture over host memory's import is restored inside its make, which waits for it
The planner ruled the seam (ii), for new_texture and new_texture_in_place alike, one form: the
restore pair of a texture in place over host memory's import runs in a submission of the
runtime's own inside the make, and the make returns after it completes. Metal touches no bytes at
a make, and a CPU write to a Shared buffer that no pending GPU command uses is fully defined.
Running the pair at the next submission on any queue let one thread's commit revert another
thread's write (reims: an app wrote its first frame into a fresh pool surface under a lock that
waits on nothing, and a later submission from another process ran the pair mid-write): a lost
write documented Metal never loses. The planner's earlier term (the pair in the texture's first
command buffer, held by an ordering test) is withdrawn. Discrete devices are untouched: they have
no pair.

Device::texture, for a texture whose image restores (Keep::Restore), has the upload that holds
its move home go at once, alone (WorkState::flush), and waits on the progress semaphore for it
(Done::wait), the pattern Texture::get_bytes and new_buffer's Private zeroing use. The upload's
barrier orders the save after the GPU work already submitted, so the make waits for that work
too. An encoded shared-event wait is held on the CPU and never submitted, so it never holds the
make's submission back. The make is refused in a scheduled handler (Refusal::InScheduledHandler),
which runs on the submit thread that the make waits for, as those calls are.

Docs: new_texture's and new_texture_in_place's, InScheduledHandler's list, the counters'
(HostMemoryRestore inside the make), check_over's and the homing comment; the runtime README's
Imported blocks paragraph and its known gap, which now says what remains (a host write from
another thread during the make) and carries the Radeon 780M row (Phoenix, RADV, job
m3-max-81673: 696 against 537 us a frame at one draw, 1025 against 793 at four);
docs/REPLAY-STREAM.md; AGENTS.md rule 2 ("after one counted copy pair at its making") and rule 3
("a counted copy pair at the texture's making restores the bytes"), in the planner's words.
Tests: host_in_place, over_causes and import count the pair at the make.

Verified on lavapipe, job m3-max-81704: the seam test failed at the commit before (exit 100) and
passed here (exit 0), with clippy under --cfg m2v_cpu_icd clean. With the series' final code (runs
at its README commits, which change no code), the touched device tests with in_place_views passed on
the Apple M3 Max under KosmicKrisp 26.3.1 (job m3-max-81753, 12 of 12), the Radeon 780M (job
m3-max-81798, 18 of 18), the Iris Xe (job m3-max-81801, 18 of 18) and the RTX 3090 (job
m3-max-81792, 18 of 18), the integrated three restoring in place inside the make (32 restore copies
over sixteen 1080p makes); gate job m3-max-81765 (clippy in three configurations, Rustdoc, the
runtime's private Rustdoc, and the runtime, translator, validation and conformance suites) passed
with the series' final code.
2026-12-02 20:07:40 -08:00
Anees Iqbal 0d7521a809 Runtime test: a texture over host memory is restored inside its make (red)
reims's case: an app makes a texture over a fresh pool surface and writes its first frame under a
lock that waits on nothing; a later submission from another process runs the save and write-back
of the in-place texture's bytes mid-write, and the bytes revert. The planner ruled the seam (ii),
for both calls, one form: the restore pair runs in a submission of the runtime's own inside the
make, which returns once it completed. Metal touches no bytes at a make, and a CPU write to a
Shared buffer that no pending GPU command uses is fully defined; running the pair at the next
submission on any queue lets one thread's commit revert another thread's write, a lost write
documented Metal never loses. The planner's earlier term (the pair in the texture's first
command buffer, held by an ordering test) is withdrawn.

The test, for new_texture and new_texture_in_place over host memory's import, each device in
both forms: the restore pair is counted by the make's return (in place: two copies; copied:
none), and no restore runs after it; bytes the CPU wrote before the make and after it returns
hold through a commit on another queue and a read; then, with another queue committing
throughout, bytes the CPU writes for 20 ms after the make returns hold. Off unified memory the
in-place-only make is refused for HostMemory. Sixteen timed makes print their median and
largest time.

Expected red on lavapipe and every integrated device: the pair is counted only at the next
submission, so none is counted by the make's return.
2026-12-02 20:07:40 -08:00
Anees Iqbal 3f573034e2 Runtime README: row 1's known gap carries census B's bound on host memory's remaining copies
The planner accepted main's reading of reims's census B on the Apple M3 Max at this form (job
m3-max-81507, against the base at job m3-max-81498): 29 textures over host memory lay in place;
host memory's 2,327 counted copies, 982.3 MB with the in-place textures' restore pairs among
them, are at least 906 MB (92%) of textures with render-target usage, which KosmicKrisp makes no
linear colour attachment for, and six kinds read by shaders alone, of at most 32 KB each, carry
the rest, at most 76 MB. The entry states that bound beside the KosmicKrisp render-target
sentence and claims no more than the census's kind lines show.

Docs only.
2026-12-02 20:07:40 -08:00
Anees Iqbal 2186bd04d1 Runtime: an in-place texture's restore pair counts under OverCause::HostMemoryRestore
A texture in place over host memory's import on an integrated or CPU device costs one save and
write-back of the bytes under its image around its move out of the undefined layout, once, at
its first use. Those two copies counted under OverCause::HostMemory, beside a copied texture's
copies at its uses, so a census could not tell an in-place texture's kind line from a copy's.
The planner ruled (row 1, pin N) that the pair stays counted, in count and bytes and in the
totals, under a cause that says what it is.

The upload's restore now counts under OverCause::HostMemoryRestore, in
Metrics::over_copies_host_memory_restore and over_copy_bytes_host_memory_restore, and still in
over_copies, over_copies_imported and bytes_copied; its OverCopyKind carries that cause.
over_copies_host_memory counts the per-use copies alone. Docs: new_texture's, the runtime
README's Imported blocks and over-copy paragraphs, docs/REPLAY-STREAM.md's over-copy causes (now
twelve beside host memory's) and the frame line's host_memory part, which carries the restore
pairs.

Verified on lavapipe before the rebase onto 9ce9960452, job m3-max-81616: the tests failed at the
commit before (3 of 12 failed) and passed here (12 of 12). Then gate job m3-max-81765 (clippy in
three configurations, Rustdoc, the runtime's private Rustdoc, and the runtime, translator,
validation and conformance suites) passed with the series' final code.
2026-12-02 20:07:40 -08:00
Anees Iqbal 047d853104 Runtime tests: an in-place texture's restore pair counts under a cause of its own (red)
The first-use save and write-back of a texture in place over host memory's import counts today
under OverCause::HostMemory, the cause of a copied texture's copies at its uses. A census then
reads an in-place texture's kind line as a host-memory copy: reims's census B on the M3 showed
six ShaderRead-only kinds under HostMemory that the code says are the in-place textures' pairs.
The planner ruled that the pair keeps being counted, in count and bytes, under a cause that says
what it is, so that HostMemory means the per-use copies alone again.

This commit adds OverCause::HostMemoryRestore and its Metrics pair
(over_copies_host_memory_restore, over_copy_bytes_host_memory_restore), with docs, the
api_signatures table blessed, and the replay's metrics list and its over-copies-by-frame
host_memory part carrying the pair. The tests now expect the pair there: host_in_place's first
test (the first use's restore pair alone, and no host-memory copy), its device-type test (in
place: the restore pair at the first read, nothing after; copied: one host-memory copy a read,
no restore), and over_causes's move home (two restore copies, no other cause).

Expected red on lavapipe and every integrated device: the pair is still counted under
HostMemory.
2026-12-02 20:07:40 -08:00
Anees Iqbal 5f9287e40e Runtime: Buffer::new_texture_in_place, a texture over a buffer in place or a typed refusal
The consumer keeps a texture of its own where the runtime would make the counted copy of a
texture over a buffer, and needs the runtime's in-place texture everywhere else. Buffer::
new_texture_in_place makes what Buffer::new_texture makes where that texture is in place, and
refuses with Refusal::TextureNotInPlace { cause } where new_texture would make the copy, naming
the OverCause its copies would count under. A refusal makes no texture and counts no copy.

One decision in one place: Source::Over carries what the making does with a texture it would not
make in place (Unplaced::Copy for new_texture and a surface plane's texture, Unplaced::Refuse for
the new call). Device::texture refuses at the same two points where it chooses the copy: where
check_over names a cause, and where the linear image made does not lie as the texture's bytes do
(Unmade::Unfit). No new form and no new query: over host memory's import the choice is still
row 1's unified-memory query alone. A texture buffer is a view, never copied, and is made as
new_texture makes it.

The doc comment names newTextureWithDescriptor:offset:bytesPerRow: and lists what is refused;
texture_copy_cause's doc and the runtime README name the new call. docs/REFUSALS.md regenerated
(the refusal's two sites in texture); api_signatures blessed at the red commit.

Verified on lavapipe before the rebase onto 9ce9960452, job m3-max-81616: copy_cause's test failed
at the commit before (1 of 12 failed) and passed two commits on (12 of 12). With the series' final
code (runs at its README commits, which change no code), the touched device tests with
in_place_views passed on the Apple M3 Max under KosmicKrisp 26.3.1 (job m3-max-81753, 12 of 12), the
Radeon 780M (job m3-max-81798, 18 of 18), the Iris Xe (job m3-max-81801, 18 of 18) and the RTX 3090
(job m3-max-81792, 18 of 18); gate job m3-max-81765 (clippy in three configurations, Rustdoc, the
runtime's private Rustdoc, and the runtime, translator, validation and conformance suites) passed
with the series' final code.
2026-12-02 20:07:40 -08:00
Anees Iqbal cbe89f239d Runtime tests: a texture over a buffer made in place alone agrees with the ordinary make (red)
The consumer asked for an in-place-only make of a texture over a buffer: the linear image in
place wherever Buffer::new_texture takes it, and a typed refusal naming the cause wherever
new_texture would take the counted copy, so that the consumer keeps those bytes in a texture of
its own and counts them.

This commit adds Refusal::TextureNotInPlace { cause: OverCause } (Basis: ours), its Display arm,
docs/REFUSALS.md and basis.rs regenerated, the api_signatures table blessed, and a stub
Buffer::new_texture_in_place that makes the ordinary texture. copy_cause's test now runs each
device in both forms (an integrated or CPU device through its two-copy view too), makes each
case in place alone beside the ordinary texture, and adds a render target over its texels alone,
an R8Unorm texture of 13 x 3 at the device's pitch, and RGBA8Unorm and R8Unorm textures over host
memory's import. It asserts that the in-place-only make is in place where texture_copy_cause
answers in place, and elsewhere refused for that cause with no texture made and no copy counted.

Expected red on every device: the stub makes the counted copy where the answer is a cause (the
pitch case at least, on every device).
2026-12-02 20:07:39 -08:00
Anees Iqbal 0703c09cdb Runtime: a texture over host memory's import in place on an integrated or CPU device alone, the counted copy at each use elsewhere
The planner's ruling on row 1 (a). The in-place form over a host-pointer import is chosen by rule 2's
unified-memory query, Vulkan's physical device type (Core::unified_memory, the query that keeps one
copy of a Managed buffer): in place on an integrated or CPU device, after one counted copy pair at its
first use; on a discrete or virtual device the per-use counted copy stays. The planner's earlier term
that deleted the per-use path is withdrawn by name: that path stays, for discrete devices alone. It
is the same query and the same form, widened, not a new one.

Grounds. On an integrated device a texture over Shared memory is already a linear image in place by
rule 3, on the ordinary Shared-buffer route and on the dma-buf import route, and pays the same linear
read; the host-pointer import was the one case still copying at each use. The speed pair (a scratch
timed test, never landed: a 1920x1080 RGBA8Unorm texture over host memory the CPU writes whole each
frame, read at every texel by a 1080p pass of 1 or 4 draws; base d69a0bda18, in place 99125586fb;
six alternating runs of 300 frames each, frame time in microseconds, per-use copy against in place):
- Apple M3 Max, KosmicKrisp 26.3.1, job m3-max-81356: 1016 against 843 (1 draw), 1043 against 888
  (4 draws).
- Intel Iris Xe (RPL-P), ANV Mesa 26.2.6, job m3-max-81425: 3069 against 2630 (1), 4810 against 5381
  (4): a full linear read costs about 360 more than an optimal one and the copy about 480 to 500,
  so in place costs more from about two full reads a frame. The planner: that loss is against the
  copy being removed, in a kernel built to be its worst case, a recorded cost of the linear form,
  not a guest-shown regression; reims's census B on the M3 is the real-workload row.
- AMD RX 7900 XTX on OCuLink, RADV Mesa 26.2.6, job m3-max-81416: 1602 against 1561 (1), 1743
  against 1579 (4), within the spread: in-place reads at the copy's own rate, about 6.7 GB/s.
- NVIDIA RTX 3090 behind Thunderbolt, 620.70.06, job m3-max-81379: 5219 against 12522 (1), 5291
  against 12564 (4): the copy at about 1.98 GB/s, in-place reads at about 0.72 GB/s.

check_over lays a texture over host memory's import in place only where core.unified_memory();
elsewhere memory_cause names OverCause::HostMemory, the counted copy at each use. AGENTS.md: rule 2's
unified-memory clause gains the planner's words verbatim ("and a texture over a host-pointer import
in place on an integrated or CPU device, after one counted copy pair at its first use, and through
its per-use counted copy elsewhere"), and rule 3's host-pointer-import clause is limited to an
integrated or CPU device. The runtime README's Imported blocks paragraph names the device type, and
its known gap of memory blocks is one entry with the four rows. Buffer::new_texture's doc, the
counters' docs (OverCause::HostMemory, over_copies_host_memory, textures_in_place_over_imports),
REPLAY-STREAM.md and the device tests' docs say the same.

Verified before its rebases, on adba2693a1: on lavapipe, job m3-max-81460, the device-type test
failed at the commit before (1 of 2 failed) and passed here (2 of 2); the touched device tests
passed 15 of 15 on the Apple M3 Max under KosmicKrisp (job m3-max-81454), the Iris Xe
(m3-max-81456), the RX 7900 XTX (m3-max-81503), the RTX 3090 (m3-max-81555, the per-use copy) and
the Radeon 780M (m3-max-81556, in place); gate m3-max-81446 passed. Then gate job m3-max-81765
(clippy in three configurations, Rustdoc, the runtime's private Rustdoc, and the runtime,
translator, validation and conformance suites) passed with the series' final code.
2026-12-02 20:07:39 -08:00
Anees Iqbal f53c47d120 Runtime test: a texture over host memory in place on an integrated or CPU device alone, the counted copy elsewhere (red)
The planner's ruling on row 1 (a): the in-place form over a host-pointer import is chosen by rule 2's
unified-memory query, Vulkan's physical device type, as one copy of a Managed buffer is: in place on
an integrated or CPU device, after one counted copy pair at its first use; through its per-use
counted copy on a discrete or virtual device. Grounds: on the RTX 3090 (job 81379) a 1080p texture
read in place across the card's link took 12522 us a frame against 5219 us for the per-use copy,
while on the M3 (job 81356) in place took 0.829 and 0.852 of the copy's frame time.

each_device_takes_a_texture_over_host_memory_in_place_by_its_device_type runs in both forms
(each_device_in_both_forms): on an integrated or CPU device it asks in place, counted once in
textures_in_place_over_imports, the pair at the first read and nothing at the second; through the
two-copy view, and on a discrete device, the counted copy, one copy in of the texels' bytes at each
read and nothing back, and no count of a texture in place. It prints both counters per card.

Expected red at this commit: the two-copy view on lavapipe takes the texture in place.
2026-12-02 20:07:39 -08:00
Anees Iqbal 4b7f935a80 Runtime: a texture over host memory's import in place, its bytes saved and written back once
A texture over a buffer in host memory's import (Device::import_host_memory) used to be the counted
copy at every use. Its bytes were copied into an image of its own before each submission that used
it, and back after each write. Now it is in place: the device's linear image, made for host
memory's handle, bound in the import's own memory. The condition is that the external image query
for VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT answers the linear image importable,
compatible and not dedicated-only, and that the image passes the tests of any texture over a
buffer in place.

This is not a new copy. It is the existing last form made smaller: one copy pair in the texture's
life, in place after it, on documented behaviour only.
- Created UNDEFINED: an image bound in imported memory names the import's handle type
  (VUID-vkBindImageMemory-memory-02989), so it starts undefined
  (VUID-VkImageCreateInfo-pNext-01443).
- Saved and written back around the one transition: a move out of the undefined layout may
  discard the bytes (Vulkan 1.4, section 7.1.1).
- Host access by memory-domain operations: host memory has no other side whose release an acquire
  could match (section 11.2.6).

The image's one move home is in the upload ahead of the first command buffer submitted after the
making, from any queue, in this order:
1. a barrier from every earlier command's writes, including earlier submissions on the one
   queue, to the save;
2. a copy of the bytes bound under the image into a Private block taken at the making;
3. the move, in a barrier that waits for the save's reads;
4. the write-back, with a barrier between write-backs, since two imports of the same pages may
   meet;
5. a barrier from the write-backs to every later command and the host.
The block goes back once the upload retires. A later use copies nothing. Where the query offers no
linear image of the format and usage, the texture stays the counted copy at each use. On the Mac
driver that is every render target, since it makes no linear colour attachment.

Counts:
- the two copies count in Metrics::over_copies_host_memory (and over_copies, over_copies_imported,
  bytes_copied), each of the bytes bound under the image;
- new: Metrics::textures_in_place_over_imports counts each texture in place over an import, host
  memory's or a dma-buf's, at its making;
- the replay's frame metrics carry it.

Docs, in this commit:
- AGENTS.md rule 3's first exception gains the planner's clause verbatim;
- the runtime README's Imported blocks gives the form, and states the two VUIDs' rule in plain
  words;
- its known gap gives the pair, the window while the upload runs (a host write may be lost, and a
  host read may see the bytes undefined), and which formats and usages keep the per-use form on
  which driver, by query;
- REPLAY-STREAM.md and Buffer::new_texture's doc follow.

Tests:
- host_in_place gains two checks: a fill submitted before the making and not waited for is in the
  first read, and the texture counts once at its making;
- over_causes, import's texture test and imported_aliases now take either form, asserting in
  place on lavapipe and the copy where the query refuses.

Verified on the system lavapipe (llvmpipe, LLVM 23.1.4), job m3-max-81271, filter host_in_place,
over_causes, import's texture test, imported_aliases, import_overs and layouts: 17 tests.
- Red at the commit before: host_in_place fails at its in-place assertion; the other 16 pass.
- Green, at a tree whose code equals this commit's: 17 of 17 pass. The restore pair is 2 copies,
  512 bytes. In imported_aliases, the Half textures are in place, two pairs for two textures over
  one import. Clippy -D warnings under --cfg m2v_cpu_icd is clean for the runtime and validation.
2026-12-02 20:07:39 -08:00
Anees Iqbal 8c831aea1b Runtime test: a texture over host memory's import in place, restored once (red)
A device test for row 1's form. Under a device cfg, on every device that imports host memory, it
makes an RGBA8Unorm texture of 16 by 4 texels over a buffer spanning the import, at the device's
linear pitch. Where the external image query offers the linear image for host memory's handle
(lavapipe: Mesa's lvp_formats.c answers that handle importable), the texture is to be in place,
and three command buffers are each read exact:

- the CPU wrote the pages before the making and after it, before the commit; a blit reads both
  writes through the texture, and one save and write-back pair (over_copies_host_memory 2, its
  bytes between the texels' span and the import, each) are the command buffer's only copies;
- the CPU writes again; a blit reads the new bytes with no copy;
- a blit writes the texture; the pages hold its texels at the pitch, every other byte as the CPU
  wrote it, with no copy back.

No command names the image preinitialized, and the moves keep their order. Where the query offers
no such image, the texture is the counted copy, printed, and the same reads hold.

Red at this commit: every texture over host memory's import is the counted copy, so on lavapipe
the in-place assertion fails.
2026-12-02 20:07:39 -08:00
Anees Iqbal 9ce9960452 Conformance tests: record mode reads the host's macOS release from the side, so its tests run on any Mac
CI run 47018745061 (at 9186e2fe46) passes macOS's validation suite. Its next
step, "Test the conformance suite", fails 2 of 1054 on the macos-26 runner
(macOS 26.7.2, 25G332):
- record_mode_counts_the_outcomes_it_saw_with_their_runs unwraps
  Err(HostMoved { found: "macOS 26.7.2 (25G332)", named: "apple-m3-max on
  macOS 27.0.1 (26A434)" });
- record_mode_refuses_a_case_whose_metal_run_stopped gets the same
  HostMoved where it expects Refused.
These tests check record mode's logic through a stub side, but record mode
read the host's sw_vers directly. So on any Mac but the oracle, the host
check stopped them first.

Form:
- The Side trait gains macos_release (macOS only). Its default answers this
  host's sw_vers -productVersion and -buildVersion (record::sw_vers, the
  same reads check_host made). Metal's side and the runtime's side keep the
  default.
- check_host takes the side and holds its release against ORACLE_OS_VERSION
  and ORACLE_OS_BUILD as before. HostMoved and its text are unchanged. Off
  macOS it is NoMetal, as before.
- watch::Watching forwards macos_release to the side it wraps, as it
  forwards every Side call (the_announcing_side_forwards_every_call reads
  the trait). docs/CONFORMANCE-COVERAGE.md is regenerated: the Side method
  count is 135.
- The test StubSide states the oracle's release, so the record-mode tests
  check record mode's logic on any Mac. on_release moves it.
- New test record_mode_refuses_a_host_that_is_not_the_oracle (macOS):
  - a stub on macOS 26.7.2 (25G332) is HostMoved, naming both hosts;
  - the oracle's release on another build is HostMoved too.

The rest of the macOS job after this step: only "Doc tests" (cargo test
--workspace --all-features --doc). Every later step is Linux-only. No
running doctest touches the host: the only doc code fence in macOS-gated
code is a text block in the conformance binary. Packaging and the
documentation steps run before this one, and passed in run 47018745061.

Verified: see the hand-over. The M3 runs no tests, so the macOS proof is
the next CI run.
2026-12-02 20:00:52 -08:00
Anees Iqbal 208360ab6d rt: surface.rs imports Gap only on Windows, where its one use is
87693a368c left surface.rs's one Gap use, Gap::D3d11SurfaceBuffer, in a #[cfg(windows)] arm,
so every other build warned of an unused import and clippy with -D warnings failed on it
(m3-max-81412: workspace clippy plain, m2v_gpu and m2v_cpu_icd all EXIT=101 at 417d86ac90). The
import is now cfg(windows), and the make's doc links Gap::TextureView by path.
2026-12-02 19:29:39 -08:00
Anees Iqbal 094405e9a9 Harness and player: video planes ask shader read and write with no read-alone fallback
Since c850655216, new_exported_surface answers a plane whose image in place lacks storage with
the copy form (SurfaceCopy::Usage) rather than Gap::SurfaceUsage. So the harness's churn probe
and the replay player's video surfaces can no longer reach their fallback to planes of shader
read alone, and this commit deletes it:
- churn.rs: the probe's retry and Video's usage field, replaced by one const usage;
- videos.rs: the retry, its read_only counter, and the report's "with planes of shader read
  alone" count;
- REPLAY-STREAM.md and videos.rs's module doc now say the copy form takes such a device.
A device that lacks storage now shows in the report's copy-form count under its reason.

Checked by the hand-over job: clippy of the harness and validation crates, and the validation
suite.
2026-12-02 19:29:39 -08:00
Anees Iqbal 6d9706769a rt: a surface plane whose image in place lacks a usage its texture asks takes the copy form
new_exported_surface refused a plane whose texture asks a usage that its image in place does
not hold or export, ShaderWrite's storage for one, with Gap::SurfaceUsage. As ruled for row 5,
that plane now takes the counted copy form with its own reason, SurfaceCopy::Usage { plane }.
The copy form's texture over the block's buffer is an optimal image of the usage the texture
asks. The submissions copy it into the image and back (Metrics::over_copies), so a kernel's
write through a view of the plane reaches the exported bytes by that copy before the host or
the other API reads them.

How:
- Query::plane answers usage_verdict's reason in place of the gap. With nothing else to fail,
  its return type drops the outer Result and the pixel_format it carried only for the gap.
- The feedback-loop retry skips Usage, as it skips Tiling and NoModifier, since dropping the
  loop does not change the usage asked.
- Gap::SurfaceUsage stays for the Direct3D 11 import, and its doc now says that alone.

Docs, in this commit: the runtime README (the guide's storage paragraph, the copy form's list
of reasons, and a fifth case in the known gaps), REFUSALS.md regenerated (SurfaceUsage's row
and its sites) and the api_surface table (the new variant).

Tests:
- Verdict unit test a_plane_whose_tiling_lacks_an_asked_usage_takes_the_copy_form, with
  synthetic features: a LINEAR tiling without STORAGE_IMAGE, where the optimal tiling has it,
  takes Usage for a plane that asks storage, and lies in place for one that does not.
- The device test every_device_writes_a_surface_plane_through_a_shader_write_uint_view no
  longer accepts Gap::SurfaceUsage at the make.
- The write-back through the copy form's own copy is the same copy_form path the device test
  already ran at f997a251fc: on the RTX 3090 (NVIDIA 620.70.06, m3-max-81338) the dma-buf row
  took Copy(Tiling) and the copy-form row Copy(Pitch); on the RX 7900 XTX (RADV, Mesa 26.2.6,
  m3-max-81352) and lavapipe (Mesa 26.2.4, m3-max-81341) the copy-form row took Copy(Pitch).
  Each had the kernel's 2,073,600 texels written through the ShaderWrite R8Uint view, read
  back exactly from the surface's buffer.
- No device queried takes Usage for an R8 plane (the row 5 queries m3-max-81308, 81309,
  81310, 81314, 81318, 81322 and 81353).
2026-12-02 19:29:39 -08:00
Anees Iqbal adba2693a1 Conformance ledger: the shared creator's remaining refusals are the consumer's own and rt's padded formats
With a247e1ec2b the rt side answers newSharedTextureWithDescriptor:,
newSharedTextureHandle and newSharedTextureWithHandle:. Replaying the four cases on lavapipe
(Mesa 26.2.4, m3-max-81374) gave these results:
- the made, texture and handle sites compare against Metal's recording;
- a creator outside Private storage, and RGBA16Float_XR, answer nil as Metal does;
- 52 sites stayed refused, none divergent. This commit lists them:
  - 40 sites read parentTexture, parentRelativeLevel, parentRelativeSlice and isShareable, on
    the shared texture and its views. rt keeps no getter for them (TheConsumers), with the same
    text as the views' existing rows.
  - 8 resource and resource-after-handle sites read MTLResource's getters (TheConsumers), with
    storageMode among them, so storageMode is not compared at those sites.
  - 4 made sites for Private R10Unorm_X6, R10Unorm_X6_sRGB, RG10Unorm_X12 and
    RG10Unorm_X12_sRGB, where rt makes no texture of the format (the same gap as
    extended-swizzles-*'s rows; the 11-19 selector census found no stream that uses them).
All are venue *. CONFORMANCE-COVERAGE.md is regenerated (coverage.py --check: as derived).

The same job's full replay found no mismatch outside these four cases (52 in all, every one
listed here), and the conformance suite passed (1048 of 1048). The replay that shows these rows
holding is the hand-over's job.
2026-12-02 19:13:13 -08:00
Anees Iqbal 3f41b3b5b8 Conformance rt side: the shareable set keys textures by the handle's u32
957d59ecc1 kept the shareable textures in a set of u64, where a Handle is a u32; its build
failed (m3-max-81319, lavapipe, GREEN BUILD EXIT=101, E0308 at both uses). The set now holds
the handle's own type.
2026-12-02 19:13:13 -08:00
Anees Iqbal d0934196ef Conformance rt side: the shared creator and its handle as the runtime's consumer answers them
newSharedTextureWithDescriptor: is the texture newTextureWithDescriptor: makes, kept as
shareable; Metal's nil outside Private storage and for a format Metal makes no texture of
from a descriptor alone (texture_query::WITHOUT_TEXTURES, the list heap_metal_sizes already
asked, now shared) comes out nil, as measured on the M3 Max. newSharedTextureHandle and
newSharedTextureWithHandle: answer the handle of the one device and a clone of the same
Texture, shareable; a texture that is not shareable answers nil.

Not yet run: the replay of the four cases on lavapipe, and the ledger rows the getters of
the consumer's own (the resource getters, the parent facts and shareable) add at the new
sites, follow in their own commit.
2026-12-02 19:13:12 -08:00
Anees Iqbal e33ee4099f Conformance ledger: the shared creator's 31 cells compare against Metal (red)
The 31 rows of shared-creator-padded-format-storage, shared-creator-extended-range-samples,
texture-shared-handles and texture-view-descriptors at which the rt side answers
Unavailable(shared_texture) are dropped: the side is to answer newSharedTextureWithDescriptor:
and the handle calls as the runtime's consumer does on the runtime's one device, so each of
those sites compares against the M3 Max recordings (Metal's nil at Shared, Managed and
Memoryless, and for RGBA16Float_XR at Private; a texture at Private otherwise).

Red: the side still answers Unavailable, so a replay of the four cases fails on 31 refusals
the ledger does not list. CONFORMANCE-COVERAGE.md is regenerated (coverage.py --check: as
derived).
2026-12-02 19:13:12 -08:00
Anees Iqbal c13871f07a rt test: the shader-write plane test fills its texels as 16-byte arrays
clippy's chunks_exact_to_as_chunks failed the test build under --cfg m2v_gpu and
--cfg m2v_cpu_icd (m3-max-81362, CLIPPY m2v_gpu EXIT=101, m2v_cpu_icd EXIT=101) at
f997a251fc's chunks_exact_mut(16); as_chunks_mut::<16>() takes the same texels.
2026-12-02 19:11:30 -08:00
Anees Iqbal 02702415f9 rt: a dma-buf plane's view list holds only formats its DRM_FORMAT_MOD_LINEAR modifier samples
view_list takes each format's features in the plane image's own tiling: LINEAR's for an
opaque handle's LINEAR image, the MOD_LINEAR modifier's for a dma-buf's modifier image, as
Vulkan 12.6.1 defines a view's format features. A format the modifier lists no features for
is no longer listed for a dma-buf's plane, so no view of it is made with empty format
features (VUID-VkImageViewCreateInfo-None-02273); a view in it is Gap::TextureView of
SurfacePixelFormat, as for a format the LINEAR tiling does not sample.

No device the tests run on routes a dma-buf export through NVIDIA, whose LINEAR tiling
samples the 8-bit UINT and SINT formats with no modifier listed for them (row 5's queries);
the AMD and Intel devices list MOD_LINEAR for every format they sample (780M m3-max-81314,
Iris Xe 81310). The verdicts test from the red commit passes.
2026-12-02 19:11:30 -08:00
Anees Iqbal 17868df415 rt: a plane's view list from its tiling's features, beside a test that a dma-buf's list holds only formats its modifier samples (red)
surface.rs filtered an in-place plane's view formats by each format's LINEAR tiling
features whatever the plane's image is. A dma-buf's plane is a DRM_FORMAT_MOD_LINEAR
modifier image, whose view's format features are its format's drmFormatModifierTilingFeatures
for that modifier (Vulkan 12.6.1), and on a device whose LINEAR tiling samples a format the
modifier lists no features for, the list named a format no view of the image may take
(VUID-VkImageViewCreateInfo-None-02273). Row 5's queries found that on NVIDIA 620.70.06 and
615.71.09 (RTX 3090 m3-max-81318, RTX 2080 81309, RTX 5080 Laptop 81308): R8_UINT and
R8G8_UINT sample in LINEAR and list no modifier.

This commit is a refactor with no change in behaviour: the filter moves into view_list,
over TilingFeatures (a format's LINEAR features and its MOD_LINEAR modifier's) that
Query::tilings reads, and still reads the LINEAR features for both tillings (the same
SAMPLED_IMAGE bit as the legacy word it read). The new verdicts test,
a_plane_s_view_list_takes_the_formats_its_own_tiling_samples, gives synthetic features where
R8_UINT and the rest of the 8-bit list sample in LINEAR and list no modifier, and expects a
dma-buf's list empty: red.
2026-12-02 19:11:30 -08:00
Anees Iqbal afa0046e9e rt test: a kernel writes an exported surface plane through a ShaderWrite R8Uint view
A guard, not red. For each row the device exports (the VA-API dma-buf row, the NVIDIA
opaque-handle row and the copy-form row), on the 1080p picture, a surface whose luma has
ShaderRead, ShaderWrite, RenderTarget and PixelFormatView usage; an R8Uint view of the luma
that fpv_rgbx_write_uint writes from a buffer of values; then the surface's buffer, copied
whole to a Shared buffer, holds each written texel at the luma's offset and pitch as the
export states them. In place, a device whose linear image takes no storage usage may answer
Gap::SurfaceUsage at the make, or Gap::TextureView of SurfacePixelFormat at the view, each
printed.

This is the consumer's form for the exported planes a guest writes (row 5): the plane's own
image, viewed, with no storage shape and no copy. The row 5 format queries
(5080 m3-max-81308, 2080 81309, Iris Xe 81310, 780M 81314, 3090 81318, RX 550 81322) found
storage offered on the plane's linear and DRM_FORMAT_MOD_LINEAR images on every card, and
the layout unchanged by it; surface.rs already adds storage where the query offers it.
2026-12-02 19:11:30 -08:00
Anees Iqbal 0d2d3ef99b rt: a state takes the loop's colour flag at its make where a function can read a texture
T1 (795edfb733) made every render pipeline without the attachment feedback loop's colour flag
and, at a state's first draw that reads its pass's attachment through a texture, made a flagged
one on the encoding thread. In a window-drag stream (windrag-780m-b4, to frame 500) that was 110
compiles at first use on each desktop card that the base (every pipeline flagged at its make)
did not have: 603.7 ms in all on the RX 7900 XTX with the driver's shader cache off
(m3-max-81076), 2.39 ms on the RTX 2080 (m3-max-80961). None of the 110 was a state whose
fragment function fetches its attachment ([[color(n)]]): T1 flagged those at their make. Each
was a draw handed its pass's attachment as a texture, which no state's make can know.

The ruled form decides the flag at the state's make from its functions' structure
(Draws::reads_textures): a state takes the flag on every pipeline where a function of any stage
can read a texture (a texture slot it reads, at any stage; a colour the fragment function
fetches; or a read beyond its slots, an argument buffer's texture or a resource ID, which the
structure cannot settle). A state whose functions read no texture never reads an attachment
other than as one, and takes no flag. No draw makes a pipeline for the loop: Raster's `loops`,
FirstUse::Loop and the content's per-raster flags go, and the content's later pipelines are
again at most 15.

Metrics::first_use_loop_waits, first_use_loop_wait_nanos and first_use_loop_wait_max_nanos go
with the site they counted (api_signatures.tsv), as do Raster's `loops` and FirstUse::Loop; the
replay's report drops their two keys. No consumer search was needed: T1 never reached a pushed
sha (origin is at 9186e2fe46, and T1 sits above it on development), so no consumer pin can hold
them.

Docs: the runtime README's attachment-read paragraph says which states take the flag; the first
use waits list drops the loop's; the known gap of render encoders for T1's first-use compile
gives way to one for the flag on the pipelines of every state that can read a texture, whether
or not a draw hands it an attachment, with what the flag costs a draw that reads none, and what
leaving it off saves, not measured on a tile-based phone GPU (no such device in the lab). The
floor table's VK_EXT_attachment_feedback_loop_layout row, Core::feedback_loop,
floor::Capabilities::feedback_loop and the render encoder's module doc say the same. No gain is
claimed for any device.

Verified at 00fe2f78be, this patch on development 795edfb733 (base = 59326c8dff, before T1),
then rebased onto d69a0bda18 with the same patch:
- Red/green: both tests of the red commit fail at it and pass here, on the RTX 2080 and on
  lavapipe (llvmpipe, LLVM 23.1.4) in m3-max-81257, on the Iris Xe (RPL-P) in m3-max-81291 and
  m3-max-81367, on the RX 7900 XTX (RADV NAVI31) in m3-max-81373 and on the RTX 3090 in
  m3-max-81365. At the red commit the fragment test reads ((1, 0), (1, 0)) against
  ((1, 0), (0, 1)), and the vertex test (1, 0) against (0, 1).
- The stream's states, counted with a build of this tree that printed each content and each
  render pipeline made (never committed; one play of windrag-780m-b4 to frame 500 on the 2080 in
  m3-max-81257): 275 render contents, 218 of which can read a texture, every one through a
  fragment texture slot, and 57 read none. 281 render pipelines: 220 with the flag, 61 without.
  The play's Metrics::pipelines_created, 407, counts compute and the runtime's own pipelines too;
  the 281 render pipelines are the ones the base flagged, and 61 of them lose the flag here.
- The A/B on the RTX 2080 (m3-max-81257): arms alternating a:cold, b:cold, a, b, a, b, cold with
  the driver's disk cache off (__GL_SHADER_DISK_CACHE=0), each with a fresh rt shader cache.
  Every play of both arms: pipelines_created 407, rendering interrupts 28857, barriers 136307,
  attachment loop reads 33533, 0 refused; first-use waits a 17, 18, 15 and b 17, 16, 17 (the other
  kinds; none for the loop, which the base never had and this tree no longer has). Median frame
  GPU time: a 1.7290 (cold), 1.7267, 1.7542 ms; b 1.7188 (cold), 1.2215, 1.7233 ms. Every play's
  clock samples mix P0, P5 and P8, and b's 1.2215 ms play is the one whose median moved alone; b's
  other two sit at or below a's range. No gain is claimed.
- Merged-tree check (m3-max-81184, at 00fe2f78be): signatures, clippy plain, --cfg m2v_gpu and
  --cfg m2v_cpu_icd, rustdoc, private intra-doc links, the translator's core (3420 passed, 37
  skipped), the runtime on lavapipe (947 passed, 4 skipped), validation (1319 passed, 3 skipped),
  validation on lavapipe (1441 passed, 3 skipped), and the conformance replay on lavapipe
  (exactly the ledger's gaps, 0 drift), each exit 0. Clippy plain, --cfg m2v_gpu and --cfg
  m2v_cpu_icd at the rebased tree (m3-max-81311), each exit 0.
- The A/B on the RX 7900 XTX (m3-max-81373, holding its node alone; cold with
  MESA_SHADER_CACHE_DISABLE=true): every play's counts equal (pipelines_created 407, barriers
  127909); the play's GPU time a 128.88 (cold), 129.16, 128.96 ms against b 129.12 (cold), 129.48,
  129.20 ms (+0.21%, same-arm spreads 0.22% and 0.28%); median frame a 341.2, 340.0, 339.7 us
  against b 339.8, 340.5, 339.9 us (-0.07%).
- The A/B on the Iris Xe (m3-max-81367, holding its node alone; a:cold, b:cold, then three pairs):
  every play's pipelines_created 407, barriers 135343, loop reads 33533; median frame a 518.9
  (cold), 524.8, 522.6, 525.2 us against b 507.8 (cold), 494.6, 522.0, 467.3 us, none of b's above
  a's highest; the play's GPU time a 287.5, 292.6, 272.1, 280.9 ms against b 281.5, 281.3, 273.7,
  277.4 ms, b's within a's range.
- The RTX 3090 (m3-max-81365): every play's pipelines_created 407 and other counts as the 2080's;
  its clock samples mix P0, P5 and P8 within every play, so its timing is not read.
- Runtime command buffers per play vary between plays of one arm, the base's included (6258 to
  6263 on the Iris Xe, 6320 and 6321 on the 3090): the play's own variance.
- Not measured on a tile-based phone GPU (no such device in the lab).
2026-12-02 19:07:57 -08:00
Anees Iqbal d781dbbe93 rt test: a state takes the loop's colour flag at its make where a function reads a texture (red)
T1 (795edfb733) made a state's pipelines without the attachment feedback loop's colour flag
and, at the first draw that reads an attachment through a texture, made a flagged one on the
encoding thread: 110 such compiles at first use in a window-drag stream on each desktop card,
603.7 ms in all on the RX 7900 XTX with the driver's cache off (m3-max-81076). The ruled form
decides the flag at the state's make, from the structure of its functions: a state whose
functions can read a texture (a slot one reads, a colour the fragment function fetches, or a
read beyond the slots) takes it on every pipeline from its make, as every state did before T1;
one whose functions read none never takes it. No draw makes a pipeline for the loop.

Two tests, red at this commit on a device with the loop:
- every_device_flags_a_pipeline_for_the_loop_at_its_make_where_its_fragment_reads_a_texture
  replaces T1's test: own_pixel_fragment's state makes its pipeline with the flag, and its
  reading passes make no pipeline and wait for none (Metrics::pipelines_created,
  Metrics::first_use_waits). T1 makes it without the flag, and its first reading draw makes a
  second pipeline.
- every_device_flags_a_pipeline_for_the_loop_at_its_make_where_its_vertex_reads_a_texture:
  icb_direct_arguments' texture_vertex with plain_fragment makes its pipeline with the flag. A
  draw that hands the vertex function its pass's attachment is refused on every device
  (Gap::Draw { AttachmentRead }), as before: only a fragment function reads an attachment of
  its pass through a texture. T1 never flags this state.
2026-12-02 19:07:57 -08:00
Anees Iqbal e1e6f52848 Conformance ledger: the shared-texture rows are not built yet, as a guest meets the call
The 31 rows of shared-creator-padded-format-storage, shared-creator-extended-range-samples,
texture-shared-handles and texture-view-descriptors that the rt side refuses with
Unavailable(shared_texture) gave "no stream uses it yet" (the 11-19 census) as their reason.
That is stale: on 12-02 a viewer's render process called newSharedTextureWithDescriptor:
about 2.5 s after its window opened, and its consumer answered nil. Their reason is now the
ledger's "refused: not built yet (fix-l155)", so every replay counts them as open work, and
the row says what is to be built: on rt's one device a shared texture is a Private texture
and the texture its handle opens a clone of the same Texture, the handle the consumer's.

Docs only: no row's case, venue, site or answer changes. CONFORMANCE-COVERAGE.md is
regenerated (coverage.py --check: as derived).
2026-12-02 18:34:56 -08:00
Anees Iqbal d69a0bda18 Runtime README: KosmicKrisp's indirect patch draws of more than one instance as a known gap
The Mac host leg of the runtime's device tests failed two patch tests with indirect true only:
every_device_reads_a_patch_draw_s_base_instance_after_tessellation and
every_device_reads_a_patch_s_position_as_its_primitive_id_under_a_patch_index_buffer (M3 Max
under KosmicKrisp, job m3-max-81082). Both draw 2 patches in 2 instances, and in both the second
instance's second patch is missing.

The cause is in the driver, not in the runtime. The runtime records an indirect patch draw as one
vkCmdDrawIndirect on Metal's argument buffer, the same on every device, with no compute pass in
front of it. KosmicKrisp (Mesa 26.3.1) emulates tessellation in compute. For an indirect draw,
libkk_tess_setup_indirect writes the vertex grid as {count, instances, 1} and the control grid as
{patches * output vertices, instances, 1}. kk_dispatch_compute then runs both through
dispatchThreadgroupsWithIndirectBuffer, so each word counts threadgroups (64 threads for the
vertex grid), where the direct draw passes the same words to dispatchThreads as thread counts.
Neither stage bounds the extra work, so it overwrites the next instance's vertices and control
points. This was read from the driver's source, not instrumented.

A bare Vulkan program (no runtime code) draws 2 patches of 3 control points in 1 and then 2
instances, direct and from the host-written VkDrawIndirectCommand, 8 rounds each. Under
KosmicKrisp the second instance's second patch was wrong in 3 of 8 indirect draws, and right in
all 8 direct draws and in every one-instance draw. Under MoltenVK on the same M3 Max, every draw
was right (job m3-max-81189). The tests' indirect arms pass on RADV on the RX 7900 XTX and the
Radeon 780M (m3-max-80750) and on lavapipe (m3-max-80990).

Docs only: one known-gap bullet under "Known gaps of render encoders". The README is not part of
any crate's Rustdoc, and its tests read only the floor tables.
2026-12-02 18:17:42 -08:00
Anees Iqbal 6b939ef793 Replay player: copyFromTexture:...sliceCount:levelCount: as the runtime's region copies
Metal's copy of whole surfaces between textures has no runtime call of its
own; the player refused it as not played on a blit encoder, which ended a
viewer stream's play on the XTX in its first seconds (job m3-max-81089). It
now plays as the runtime's copy_from_texture, once for each slice and level
of the counts, each the source level's whole extent from the origin to the
origin, as a bind of a range plays as single-slot binds. The runtime's own
checks refuse a level or slice past either texture. REPLAY-STREAM.md says so.
2026-12-02 18:17:42 -08:00
Anees Iqbal 375b66b5b2 Replay test: a copy of whole texture surfaces, which the player refuses, played through the runtime (red)
A device test of the replay player copies slices 0 and 1 at levels 0 and 1 of
a 2D array texture into slices 1 and 2 of another with
copyFromTexture:sourceSlice:sourceLevel:toTexture:destinationSlice:
destinationLevel:sliceCount:levelCount:, each source surface written from its
own bytes first, and checks the four copied surfaces read back as those bytes.

Red until the player plays the selector: it refuses it as not played on a
blit encoder, which stops a viewer stream's play on the XTX (job
m3-max-81089) long before its patch draws.
2026-12-02 18:17:42 -08:00
Anees Iqbal 8ac91a9b33 Docs: REPLAY-STREAM.md's render encoder paragraph rewrapped at 100 columns
The patch draws' sentence left two lines past the paragraph's width.
2026-12-02 18:17:41 -08:00
Anees Iqbal b6c6997cfa Replay player: drawPrimitives and drawIndexedPrimitives from an indirect buffer
The player refused both of Metal's indirect draws of primitives as not
played on a render encoder, so a stream whose program draws from an indirect
buffer lost each such draw. Each now plays as the runtime's call
(draw_primitives_indirect, draw_indexed_primitives_indirect), its arguments
and index buffer at their offsets. The patch draws' buffer helper becomes
draw_buffers, which both arms share: a draw naming a skipped index or
indirect buffer is a skipped draw, and one skipped by its state or a bound
object is counted as before; patch_draw keeps the patch draws' count of
draws through a state whose record lacks tessellation. REPLAY-STREAM.md says
the draws play direct or from an indirect buffer.
2026-12-02 18:17:41 -08:00
Anees Iqbal 3f8cdba2ee Replay test: draws from an indirect buffer, which the player refuses, played through the runtime (red)
Three device tests of the replay player draw the render fixture's triangle
from an indirect buffer into a pass cleared red:
drawPrimitives:indirectBuffer:indirectBufferOffset: with its arguments at byte
16, and drawIndexedPrimitives:...:indirectBuffer:indirectBufferOffset: of 16-bit
and of 32-bit indices, its arguments at byte 20 and its index buffer at an
offset of one index. Vertex 0 is a blue one at the target's centre and the
arguments start at vertex (or index) 1, so only a draw that reads its
arguments and indices at their offsets covers the target green, which the
stream checks.

Red until the player plays those selectors: it refuses each as not played on
a render encoder.
2026-12-02 18:17:41 -08:00
Anees Iqbal b141773499 rt: a render pipeline takes the loop's colour flag only where a draw reads its attachment
Every render pipeline was made with VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT on a
device with the attachment feedback loop (22ca6271eb). Vulkan asks for the flag only of a draw
that reads, other than as an attachment, an attachment in the feedback layout (vkspec
"Non-Overlapping Access Between Resources"). Tile-based GPUs are a target; the flag stays off
the pipelines of draws that read no attachment. Not measured on a tile-based phone GPU; no such
device in the lab.

Now:
- Raster gains `loops`: the draw reads an attachment of its pass through the loop. The content's
  main pipelines are made without the flag; the first draw that reads an attachment through a
  texture makes the content's pipeline under `loops` in the content's bounded map of later
  pipelines (at most 31 now, from 15), and later reading draws take it. One form on every device
  with the loop; a device without it keeps its counted copy into the shadow, unchanged.
- A content whose fragment function fetches a colour ([[color(n)]]) reads through the loop at
  every draw, so all its pipelines take the flag from creation, as before.
- An execution of an indirect command buffer takes the flagged pipeline wherever the device has
  the loop, as before, since its commands bind their own slots; execution_part asks the same
  pipeline, so the part and the draw's shape agree.
- A draw that may read beyond its slots while a read declaration covers an attachment the pass
  holds out of its home layout (Metrics::unslotted_attachment_reads) takes it too.
- The extra make is a first-use wait of its own: Metrics::first_use_loop_waits, with its
  nanoseconds and longest (three new public fields of the non-exhaustive Metrics, additive;
  api_signatures.tsv blessed). The replay's metrics report the count and the nanoseconds.

No dynamic-state form: the loop's dynamic state stays gone.

Docs: the runtime README's attachment-read paragraph, the first-use waits list, a known gap of
render encoders for the extra compile at a state's first reading draw (with where the form has not
run), the floor table's VK_EXT_attachment_feedback_loop_layout row, the AMDVLK measurement's
wording, Core::feedback_loop, floor::Capabilities::feedback_loop and the render encoder's module
doc.

Not run on an Intel card: the lab's Iris Xe node is down; that leg is owed.

Not run on the M3: KosmicKrisp ignores the pipeline flag. Read in Mesa 26.3.1's source: KK lists
VK_EXT_attachment_feedback_loop_layout and attachmentFeedbackLoopLayout
(kk_physical_device.c:171, :431); Mesa's common runtime turns the flag into vk_graphics_state's
feedback_loops, which no kk_* file reads; KK reads only the image's feedback usage
(kk_image_layout.c:111). A run there could show no change.

Verified (the tree of this commit, 87e8f0241a, on development 15898e612e):
- Red/green: every_device_flags_a_render_pipeline_for_the_loop_only_where_a_draw_reads_its_attachment
  fails before and passes after, at the pre-rebase shas 5e1e88e94b and d2e563c826, on lavapipe
  (m3-max-80585), the RX 7900 XTX (m3-max-80586) and the RTX 3090 (m3-max-80589); at this tree it
  passes on lavapipe in the merged-tree check.
- Merged-tree check (m3-max-80973, then m3-max-81099 for its last step): signatures, clippy plain,
  --cfg m2v_gpu and --cfg m2v_cpu_icd, rustdoc, private intra-doc links, the translator's core
  (3413 passed, 37 skipped), the runtime on lavapipe (945 passed, 4 skipped), validation (1319
  passed, 3 skipped), validation on lavapipe (1438 passed, 3 skipped), and the conformance replay
  on lavapipe (exactly the ledger's gaps, 0 drift), each exit 0.
- A window-drag replay stream recorded on a 780M (windrag-780m-b4) to frame 500 (501 frames),
  arm a = 15898e612e and arm b = this tree, alternating in one job per card, a fresh rt shader
  cache each play. On the RX 7900 XTX (m3-max-80880) and the RTX 2080 (m3-max-80926), every
  play: rendering interrupts 28857, passes 41477, barriers 127909 (XTX) and 136307 (2080),
  attachment loop reads 33533, 0 refused, equal in
  both arms; pipelines made 407 in a and 515 in b, first-use loop waits 0 and 110.
- GPU time, the driver's shader cache warm: XTX, the play's command buffers, a 128.86, 129.29,
  128.88 ms against b 129.02, 129.43, 129.27 ms (+0.18%, spread 0.33%); 2080, the median frame
  over four plays each (its play totals follow the card's clock state), a 1.7255 ms against b
  1.7320 ms (+0.38%, spreads 0.71% and 1.01%).
- The 110 loop compiles with the driver's disk cache off for the play (a measurement setting of
  the job), alternated with warm plays in one job: XTX (MESA_SHADER_CACHE_DISABLE=true,
  m3-max-81076, on a node running other jobs' CPU work then) 603.7 ms in all on the encoding
  thread, against a play GPU time of 129.35 ms and 32.5 s of wall; 2.24 ms warm. 2080
  (__GL_SHADER_DISK_CACHE=0, m3-max-80947) 2.39 ms cold and 1.88 ms warm; its cold plays' first-use
  waits were no longer than its warm plays', so that setting's effect is not shown.
- Not run on an Intel card; not on the M3 (above); not measured on a tile-based phone GPU.
2026-12-02 18:17:41 -08:00
Anees Iqbal fcbb221b5f rt test: a render pipeline takes the loop's colour flag only where a draw reads its attachment (red)
Every render pipeline is made with VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT on a
device with the attachment feedback loop, whether or not a draw reads an attachment through it.
Vulkan asks for the flag only where a draw reads, as a non-attachment, an attachment that is in
the feedback layout (vkspec 8.10.2).

The test replaces the one that held every pipeline to the flag:
- an ordinary pass draws a state whose fragment function reads no texture and one whose function
  reads a texture no attachment renders; each state's pipelines carry no flag;
- two passes draw blue, then, after a memory barrier, each pixel read plus green; the reading draw
  makes its state's flagged pipeline once, at the first pass, and every pixel reads blue plus
  green each time, each reading draw one attachment_loop_reads;
- a device without the loop makes every pipeline with no flag and reads through a copy.

RenderCompiled::made_flags, for the device tests, lists the create flags of each pipeline a
content made.

Red here on a device with the loop: the ordinary pass's pipelines carry the flag.
2026-12-02 18:17:41 -08:00
Anees Iqbal 9186e2fe46 Validation test: the oracle-fuel fixture round trip skips what the toolchain is too old for and puts its status at the oracle's slot
oracle_fuel::tests::public_fixtures_with_loops_round_trip_instrumented failed on macOS CI (run
47003321413, macos-26, MetalToolchain 17.6), the first macOS run to reach it, in three ways:

- Ten .metal fixtures that name metal4.1, newer than that toolchain's metal4.0: "invalid value
  'metal4.1' in '-std=metal4.1'".
- tns_mm_fp8, tns_mm_left and tns_mm_v2 .air.ll: metal-opt "unrecognized architecture
  'air64_v29' provided." for the fixtures' own target triple.
- parked_heap_handles (.metal and .air.ll, four entries each): "buffer argument m2v_oracle_status
  has invalid location (<29,1>)". The fixture binds buffers 28 and 29, and the test put every
  status buffer at a fixed slot 29. The oracle itself puts it at the highest slot the entry's
  interface leaves free (NativeBufferSlots::from_interface(..).allocate(), via producer_slots);
  that is slot 30 here. This one is a test defect on any SDK.

The air writer's round trips already skip, list and count an input above the toolchain's AIR
version or Metal standard (Tally::refused). That rule moves into
air_writer::tests::above_the_toolchain and gains a third case, arch_ceiling: metal-opt's
refusal of an `air64_v<N>` architecture that the input's own target triple names. Each is the
toolchain's own refusal of something the input states; any other error stays a failure.

The oracle-fuel round trip now applies above_the_toolchain to a failure of a step on the fixture's
own AIR (compiling or assembling it, and finding the strictest level metal-opt passes). It prints
each skip and their count, "SKIP N of M inputs above the toolchain's newest version", as the air
writer's round trips do. A failure of the instrumented module's own round trip is never skipped.
Each entry is instrumented with its status buffer at the slot the oracle gives it, from the
entry's interface (status_slot).

Verified: red job m3-max-81148 (msi CPU) failed
an_input_of_an_architecture_the_toolchain_does_not_know_is_skipped_and_counted, and
every_other_toolchain_error_fails passed, at bec8a8dea1. The green and the macOS runs are named
in the hand-over.
2026-12-02 18:09:53 -08:00
Anees Iqbal 4bd7516305 Validation test: the L3 stand-in finds its parent with pgrep -a on macOS
translation_l3_stage::spirv_val_runs_in_the_l3_stage_that_replaced_the_translation failed on
macOS CI (run 47003321413, macos-26), the first macOS run to reach it: 'spirv-val ran under
"96367: not the L3 stage", not the worker's L3 stage'. The worker is right; the test's stand-in
is wrong. The stand-in spirv-val asks pgrep for the processes whose arguments hold
"--l3-stage engine" and looks for its parent there. macOS's pgrep leaves out its own ancestors
unless given -a (pgrep(1): "By default, the current pgrep or pkill process and all of its
ancestors are excluded"), and the L3 stage is pgrep's grandparent, so it never matched. procps's
pgrep on Linux excludes only itself, which is why the Linux job passes.

The stand-in now passes -a on Darwin alone: procps reads -a as --list-full, which would print each
command line beside its pid and break the exact pid match.

Verified: a local probe of the same script under `bash -c "sh standin.sh; :" --l3-stage engine`
on macOS 27 printed "not found" with plain pgrep and "found" with the fixed line. The test itself
runs on the next macOS CI run; it is not run on the M3 (no tests there).
2026-12-02 18:09:53 -08:00
Anees Iqbal e85535dbfa Validation test: an input whose architecture the toolchain does not know is skipped and counted (red)
macOS CI (run 47003321413, macos-26, MetalToolchain 17.6) failed
oracle_fuel::tests::public_fixtures_with_loops_round_trip_instrumented on tns_mm_fp8, tns_mm_left
and tns_mm_v2 .air.ll: that toolchain's metal-opt answers "unrecognized architecture 'air64_v29'
provided." for the fixtures' own target triple, which is newer than it knows. The air writer's
Tally already skips, lists and counts an input above the toolchain's AIR version or Metal
standard; it has no rule for this third refusal, so the fixture counts as a failure.

The new test hands Tally::refused that refusal for tns_mm_v2.air.ll and expects a skip. Two more
cases join every_other_toolchain_error_fails: an architecture the input's triple does not name,
and one refused for an input with no triple, both still failures.

Red: string-only, so it runs on Linux; expected to fail until the classifier lands (next
commits).
2026-12-02 18:09:53 -08:00
Anees Iqbal dddd91b993 Tables: golden hashes at semantics 2325
The bless for mad (2324) and the half form on devices lacking only 16-bit
DenormPreserve (2325). 1413 cells move, 471 in each of lavapipe,
gate-lavapipe and gate-lavapipe-x86_64, over 320 fixtures; no other profile's
cell moves, as T3's comparison predicted (the 3090 column is still owed). No
row is added or removed; mad's fixtures are not in the public set.

Blessed on the M3 (job m3-max-81107): inventory, golden hashes and printouts
exit 0; the metallib half of committed_air_fixtures_parse_and_link exit 0.
2026-12-02 17:58:54 -08:00
Anees Iqbal 59326c8dff Translator: half computes in 16 bits where only 16-bit DenormPreserve is missing, noting half denormals
The planner's ruling (T3). On a device with shaderFloat16, 16-bit RoundingModeRTE and 16-bit
SignedZeroInfNanPreserve whose only missing 16-bit control is DenormPreserve, the half operations
narrow::half_controls gates take the 16-bit route: a half + - * / sqrt and fused multiply-add on
the device's 16-bit instructions, half values held at 16 bits, the controlled pair for a float
rounded to half, and a half widened from and narrowed to its bits by the device's conversion.
It is the 16-bit floats query's existing form, read from one more of its properties.

narrow::controlled_modes declares RoundingModeRTE and SignedZeroInfNanPreserve for 16 bits there
and no denormal mode: not DenormPreserve for 16 bits (VUID 06296), nor the 64-bit one the
independence for 32 bits only ties to it (VUID 06289 asks for the same denormal mode at 16 and
64 bits). The independence rules decide which devices take it as before, and a device missing any
other 16-bit control keeps half in float.

MoltenVK on the M3 stays off the route: its denormal modes are not independent at all
(denormBehaviorIndependence NONE), where the form would tie float's denormal mode to half's and
change how the module's float arithmetic reads denormals, which Metal flushes; and its rounding
modes are not independent while it offers no 64-bit RoundingModeRTE, so the 16-bit
RoundingModeRTE the form declares cannot be declared at every width as VUID 06292 asks.

Every module that declares those controls on such a device (narrow::flushes_half_denormals)
records the new static note PrecisionNote::DeviceHalfDenormals, "half denormals may flush to
zero where Metal preserves them": the Vulkan spec leaves a 16-bit denormal to the device in an
entry declaring no 16-bit denormal mode. No other module records it. The conformance suite holds
its code, metal2vulkan-degrade-device-half-denormals, among the native notes beside
device-denormals (the device's own denormals, the one form built there); validation allows it
unbounded, as it does NativeHalfConversion.

Run on lavapipe, whose committed profile has this shape: its half arithmetic moves from float to
16 bits. Turnip on an Adreno GPU before the 8xx series reports the same controls (Mesa 26.3.1,
tu_device.cc lines 534, 1038-1048: shaderFloat16, RTE and SignedZeroInfNanPreserve for 16 bits,
DenormPreserve for 16 bits false below A8XX, independence ALL): not measured on a tile-based
phone GPU; no such device in the lab. No performance claim is made.

Tests: engine_native_half's new test (the red commit before this) now also asks for the note on
each such module and for none under all three controls or without another one. The tests that
held lavapipe as the conversion form now hold it under the controls (engine_native_half's
rounding kinds, memory and decode widenings and controlled modes; engine_half_hold's held values
and division; engine_arith's 16-bit fma profiles), and the conversion form on lavapipe's
description without 16-bit RoundingModeRTE.

SEMANTICS_VERSION 2325 (development holds 2323; 2324 is mad's), and ARTIFACT_FORMAT_VERSION
601 -> 602 (the new note's codec member). Golden rows are blessed at the pin.

Docs: the precision-note catalogue (docs/API.md, the new entry and the conversion entry's
controls), docs/HOWTO.md, the runtime README's shaderFloat16 row and its half fma line, the
NativeHalfConversion note's device list, api_signatures.

The conformance ledger. The form moves lavapipe, whose float controls lack only 16-bit
DenormPreserve, onto the 16-bit route. The conformance replay in the pinned lavapipe image (Mesa
26.2.4, LLVM 23.1.1) then answers 79 of the runtime ledger's llvmpipe rows otherwise:

- 47 now match Metal and are dropped: vertex-format-half4 28 and integer-vertex-attributes 16
  (the rows said lavapipe folds the unrounded OpFConvert pair, with no 16-bit DenormPreserve to
  make it Metal's; the pair now rounds under the 16-bit controls), and half-texel-nans-rg11b10f's
  3 (nearest-sample, read, widened).
- 32 now answer otherwise and are replaced, each with the answer and a reason written from this
  run's printout (first differing element):
  - vertex-format-half4, 8 rows (Float..Float4, Half..Half4): only the NaN differs now, Metal
    0x7fc00000, the device 0xffc00000; one element per component, where the rows recorded the
    unrounded values (Float, the largest difference inf) or the kept payload (Half).
  - half-texel-nans, 18 rows (nearest-sample, read and widened of r16f, rg16f, rgba16f, r32f,
    rg32f, rgba32f): a 16-bit float texel's NaN now narrows to 0x7e00 (the payload dropped, as
    read-through-sample already answered; Metal hands back the texel's code); a 32-bit one to
    0xfe00 (Metal 0x7e00); the widening answers 0xffc00000 (Metal 0x7fc00000). Six rows count more
    elements than before (the 16f nearest-sample and read rows: 215 -> 472, 428 -> 940,
    852 -> 1874), twelve fewer.
  - bicubic-texel-classes, 6 rows: fewer elements at every site, each count and largest
    difference the one the 780M and RTX 5080 rows record; within the bicubic note's bound.
  None of the 79 is a half denormal.

docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py): ledger rows
7932 -> 7885. The image is the pinned one, so the ledger's llvmpipe line does not move.

Not replayed, a follow-up: the six bicubic-texel-classes rows of venue "llvmpipe (LLVM 23.1.4,
256 bits)", a lavapipe outside the pinned image; this commit leaves them as they were.

Verified: the replay of this tree without the ledger edit, job m3-max-80972 (pinned lavapipe
image): exit 1 with row differs 32, now answers otherwise 32, now matches 47; the rows are written
from its printout. The same counts in job m3-max-80871 (the pre-rebase fix, against its base,
which exits 0). coverage.py --check: as derived.

No lab card's translation moves. The golden blesses at development (15898e612e) and at this
change, over the committed profiles plus the RX 7900 XTX's vulkaninfo --json capture (job
m3-max-80916), compared cell for cell, job m3-max-81006 (macOS, every fixture, 3624 rows): every
column but lavapipe, gate-lavapipe and gate-lavapipe-x86_64 (471 cells each) is equal, among them
the XTX capture, amd-780m-radv, amd-780m-hawkpoint-radv, intel-irisxe-rplp-anv,
intel-irisxe-anv and moltenvk-m3; no profile fingerprint moves (job m3-max-80958, the
same over the 1910 rows a Linux host assembles, agrees). Not run on an RTX 3090: its column is
owed until the card is back.

Gate at this tree, job m3-max-80990: clippy -D warnings plain, under m2v_cpu_icd and under m2v_gpu
0; rustdoc -D warnings 0, and with private items for metal2vulkan 0; the runtime's suite on
lavapipe 945 passed, 4 skipped (whole suite); translator and AIR 3415 passed, 37 skipped (the
golden hash table, the fixture inventory and the engine printouts excluded: their bless is due at
the pin); validation 1319 passed, 3 skipped; conformance 1048 passed. CI's lavapipe steps in the
pinned image, job m3-max-81012: device tests 841 passed (843 listed), the conformance replay exit 0
(the 4640 gaps the ledger expects, exactly), public case qualification exit 0.
2026-12-02 17:49:23 -08:00
Anees Iqbal 306f8b00eb Translator test: half computes in 16 bits under RTE and SignedZeroInfNanPreserve where only 16-bit DenormPreserve is missing (red)
The planner's ruling (T3): on a device with shaderFloat16, 16-bit RoundingModeRTE and 16-bit
SignedZeroInfNanPreserve whose only missing 16-bit control is DenormPreserve, the half
operations narrow::half_controls gates take the 16-bit route, and any other missing control
keeps today's 32-bit form, under today's independence rules.

engine_native_half's new test asks, on the committed lavapipe profile and on the RTX 5080
Laptop GPU's and the Radeon 780M's descriptions without shaderDenormPreserveFloat16, for the
16-bit instructions the full controls give (a sum, a product and a chain of two on 16-bit
floats, the controlled pair for a half narrowed alone), an entry declaring RoundingModeRTE and
SignedZeroInfNanPreserve for 16 bits and no DenormPreserve at any width (the 780M's
independence for 32 bits only would tie a 64-bit one to a 16-bit one, VUID 06289), no
DenormPreserve property required, L3, and each operation rounded on the interpreter. And it
asks that the RTX 5080 Laptop GPU without 16-bit SignedZeroInfNanPreserve too, MoltenVK on the
M3 (denormal and rounding modes not independent), and the 780M without 64-bit DenormPreserve
stay in float.

Red: half_controls asks for 16-bit DenormPreserve, so lavapipe computes half in float.
2026-12-02 17:49:16 -08:00
Anees Iqbal 4fa543f9e6 rt test: a half mad answers the fused 2^-12 only where the module records NativeHalfConversion
opencl_mode_mad_rounds_its_product_and_its_sum failed on lavapipe (llvmpipe, LLVM 23.1.1):
the half mad(a, a, c) at a = 1 + 2^-6, c = -(1 + 2^-5) answered 0x0c00, the fused 2^-12,
where the M3 Max answers 0. The float and float4 rows answered 0 there too, as on every
device.

lavapipe has no 16-bit denormal-preserve control, so the module computes the half product
in float and rounds it through the conversion pair, records NativeHalfConversion, and
lavapipe's compiler folds the pair: the product stays exact and the sum is the fused
answer. That is the note's documented bound (docs/API.md), so the test now accepts 0x0c00
only where the module records NativeHalfConversion, as the vstore_half test beside it
does; every other row, and the half row on a module without the note, stays exact. The
test prints the half it read and the notes, so a run shows which case it took.

When the 16-bit route for lavapipe lands, the half mad there is the device's 16-bit
multiply and add, the module records no NativeHalfConversion, and this test is exact on
lavapipe too.

Verified: m3-max-80986 (msi, 8dbd521441) failed the test on lavapipe; m3-max-81037 read its
assertion, half 0x0c00 with the float rows 0. The run of this commit on lavapipe is the
hand-over's job.
2026-12-02 17:49:12 -08:00
Anees Iqbal 90950389a8 canon: routine_len takes a routine's operands with get, not a slice index
clippy's indexing_slicing lint refused `&any[..r.kind.arity()]` in routine_len, in all three
configurations (job m3-max-80905, STEP clippy_plain, clippy_gpu and clippy_cpu EXIT=101: "slicing
may panic"). The operands are now `any.get(..arity)`; an arity past three is an invariant error,
which no kind has.

Verified: cargo fmt only on this host; the check job reruns clippy.
2026-12-02 17:49:12 -08:00