Docs: delete the cites of the deleted runtime lanes
The runtime_lane tests went with the old runtime, so every cite of one was false. Each cite is deleted outright, in the conformance cases and probes, the engine fixtures README, the translator's precision-note and profile docs, one engine test comment and the i915 counter's header. Where a sentence only restated what a deleted lane held or showed (the "what the port changes" paragraphs, the "stays a lane assertion" sentences, the lane's own model kept "exactly as" it stated it), the sentence is deleted; the Metal facts the cases record stay. Two runtime claims beside the cites were false of the live runtime and now say what it does: a command queue of 0 command buffers is Refusal::NoCommandBuffers, and a heap texture's size is the device image's own requirement, held by its property. Verified: git grep runtime_lane finds nothing. Not built yet; the gate for the whole pass follows.
This commit is contained in:
1 parent
9ea53f7acd
commit
ffc3208151
78 files changed
+282
-486
No files matched your search
@@ -19,9 +19,6 @@
|
||||
//
|
||||
// Each case compiles the source as MSL 4.1, runs its kernel over 8 threads in one threadgroup
|
||||
// with `in[i] = i` (16 words), and prints the words.
|
||||
//
|
||||
// WHAT IT MEASURED (Apple M3 Max, macOS 27.0.1): the module docs of
|
||||
// `runtime_lane::generic_pointers` in metal2vulkan-validation before 8871d40bdf.
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Metal/Metal.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
// clang -fobjc-arc -O1 -fmodules -o nullable_private nullable_private.m \
|
||||
// -framework Foundation -framework Metal
|
||||
// Run: ./nullable_private, MTL_DEBUG_LAYER unset.
|
||||
//
|
||||
// WHAT IT MEASURED (Apple M3 Max, macOS 27.0.1): the module docs of
|
||||
// `runtime_lane::nullable_private` in metal2vulkan-validation before 8871d40bdf.
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Metal/Metal.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
// clang -fobjc-arc -O1 -fmodules -o overlapping_slots overlapping_slots.m \
|
||||
// -framework Foundation -framework Metal
|
||||
// Run: ./overlapping_slots, MTL_DEBUG_LAYER unset.
|
||||
//
|
||||
// WHAT IT MEASURED (Apple M3 Max, macOS 27.0.1): the module docs of
|
||||
// `runtime_lane::overlapping_slots` in metal2vulkan-validation before 8871d40bdf.
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Metal/Metal.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
// clang -fobjc-arc -O1 -fmodules -o pooled_cells pooled_cells.m \
|
||||
// -framework Foundation -framework Metal
|
||||
// Run: ./pooled_cells, MTL_DEBUG_LAYER unset.
|
||||
//
|
||||
// WHAT IT MEASURED (Apple M3 Max, macOS 27.0.1): the module docs of
|
||||
// `runtime_lane::pooled_cells` in metal2vulkan-validation before 8871d40bdf.
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Metal/Metal.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
// clang -fobjc-arc -O1 -fmodules -o tns_air29 tns_air29.m \
|
||||
// -framework Foundation -framework Metal
|
||||
// Run: ./tns_air29, MTL_DEBUG_LAYER unset.
|
||||
//
|
||||
// WHAT IT MEASURED (Apple M3 Max, macOS 27.0.1): the module docs of
|
||||
// `runtime_lane::tensors_air29` in metal2vulkan-validation before 8871d40bdf.
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Metal/Metal.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -51,8 +51,7 @@
|
||||
//! 0.5 at one sample covers **no** sample and the destination survives untouched, where
|
||||
//! rounding half up would have stored the fragment. Between those points Metal's count depends
|
||||
//! on the pixel (a 2x2 ordered dither at two and four samples), which this family's one pixel
|
||||
//! cannot see: the validation lane `runtime_lane::alpha_coverage` reads it over 639 alphas a
|
||||
//! count, and the model below is that rule at this family's pixel, `(0, 0)`.
|
||||
//! cannot see; the model below is that rule at this family's pixel, `(0, 0)`.
|
||||
//! 2. **The alpha is read before the attachment's write mask.** A write mask that drops alpha
|
||||
//! leaves the coverage exactly as the same alpha gives with the mask absent, and only the stored
|
||||
//! alpha moves. A mask sweep cannot ask this and an alpha sweep cannot either.
|
||||
@@ -681,8 +680,7 @@ impl Case for AlphaCoverageCase {
|
||||
mod tests {
|
||||
//! The model each row's answer is held against, and the guards that keep the crosses honest.
|
||||
//!
|
||||
//! The coverage model is Metal's, measured (`runtime_lane::alpha_coverage`, over 639 alphas a
|
||||
//! sample count on this M3 Max) at this family's one pixel, `(0, 0)`, ANDed with a sample mask
|
||||
//! The coverage model is Metal's at this family's one pixel, `(0, 0)`, ANDed with a sample mask
|
||||
//! the fragment writes. The tests derive each row's expected coverage from that one rule rather
|
||||
//! than listing answers, so a row that agrees for the wrong reason fails.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! How ASTC texels decode, ported from `runtime_lane::astc_textures`'s first lane.
|
||||
//! How ASTC texels decode.
|
||||
//!
|
||||
//! An ASTC texture is a texture no desktop GPU and no lavapipe holds in its own format, so the
|
||||
//! runtime keeps its blocks in a carrier image and its reads go through a **decoded twin** it fills
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Border texels through a swizzled texture, ported from `runtime_lane::border_swizzles`.
|
||||
//! Border texels through a swizzled texture.
|
||||
//!
|
||||
//! Metal's answer, as the lane fitted it over 1,056 border values on an **Apple M4**: a border texel
|
||||
//! is the border colour in the format's channels — a missing red, green or blue read as 0 and a
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
//! What a blit encoder's buffer copies and fills leave behind, measured on Metal.
|
||||
//!
|
||||
//! Ported from the runtime lane `runtime_lane/blits.rs`, whose doc comment says "the expected bytes
|
||||
//! are Metal's: copies and fills of any range, overlapping copies within one buffer as `memmove`,
|
||||
//! and every refusal, as measured on Metal". Three of those claims are now run on Metal rather than
|
||||
//! restated: the lane computes each expectation in Rust — a `Vec` filled and `copy_within`'d — and
|
||||
//! compares it against our own runtime, so nothing in it was ever tied to a Metal measurement.
|
||||
//! Record mode runs each case below on the oracle, and the recording holds the bytes Metal's own
|
||||
//! blit encoder produced.
|
||||
//!
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! A buffer copied into every sample of a multisample depth or stencil texture, and copied back
|
||||
//! out: ported from `runtime_lane::buffer_depth_samples`.
|
||||
//! out.
|
||||
//!
|
||||
//! The lane's Metal answer was a **rule**, not a table — "each copy unit of the buffer lands in its
|
||||
//! sample by the layout measured for colour, texel `(x, y)` sample `s` at
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
//! Textures laid over a buffer's bytes: which shapes Metal makes one of, what the made texture
|
||||
//! answers of itself, and where its texels are in the buffer.
|
||||
//!
|
||||
//! Ported from `runtime_lane::buffer_textures`. Metal's whole path here is **public** —
|
||||
//! `newTextureWithDescriptor:offset:bytesPerRow:` on an `MTLBuffer`, then `getBytes:`,
|
||||
//! `replaceRegion:` and the buffer's own `contents` — so record mode runs every case of this
|
||||
//! family on the oracle rather than carrying a table, and the lane's numbers become Metal's own
|
||||
//! answers, re-takeable whenever anybody asks.
|
||||
//! Metal's whole path here is **public** — `newTextureWithDescriptor:offset:bytesPerRow:` on an
|
||||
//! `MTLBuffer`, then `getBytes:`, `replaceRegion:` and the buffer's own `contents` — so record mode
|
||||
//! runs every case of this family on the oracle rather than carrying a table.
|
||||
//!
|
||||
//! Three cases, because the family asks three different kinds of question:
|
||||
//!
|
||||
@@ -31,23 +29,13 @@
|
||||
//! our typed refusal (`BufferTextureProblem::RowPitch`) at the same site, so a release where we
|
||||
//! stop refusing it reads as a divergence rather than as a pass.
|
||||
//!
|
||||
//! # What is deliberately not ported, and why
|
||||
//! # What is deliberately not a case, and why
|
||||
//!
|
||||
//! The lane also checks four other refusals, each of which the runtime answers
|
||||
//! `Error::Invalid`: a block-compressed format, a 3D descriptor, a 2D descriptor at an offset off
|
||||
//! the format's alignment, and a 2D array through this call. (A 2D texture whose texels run past
|
||||
//! the buffer's length Metal makes, and so does the runtime: [`super::buffer_tails`].) `Error::Invalid` is, by the runtime's own documented model, "Metal
|
||||
//! stops this call" — as against `Error::Nil`, "plain Metal answers nil and the process goes on" —
|
||||
//! so handing any of them to Metal risks exactly what the stride row does. Unlike the stride row,
|
||||
//! no probe of this tree has recorded *how* Metal stops them, so there is nothing to state and the
|
||||
//! suite would be guessing. They stay `runtime_lane` assertions until somebody measures them
|
||||
//! safely, and the honest place for that is the refusal surface rather than a case here.
|
||||
//!
|
||||
//! The lane's remaining three tests are elsewhere by subject: the shareable texture buffer and its
|
||||
//! handle, the unbound texture-buffer slots reading the device's neutrals (what Metal reads there
|
||||
//! is undefined, so there is nothing to compare), and the texture buffer at an offset off 16 bytes
|
||||
//! whose *functions* read from the offset rounded down, which is a dispatch case rather than a
|
||||
//! texture-making one.
|
||||
//! Four other shapes the runtime refuses typed are not cases: a block-compressed format, a 3D
|
||||
//! descriptor and a 2D array through this call (`Gap::TextureOverBuffer`), and a 2D descriptor at
|
||||
//! an offset that is not a whole number of texels (`Refusal::BufferTextureLayout`). No probe of
|
||||
//! this tree has recorded what Metal does with them, and handing one to Metal risks exactly what
|
||||
//! the stride row does, so there is nothing to state and the suite would be guessing.
|
||||
//!
|
||||
//! Nothing here faults a GPU, hangs one or trips a watchdog: the making call allocates no texels of
|
||||
//! its own, and the bytes case runs one blit-free program of host calls over shared memory.
|
||||
|
||||
@@ -1,19 +1,12 @@
|
||||
//! Metal's 4:2:2 chroma-pair textures (`GBGR422`, `BGRG422`): what a copy moves, and what a
|
||||
//! kernel's `read()` and nearest sample of one answer.
|
||||
//!
|
||||
//! Ported from `runtime_lane/chroma_pairs.rs`. Both of these formats are **public** Metal pixel
|
||||
//! formats, and every call the lane makes of them — `newTextureWithDescriptor:`,
|
||||
//! `replaceRegion:`, `getBytes:`, the four blit copies and a kernel's `read()` — is a public
|
||||
//! call. So nothing here is carried: record mode runs both families on Metal and the recordings
|
||||
//! hold Metal's own answers, taken on this M3 Max.
|
||||
//! Both of these formats are **public** Metal pixel formats, and every call the cases make of them
|
||||
//! — `newTextureWithDescriptor:`, `replaceRegion:`, `getBytes:`, the four blit copies and a
|
||||
//! kernel's `read()` — is a public call. So nothing here is carried: record mode runs both families
|
||||
//! on Metal and the recordings hold Metal's own answers, taken on this M3 Max.
|
||||
//!
|
||||
//! **What the port changes.** The lane's copy table was measured on an Apple M4 and written into
|
||||
//! assertions. Its *texel* table is not a Metal run at all: `four_two_two_texels_read_as_metal_s`
|
||||
//! compares our reads with `metal2vulkan::bind::ChromaDecode`'s model, so both sides of its
|
||||
//! comparison are ours and nothing in the lane can tell a wrong model from a wrong
|
||||
//! implementation.
|
||||
//!
|
||||
//! The model itself **was** measured, and this port must not imply otherwise: `bind/chroma_decode`
|
||||
//! The model itself **was** measured: `bind/chroma_decode`
|
||||
//! records a probe on an Apple M3 Max under macOS 27.0.1 that found every `float` and `half`
|
||||
//! `read()`, nearest, linear and bicubic sample, and gather of both formats bit for bit the one of
|
||||
//! an `RGBA8Unorm` texture holding the decoded codes, over 16 x 4 texels of random bytes. So
|
||||
|
||||
@@ -7,13 +7,11 @@
|
||||
//! next one did not, that it answered once a slot came back, and that another queue's make went on
|
||||
//! meanwhile.
|
||||
//!
|
||||
//! # What it pulls forward
|
||||
//! # What it measures
|
||||
//!
|
||||
//! `runtime_lane::command_queues` holds Metal's default count as `METAL_DEFAULT: usize = 64`, a
|
||||
//! constant with the word "measured" beside it and no run behind it. The first row here measures it
|
||||
//! on the oracle: the default queue's probe makes command buffers until one blocks, up to a cap
|
||||
//! above 64, so the number in the recording is the number Metal answered rather than the number
|
||||
//! somebody wrote down. A release where Apple changes it fails the case.
|
||||
//! The first row measures Metal's default count on the oracle: the default queue's probe makes
|
||||
//! command buffers until one blocks, up to a cap above 64, so the number in the recording is the
|
||||
//! number Metal answered. A release where Apple changes it fails the case.
|
||||
//!
|
||||
//! # Why it is safe
|
||||
//!
|
||||
@@ -22,9 +20,8 @@
|
||||
//! probe, so no wait here can hang ([`crate::queue_slots::probe`]).
|
||||
//!
|
||||
//! **A count of 0 is deliberately not a row.** Metal's own validation ends the process on
|
||||
//! `maxCommandBufferCount:0` — the runtime says so by answering `Invalid` rather than `Nil` — so no
|
||||
//! case may ask Metal for it. The runtime's typed refusal of a count of 0 stays a `runtime_lane`
|
||||
//! assertion, where no Metal run is involved.
|
||||
//! `maxCommandBufferCount:0`, so no case may ask Metal for it; the runtime refuses it typed
|
||||
//! (`Refusal::NoCommandBuffers`).
|
||||
|
||||
use crate::case::{Abort, Case, Input, MetalSource, Side};
|
||||
use crate::transcript::{Node, Observed, Sites};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! How BC1 to BC5 texels decode, ported from `runtime_lane::compressed_decode`.
|
||||
//! How BC1 to BC5 texels decode.
|
||||
//!
|
||||
//! The consumer's x86 guests hold BC textures, so what one texel of a block decodes to is a value a
|
||||
//! guest shader reads. The lane's expectation is not a table but a **rule** fitted bit for bit on an
|
||||
@@ -419,7 +419,7 @@ impl Case for CompressedDecode {
|
||||
}
|
||||
}
|
||||
|
||||
/// Metal's decode of BC1 to BC5, as `runtime_lane::compressed_decode` fitted it on an Apple M4.
|
||||
/// Metal's decode of BC1 to BC5, as a rule fitted to an Apple M4's texels.
|
||||
///
|
||||
/// It is **not** what any case here expects: the recordings hold Metal's own texels, measured on
|
||||
/// this M3 Max. The rule is kept so a test can hold the two against each other, which is the one
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//! How block-compressed textures move their blocks, ported from
|
||||
//! `runtime_lane::compressed_moves`'s first lane.
|
||||
//! How block-compressed textures move their blocks.
|
||||
//!
|
||||
//! The consumer's x86 guests hold BC textures, and corrupt texels on NVIDIA were what made this a
|
||||
//! lane. Its subject is every BC format's blocks moving through shapes whose levels end in partial
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//! How block-compressed blocks move through a format view and into interior regions, ported from
|
||||
//! `runtime_lane::compressed_moves`'s second lane.
|
||||
//! How block-compressed blocks move through a format view and into interior regions.
|
||||
//!
|
||||
//! The first lane moves whole levels; this one asks the three questions that lane adds, in the same
|
||||
//! five shapes ([`crate::cases::compressed_moves::SHAPES`]) and over the same fourteen formats:
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
//! Whether a gather and a nearest sample of 32-bit float texels keep a **denormal's exact word**.
|
||||
//!
|
||||
//! This is the one family where the interesting answer is a driver's habit rather than a format's
|
||||
//! rule: `runtime_lane::denormal_word_fetches` measured that Metal keeps a denormal texel through
|
||||
//! its samplers, while RADV's gathers and nearest samples, NVIDIA's gathers and ANV's nearest
|
||||
//! samples hand back **the zero of the texel's sign** — and every one of those devices' plain
|
||||
//! fetches keeps it. A denormal flushed to zero is a value a comparison in floats would call
|
||||
//! almost right, so every site here records unsigned words and compares them exactly. This case's
|
||||
//! replay on RADV (Mesa 26.2.6, the RX 7900 XTX and the Radeon 780M, 2026-11-07) differed at the
|
||||
//! four nearest-sample sites alone: its gathers kept the word there. The device's flush is its
|
||||
//! native answer, `device-texel-conversion`.
|
||||
//! rule: Metal keeps a denormal texel through its samplers, while RADV's gathers and nearest
|
||||
//! samples, NVIDIA's gathers and ANV's nearest samples hand back **the zero of the texel's sign** —
|
||||
//! and every one of those devices' plain fetches keeps it. A denormal flushed to zero is a value a
|
||||
//! comparison in floats would call almost right, so every site here records unsigned words and
|
||||
//! compares them exactly. This case's replay on RADV (Mesa 26.2.6, the RX 7900 XTX and the Radeon
|
||||
//! 780M, 2026-11-07) differed at the four nearest-sample sites alone: its gathers kept the word
|
||||
//! there. The device's flush is its native answer, `device-texel-conversion`.
|
||||
//!
|
||||
//! The owned fixture `denormal_texels` is the one written for this question. Lane `i` reads the
|
||||
//! coordinate `in[i].xy` and writes eight `float4`s, each a site of its own because each is its own
|
||||
@@ -32,12 +31,9 @@
|
||||
//! corner are recorded too rather than being left out as uninteresting — they are the rows that
|
||||
//! would catch a tie broken the other way.
|
||||
//!
|
||||
//! The lane also read the texture through a **runtime** sampler slot, through an argument buffer's
|
||||
//! sampler, and as a heap texture, on its own generated AIR; `denormal_texels` holds constexpr
|
||||
//! samplers only and no committed fixture reads a denormal texture through the other three with
|
||||
//! one texture bound. They are not ported here, and the module docs of
|
||||
//! `runtime_lane::denormal_word_fetches` record that Metal's runtime and argument-buffer samplers
|
||||
//! filtered exactly as its constexpr samplers of the same state.
|
||||
//! `denormal_texels` holds constexpr samplers only, and no committed fixture reads a denormal
|
||||
//! texture through a runtime sampler slot, an argument buffer's sampler or a heap texture with one
|
||||
//! texture bound, so those three are not cases here.
|
||||
//!
|
||||
//! Every output word holds [`BLANK`] before the dispatch, so a word the kernel did not reach is a
|
||||
//! recorded value rather than whatever the allocator left.
|
||||
|
||||
@@ -7,20 +7,10 @@
|
||||
//! over 256 pages, each page a texture of its own holding its 256 codes, and both accesses run
|
||||
//! over every page.
|
||||
//!
|
||||
//! **Why this case exists, and what it adds to the lane it comes from.**
|
||||
//! `runtime_lane::depth_texel_reads` holds one 64-digit constant: the SHA-256 of 65,536 `float`s.
|
||||
//! Nothing in the tree holds the values. The lane's own test
|
||||
//! (`the_rule_is_metals_answer`) recomputes `c / 65535` for every code and asserts the digest, so
|
||||
//! the digest pins a **rule**, and the probe that tied the rule to Metal is gone. Two things
|
||||
//! follow, and both are why the port was worth doing rather than transcribing the digest:
|
||||
//!
|
||||
//! - The values **are** recoverable, and this case recovers them: record mode runs the two
|
||||
//! accesses on native Metal and the recording holds all 131,072 `float`s. Where the lane could
|
||||
//! only say "the digest differs", the case names the code — `element [row 0, 44731]` is code
|
||||
//! 44,731 — and says which access moved and by how many units in the last place.
|
||||
//! - A rule a digest pins is only as good as the digest. The recording replaces the rule with the
|
||||
//! measurement, so a release that changes Metal's conversion shows as the codes that moved
|
||||
//! rather than as one hex string that no longer matches anything.
|
||||
//! **Why this case records the values.** Record mode runs the two accesses on native Metal and the
|
||||
//! recording holds all 131,072 `float`s, so a difference names the code — `element [row 0, 44731]`
|
||||
//! is code 44,731 — and says which access moved and by how many units in the last place, and a
|
||||
//! release that changes Metal's conversion shows as the codes that moved.
|
||||
//!
|
||||
//! Every code compares exactly, and the two accesses are separate sites because they are separate
|
||||
//! questions: a device may fetch a depth texel one way and filter it another.
|
||||
|
||||
@@ -380,8 +380,7 @@ mod tests {
|
||||
DroppedQuads,
|
||||
}
|
||||
|
||||
/// Metal's answer for each shape, copied from `runtime_lane::discard_hoist::SHAPES` to be
|
||||
/// checked against the recording, never to stand in for it.
|
||||
/// Metal's answer for each shape, checked against the recording, never to stand in for it.
|
||||
const LANE_ANSWERS: [(&str, Answer); 13] = [
|
||||
("hoisted_known", Answer::Survivors),
|
||||
("counted_dependent", Answer::DroppedQuads),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! How ETC2 and EAC texels decode, ported from `runtime_lane::etc_textures`.
|
||||
//! How ETC2 and EAC texels decode.
|
||||
//!
|
||||
//! An ETC2 or EAC texture is a texture no desktop GPU and no lavapipe holds in its own format, so
|
||||
//! the runtime keeps its blocks in a carrier image and its reads go through a **decoded twin** it
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//! What an event orders, measured on Metal: the four ordering facts `runtime_lane::events` holds
|
||||
//! as assertions of the runtime against itself.
|
||||
//! What an event orders, measured on Metal: four ordering facts.
|
||||
//!
|
||||
//! An event's value only rises ([`super::shared_events`]) — these cases are about what it
|
||||
//! **orders**. A command buffer's `encodeWaitForEvent:value:` holds that command buffer, and the
|
||||
@@ -43,12 +42,8 @@
|
||||
//!
|
||||
//! # What this pulls forward
|
||||
//!
|
||||
//! Every one of these numbers was ours before. `runtime_lane::events` runs the shapes on the
|
||||
//! runtime and asserts the answers the module's prose says Metal gave — "as measured on Metal",
|
||||
//! "measured on the M3 and the M4" — with no Metal leg in the test and, for the statuses, no
|
||||
//! measurement written down at all beyond the word in the comment. Here both sides run and the
|
||||
//! answers are compared field by field, so the statuses, the handler order and the bytes are
|
||||
//! Metal's.
|
||||
//! Both sides run and the answers are compared field by field, so the statuses, the handler order
|
||||
//! and the bytes are Metal's.
|
||||
//!
|
||||
//! The commit order of [`CROSS_QUEUE_WAIT`] is the one that can deadlock. Two logical queues share
|
||||
//! the device's `VkQueue`s — one on most devices — so a wait committed ahead of its signal
|
||||
@@ -76,11 +71,9 @@
|
||||
//! needs the hazard-tracking vocabulary first, and a hazard between two queues needs work big
|
||||
//! enough to overlap, which a bytes record of a small buffer cannot stand in for.
|
||||
//!
|
||||
//! The lane's refusals of an event command **with an encoder open** and **after the commit** are
|
||||
//! left out, and must stay out: the lane's own prose says Metal asserts there, which ends Metal's
|
||||
//! process. They are the shape the suite has no outcome kind for, and the round's rule is that
|
||||
//! such a design is written down and left unbuilt. The runtime's typed refusals of both stay
|
||||
//! `runtime_lane` assertions.
|
||||
//! An event command **with an encoder open** and **after the commit** is left out, and must stay
|
||||
//! out: Metal asserts there, which ends Metal's process. It is the shape the suite has no outcome
|
||||
//! kind for.
|
||||
|
||||
use crate::allowance::{Allowance, Justification, Loosening};
|
||||
use crate::case::{Abort, Case, Input, MetalSource, Side};
|
||||
|
||||
@@ -13,17 +13,14 @@
|
||||
//! 32 by 32 — a 64 by 32 grid whose rows 4 to 31 are outside the texture — written with
|
||||
//! `0x3000 + n + 2048 c` and read back both ways.
|
||||
//!
|
||||
//! **What the port settles, and where it stops.** `runtime_lane::extended_range_two_planes` states
|
||||
//! Metal's answer for these six outputs as six SHA-256 constants and nothing else, from a probe
|
||||
//! whose numbers are gone. Two different things were in the way of recovering them, and only one of
|
||||
//! them turned out to be real:
|
||||
//! **What is recorded, and where it stops.** Two things decide how Metal's answer for these six
|
||||
//! outputs is recorded:
|
||||
//!
|
||||
//! - *Not* the format. The two-plane extended-range formats are not in Apple's public
|
||||
//! `MTLPixelFormat` list, and an earlier batch took that to mean the Metal side has no public
|
||||
//! call for them. It does: `MTLTextureDescriptor`'s pixel format is a raw value, and native Metal
|
||||
//! makes, writes and reads back a texture of 550 and 551 through entirely public calls. Record
|
||||
//! mode runs all six outputs on Metal, so every digest here is the oracle chip's own, taken by
|
||||
//! running the case.
|
||||
//! `MTLPixelFormat` list, but the Metal side has public calls for them: `MTLTextureDescriptor`'s
|
||||
//! pixel format is a raw value, and native Metal makes, writes and reads back a texture of 550
|
||||
//! and 551 through entirely public calls. Record mode runs all six outputs on Metal, so every
|
||||
//! digest here is the oracle chip's own, taken by running the case.
|
||||
//! - The size. The four 256 by 256 outputs are 65,536 threads of a `half4` or a `float4`, which is
|
||||
//! 6 MiB of Metal's bytes across the two formats — more than belongs in a committed recording.
|
||||
//! Those four keep the digest, with a **window** of the first and the last 256 threads recorded
|
||||
@@ -31,9 +28,8 @@
|
||||
//! of only saying that the digest differs. The consumer's shape is 2,048 threads, so it is
|
||||
//! recorded whole.
|
||||
//!
|
||||
//! So the honest accounting is: four outputs are a digest plus a window and remain less informative
|
||||
//! than raw values would be, and two are raw. All six are now Metal's measured answer on the chip
|
||||
//! the suite names, rather than a digest from a probe on another machine.
|
||||
//! So four outputs are a digest plus a window and remain less informative than raw values would
|
||||
//! be, and two are raw. All six are Metal's measured answer on the chip the suite names.
|
||||
//!
|
||||
//! Every output compares exactly, or by its digest where the digest is all that is recorded, and
|
||||
//! the case carries **no allowance**: on both venues this round covers, MoltenVK and lavapipe, the
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! A swizzled **extended-range, bfloat or packed-normalized** texture read, sampled and gathered at
|
||||
//! a sampled slot, ported from `runtime_lane::extended_swizzles`.
|
||||
//! a sampled slot.
|
||||
//!
|
||||
//! These are the formats whose image holds raw codes the function decodes, so a swizzle in the
|
||||
//! view's component mapping hands a channel's codes to another channel's lane. Metal applies the
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Blit copies between a depth or stencil format and a colour format of its unit, and through a
|
||||
//! combined texture's stencil view, ported from `runtime_lane::format_copies`.
|
||||
//! combined texture's stencil view.
|
||||
//!
|
||||
//! Metal copies the **bytes** between a depth-only or stencil-only format and a colour format whose
|
||||
//! texel is its copy unit — 2 bytes for `Depth16Unorm`, 4 for `Depth32Float`, 1 for stencil — and
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
//! What a new buffer or texture holds before anything writes it, and what memory that was written
|
||||
//! and released reads as once it comes back.
|
||||
//!
|
||||
//! Ported from the runtime lane `runtime_lane/fresh_contents.rs`. Metal's answer, which that lane's
|
||||
//! header states from our own probe and which record mode now takes row by row:
|
||||
//! Metal's answer, which record mode takes row by row:
|
||||
//!
|
||||
//! - **Zero, every read:** buffers of every storage mode; `Shared` and `Managed` textures of every
|
||||
//! type and format tried; the `Private` textures Metal keeps uncompressed (shader-write usage,
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
//! What a device's blend stores for a fragment function's `half` output, into a 16- and a 32-bit
|
||||
//! float attachment.
|
||||
//!
|
||||
//! `runtime_lane::half_output_blends` is a **measurement** lane rather than a check: it prints
|
||||
//! `HALF-BLEND` lines, fits a rule to them, and asserts only that each draw completes and that a
|
||||
//! pipeline announcing nothing stores the fitted rule's value. The rule it fitted is worth having —
|
||||
//! into a 16-bit float format Metal blends the `half` the function returns with each factor (`1 - x`
|
||||
//! included), each product and the sum rounded to `half`, nearest even, and `Min` and `Max` read no
|
||||
//! factor; into a 32-bit float format it is a multiply-add in `float` — but the numbers behind it
|
||||
//! were printed to a terminal and are gone, and the blend colour's `1 - x` is the part of it this
|
||||
//! family has since measured and found not to hold on this OS (below).
|
||||
//! A rule fitted to Metal's blends reads: into a 16-bit float format Metal blends the `half` the
|
||||
//! function returns with each factor (`1 - x` included), each product and the sum rounded to
|
||||
//! `half`, nearest even, and `Min` and `Max` read no factor; into a 32-bit float format it is a
|
||||
//! multiply-add in `float`. The blend colour's `1 - x` is the part of it this family has measured
|
||||
//! and found not to hold on this OS (below).
|
||||
//!
|
||||
//! **So the recorded answer here is the blended attachment's stored codes, compared exactly**, and
|
||||
//! the fitted rule becomes a cross-check over Metal's own measurement instead of the thing the
|
||||
@@ -197,13 +194,11 @@ impl Rng {
|
||||
}
|
||||
}
|
||||
|
||||
/// The blend colour every pass sets, which is the lane's own
|
||||
/// (`runtime_lane::half_output_blends::BLEND_COLOR`): `(0.3, 0.6, 0.9, 0.45)`.
|
||||
/// The blend colour every pass sets: `(0.3, 0.6, 0.9, 0.45)`.
|
||||
///
|
||||
/// Restated from the lane rather than chosen here, because the finding these rows carry is the
|
||||
/// lane's and a different colour would be a different measurement. **Not one of the four channels
|
||||
/// is exact in `half`**, which is the whole point: a blend colour the attachment holds exactly
|
||||
/// could not tell a factor that rounds the colour before its one minus from one that does not.
|
||||
/// **Not one of the four channels is exact in `half`**, which is the whole point: a blend colour
|
||||
/// the attachment holds exactly could not tell a factor that rounds the colour before its one minus
|
||||
/// from one that does not.
|
||||
///
|
||||
/// Every pass sets it, not only the four rows whose factors read it, as the lane's every draw did.
|
||||
/// Once a pass and never twice: Metal's own API validation layer stops a pass that sets the blend
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
//! in words, so every site here records unsigned words and compares them exactly — a NaN's payload,
|
||||
//! a denormal's exact code and a signed zero are all lost the moment a site reads as a float.
|
||||
//!
|
||||
//! What `runtime_lane::half_read_nans` measured on plain Metal, and what these recordings hold the
|
||||
//! implementation to: with a `float` result, **every** NaN of a 16-bit float texel — whatever its
|
||||
//! What plain Metal answers, and what these recordings hold the implementation to: with a `float`
|
||||
//! result, **every** NaN of a 16-bit float texel — whatever its
|
||||
//! sign, its payload and its signalling bit — is `0x7fc00000`, and every other half its exact
|
||||
//! widening with denormals kept; a **32-bit** float texel's word is handed back as stored, a
|
||||
//! signalling NaN's and a negative NaN's included. So `0x7c01` in an `R16Float` texel reads
|
||||
@@ -27,12 +27,9 @@
|
||||
//! `SampleSlot` access rather than a constexpr sampler folded into the shader. The texture is 16 by
|
||||
//! 16, which the kernels' `16 g.y + g.x` and their division by 16 both fix.
|
||||
//!
|
||||
//! The lane's four other accesses — a `texture2d<float, access::read_write>`, a
|
||||
//! `texture_buffer<float, read>`, the texture an argument buffer holds, and a gather — ran on the
|
||||
//! lane's own generated AIR, and no committed fixture reads an arbitrary format through one of them
|
||||
//! with a single texture bound. They are not ported here; the module docs of
|
||||
//! `runtime_lane::half_read_nans` record that plain Metal answered the same words through all
|
||||
//! seven.
|
||||
//! No committed fixture reads an arbitrary format through a `texture2d<float, access::read_write>`,
|
||||
//! a `texture_buffer<float, read>`, the texture an argument buffer holds, or a gather with a single
|
||||
//! texture bound, so those four accesses are not cases here.
|
||||
//!
|
||||
//! Every word of both output buffers holds [`BLANK`] before its dispatch, so a word the kernel did
|
||||
//! not reach is a recorded value rather than whatever the allocator left.
|
||||
@@ -367,8 +364,8 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
/// Metal's `float` lane for channel `channel` of texel `index`, as
|
||||
/// `runtime_lane::half_read_nans` measured it: a 16-bit float texel's NaN is the canonical
|
||||
/// Metal's `float` lane for channel `channel` of texel `index`: a 16-bit float texel's NaN is
|
||||
/// the canonical
|
||||
/// `0x7fc00000` and every other half its exact widening; a 32-bit float texel's word is as
|
||||
/// stored; a missing green or blue reads 0 and a missing alpha 1.
|
||||
fn metal(case: &HalfReadNans, index: usize, channel: usize) -> u32 {
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
//! of every `half` bit pattern.
|
||||
//!
|
||||
//! Metal's conversion here is **not** IEEE's round-to-nearest, which is the whole reason the family
|
||||
//! exists: `runtime_lane::half_storage_writes` measured that Metal rounds each channel **toward
|
||||
//! zero**, stores a finite value at or past 65504 as 65504, keeps an infinity, and stores every NaN
|
||||
//! as `0x7e00`. A device that rounds to nearest is wrong by one code on half the inputs, and a
|
||||
//! device that quiets a NaN its own way is wrong in the payload — both are differences a comparison
|
||||
//! in floats would call almost right, so every site here records unsigned words.
|
||||
//! exists: Metal rounds each channel **toward zero**, stores a finite value at or past 65504 as
|
||||
//! 65504, keeps an infinity, and stores every NaN as `0x7e00`. A device that rounds to nearest is
|
||||
//! wrong by one code on half the inputs, and a device that quiets a NaN its own way is wrong in the
|
||||
//! payload — both are differences a comparison in floats would call almost right, so every site
|
||||
//! here records unsigned words.
|
||||
//!
|
||||
//! **The sweep is exhaustive over a complete space**, which is why it records whole rather than as a
|
||||
//! digest: all 65,536 `half` bit patterns, each widened to its exact `f32` and written back, so
|
||||
@@ -28,10 +28,9 @@
|
||||
//! | `read-write` | `hsw_read_write`, a `texture2d<float, access::read_write>` at slot 0 |
|
||||
//! | `held` | `hsw_held`, the `texture2d<float, access::write>` an argument buffer at buffer 2 holds |
|
||||
//!
|
||||
//! The lane's fourth form, `hsw_buffer`'s `texture_buffer<float, access::write>`, is not ported: a
|
||||
//! texture over a buffer's bytes has no call in the vocabulary a case is written against, so there
|
||||
//! is nowhere to say it. The module docs of `runtime_lane::half_storage_writes` record that plain
|
||||
//! Metal stored the same codes through all four.
|
||||
//! A fourth form, `hsw_buffer`'s `texture_buffer<float, access::write>`, is not a case: a texture
|
||||
//! over a buffer's bytes has no call in the vocabulary a case is written against, so there is
|
||||
//! nowhere to say it.
|
||||
//!
|
||||
//! Every texel holds [`FILL`] before the dispatch, so a texel the kernel did not reach is a
|
||||
//! recorded value rather than whatever the allocator left.
|
||||
@@ -70,12 +69,12 @@ pub const FILL: u8 = 0xab;
|
||||
/// texel of the level is a value the case stated and the NaN rule is asked once more.
|
||||
const TAIL: u32 = 0x7f80_0001;
|
||||
|
||||
/// The lane's specials, as `f32` bits: the inputs no `half` code can be.
|
||||
/// The specials, as `f32` bits: the inputs no `half` code can be.
|
||||
///
|
||||
/// Zeros and ones of both signs, the two `f32` denormals that must flush, a tiny normal, both
|
||||
/// infinities, 65504 and the two values either side of the half's last rounding boundary, a value
|
||||
/// far past the range, and four `f32` NaN payloads. These are `runtime_lane::color_writes`'
|
||||
/// `specials`, by their bits so a transcription cannot move one by a step.
|
||||
/// far past the range, and four `f32` NaN payloads, by their bits so a transcription cannot move
|
||||
/// one by a step.
|
||||
const SPECIALS: [u32; 27] = [
|
||||
0x0000_0000, // 0.0
|
||||
0x8000_0000, // -0.0
|
||||
@@ -391,9 +390,8 @@ impl Case for HalfStorageWrites {
|
||||
}
|
||||
}
|
||||
|
||||
/// The code Metal's conversion stores for `x`, as `runtime_lane::half_storage_writes` measured it:
|
||||
/// a NaN is `0x7e00`, an infinity is kept, a finite value at or past 65504 is the largest half, and
|
||||
/// everything else is rounded **toward zero**.
|
||||
/// The code Metal's conversion stores for `x`: a NaN is `0x7e00`, an infinity is kept, a finite
|
||||
/// value at or past 65504 is the largest half, and everything else is rounded **toward zero**.
|
||||
///
|
||||
/// Public so the cross-check can name it and so a reader of the family can find the rule in one
|
||||
/// place rather than in prose.
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
//! texel hands back its own bits — sign, payload and signalling bit kept, so `0x7c01` stays
|
||||
//! `0x7c01` — while a 32-bit float texel's NaN, a small float's (`RG11B10Float`) and every filtered
|
||||
//! sample's come back as `0x7e00`. `RGB9E5Float` decodes every code to a finite value, so no lane of
|
||||
//! it is a NaN at all. That is what `runtime_lane::half_texel_nans` measured on plain Metal, and
|
||||
//! these recordings are what hold the implementation to it.
|
||||
//! it is a NaN at all. That is what plain Metal answers, and these recordings are what hold the
|
||||
//! implementation to it.
|
||||
//!
|
||||
//! One case per format, so a format a venue honestly lacks a readable or filterable texture of is
|
||||
//! that venue's gap ([`crate::verdict::Verdict::LacksFeature`]) at its own row.
|
||||
@@ -70,11 +70,9 @@
|
||||
//! validation derives no tolerance from it, so a tolerance here would be the suite overruling the
|
||||
//! contract under test. `known-gaps-rt.tsv` carries the nine rows.
|
||||
//!
|
||||
//! The lane's four filtered accesses — a linear sample at the centre, a linear sample a quarter
|
||||
//! texel right of it, a gather, and the same through the runtime sampler at slot 0 — ran on the
|
||||
//! lane's own generated AIR, and no committed fixture stores a `half` result's raw bits through one
|
||||
//! of them. They are not ported; the module docs of `runtime_lane::half_texel_nans` record that
|
||||
//! plain Metal answered `0x7e00` for every one of their NaN lanes.
|
||||
//! No committed fixture stores a `half` result's raw bits through a filtered access (a linear
|
||||
//! sample at the centre, a linear sample a quarter texel right of it, a gather, or the same through
|
||||
//! the runtime sampler at slot 0), so those four are not cases here.
|
||||
//!
|
||||
//! Every word of the output holds [`BLANK`] before the dispatch, so a word the kernel did not reach
|
||||
//! is a recorded value rather than whatever the allocator left, and the five columns together cover
|
||||
@@ -456,8 +454,7 @@ mod tests {
|
||||
/// What channel `channel` of texel `index` holds, as far as a NaN goes: the NaN's bits in the
|
||||
/// format's own encoding, or `None` where the channel is not a NaN.
|
||||
///
|
||||
/// This is `runtime_lane::half_texel_nans`'s own `class`, restated so the cross-check below has
|
||||
/// the lane's rule to hold Metal's recording to.
|
||||
/// The cross-check below holds Metal's recording to this rule.
|
||||
fn nan_bits(case: &HalfTexelNans, index: usize, channel: usize) -> Option<u32> {
|
||||
if channel >= case.channels {
|
||||
return None;
|
||||
|
||||
@@ -13,12 +13,9 @@
|
||||
//!
|
||||
//! The kernel is the owned fixture `xr_two_planes`'s `xr2p_write_half`, a
|
||||
//! `texture2d<half, access::write>` that writes buffer 0's `half4` at the thread's texel, with the
|
||||
//! row's width in buffer 1 — the same call shape as the lane's own `write` kernel, and a committed
|
||||
//! fixture, so Metal's assembler and a host without Metal read the same shader. The lane's two
|
||||
//! other accesses (a `texture2d<half, access::read_write>`, and a texture an argument buffer holds)
|
||||
//! have no committed fixture that writes a `half4` from a buffer, so they are not ported; the
|
||||
//! module docs of `runtime_lane::half_write_nans` record that plain Metal stored the same bits
|
||||
//! through all three.
|
||||
//! row's width in buffer 1 — a committed fixture, so Metal's assembler and a host without Metal
|
||||
//! read the same shader. A `texture2d<half, access::read_write>` and a texture an argument buffer
|
||||
//! holds have no committed fixture that writes a `half4` from a buffer, so they are not cases here.
|
||||
//!
|
||||
//! Every texel of the texture holds one fill byte before the dispatch, so a texel the kernel did not
|
||||
//! reach is a recorded value rather than whatever the allocator left.
|
||||
|
||||
@@ -5,14 +5,13 @@
|
||||
//! answers; some also record whether `newTextureWithDescriptor:` answers a texture at all, which is
|
||||
//! the fact that makes a 0-byte answer mean something.
|
||||
//!
|
||||
//! # Why this family came first
|
||||
//! # What the numbers are
|
||||
//!
|
||||
//! `runtime_lane`'s `heap_metal_sizes` carries the numbers these cases measure — 44 bytes for a
|
||||
//! 6 x 3 4:2:2 texture, 20480 for a 64 x 64 two-plane extended-range one, and some 240 more — and
|
||||
//! until now nothing tied them to a Metal run: they were taken on an Apple M4 by hand, written into
|
||||
//! assertions, and the probe was thrown away. The runtime answers them from a **model** of Metal's
|
||||
//! arithmetic (`texture/heap_tiled.rs`) that is the same on every device, so the numbers are a
|
||||
//! contract with Metal and with nothing else, and the only thing that can check them is Metal. Record mode now does, on the oracle, as often as anybody asks.
|
||||
//! The numbers these cases record — 44 bytes for a 6 x 3 4:2:2 texture, 20480 for a 64 x 64
|
||||
//! two-plane extended-range one, and some 240 more — are Metal's, taken on the oracle by record
|
||||
//! mode. The runtime answers its device image's own memory requirements
|
||||
//! (`Device::heap_texture_size_and_align`), which differ by device, so its answers are held by
|
||||
//! their property rather than by Metal's numbers (`texture_query::DEVICE_OWN_SIZES`).
|
||||
//!
|
||||
//! # Why every case here is safe
|
||||
//!
|
||||
|
||||
@@ -1118,9 +1118,8 @@ impl Case for RenderCommands {
|
||||
/// lengths.
|
||||
pub const MESH_OBJECT_LENGTHS: &str = "indirect-mesh-commands-object-threadgroup-lengths";
|
||||
|
||||
/// The owned fixture the row runs, which `runtime_lane/mesh_commands.rs` measured this shape on
|
||||
/// first: an object function with threadgroup memory at arguments 0 and 1 and no size of its own
|
||||
/// for either.
|
||||
/// The owned fixture the row runs: an object function with threadgroup memory at arguments 0 and
|
||||
/// 1 and no size of its own for either.
|
||||
///
|
||||
/// Its thread 0 writes `0xb` into `b[0]`, then `0xa` into `a[0..63]`, then `b[0]` into word 0 of
|
||||
/// object buffer 0 and `a[63]` into word 1. So the **length** is what the words read back: where
|
||||
|
||||
@@ -365,8 +365,7 @@ mod tests {
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
/// Metal's `half` of the integer `value`: rounded to nearest even at 11 significant bits, and
|
||||
/// 65520 and above to infinity. Copied from `runtime_lane::int_attributes::metal_half` to be
|
||||
/// checked against the recording, never to stand in for it.
|
||||
/// 65520 and above to infinity. Checked against the recording, never to stand in for it.
|
||||
fn metal_half(value: i64) -> f32 {
|
||||
let size = value.unsigned_abs();
|
||||
let magnitude = if size >= 65520 {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! A texture's extent at a level read from a buffer, ported from `runtime_lane::level_sizes`.
|
||||
//! A texture's extent at a level read from a buffer.
|
||||
//!
|
||||
//! A shader may ask for `get_width(lod)` at a level the texture does not have, and Metal answers
|
||||
//! something rather than refusing: `max(1, e >> (lod & 255))` of the first level's extent, a shift
|
||||
|
||||
@@ -8,10 +8,8 @@
|
||||
//! both zeros, normals, denormals, the largest finite value, both infinities, and quiet and
|
||||
//! signalling NaNs with payloads.
|
||||
//!
|
||||
//! Why these two: `runtime_lane::math_routines` states Metal's answer as a **rule** it computes on
|
||||
//! the host, not as a table Metal wrote. The rule was fitted to a probe whose numbers are gone, so
|
||||
//! the lane holds no Metal value at all and nothing checks the fit. These cases record what Metal
|
||||
//! actually writes for every input, word by word, so the measurement stops being a reconstruction.
|
||||
//! These cases record what Metal writes for every input, word by word, so the answer is Metal's
|
||||
//! measurement rather than a rule fitted to it.
|
||||
//!
|
||||
//! Each word is a column of its own, because the eight words are different answers: a diff names
|
||||
//! `frexp-mantissa` or `ilogb` of one input rather than a row of eight numbers. Every column
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
//! Mesh draws behind a memory barrier: whether a reader draw sees the writer draw's words.
|
||||
//!
|
||||
//! Ported from the runtime lane `runtime_lane/mesh_barriers.rs`, whose expectation is a transcript
|
||||
//! of a Metal probe's printed lines (`PX`, `RESULT`, `CTL`). Metal's answer here is **run**, not
|
||||
//! copied: the lane's own documentation says its table is what an **M4** on macOS 27.0.1 printed,
|
||||
//! while the suite's oracle is this M3 Max, so porting the lane and recording it is also the first
|
||||
//! measurement of this probe on the chip the recording is keyed to.
|
||||
//! Metal's answer here is **run**, not copied: record mode measures it on the chip the recording is
|
||||
//! keyed to.
|
||||
//!
|
||||
//! Each row is one pass of one `RGBA32Uint` attachment, 8x8, cleared to zero and stored, and a
|
||||
//! control buffer of four words, `(1, 1, 1, 0)` from the host. A writer draw covers texel (7, 7)
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
//! Mesh draws in an indirect command buffer: what commands with pipeline states of their own draw.
|
||||
//!
|
||||
//! Ported from `runtime_lane/mesh_commands.rs`'s `cpu_own` row, whose expectation is a transcript
|
||||
//! of a Metal probe's printed lines. That lane's own documentation says its table is an **M4**'s
|
||||
//! (macOS 27.0.1), while the suite's oracle is this M3 Max, so running it through record mode is
|
||||
//! also the first measurement of this probe on the chip its recording is keyed to.
|
||||
//! Record mode measures the row on the chip its recording is keyed to.
|
||||
//!
|
||||
//! The row is an indirect command buffer of two commands the host encodes, over a pass of two
|
||||
//! `RGBA32Uint` attachments, 8x8, cleared to zero and stored: command 0 sets `mesh_draws`' object
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
//! Mesh draws: the words each mesh threadgroup's primitive drew, and the grids Metal draws
|
||||
//! nothing for.
|
||||
//!
|
||||
//! Ported from the runtime lane `runtime_lane/mesh_draws.rs`, whose expectation is a transcript of
|
||||
//! a Metal probe's printed lines (`PX <case> <x> <y> a=<words> b=<words>`, then `RESULT <case>
|
||||
//! drawn=<n>`). The lane holds those lines as text and compares its own printed lines with them.
|
||||
//! Here the same measurement is **run on Metal** instead: the case is one body, record mode drives
|
||||
//! it through `objc2-metal` on this Mac, and replay drives it through the runtime on any Vulkan
|
||||
//! device.
|
||||
//! The measurement is **run on Metal**: the case is one body, record mode drives it through
|
||||
//! `objc2-metal` on this Mac, and replay drives it through the runtime on any Vulkan device.
|
||||
//!
|
||||
//! What a row observes is typed, not printed:
|
||||
//!
|
||||
|
||||
@@ -10,9 +10,8 @@
|
||||
//! reads the next texel.
|
||||
//!
|
||||
//! The case records what Metal wrote, not a rule: record mode runs the fixture on native Metal, so
|
||||
//! the recording holds Metal's whole output buffer, and the runtime lane's fitted rule
|
||||
//! (`runtime_lane::nearest_positions::metal_texel`) is a cross-check this module's tests apply to
|
||||
//! the recorded bytes rather than a second expectation to keep in step.
|
||||
//! the recording holds Metal's whole output buffer, and a fitted rule is a cross-check this
|
||||
//! module's tests apply to the recorded bytes rather than a second expectation to keep in step.
|
||||
//!
|
||||
//! One site a row holds the whole output buffer, and its layout's row is one thread's results with
|
||||
//! the column the case is about: the four words of the runtime sampler's sample. A diff therefore
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//! What a kernel stores when it writes a `float` to a **normalized** storage texture, ported from
|
||||
//! `runtime_lane::norm_storage_writes`.
|
||||
//! What a kernel stores when it writes a `float` to a **normalized** storage texture.
|
||||
//!
|
||||
//! Metal stores such a write as a fragment function's write to a color attachment of the format: a
|
||||
//! unorm channel of `b` bits takes `x` clamped to `[0, 1]` (a NaN 0) times `2^b - 1` **exactly**,
|
||||
|
||||
@@ -14,10 +14,7 @@
|
||||
//! `px_sample_argument`). Metal answered the two alike at every size, which is the claim the
|
||||
//! control exists to make.
|
||||
//!
|
||||
//! **What the port changes.** `runtime_lane::pixel_downscales` holds each size's three answers as
|
||||
//! SHA-256 constants taken on an Apple M4 and compares a digest, and its AIR is an inline `&str`
|
||||
//! in the opaque-pointer dialect, which `xcrun metal-as` does not read, so it could have no Metal
|
||||
//! leg. Record mode now runs every set at every size on native Metal.
|
||||
//! Record mode runs every set at every size on native Metal.
|
||||
//!
|
||||
//! **Why these sites are not whole values.** A set is 24,300 `float4`s at the largest size, so a
|
||||
//! case's six sets would be 2.3 MiB and its recording far past the 512-KiB whole-value rule. Each
|
||||
@@ -537,10 +534,10 @@ mod tests {
|
||||
use crate::transcript::Node as TranscriptNode;
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
/// What an Apple M4 answered for each size's three sets through the pixel sampler, as
|
||||
/// `runtime_lane::pixel_downscales`' own probe measured it (macOS 27.0.1, two processes,
|
||||
/// identical): the case, the set, and the SHA-256 of its results. Our own measurement over our
|
||||
/// own inputs, carried here so the recorded M3 answers can be held against it.
|
||||
/// What an Apple M4 answered for each size's three sets through the pixel sampler (macOS
|
||||
/// 27.0.1, two processes, identical): the case, the set, and the SHA-256 of its results. Our
|
||||
/// own measurement over our own inputs, carried here so the recorded M3 answers can be held
|
||||
/// against it.
|
||||
///
|
||||
/// The lane's fourth configuration at each size — the draw — is not here: the case vocabulary
|
||||
/// has no vertex-and-fragment pipeline, so those seven digests stay in the lane.
|
||||
|
||||
@@ -15,12 +15,7 @@
|
||||
//! - `const`: the texture at slot 0 through the fixture's constexpr `coord::pixel` sampler of that
|
||||
//! filter and mode, where MSL can state it (not mirror clamp to edge, which it cannot).
|
||||
//!
|
||||
//! **What the port changes.** `runtime_lane::pixel_samplers` holds these sixty answers as sixty
|
||||
//! SHA-256 constants taken on an Apple M4, and compares a digest; on a difference it prints the
|
||||
//! cells that differ from the device's own `norm` control, which is a device-against-device check,
|
||||
//! not a check against Metal. Worse, the lane's AIR is an inline `&str` in the opaque-pointer
|
||||
//! dialect, which `xcrun metal-as` does not read, so the lane could have no Metal leg at all. The
|
||||
//! owned fixture `px_samplers` is the two shapes it needed, and record mode now runs all sixty
|
||||
//! The owned fixture `px_samplers` holds the two shapes, and record mode runs all sixty
|
||||
//! configurations on native Metal and keeps every one of the 800 results of each, so a comparison
|
||||
//! names the coordinate and the lane rather than saying a hash moved.
|
||||
//!
|
||||
@@ -708,8 +703,8 @@ mod tests {
|
||||
/// The coordinates each subnormal case samples at ([`subnormal_grid`]).
|
||||
const SUBNORMAL_SAMPLES: usize = 16;
|
||||
|
||||
/// What an Apple M4 answered for each configuration, as `runtime_lane::pixel_samplers`' own
|
||||
/// probe measured it (macOS 27.0.1, two processes, identical): the case, the source, and the
|
||||
/// What an Apple M4 answered for each configuration (macOS 27.0.1, two processes, identical):
|
||||
/// the case, the source, and the
|
||||
/// SHA-256 of its 800 `float4` results. Our own measurement over our own inputs, carried here
|
||||
/// so the recorded M3 answers can be held against it.
|
||||
const M4: [(&str, &str, &str); 60] = [
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//! The order a PVRTC texture's blocks take under Metal's **host** copies, ported from
|
||||
//! `runtime_lane::pvrtc_textures`' CPU-order lane.
|
||||
//! The order a PVRTC texture's blocks take under Metal's **host** copies.
|
||||
//!
|
||||
//! A PVRTC texture does not hold its blocks row by row. A blit under
|
||||
//! `MTLBlitOptionRowLinearPVRTC` moves them row by row ([`crate::cases::pvrtc_rows`]); Metal's host
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//! How a PVRTC texture's blocks move under `MTLBlitOptionRowLinearPVRTC`, ported from
|
||||
//! `runtime_lane::pvrtc_textures`' two row-linear lanes.
|
||||
//! How a PVRTC texture's blocks move under `MTLBlitOptionRowLinearPVRTC`.
|
||||
//!
|
||||
//! PVRTC is the one compressed family whose blocks do **not** lie row by row in a texture by
|
||||
//! default: Metal places them in a block order of its own, and
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//! What a kernel reads from, writes to and samples of, and what a draw stores into, an
|
||||
//! `RGB10A2Unorm_sRGB` (586) texture.
|
||||
//!
|
||||
//! Eight cases over Apple's padded 10-bit sRGB format: the three of
|
||||
//! `runtime_lane::rgb10a2_srgb`'s nine questions a compute pass can ask, and the one a render pass
|
||||
//! asks whose answer was truncated:
|
||||
//! Eight cases over Apple's padded 10-bit sRGB format, for three questions a compute pass asks and
|
||||
//! one a render pass asks:
|
||||
//!
|
||||
//! - `rgb10a2-srgb-reads`: a 1024 by 1 texture of the words
|
||||
//! `c | (1023 - c) << 10 | (7 c mod 1024) << 20 | (c mod 4) << 30`, every texel read by the owned
|
||||
@@ -196,10 +195,8 @@ const STORE_SPECIALS: [f32; 20] = [
|
||||
/// from 65520 up to an infinity, which is what a `float` the fragment function returns into a
|
||||
/// `half4` output goes through.
|
||||
///
|
||||
/// This is `runtime_lane::rgb10a2_srgb`'s own function, and `the_half_bits_are_the_lane_s` pins it
|
||||
/// against the values that lane's test states, because the suite may not depend on the validation
|
||||
/// crate and a second spelling that drifted would make the `half` case's inputs quietly another
|
||||
/// case's.
|
||||
/// `the_half_bits_are_the_lane_s` pins it against fixed values, so the `half` case's inputs cannot
|
||||
/// drift.
|
||||
fn half_bits(value: f32) -> u16 {
|
||||
if value.is_nan() {
|
||||
return 0x7e00;
|
||||
@@ -964,8 +961,7 @@ mod tests {
|
||||
assert_eq!(WRITE_SPECIALS.iter().filter(|v| v.is_nan()).count(), 2);
|
||||
}
|
||||
|
||||
/// `half_bits` is the lane's, pinned by the values `runtime_lane::rgb10a2_srgb`'s own test
|
||||
/// states: the `half` store case's inputs are that lane's inputs and not merely similar ones.
|
||||
/// `half_bits`, pinned by fixed values, so the `half` store case's inputs cannot drift.
|
||||
#[test]
|
||||
fn the_half_bits_are_the_lane_s() {
|
||||
assert_eq!(half_bits(1.0), 0x3c00);
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
//! Where a command buffer's scheduling sits relative to its scheduled handlers, measured on Metal.
|
||||
//!
|
||||
//! `runtime_lane::submission_handlers` states this order in its module prose — "its status reads
|
||||
//! `Scheduled` just before its first scheduled handler starts, and Metal's wait for the scheduling
|
||||
//! returns only once every scheduled handler returned" — attributed to **an M4 on macOS 27.0.1**,
|
||||
//! a machine this project no longer has. Its test
|
||||
//! (`wait_until_scheduled_returns_once_the_scheduled_handlers_returned`) then holds the runtime to
|
||||
//! that sentence with no Metal leg in it. So the number behind the rule is a measurement nobody can
|
||||
//! re-take there, on a chip that is gone.
|
||||
//!
|
||||
//! This case re-takes it on the oracle, with both sides running, and compares six fields:
|
||||
//! The order under test: a command buffer's status reads `Scheduled` just before its first
|
||||
//! scheduled handler starts, and Metal's wait for the scheduling returns only once every scheduled
|
||||
//! handler returned. This case takes it on the oracle, with both sides running, and compares six
|
||||
//! fields:
|
||||
//!
|
||||
//! - the status the scheduled handler read of its own command buffer, from inside itself;
|
||||
//! - the status the probe's thread read while that handler was held inside itself;
|
||||
@@ -34,14 +29,6 @@
|
||||
//! thread and not the suite — the shape [`crate::queue_slots::probe`] already takes for the same
|
||||
//! reason. The GPU work is one fill of [`crate::event_orders::SCRATCH`] bytes and is independent of
|
||||
//! every handler thread: no pass, no dispatch, no loop.
|
||||
//!
|
||||
//! # What is deliberately not here
|
||||
//!
|
||||
//! The lane's **submission handlers** (`CommandBuffer::add_submission_handler`) are a runtime
|
||||
//! extension: Metal has no counterpart, so there is nothing for a conformance case to compare, and
|
||||
//! which thread of ours runs them is exactly the kind of internal fact the suite keeps out of a
|
||||
//! transcript. The whole of `runtime_lane::submission_checks` is the same story one layer up
|
||||
//! (`set_submission_check` is ours alone). Both stay lanes.
|
||||
|
||||
use crate::case::{Abort, Case, Input, MetalSource, Side};
|
||||
use crate::event_orders::{COMPLETED, SCHEDULED, SCRATCH};
|
||||
|
||||
@@ -438,10 +438,8 @@ mod tests {
|
||||
use super::*;
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
/// Metal's stencil after the three draws, by pixel, as
|
||||
/// `runtime_lane::shader_stencil::METAL` carries it. The lane measured it on an **M4** with
|
||||
/// macOS 27.0.1, a machine this project no longer has, so it is a cross-check of the rule
|
||||
/// below and never a stand-in for the recording.
|
||||
/// Metal's stencil after the three draws, by pixel, as measured on an **M4** with macOS
|
||||
/// 27.0.1: a cross-check of the rule below and never a stand-in for the recording.
|
||||
const LANE: [u8; 4] = [0x01, 0xa1, 0x00, 0x01];
|
||||
|
||||
/// Metal's stencil rule for one pixel under one face: the reference and the stored value are
|
||||
|
||||
@@ -13,9 +13,7 @@
|
||||
//! - a host wait for 3 and one for 5 answer, and one for 6 runs out;
|
||||
//! - a command buffer signals `u64::MAX`, and a host wait for it answers.
|
||||
//!
|
||||
//! `runtime_lane::events` holds this as `a_shared_events_value_only_rises`, which asserts the
|
||||
//! runtime agrees with itself. Here both sides answer and the answers are compared field by field,
|
||||
//! so the numbers are Metal's rather than ours.
|
||||
//! Both sides answer and the answers are compared field by field, so the numbers are Metal's.
|
||||
//!
|
||||
//! # Why it is safe and quick
|
||||
//!
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//! `RGB9E5Float` written and read through a storage slot, ported from
|
||||
//! `runtime_lane::shared_exponent_storage`.
|
||||
//! `RGB9E5Float` written and read through a storage slot.
|
||||
//!
|
||||
//! This is a format whose storage is nothing like its read type: one 32-bit word holds three
|
||||
//! nine-bit mantissas and the five-bit exponent they share, and what a kernel writes as three
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
//! Threadgroup words that only a simdgroup's lockstep orders.
|
||||
//!
|
||||
//! Ported from the two lockstep rows of the runtime lane `runtime_lane/driver_deviations.rs`. The
|
||||
//! owned fixture `rtl_lockstep` holds two kernels over one 64-thread threadgroup — two simdgroups —
|
||||
//! whose loops each thread leaves after its own count, with no barrier inside: thread `t` reads
|
||||
//! another thread's word of its own simdgroup and writes its own from it. Nothing but the
|
||||
//! The owned fixture `rtl_lockstep` holds two kernels over one 64-thread threadgroup — two
|
||||
//! simdgroups — whose loops each thread leaves after its own count, with no barrier inside: thread
|
||||
//! `t` reads another thread's word of its own simdgroup and writes its own from it. Nothing but the
|
||||
//! simdgroup running its lanes in lockstep decides what those words come to, so the recorded words
|
||||
//! **are** Metal's lockstep, in the one shape where it is observable.
|
||||
//!
|
||||
@@ -266,11 +265,9 @@ pub fn all() -> Vec<Box<dyn Case>> {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
/// The lane's own model of lockstep, kept exactly as
|
||||
/// `runtime_lane::driver_deviations::in_lockstep` states it: each simdgroup's threads run each
|
||||
/// iteration together, so the threads still in the loop all read, then all write. `step` gives
|
||||
/// a thread's iteration from the words as the iteration found them: `None` where the thread
|
||||
/// leaves the loop, else its new word.
|
||||
/// A model of lockstep: each simdgroup's threads run each iteration together, so the threads
|
||||
/// still in the loop all read, then all write. `step` gives a thread's iteration from the words
|
||||
/// as the iteration found them: `None` where the thread leaves the loop, else its new word.
|
||||
pub(super) fn in_lockstep(
|
||||
words: &mut [u32],
|
||||
mut step: impl FnMut(usize, u32, &[u32]) -> Option<u32>,
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
//! What Metal's tile store leaves in the texels a draw did not write: a signed normalized
|
||||
//! attachment's minimum codes, and an `RGB9E5Float` attachment's unnormalized words.
|
||||
//!
|
||||
//! Ported from the runtime lane `runtime_lane/snorm_tile_store.rs`. The lane's claim is Metal's
|
||||
//! behaviour, measured on this same chip: once a pass **draws**, Metal writes each 32x32 tile back
|
||||
//! through its channels' *values*, so a channel's minimum code (-128, or -32768), which reads as
|
||||
//! -1.0 exactly as the code above it does, is stored as that code above (-127, -32767) in every
|
||||
//! Metal's behaviour, measured on this chip: once a pass **draws**, Metal writes each 32x32 tile
|
||||
//! back through its channels' *values*, so a channel's minimum code (-128, or -32768), which reads
|
||||
//! as -1.0 exactly as the code above it does, is stored as that code above (-127, -32767) in every
|
||||
//! texel of the tile — including the texels no fragment wrote. An `RGB9E5Float` attachment's tiles
|
||||
//! go back the same way, so a word whose largest mantissa is below 256 under an exponent above 0 is
|
||||
//! stored normalized. A pass that **draws nothing** keeps every code.
|
||||
@@ -398,13 +397,11 @@ impl Case for SnormTileStore {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
//! The cross-check the port owes the lane: the codes Metal's own store left, as the recordings
|
||||
//! hold them, against the lane's table.
|
||||
//! The cross-check: the codes Metal's own store left, as the recordings hold them, against a
|
||||
//! table.
|
||||
//!
|
||||
//! The table is the lane's (`runtime_lane/snorm_tile_store.rs`), restated here because a
|
||||
//! conformance case may not depend on the validation crate. It is the claim under test, not a
|
||||
//! helper: if a recorded texel disagrees, either Apple's store moved or the lane's table was
|
||||
//! never Metal's, and the test says which format.
|
||||
//! The table is the claim under test, not a helper: if a recorded texel disagrees, either
|
||||
//! Apple's store moved or the table was never Metal's, and the test says which format.
|
||||
|
||||
use super::*;
|
||||
use crate::recording::Recording;
|
||||
|
||||
@@ -5,24 +5,19 @@
|
||||
//! `size` and `usedSize`, `newTextureWithDescriptor:` on that heap, and the texture's `isSparse`,
|
||||
//! `firstMipmapInTail` and `tailSizeInBytes`.
|
||||
//!
|
||||
//! # What the port adds to the lane
|
||||
//! # What the sweep checks
|
||||
//!
|
||||
//! `runtime_lane::sparse_textures` reads these getters of exactly one texture — a 256 by 256
|
||||
//! `R32Float` of 9 levels — and asserts `firstMipmapInTail == 3` and `tailSizeInBytes == 16384`
|
||||
//! inside a much larger test. The runtime answers both from models (`sparse::first_mipmap_in_tail`,
|
||||
//! `sparse::tail_size_in_bytes`) whose comments say "measured" four times over, including the two
|
||||
//! claims that decide every other answer:
|
||||
//! Two claims decide every other answer:
|
||||
//!
|
||||
//! - **the chain is the full mip chain**, `floor(log2(largest axis)) + 1` levels, *whatever the
|
||||
//! texture's own level count* — so `firstMipmapInTail` may be past the texture's own levels;
|
||||
//! - **a 3D texture's tail is summed per depth slice**, each rounded up to whole pages separately.
|
||||
//!
|
||||
//! Nothing in the tree tied either to a Metal run. One texture cannot: the first claim only shows
|
||||
//! where a texture's levels are fewer than its chain, and the second only on a 3D texture. The
|
||||
//! One texture cannot check either: the first claim shows only where a texture's levels are fewer
|
||||
//! than its chain, and the second only on a 3D texture. The
|
||||
//! sweep here records Metal's two numbers for 123 textures — level counts from 1 to the full chain
|
||||
//! and past it, non-square and odd extents, every sparse texture type, four tile widths, and the
|
||||
//! multisample pair — so the models are checked against Metal rather than against their own
|
||||
//! comments.
|
||||
//! multisample pair.
|
||||
//!
|
||||
//! The heap's three getters go beside them because `usedSize` is what every mapping case counts in,
|
||||
//! and a fresh sparse heap's `usedSize` being 0 — with a texture made over it and nothing mapped —
|
||||
|
||||
@@ -100,10 +100,10 @@ const HEAP: SparseHeapSpec = SparseHeapSpec::new(4 << 20);
|
||||
|
||||
/// The texture extent every row uses, and the levels it declares.
|
||||
///
|
||||
/// 256 by 256 `R32Float` is the shape `runtime_lane::sparse_textures` measured on this oracle:
|
||||
/// a 16-KiB page makes its tile 64 by 64 texels, so level 0 holds 4 by 4 tiles, level 1 holds
|
||||
/// 2 by 2, level 2 holds exactly one, and `firstMipmapInTail` is 3. Nine levels is the full mip
|
||||
/// chain, so the rows can name a level past the tail as well as inside it.
|
||||
/// On this oracle, a 256 by 256 `R32Float` texture's 16-KiB page makes its tile 64 by 64 texels, so
|
||||
/// level 0 holds 4 by 4 tiles, level 1 holds 2 by 2, level 2 holds exactly one, and
|
||||
/// `firstMipmapInTail` is 3. Nine levels is the full mip chain, so the rows can name a level past
|
||||
/// the tail as well as inside it.
|
||||
const WIDTH: u32 = 256;
|
||||
const LEVELS: u32 = 9;
|
||||
const FORMAT: PixelFormat = PixelFormat::R32Float;
|
||||
|
||||
@@ -15,19 +15,12 @@
|
||||
//! Metal answers from its own. So the whole family compares on a venue that has no sparse binding
|
||||
//! at all, and a lavapipe leg here reports real answers rather than a hole.
|
||||
//!
|
||||
//! # What the port adds to the lane
|
||||
//! # What the sweep checks
|
||||
//!
|
||||
//! `runtime_lane::sparse_textures` asks the runtime for exactly three of these answers, inside
|
||||
//! three much larger tests, and asserts each against a literal: `(Type2D, R32Float, 1)` and
|
||||
//! `(Cube, R32Float, 1)` are 64 by 64, and `(Type2DMultisample, RGBA8Unorm, 2)` and `4` are 64 by
|
||||
//! 32 and 32 by 32. Nothing in the tree ties any of them to a Metal run, and the model's own
|
||||
//! comment says it was measured on an Apple M4 — a machine that is gone.
|
||||
//! The rule has two claims a sweep can check:
|
||||
//!
|
||||
//! The rule the model states has two claims a sweep can check and three literals cannot:
|
||||
//!
|
||||
//! - **the answer does not depend on the texture type** (`sparse_tile_size_for_page` takes the
|
||||
//! type and ignores it, `_texture_type`), which [`BY_TYPE`] asks of every texture type a sparse
|
||||
//! heap makes a texture of;
|
||||
//! - **the answer does not depend on the texture type**, which [`BY_TYPE`] asks of every texture
|
||||
//! type a sparse heap makes a texture of;
|
||||
//! - **the tile halves a side as the block's bytes double**, keeping the tile's bytes at the
|
||||
//! page's, which [`BY_FORMAT`] asks of formats from 1 to 16 bytes a block and of the
|
||||
//! block-compressed families, in all three pages.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! Metal's private texture fills over a surface's plane or a buffer: which bytes one fill changed.
|
||||
//!
|
||||
//! Ported from the runtime lane `runtime_lane/surface_fills.rs`'s first test, whose expectation is
|
||||
//! a transcript of what our probes `surface.m` and `cases.sh` printed on this M3 Max under macOS
|
||||
//! 27.0.1: for each case, the runs of bytes that are no longer `0xEE`, as ` [<at>+<n>: <bytes>]`.
|
||||
//! The expectation is a transcript of what our probes `surface.m` and `cases.sh` printed on this M3
|
||||
//! Max under macOS 27.0.1: for each case, the runs of bytes that are no longer `0xEE`, as `
|
||||
//! [<at>+<n>: <bytes>]`.
|
||||
//!
|
||||
//! Metal's answer is **carried**, and re-recording it is **forbidden**: `fillTexture:` and
|
||||
//! `fillTextureColor:` are Apple SPI, so there is no public call a Metal side could make. What the
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//! A swizzled texture read and written through a **storage** slot, ported from
|
||||
//! `runtime_lane::swizzled_storage`.
|
||||
//! A swizzled texture read and written through a **storage** slot.
|
||||
//!
|
||||
//! What plain Metal does (the lane: an Apple M4 on macOS 27.0.1, plain twice alike) with a 2 by 2
|
||||
//! texture whose every texel is `(10, 20, 30, 40)` in bytes — `RG8Unorm` `(10, 20)`, `R32Float`
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! A texture **buffer** made or viewed with a swizzle, ported from `runtime_lane::texel_swizzles`.
|
||||
//! A texture **buffer** made or viewed with a swizzle.
|
||||
//!
|
||||
//! Metal applies a texture buffer's swizzle to every read, out of bounds included (the lane: an M3
|
||||
//! Max on macOS 26.7 and an Apple M4 on 27.0.1, plain and under Metal's API validation alike). Each
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//! A render state's texture slots and how its functions access them, ported from
|
||||
//! `runtime_lane::texture_accesses`.
|
||||
//! A render state's texture slots and how its functions access them.
|
||||
//!
|
||||
//! The question is Metal's reflection: what
|
||||
//! `newRenderPipelineStateWithDescriptor:options:reflection:error:` states about the texture
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//! Every uncompressed colour format's texture, ported from
|
||||
//! `runtime_lane::textures`'s `every_format_makes_a_texture_or_is_refused_typed`.
|
||||
//! Every uncompressed colour format's texture.
|
||||
//!
|
||||
//! One case a format. Each one makes an 8 by 8 `Shared` 2D texture of its format, read by shaders,
|
||||
//! at a row pitch one texel wider than its rows, then asks three things of it:
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
//! Tile threadgroups: which thread of a tile dispatch is which, and what a tile state answers.
|
||||
//!
|
||||
//! Ported from the runtime lane `runtime_lane/tile_threadgroups.rs`. That lane is the clearest case
|
||||
//! in the survey for porting: its expectations are **formulas** rather than a table —
|
||||
//! `position(simdgroup, lane)`, `thread_index(x, y)` and `quad_order(qw, qh)`, each a model of how
|
||||
//! Metal places the threads of a tile threadgroup — and the only thing tying those formulas to
|
||||
//! Metal is a comment saying a probe measured them on an M4 and on an M3 Max under macOS 26.7.
|
||||
//! Both of those measurements are gone, and the second is of an older release.
|
||||
//!
|
||||
//! So Metal's answer here is **run**, not copied. Record mode runs each case on native Metal on the
|
||||
//! The tests hold **formulas** — `position(simdgroup, lane)`, `thread_index(x, y)` and
|
||||
//! `quad_order(qw, qh)`, each a model of how Metal places the threads of a tile threadgroup — and
|
||||
//! Metal's answer here is **run**, not copied. Record mode runs each case on native Metal on the
|
||||
//! chip and build the recording is keyed to, and the case records the words Metal's own threads
|
||||
//! wrote. The lane's formulas stay exactly where they are, as the readable model, and this module's
|
||||
//! own tests check the recorded words against them: that is the cross-check the port
|
||||
@@ -801,14 +796,11 @@ impl Case for TileThreadgroups {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
//! The cross-check the port owes the lane: the words Metal's own threads wrote, as the
|
||||
//! recordings hold them, against the lane's formulas for where Metal places a tile
|
||||
//! threadgroup's threads.
|
||||
//! The cross-check: the words Metal's own threads wrote, as the recordings hold them, against
|
||||
//! the formulas for where Metal places a tile threadgroup's threads.
|
||||
//!
|
||||
//! The formulas are the lane's (`runtime_lane/tile_threadgroups.rs`), restated here because a
|
||||
//! conformance case may not depend on the validation crate. They are the claim under test, not
|
||||
//! a helper: if a recorded word disagrees with one, either Apple moved or the lane's model was
|
||||
//! never Metal's, and the test says which thread.
|
||||
//! The formulas are the claim under test, not a helper: if a recorded word disagrees with one,
|
||||
//! either Apple moved or the model was never Metal's, and the test says which thread.
|
||||
|
||||
use super::*;
|
||||
use crate::recording::Recording;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//! Blits between Apple's two-plane extended-range textures placed in a heap, ported from
|
||||
//! `runtime_lane::two_plane_heap_blits`.
|
||||
//! Blits between Apple's two-plane extended-range textures placed in a heap.
|
||||
//!
|
||||
//! The probe (`tph`): a placement heap of Metal's size, shared or private, every byte of it a byte
|
||||
//! of the case's seed written through a buffer over the whole heap; two one-level 2D textures of
|
||||
|
||||
@@ -13,13 +13,9 @@
|
||||
//! state, which is a claim of its own: Metal filters through a sampler state the host made as it
|
||||
//! filters through one the shader declares.
|
||||
//!
|
||||
//! **What the port changes.** `runtime_lane::two_plane_samples` holds these sixteen answers as
|
||||
//! sixteen SHA-256 constants taken on an Apple M4, and compares a digest. On a difference it prints
|
||||
//! the first sixteen results as hex and nothing more, so the lane cannot say which of the 4,096
|
||||
//! coordinates moved. The values are recoverable and small — a `float` case is 4,096 `float4`s, 64
|
||||
//! KiB — so record mode runs every case on native Metal and the recordings hold all 4,096 results
|
||||
//! of each. The comparison then names the sample, the lane and both values, and the digest stays
|
||||
//! beside the value as a projection of it.
|
||||
//! The values are small — a `float` case is 4,096 `float4`s, 64 KiB — so record mode runs every
|
||||
//! case on native Metal and the recordings hold all 4,096 results of each. The comparison names the
|
||||
//! sample, the lane and both values, and the digest stays beside the value as a projection of it.
|
||||
//!
|
||||
//! Every result compares exactly. The linear cases declare one notice of the runtime's: an
|
||||
//! extended-range texture's linear filter blends its decoded taps in the device's arithmetic
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
//! What Metal writes into a pass's visibility-result buffer: the words a `Boolean` mode stores,
|
||||
//! the samples a `Counting` mode counts, and what an offset nobody set keeps.
|
||||
//!
|
||||
//! Ported from the runtime lane `runtime_lane/visibility.rs`. Every pass here is one the lane
|
||||
//! drives, drawn with the owned fixture `rt6_render_state`: the fullscreen triangle covers every
|
||||
//! pixel of a 4 by 4 target, and the same draw **from vertex 3** covers none. Each visibility
|
||||
//! buffer starts as `0xaa` bytes, so a word Metal never wrote is visible as the bytes that were
|
||||
//! there rather than as a zero nobody can tell from a result; an `Accumulate` shape's starts as
|
||||
//! the words it adds to.
|
||||
//! Every pass here is drawn with the owned fixture `rt6_render_state`: the fullscreen triangle
|
||||
//! covers every pixel of a 4 by 4 target, and the same draw **from vertex 3** covers none. Each
|
||||
//! visibility buffer starts as `0xaa` bytes, so a word Metal never wrote is visible as the bytes
|
||||
//! that were there rather than as a zero nobody can tell from a result; an `Accumulate` shape's
|
||||
//! starts as the words it adds to.
|
||||
//!
|
||||
//! The lane's own table was measured on an M4, and its comment says so. Metal's answer here is
|
||||
//! **run**, not copied: record mode takes it on this M3 Max, and this module's tests cross-check
|
||||
@@ -1067,13 +1066,9 @@ impl Visibility {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
//! The cross-check the port owes the lane: the words Metal wrote, as the recordings hold them,
|
||||
//! against the lane's table.
|
||||
//!
|
||||
//! The table is the lane's (`runtime_lane/visibility.rs`), restated here because a conformance
|
||||
//! case may not depend on the validation crate. Its comment says it was measured on an **M4**;
|
||||
//! this recording is of an M3 Max. A disagreement is therefore a fact about one of the two
|
||||
//! chips, and the test names the case and the word.
|
||||
//! The cross-check: the words Metal wrote, as the recordings hold them, against a table
|
||||
//! measured on an **M4**; this recording is of an M3 Max. A disagreement is therefore a fact
|
||||
//! about one of the two chips, and the test names the case and the word.
|
||||
|
||||
use super::*;
|
||||
use crate::recording::Recording;
|
||||
|
||||
@@ -387,10 +387,9 @@ mod tests {
|
||||
/// No pixel drawn, in the lane's table.
|
||||
const NONE: u8 = u8::MAX;
|
||||
|
||||
/// The pixel the lane's own Metal probe stored, `8 x + y`, through each viewport at each
|
||||
/// offset along `x`, then along `y`; [`NONE`] where it drew none. Copied from
|
||||
/// `runtime_lane::wide_points::PROBE_9` to be checked against the recording, never to stand in
|
||||
/// for it.
|
||||
/// The pixel a Metal probe stored, `8 x + y`, through each viewport at each offset along `x`,
|
||||
/// then along `y`; [`NONE`] where it drew none. Checked against the recording, never to stand
|
||||
/// in for it.
|
||||
const PROBE_9: [[[u8; 17]; 2]; 7] = [
|
||||
[
|
||||
[
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//! A minified 10-bit two-plane YCbCr texture's samples: where a linear footprint's rounding puts
|
||||
//! the switch.
|
||||
//!
|
||||
//! Ported from `runtime_lane/ycbcr_minify.rs`, which exists because of a consumer bug: a pass that
|
||||
//! samples a 3840 x 2160 `YCBCR10_420_2P` surface minified into a 1440 x 1080 target wrote rare
|
||||
//! ±1s in its red, green and blue. The lane sweeps, along each axis, 2,048 places where a
|
||||
//! This family exists because of a consumer bug: a pass that samples a 3840 x 2160
|
||||
//! `YCBCR10_420_2P` surface minified into a 1440 x 1080 target wrote rare ±1s in its red, green and
|
||||
//! blue. It sweeps, along each axis, 2,048 places where a
|
||||
//! footprint's rounding decides which side of a `1 / 256` step a sample reads — 64 places times 32
|
||||
//! steps, 17 consecutive `f32` coordinates each — and compares the whole band's results with
|
||||
//! plain Metal's.
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
//! Two-plane YCbCr textures: what Metal says about the formats' descriptors, and what a kernel's
|
||||
//! `read()` of a `420v` surface's texels answers.
|
||||
//!
|
||||
//! Ported from `runtime_lane/ycbcr_textures.rs`. The lane is 4,500 lines over a `YCBCR8_420_2P`
|
||||
//! texture laid over a CoreVideo surface's two planes, and the two halves of it port very
|
||||
//! differently, because of one fact about Metal's API:
|
||||
//! The two cases here are shaped by one fact about Metal's API:
|
||||
//!
|
||||
//! **A texture of a two-plane YCbCr format exists only over an IOSurface.** The lane's own
|
||||
//! `ycbcr_textures_are_made_only_over_their_surfaces` is that fact: `newTextureWithDescriptor:`
|
||||
//! answers nil for the format, and so does a buffer's texture of it. The runtime takes a *buffer*
|
||||
//! standing for the surface, which is what makes the lane run on a host with no CoreVideo, but
|
||||
//! Metal takes an IOSurface and nothing else. So:
|
||||
//! **A texture of a two-plane YCbCr format exists only over an IOSurface.**
|
||||
//! `newTextureWithDescriptor:` answers nil for the format, and so does a buffer's texture of it.
|
||||
//! The runtime takes a *buffer* standing for the surface, which is what makes the cases run on a
|
||||
//! host with no CoreVideo, but Metal takes an IOSurface and nothing else. So:
|
||||
//!
|
||||
//! - [`FormatDescriptors`] is **recorded on Metal**, because it asks only about descriptors:
|
||||
//! `heapTextureSizeAndAlignWithDescriptor:` and whether `newTextureWithDescriptor:` answers a
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! What an event orders: the vocabulary for the four ordering facts of `runtime_lane::events`,
|
||||
//! and for what Metal does with a wait whose signal is already submitted and running.
|
||||
//! What an event orders: the vocabulary for four ordering facts, and for what Metal does with a
|
||||
//! wait whose signal is already submitted and running.
|
||||
//!
|
||||
//! An `MTLEvent` and an `MTLSharedEvent` hold a value that only rises, and a command buffer's
|
||||
//! `encodeWaitForEvent:value:` holds that command buffer — and the ones committed behind it on its
|
||||
@@ -28,8 +28,7 @@
|
||||
//!
|
||||
//! # The buffers are small on purpose
|
||||
//!
|
||||
//! `runtime_lane::events` fills 8 MiB a command buffer, which is the size a *hazard* between two
|
||||
//! queues needs to be seen at. The fact these cases pin is the event's, and the fills here are
|
||||
//! The fact these cases pin is the event's, not a hazard between two queues, and the fills here are
|
||||
//! [`SCRATCH`] bytes and write **disjoint** halves, so there is no hazard either way and a bytes
|
||||
//! record stays far inside the recording budget.
|
||||
|
||||
|
||||
@@ -5,9 +5,8 @@
|
||||
//! answers nil. That is a behaviour nothing in the suite could state before: the fact under test is
|
||||
//! that a call *did not return*, and then that it did once a slot came back.
|
||||
//!
|
||||
//! `runtime_lane::command_queues` holds the number — `METAL_DEFAULT: usize = 64` — as a constant
|
||||
//! with the word "measured" beside it. A case over this probe measures it instead, on the oracle,
|
||||
//! and records it keyed to the oracle.
|
||||
//! A case over this probe measures the default count on the oracle, and records it keyed to the
|
||||
//! oracle.
|
||||
//!
|
||||
//! # Why no wait here can hang
|
||||
//!
|
||||
@@ -19,9 +18,8 @@
|
||||
//!
|
||||
//! # What is deliberately not here
|
||||
//!
|
||||
//! `maxCommandBufferCount:` of **0**. Metal's own validation ends the process on it (the runtime
|
||||
//! answers `Invalid`, which is its word for exactly that), so no case may ask Metal for it. The
|
||||
//! runtime's typed refusal of a count of 0 stays a `runtime_lane` assertion.
|
||||
//! `maxCommandBufferCount:` of **0**. Metal's own validation ends the process on it, so no case
|
||||
//! may ask Metal for it; the runtime refuses it typed (`Refusal::NoCommandBuffers`).
|
||||
|
||||
use crate::transcript::{Negative, Node, Observed, Value};
|
||||
use std::time::Duration;
|
||||
|
||||
@@ -978,8 +978,7 @@ pub struct RenderPipelineSpec<'a> {
|
||||
/// above an alpha of 1/2). Metal reads the alpha **before** the attachment's write mask, and
|
||||
/// ANDs the result with a sample mask the fragment writes; a first output with no alpha
|
||||
/// component leaves the coverage as rasterized. [`super::cases::alpha_coverage_pairs`] is
|
||||
/// where each of those is measured, and the validation lane `runtime_lane::alpha_coverage`
|
||||
/// the dither.
|
||||
/// where each of those is measured.
|
||||
pub alpha_to_coverage: bool,
|
||||
/// `alphaToOneEnabled`: the fragment's alpha becomes 1 before the blend reads it and before it
|
||||
/// is stored, which the attachment's write mask can still stop from being stored.
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
//! Where a command buffer's scheduling sits relative to its scheduled handlers: the vocabulary for
|
||||
//! the one Metal order `runtime_lane::submission_handlers` carries in prose.
|
||||
//! one Metal order.
|
||||
//!
|
||||
//! Metal runs a command buffer's scheduled handlers on a thread of its own, and the order the lane
|
||||
//! states is that `waitUntilScheduled` returns **only once every scheduled handler returned**,
|
||||
//! while the status already reads `Scheduled` from the moment the first of them starts. That is a
|
||||
//! relation between three things — a handler, a status and a wait on another thread — so the whole
|
||||
//! experiment is one [`Side`](crate::case::Side) call.
|
||||
//! Metal runs a command buffer's scheduled handlers on a thread of its own, and the order is that
|
||||
//! `waitUntilScheduled` returns **only once every scheduled handler returned**, while the status
|
||||
//! already reads `Scheduled` from the moment the first of them starts. That is a relation between
|
||||
//! three things — a handler, a status and a wait on another thread — so the whole experiment is one
|
||||
//! [`Side`](crate::case::Side) call.
|
||||
//!
|
||||
//! # Why the shape is safe and bounded
|
||||
//!
|
||||
|
||||
@@ -7,13 +7,8 @@
|
||||
//! is safe on every venue and comparable on every venue — including one with no sparse binding at
|
||||
//! all, which is what makes this the first sparse family the suite can carry end to end.
|
||||
//!
|
||||
//! The runtime answers them from a model of Metal's rule (`sparse::tile_texels`), the same on every
|
||||
//! device, whose comment says it was measured on an Apple M4 and whose only possible oracle is
|
||||
//! Metal. `runtime_lane::sparse_textures` asserts exactly three of its answers —
|
||||
//! `(Type2D, R32Float, 1)`, `(Cube, R32Float, 1)` and `(Type2DMultisample, RGBA8Unorm, 2 and 4)` —
|
||||
//! so the rule's two interesting claims, that the answer does not depend on the texture type and
|
||||
//! that it halves the tile's sides as the block's bytes double, have never been checked against
|
||||
//! Metal over a sweep. A case over this type checks them.
|
||||
//! Metal's rule makes two claims a case over this type checks over a sweep: that the answer does
|
||||
//! not depend on the texture type, and that it halves the tile's sides as the block's bytes double.
|
||||
//!
|
||||
//! The vocabulary is Metal's own enumerations as the translator's public API names them, so a value
|
||||
//! a case writes reaches `MTLTextureType`, `MTLPixelFormat` and `MTLSparsePageSize` by its raw
|
||||
|
||||
@@ -5,10 +5,7 @@
|
||||
//! exactly the shape a conformance case wants — the whole descriptor space is reachable from the
|
||||
//! CPU, every answer is two numbers, and the whole family can be re-measured on the oracle as often
|
||||
//! as anybody asks.
|
||||
//!
|
||||
//! It is also the family whose numbers were, until now, held by a comment: `runtime_lane`'s
|
||||
//! `heap_metal_sizes` carries tables of what an Apple M4 answered, with nothing mechanical tying
|
||||
//! them to a Metal run. A case over this type takes the answer from Metal.
|
||||
|
||||
//!
|
||||
//! The vocabulary is Metal's own enumerations as the translator's public API names them, so a value
|
||||
//! a case writes reaches `MTLTextureType`, `MTLPixelFormat` and `MTLTextureUsage` by its raw
|
||||
|
||||
@@ -583,10 +583,6 @@ impl Transcript {
|
||||
/// Every degrade notice the transcript records, by code, with how many times it was
|
||||
/// announced: the `counts` child of each site [`Sites::notices`] emitted, wherever it sits in
|
||||
/// the tree.
|
||||
///
|
||||
/// The closed-vocabulary notice census (`runtime_lane::degrade_notices`) stays a lane and
|
||||
/// reads the suite's runs through this, rather than becoming a case: its subject is the
|
||||
/// vocabulary across every lane, which has no Metal counterpart to compare against.
|
||||
pub fn announced_notices(&self) -> BTreeMap<String, u64> {
|
||||
let mut found = BTreeMap::new();
|
||||
for announced in self.announced_at() {
|
||||
|
||||
@@ -178,7 +178,7 @@ threadgroup's threads); an authored case that executes a loop declares it
|
||||
| `hlf_half_access` | `hlf_half_access` | four `access::read` and two `access::read_write` 2D `half` textures, read | how Metal converts texels to `half` in those reads (case `half-conversion-by-read-only-and-read-write-texture-reads`) |
|
||||
| `hrd_half_read` | `hrd_half_read` | a 64 x 16 2D `half` texture read and sampled nearest at each texel's centre through `access::sample`, and read through `access::read`; compiled without fast math | the `half` a half-float texel reads as: every subnormal, both zeros, both infinities, and `±65504` (case `half-reads-keep-subnormals-zeros-and-infinities`), and every NaN half, whose decode is the device's (case `half-reads-of-every-nan-half`) |
|
||||
| `hrd_half_widen` | `hrd_half_widen` | each lane loads a raw 16-bit pattern from a buffer, reinterprets it as `half`, and widens it to `float`, outside any texture path; compiled without fast math | `out[i] = (bits of the widening, bits of the widening times the literal 1.0f, bits of the widening times a runtime 1.0f, the pattern)`: every NaN half of either sign, signaling and quiet, with both zeros, both infinities, and every subnormal as controls (case `half-to-float-widening-of-every-nan-half`); the front end folds the literal product to the widening |
|
||||
| `hsw_storage_writes` | `hsw_write`, `hsw_read_write`, `hsw_buffer`, `hsw_held` | a kernel writes buffer 0's `float4` at its thread's texel through `access::write` and `access::read_write` of a `texture2d`, a `texture_buffer`, and an argument buffer's `texture2d`; compiled without fast math | what a half-float texture stores for a written `float`: Metal rounds each channel toward zero, stores past the largest as 65504 and every NaN as `0x7e00` (measured on the M3 Max and an M4; `runtime_lane::half_storage_writes`); the notes of what a device leaves its own, under the format bound at the slot (`tests::engine_half_storage_notes`) |
|
||||
| `hsw_storage_writes` | `hsw_write`, `hsw_read_write`, `hsw_buffer`, `hsw_held` | a kernel writes buffer 0's `float4` at its thread's texel through `access::write` and `access::read_write` of a `texture2d`, a `texture_buffer`, and an argument buffer's `texture2d`; compiled without fast math | what a half-float texture stores for a written `float`: Metal rounds each channel toward zero, stores past the largest as 65504 and every NaN as `0x7e00` (measured on the M3 Max and an M4); the notes of what a device leaves its own, under the format bound at the slot (`tests::engine_half_storage_notes`) |
|
||||
| `nan_arith` | `nan_arith` | NaN model: float `a + b`, `a - b`, `a * b`, `a / b`, `fma`, `a * b + c` (`llvm.fmuladd`), `sqrt`, and `fmod` of loaded operands; compiled without fast math | which NaN each answers: a NaN as either operand, two NaNs, a NaN addend, NaN-generating operands, controls (case `nan-model-arithmetic-of-nan-operands`) |
|
||||
| `nan_arith_fast` | `nan_arith_fast` | NaN model: `nan_arith`'s program under the default fast math (`fast` flags, `air.fast_sqrt`, `air.fast_fmod`, the contracted `a * b + c`) | what Metal answers for NaN operands that fast math leaves undefined (case `nan-model-arithmetic-of-nan-operands-under-fast-math`) |
|
||||
| `nan_functions` | `nan_functions` | NaN model: float `sin` to `ldexp` (trigonometric, hyperbolic, exponential, logarithmic, power, rounding, `fract`, `dot`, `length`, `mix`, `step`, `smoothstep`) of loaded operands; compiled without fast math | which NaN each answers, for a NaN operand and outside its domain (case `nan-model-functions-of-nan-operands`); `mix` at its endpoints, infinities, and signed zeros and on lanes that tell the blend's compositions apart, and `round` and `fract` at signed zeros, small negatives, and ties (case `nan-model-functions-at-blend-and-rounding-edges`) |
|
||||
@@ -208,13 +208,13 @@ threadgroup's threads); an authored case that executes a loop declares it
|
||||
| `trh_forward` | `trh_forward` | a thread writes a `read_write` 2D texture and texture buffer and then reads them, threads 0 to 3 at the location past each that they wrote (same-invocation forwarding; the slots are `Volatile`) | `out[2t]` = `img` at texel `idx[8 + t]`, `out[2t + 1]` = `tb` at element `idx[24 + t]`, zero past each; in-bounds writes `0xB0000000 \| t` and `0xC0000000 \| t` |
|
||||
| `trh_texture_atomic` | `trh_texture_atomic` | `atomic_fetch_max` on a `uint` and an `int` `read_write` 2D texture, threads 4 to 7 past them (the out-of-bounds texture atomic probe) | `out[3t]`, `out[3t + 1]` = the old texels `u`'s two maxes return, `out[3t + 2]` = the old texel `s`'s max returns |
|
||||
| `rt_instance_count` | `rt_instance_count` | `get_instance_count()` of an `instance_acceleration_structure`, which the binder supplies as a push field, so no ray tracing feature is needed (`raytracing.instance_count`) | `out[gid] = count * 3 + gid` |
|
||||
| `rt6_render_state` | `rt6_full`, `rt6_flip`, `rt6_small`, `rt6_point`, `rt6_white`, `rt6_half` | the functions of a Metal probe on an M4 (macOS 27.0.1), which the runtime lane's render state test draws with (`runtime_lane::render_state`): Metal's fullscreen triangle at a depth `z + slope * x` from a buffer, the same triangle in the other winding, a small triangle (with a fourth vertex, a strip over a quad), one point of 4 pixels, and a white and a half-gray fragment | the texels Metal stored in that probe, compared by the lane test (no authored case) |
|
||||
| `rt6_resolves` | `rt6_resolve_full`, `rt6_resolve_half`, `rt6_resolve_white`, `rt6_resolve_samples`, `rt6_resolve_sample_values`, `rt6_resolve_masked` | the functions of a Metal probe on an M4 (macOS 27.0.1), which the runtime lane's resolve test draws with (`runtime_lane::resolves`): Metal's fullscreen triangle at a depth `z` from a buffer, half the target (its diagonal pixels half covered), white, two fragments whose values follow `[[sample_id]]`, and white on the samples of a mask from a buffer | the texels Metal resolved in that probe, compared by the lane test (no authored case) |
|
||||
| `rdw_tile_kept` | `rdw_tile_kept_fill`, `rdw_tile_kept_dump`, `rdw_tile_kept_fill_dump` | tile functions over an explicit imageblock of one `uint4` a cell standing alone (after an `R32Uint` attachment, at byte 16): a fill of word `k` as `seed + k`, a dump of every word, and a fill a word at a dynamic index read back at once, which the runtime lane runs in passes of fewer imageblock bytes than the state's 32 (`runtime_lane::tile_kept_bytes`) | the words Metal's probes kept (below the pass's bytes rounded up to 8) and read as zero, compared by the lane test (no authored case) |
|
||||
| `rch_guarded_effects` | `rch_guarded_vertex`, `rch_guarded_store`, `rch_guarded_atomic`, `rch_guarded_loop`, `rch_guarded_write`, `rch_guarded_copy`, `rch_guarded_simd` | fragment functions that sample an 8x8 texture repeated over the target, discard where the sampled alpha is below 0.5, and then make side effects: a store, an atomic whose old value picks the slot of a later store, a store in a loop, a texture write, a copy of a pair of vectors, and a store of a simdgroup sum; a vertex function drawing a triangle from three corners | where the discard is predicated (a device without demote; MoltenVK on an Apple GPU, whose store-dropping defect defers it), each side effect runs under `if !discarded` and the atomic's result is zero for a discarded invocation; the simdgroup sum keeps the demote on MoltenVK (`PrecisionNote::DiscardDropsSimdgroupStores`) and is refused needing demote where no whole-quad exit can be placed (`tests::engine_fragment`); every side effect lands at the kept pixels alone (`runtime_lane::guarded_effects`) |
|
||||
| `rt6_render_state` | `rt6_full`, `rt6_flip`, `rt6_small`, `rt6_point`, `rt6_white`, `rt6_half` | the functions of a Metal probe on an M4 (macOS 27.0.1): Metal's fullscreen triangle at a depth `z + slope * x` from a buffer, the same triangle in the other winding, a small triangle (with a fourth vertex, a strip over a quad), one point of 4 pixels, and a white and a half-gray fragment | the texels Metal stored in that probe (no authored case) |
|
||||
| `rt6_resolves` | `rt6_resolve_full`, `rt6_resolve_half`, `rt6_resolve_white`, `rt6_resolve_samples`, `rt6_resolve_sample_values`, `rt6_resolve_masked` | the functions of a Metal probe on an M4 (macOS 27.0.1): Metal's fullscreen triangle at a depth `z` from a buffer, half the target (its diagonal pixels half covered), white, two fragments whose values follow `[[sample_id]]`, and white on the samples of a mask from a buffer | the texels Metal resolved in that probe (no authored case) |
|
||||
| `rdw_tile_kept` | `rdw_tile_kept_fill`, `rdw_tile_kept_dump`, `rdw_tile_kept_fill_dump` | tile functions over an explicit imageblock of one `uint4` a cell standing alone (after an `R32Uint` attachment, at byte 16): a fill of word `k` as `seed + k`, a dump of every word, and a fill a word at a dynamic index read back at once, run in passes of fewer imageblock bytes than the state's 32 | the words Metal's probes kept (below the pass's bytes rounded up to 8) and read as zero (no authored case) |
|
||||
| `rch_guarded_effects` | `rch_guarded_vertex`, `rch_guarded_store`, `rch_guarded_atomic`, `rch_guarded_loop`, `rch_guarded_write`, `rch_guarded_copy`, `rch_guarded_simd` | fragment functions that sample an 8x8 texture repeated over the target, discard where the sampled alpha is below 0.5, and then make side effects: a store, an atomic whose old value picks the slot of a later store, a store in a loop, a texture write, a copy of a pair of vectors, and a store of a simdgroup sum; a vertex function drawing a triangle from three corners | where the discard is predicated (a device without demote; MoltenVK on an Apple GPU, whose store-dropping defect defers it), each side effect runs under `if !discarded` and the atomic's result is zero for a discarded invocation; the simdgroup sum keeps the demote on MoltenVK (`PrecisionNote::DiscardDropsSimdgroupStores`) and is refused needing demote where no whole-quad exit can be placed (`tests::engine_fragment`); every side effect lands at the kept pixels alone |
|
||||
| `rch_helper_branch` | `rch_helper_branch`, `rch_helper_branch_late`, `rch_helper_branch_gradient`, `rch_helper_branch_unsampled`, `rch_helper_branch_loop` | fragment functions that read a coverage texture, round `half` values in a branch where the coverage is not 1 (where every covered pixel's coverage is 1, only the quad helpers past a primitive's edges take it) and write a buffer after it; they sample at LOD 0 before the branch, also at an implicit LOD after it at the pixel, at a coordinate the branch computes, not at all, or round in a loop as long as the coverage | on MoltenVK on an Apple GPU (`DriverWorkaround::DiscardDropsSimdgroupStores`) the branch's helper invocations take its empty arm where nothing they compute differently reaches a derivative (census `fragment.helper-guard`), and the gradient and loop functions record `PrecisionNote::HelperBranchDropsSimdgroupStores` (`tests::engine_fragment`); no other device changes them. Apple's compiler loses the live threads' texture writes of a simdgroup whose helpers alone call an `optnone` function there (measured on an M4) |
|
||||
| `rch_helper_tangle` | `rch_tangle_vertex`, `rch_tangle_sample_after`, `rch_tangle_dfdx_after`, `rch_tangle_quad_after`, `rch_tangle_lod_after`, `rch_tangle_quad_before`, `rch_tangle_sample_before`, `rch_tangle_unread`, `rch_tangle_merge_after`, `rch_tangle_loop_after` | fragment functions that read a coverage texture, sample at LOD 0, round to `half` where only the quad helpers past a primitive's edges run (a branch where the coverage is not 1, or a loop only they repeat) beside a tangled instruction, and write a texture after it: the tangled instruction reads the rounded value after the rounding (in the arm an implicit-LOD sample at it, `dfdx`, `quad_sum`, the LOD query; a sample after the branch's merge; a sample after the loop), comes first reading none of it (`quad_sum`, an implicit-LOD sample), or comes after reading none of it; a vertex function drawing a triangle from three corners | On MoltenVK on an Apple GPU (`DriverWorkaround::DiscardDropsSimdgroupStores`) nothing is guarded; the `after` functions record no `PrecisionNote::HelperBranchDropsSimdgroupStores` and the others record it (`tests::engine_fragment`); no covered pixel's write is lost where no note is recorded (`runtime_lane::helper_tangle`) |
|
||||
| `rch_helper_select` | `rch_select_vertex`, `rch_select_arm`, `rch_select_and`, `rch_select_sampled`, `rch_select_uniform` | fragment functions without fast math (every float operation `NoContraction`, which SPIRV-Cross writes through its `optnone` `spvFAdd`) that read a coverage texture, sample at LOD 0 and pick a sum where the coverage is not 1 (only the quad helpers past a primitive's edges do), with no branch: the compiler writes a select, which SPIRV-Cross writes as a `?:` whose arm holds the call; the sum as a component, its comparison on the right of a `&&`, a coordinate an implicit-LOD sample reads after it, or on a constant block's flag; each writes a texture after it; a vertex function drawing a triangle from three corners | On MoltenVK on an Apple GPU (`DriverWorkaround::DiscardDropsSimdgroupStores`) nothing is guarded; `rch_select_arm` and `rch_select_and` are fenced (census `fragment.helper-fence`), or record `PrecisionNote::HelperBranchDropsSimdgroupStores` without a fragment shuffle, and the others are left as they are (`tests::engine_fragment`); no covered pixel's write is lost where no note is recorded (`runtime_lane::helper_select`) |
|
||||
| `rch_helper_tangle` | `rch_tangle_vertex`, `rch_tangle_sample_after`, `rch_tangle_dfdx_after`, `rch_tangle_quad_after`, `rch_tangle_lod_after`, `rch_tangle_quad_before`, `rch_tangle_sample_before`, `rch_tangle_unread`, `rch_tangle_merge_after`, `rch_tangle_loop_after` | fragment functions that read a coverage texture, sample at LOD 0, round to `half` where only the quad helpers past a primitive's edges run (a branch where the coverage is not 1, or a loop only they repeat) beside a tangled instruction, and write a texture after it: the tangled instruction reads the rounded value after the rounding (in the arm an implicit-LOD sample at it, `dfdx`, `quad_sum`, the LOD query; a sample after the branch's merge; a sample after the loop), comes first reading none of it (`quad_sum`, an implicit-LOD sample), or comes after reading none of it; a vertex function drawing a triangle from three corners | On MoltenVK on an Apple GPU (`DriverWorkaround::DiscardDropsSimdgroupStores`) nothing is guarded; the `after` functions record no `PrecisionNote::HelperBranchDropsSimdgroupStores` and the others record it (`tests::engine_fragment`); no covered pixel's write is lost where no note is recorded |
|
||||
| `rch_helper_select` | `rch_select_vertex`, `rch_select_arm`, `rch_select_and`, `rch_select_sampled`, `rch_select_uniform` | fragment functions without fast math (every float operation `NoContraction`, which SPIRV-Cross writes through its `optnone` `spvFAdd`) that read a coverage texture, sample at LOD 0 and pick a sum where the coverage is not 1 (only the quad helpers past a primitive's edges do), with no branch: the compiler writes a select, which SPIRV-Cross writes as a `?:` whose arm holds the call; the sum as a component, its comparison on the right of a `&&`, a coordinate an implicit-LOD sample reads after it, or on a constant block's flag; each writes a texture after it; a vertex function drawing a triangle from three corners | On MoltenVK on an Apple GPU (`DriverWorkaround::DiscardDropsSimdgroupStores`) nothing is guarded; `rch_select_arm` and `rch_select_and` are fenced (census `fragment.helper-fence`), or record `PrecisionNote::HelperBranchDropsSimdgroupStores` without a fragment shuffle, and the others are left as they are (`tests::engine_fragment`); no covered pixel's write is lost where no note is recorded |
|
||||
| `rch_uniform_branch` | `rch_uniform_branch` | a fragment function that, where a constant block's flag says (a branch every invocation of a draw takes alike), divides a coordinate by a texture's size and takes the high word of a product (`mulhi`, an `OpUMulExtended`, which SPIRV-Cross writes through its `optnone` `spvMulExtended`), then samples the `half` texture through a runtime sampler at the coordinate and writes the sample and the product's lowest bit to a buffer. | On MoltenVK on an Apple GPU (`DriverWorkaround::DiscardDropsSimdgroupStores`): the module holds the product, and no `fragment.helper-guard` census and no `PrecisionNote::HelperBranchDropsSimdgroupStores`; L3 |
|
||||
| `sps2_residency_probes` | `sps2_residency_probes` | the residency word (`sparse_color::resident()`) and value of a texture's fetch, storage read, nearest and linear sample, and gather at authored coordinates (a probe buffer), on ordinary or sparse textures | `out[2i]` = probe `i`'s value bits, `out[2i + 1]` = `(resident, kind, i, 0x5A5)` |
|
||||
| `spse_level_probes` | `spse_level_probes` | the residency word and value of a 2D texture's fetch at a level, nearest and linear sample at a level, and gather, at authored coordinates (a probe buffer) | `out[2i]` = probe `i`'s value bits, `out[2i + 1]` = `(resident, kind, i, 0x5A5)` |
|
||||
@@ -248,9 +248,9 @@ threadgroup's threads); an authored case that executes a loop declares it
|
||||
| `denormal_texels` | `denormal_texels` | plain gathers and nearest samples (one at a texel offset, one of a 2D array's layer) of `r32Float` and `rgba32Float` textures through nearest clamp-to-edge and repeating constexpr samplers without a mip filter | Metal hands a denormal texel back as it is, where a device's gather or nearest sample may read it as zero (case `gathers-and-nearest-samples-of-denormal-32-bit-float-texels`) |
|
||||
| `unv_runtime_levels` | `unv_rlvl2d`, `unv_rpos2d` | samples of a mipmapped `texture2d<float>` at `level(x)` and `bias(x)` through the runtime sampler at slot 0 and through an argument buffer's sampler beside the same texels, at the centre; and nearest samples at `level(z)` at a coordinate `(u, v)` through the runtime sampler at slot 0; each lane reads its level, or its coordinate and level, from buffer 1 or 0 | the level and weight Metal reads for each `x` through each runtime sampler's mip filter and level clamp (Metal's level rule with the clamp held as `f32`s), and the texel Metal reads at the level it reads; no authored case (a case's texture has one level), the runtime lane's `runtime_levels` test checks it on each device |
|
||||
| `mlo_half_trig_inf`, `mlo_half_trig_inf_fast` | `mlo_half_trig_inf`, `mlo_half_trig_inf_fast` | `half` `sin`, `cos`, `tan` and `sincos` of one operand per thread, without fast math and under the default fast math | `0x7e00` for each function of `+inf` and `-inf`; of `+0` and `-0`, `cos` is `0x3c00` and `sin`, `tan` and `sincos`'s sine are `+0` (cases `half-sin-cos-tan-and-sincos-of-the-infinities-without-fast-math` and `...-under-fast-math`) |
|
||||
| `xr_planes` | `xr_planes_join`, `xr_planes_split` | a two-plane extended-range texture held as two textures, as a consumer holds `RGB10A8_2P_XR10`: plane 0 viewed `BGR10_XR` (or its sRGB twin) and the alpha plane `ARGB8Unorm`, joined into one `BGRA10_XR` texture and split back, `half` reads and writes | the lane `runtime_lane::extended_range_planes` compares every texel with Metal's bytes |
|
||||
| `xr_samples` | `xr_sample_runtime`, `xr_sample_runtime_half`, `xr_sample_constexpr`, `xr_sample_constexpr_half` | 2D linear samples of an extended-range texture through the runtime sampler at slot 0 and a constexpr linear clamp-to-edge sampler, `float` and `half` results; `xr_samples.tsv` holds Metal's 128 measured samples (measured on the M3 Max and an M4) | the lane `runtime_lane::extended_range_samples` compares each sample with Metal's bits; `tests::engine_extended_range::samples` reads the same file |
|
||||
| `xr_two_planes` | `xr2p_write_half`, `xr2p_write_float`, `xr2p_read_half`, `xr2p_read_float` | kernel writes and reads of a texture of Apple's two-plane extended-range format (`RGB10A8_2P_XR10` or its sRGB twin) as `texture2d<half>` and `texture2d<float>`, one thread per texel of a grid row `w` texels wide, under a consumer's 32 x 32 threadgroups; the same kernels read and write the consumer's two plane views over a buffer (`BGR10_XR` and `ARGB8Unorm`) | the lane `runtime_lane::extended_range_two_planes` compares each output with Metal's bytes |
|
||||
| `xr_planes` | `xr_planes_join`, `xr_planes_split` | a two-plane extended-range texture held as two textures, as a consumer holds `RGB10A8_2P_XR10`: plane 0 viewed `BGR10_XR` (or its sRGB twin) and the alpha plane `ARGB8Unorm`, joined into one `BGRA10_XR` texture and split back, `half` reads and writes | every texel is Metal's bytes |
|
||||
| `xr_samples` | `xr_sample_runtime`, `xr_sample_runtime_half`, `xr_sample_constexpr`, `xr_sample_constexpr_half` | 2D linear samples of an extended-range texture through the runtime sampler at slot 0 and a constexpr linear clamp-to-edge sampler, `float` and `half` results; `xr_samples.tsv` holds Metal's 128 measured samples (measured on the M3 Max and an M4) | each sample is Metal's bits; `tests::engine_extended_range::samples` reads the same file |
|
||||
| `xr_two_planes` | `xr2p_write_half`, `xr2p_write_float`, `xr2p_read_half`, `xr2p_read_float` | kernel writes and reads of a texture of Apple's two-plane extended-range format (`RGB10A8_2P_XR10` or its sRGB twin) as `texture2d<half>` and `texture2d<float>`, one thread per texel of a grid row `w` texels wide, under a consumer's 32 x 32 threadgroups; the same kernels read and write the consumer's two plane views over a buffer (`BGR10_XR` and `ARGB8Unorm`) | each output is Metal's bytes |
|
||||
| `linked_mps_callbacks` | `linked_mps_callbacks` | calls, in the calling convention of the MPS NDArray kernels' linked callbacks, the visible functions the public linked modules under `../linked/` define (`prefixSecondary_f`, `prefixTertiary_f`, `postfixPrimary_4xf`), through a thread-memory table of its four device buffers; a case links both modules by their `.ll` hashes, which no private store holds | element `4 tid` of buffer 3 = `(a, b, c, a + b + c + popcount(tid))` for `a`, `b`, `c` element `tid` of buffers 0, 1, 2 (engine device test `a_kernel_runs_with_the_public_linked_modules`); without linked functions `NeedsInput{LinkedFunction}` |
|
||||
| `dfl_float_denormals`, `dfl_float_denormals_fast` | `dfl_float_denormals`, `dfl_float_denormals_fast` | `float4` `+ - *`, `fma`, a contracted `a * b + c`, the six comparisons, `floor`, `ceil`, `sqrt`, `rsqrt`, `ldexp`, and operations whose operand is another's result, over every pair of a 32-value pool rich in denormals, without fast math and under the default fast math | Metal reads every `float` denormal operand of these as the zero of its sign and flushes every denormal result (cases `float-denormals-in-vector-arithmetic-comparisons-and-functions`, and `...-under-fast-math`) |
|
||||
| `dfl_half_edge`, `dfl_half_edge_fast` | `dfl_half_edge`, `dfl_half_edge_fast` | `float` to `half` conversions, `half` `+ - *`, `fma`, and a narrowed product at the edge of the `half` range (65504 to 65520 and above, both signs), at ties of the normal grid, and among the `half` denormals, without fast math and under the default fast math | Metal rounds to nearest even, every value from 65504 up to below 65520 to 65504 and from 65520 up to infinity (cases `float-to-half-rounding-at-the-half-range-edge-and-denormals`, and `...-under-fast-math`) |
|
||||
@@ -274,10 +274,10 @@ threadgroup's threads); an authored case that executes a loop declares it
|
||||
| `gsm2_simd_products` | `simd_float_products`, `simd_half_products`, `simd_int_products`, `simd_products_divergent`, `simd_rotate_up`, `simd_products_in_a_vertex_function`, `simd_rotate_up_in_a_vertex_function` | `simd_product`, `simd_prefix_inclusive_product` and `simd_prefix_exclusive_product` of `float`, `float2`, `half`, `half2`, `int`, `uint`, `ushort`, `uchar` and `short`, in divergent control flow too, and `simd_shuffle_rotate_up` by 3, by a buffer's 35, and by 31, in kernels and in vertex functions over rasterization-disabled points; the float inputs are 1, -1, 2, -2, 0.5 and -0.5, so every product of any association order is exact, and the integer inputs odd | Metal runs them in both stages and writes the same words on the M3 Max and the M4 over full simdgroups and over partial ones (the twelve `simd-*product*` and `simd-shuffle-rotate-up-*` cases; measured on the M3 Max and an M4); the exclusive product of the first active lane is 1; a vertex function needs subgroup operations in the vertex stage, or MoltenVK's measured vertex classes (`MetalVertexSimdgroups`) |
|
||||
| `gsm2_vertex_quad_permutes` | `quad_permutes_in_a_vertex_function`, `quad_pair_permutes_in_a_vertex_function`, `quad_permutes_in_branches_of_a_vertex_function` | `quad_broadcast` of each lane 0 to 3 and `quad_shuffle_xor` by masks 1, 2 and 3, by constants, of `float`, `float2`, `half`, `int`, `short` and `uchar`, in vertex functions over rasterization-disabled points: whole quads, lane pairs of a partial quad, and two branches whose quads read only their active lanes | Metal on the M4 draws the words of the cases `quad-broadcasts-and-shuffle-xors-by-constants-in-a-vertex-function-of-64-points`, `...-of-40-points`, `quad-broadcasts-and-shuffle-xors-within-lane-pairs-in-a-vertex-function-with-a-partial-quad` and `quad-broadcasts-and-shuffle-xors-by-constants-in-branches-of-a-vertex-function` (measured on an M4); the translation emits Vulkan's quad instructions where the vertex stage takes them and shuffles from the same lanes elsewhere (MoltenVK); a device needs subgroup operations in the vertex stage. Loop-free. |
|
||||
| `gsm2_vertex_votes_shifts` | `simd_votes_in_a_vertex_function`, `simd_shifts_in_a_vertex_function` | `simd_all` and `simd_any` of `x > 0` and of `x > 100`, and `simd_shuffle_up` by 3, `simd_shuffle_down` by 5 and `simd_shuffle_and_fill_up(x, -x, 2, 32)`, in vertex functions over rasterization-disabled points | Metal runs them there and draws the same words on the M3 Max and the M4 over 64 points and over 40, whose second simdgroup is the eight vertices 32 to 39 (cases `simd-all-and-any-in-a-vertex-function-of-64-points`, `simd-all-and-any-in-a-vertex-function-with-a-partial-simdgroup`, `simd-shuffle-up-down-and-fill-up-in-a-vertex-function-of-64-points`, `simd-shuffle-up-down-and-fill-up-in-a-vertex-function-with-a-partial-simdgroup`; measured on the M3 Max and an M4); a device needs subgroup operations in the vertex stage, or MoltenVK's measured vertex classes (`MetalVertexSimdgroups`) |
|
||||
| `dsx_coverage_chain` | `chain_rects`, `chain_spans`, `chain_span_edges`, `chain_edges`, `chain_coverage`, `chain_color_discarding`, `chain_color`, `chain_gradient`, `chain_gradient_lod0`, `chain_gradient_hoisted` | the consumer's icon notch: a coverage chain through an `RG16Float` attachment, as a path renderer builds one: instanced rectangles or span quads (one per vertical edge of a disc's outline) add weights under additive blending, a fetch under early tests leaves the coverage, and a colour pass reads it by framebuffer fetch and discards where it is 0; or a gradient's fill reads the colour and the coverage, discards, samples a 32x32 noise texture (between its discards, at LOD 0, or before them), discards again, and writes the colour or mixes it over the fetched one. Dyadic values a `half` holds exactly. Loop-free | `runtime_lane::framebuffer_fetch::coverage_chain` draws Metal's answer in each cell's shape and the clear elsewhere, on every device; plain Metal draws it on the M4 (every case) and the M3 Max (the cases without a gradient). Through MoltenVK on an M4 without a workaround the gradient's fills lose whole 8x4 blocks: a demoting discard, a sample from an argument buffer and an optnone call (SPIRV-Cross's `NoContraction` add) in a branch only discarded lanes take drop the SIMD group's later texture writes, a defect of Metal's own that plain Metal reproduces |
|
||||
| `dsx_fetch_returned_depth` | `fetch_returned_depth` | a fragment function without early tests that reads its color attachment, writes back half of it plus a quarter, and returns the depth its buffer holds (`[[depth(any)]]`) | beside a depth attachment it stores before the tests (`TestedStorageWrites` without an early-tests variant); a draw whose depth test can drop a fragment runs the variant that tests the returned depth in the shader (`tests::engine_fragment`, at one sample and at four); `runtime_lane::framebuffer_fetch::returned_depth` draws Metal's answer for returned depths in both clip modes, NaNs and signed zeros included |
|
||||
| `dsx_fetch_returned_stencil` | `fetch_returned_stencil`, `fetch_returned_mask`, `fetch_returned_stencil_mask` | fragment functions without early tests that read their color attachment, write back half of it plus a quarter, and return the stencil reference (`[[stencil]]`), the sample mask (`[[sample_mask]]`), or both, that their buffer holds | beside a depth and stencil attachment each stores before the tests (`TestedStorageWrites` without an early-tests variant); a draw whose tests can drop a fragment runs the variant that tests in the shader with what the function returns (`runtime_lane::framebuffer_fetch::returned_stencil`) |
|
||||
| `dsx_int_attributes` | `int_attribute_to_float4`, `int_attribute_to_half4`, `label_vertex`, `label_fragment` | the consumer's text label pipeline: unnormalized 8- and 16-bit integer vertex formats read into `float4` and `half4` attributes by rasterization-disabled points that write what they fetched; and a label pipeline's shape: eight attributes (a `ushort2` read as `float2` normalized and not, two `uchar4` colors read as `half4`), nine varyings of mixed interpolation (center perspective, center no-perspective, centroid perspective) beside the position, and a fragment that samples a texture and checks each varying against its buffer's values. Loop-free | each component reads as its integer value, a `half` rounded to nearest even with 65520 and above infinite, fixed function in the format's `USCALED`/`SSCALED` form or pulled and converted (`runtime_lane::int_attributes`, Metal's answer measured on an M4); a 32-bit integer format into a float attribute is `InvalidDescriptor(VertexAttribute)`, as Metal refuses it; the label pipeline draws `(255, 0, 255, 255)` in every pixel |
|
||||
| `dsx_coverage_chain` | `chain_rects`, `chain_spans`, `chain_span_edges`, `chain_edges`, `chain_coverage`, `chain_color_discarding`, `chain_color`, `chain_gradient`, `chain_gradient_lod0`, `chain_gradient_hoisted` | the consumer's icon notch: a coverage chain through an `RG16Float` attachment, as a path renderer builds one: instanced rectangles or span quads (one per vertical edge of a disc's outline) add weights under additive blending, a fetch under early tests leaves the coverage, and a colour pass reads it by framebuffer fetch and discards where it is 0; or a gradient's fill reads the colour and the coverage, discards, samples a 32x32 noise texture (between its discards, at LOD 0, or before them), discards again, and writes the colour or mixes it over the fetched one. Dyadic values a `half` holds exactly. Loop-free | Metal's answer in each cell's shape and the clear elsewhere; plain Metal draws it on the M4 (every case) and the M3 Max (the cases without a gradient). Through MoltenVK on an M4 without a workaround the gradient's fills lose whole 8x4 blocks: a demoting discard, a sample from an argument buffer and an optnone call (SPIRV-Cross's `NoContraction` add) in a branch only discarded lanes take drop the SIMD group's later texture writes, a defect of Metal's own that plain Metal reproduces |
|
||||
| `dsx_fetch_returned_depth` | `fetch_returned_depth` | a fragment function without early tests that reads its color attachment, writes back half of it plus a quarter, and returns the depth its buffer holds (`[[depth(any)]]`) | beside a depth attachment it stores before the tests (`TestedStorageWrites` without an early-tests variant); a draw whose depth test can drop a fragment runs the variant that tests the returned depth in the shader (`tests::engine_fragment`, at one sample and at four) |
|
||||
| `dsx_fetch_returned_stencil` | `fetch_returned_stencil`, `fetch_returned_mask`, `fetch_returned_stencil_mask` | fragment functions without early tests that read their color attachment, write back half of it plus a quarter, and return the stencil reference (`[[stencil]]`), the sample mask (`[[sample_mask]]`), or both, that their buffer holds | beside a depth and stencil attachment each stores before the tests (`TestedStorageWrites` without an early-tests variant); a draw whose tests can drop a fragment runs the variant that tests in the shader with what the function returns |
|
||||
| `dsx_int_attributes` | `int_attribute_to_float4`, `int_attribute_to_half4`, `label_vertex`, `label_fragment` | the consumer's text label pipeline: unnormalized 8- and 16-bit integer vertex formats read into `float4` and `half4` attributes by rasterization-disabled points that write what they fetched; and a label pipeline's shape: eight attributes (a `ushort2` read as `float2` normalized and not, two `uchar4` colors read as `half4`), nine varyings of mixed interpolation (center perspective, center no-perspective, centroid perspective) beside the position, and a fragment that samples a texture and checks each varying against its buffer's values. Loop-free | each component reads as its integer value, a `half` rounded to nearest even with 65520 and above infinite, fixed function in the format's `USCALED`/`SSCALED` form or pulled and converted (Metal's answer measured on an M4); a 32-bit integer format into a float attribute is `InvalidDescriptor(VertexAttribute)`, as Metal refuses it; the label pipeline draws `(255, 0, 255, 255)` in every pixel |
|
||||
| `dsx_lane_reads` | `simd_shuffles_by_index_and_xor`, `simd_shuffles_up_and_down`, `simd_and_quad_rotations`, `simd_broadcasts`, `simd_fills`, `quad_moves`, `lane_moves_in_a_branch_of_a_kernel` | one family of simdgroup or quad lane move per vertex entry, over 38 rasterization-disabled points (the second simdgroup's lanes 6 to 31 past the draw, its second quad half live) and, for its last moves, in a branch only the even vertices take; and all eighteen moves in a branch the even lanes of a kernel take, the value loaded before it. No move in a branch repeats one made before it, which Metal's compiler would merge | every word a move takes from a lane that does not take part is zero (cases `simd-shuffles-by-index-and-xor-past-the-draw-and-in-a-branch-of-a-vertex-function`, `simd-shuffles-up-and-down-...`, `simd-and-quad-rotations-...`, `simd-broadcasts-...`, `simd-fills-...`, `quad-moves-past-the-draw-and-in-a-branch-of-a-vertex-function` and `simdgroup-and-quad-moves-in-a-branch-of-the-even-lanes-of-a-kernel`; measured on the M3 Max and an M4); a device needs subgroup operations in the vertex stage, or MoltenVK's measured vertex classes |
|
||||
| `fpc_chosen_pointers` | `fpc_select`, `fpc_phi`, `fpc_loop`, `fpc_private_array`, `fpc_compare`, `fpc_threadgroup`, `fpc_int_back`, `fpc_table_mix`, `fpc_table_store`, `fpc_recurse`, `fpc_own_select`, `fpc_own_private_array`, `fpc_own_compare`, `fpc_wide` | calls through function pointers chosen at run time among `fpc_pointer_functions`' visible functions, which the pipeline links (a select, a phi, a loop, a private array, comparisons, a threadgroup array, a 64-bit integer in device memory read back by the neighbouring thread, a table's entry merged with and stored beside an address, recursion through a chosen pointer), and among the module's own functions (`fpc_own_*`); `fpc_wide`, a 64-bit bit count, declares a 64-bit type ahead of the lifetime markers so the decoded printout is the same under LLVM 21 and 22; 40 threads in one threadgroup; `fpc_loop` runs four times and `fpc_recurse` to the depth buffer 2 holds | `out[tid]` the called functions' results, as Metal answers them (measured on the M3 Max and an M4; CPU interpreter, `crates/metal2vulkan/src/tests/engine_chosen_pointers.rs`; the runtime lane, `chosen_pointers.rs`); without the linked functions `NeedsInput{LinkedFunction}`, as Metal refuses the pipeline |
|
||||
| `fpc_frames` | `frames_wide`, `frames_live8`, `frames_live32`, `frames_nest44`, `frames_nest88`, `frames_nestv`, `frames_w8`, `frames_w16`, `frames_w32`, `frames_w64`, `frames_pair`, `frames_quad`, `frames_s`, `frames_t`, `frames_u` | recursive visible functions (`fr_*`, which the pipeline links) whose frames Metal sizes differently: 8 and 32 words live across the call, arrays `[4][4]`, `[8][8]` and `[3][2]` of `uint4`, one-dimensional arrays of 8, 16, 32 and 64 words, and pairs of unequal frames entered at the small one, the big one, or either by the mode word buffer 3 holds; each kernel calls its function at the depth buffer 2 holds; `frames_wide`, a 64-bit bit count, declares a 64-bit type ahead of the lifetime markers so the decoded printout is the same under LLVM 21 and 22 | `out[tid]` the recursion's result; Metal's largest accepted `maxCallStackDepth` and first wrong depth at `k` 1 to 16 per kernel (measured on an M4; CPU interpreter, `crates/metal2vulkan/src/tests/engine_fpc_frames.rs`); without the linked functions `NeedsInput{LinkedFunction}`, as Metal refuses the pipeline |
|
||||
@@ -285,8 +285,8 @@ threadgroup's threads); an authored case that executes a loop declares it
|
||||
| `tib_clamped_lod_mixed_filters` | `tib_clamped_lod_mixed_filters` | `calculate_clamped_lod` in a fragment function through constexpr samplers whose min and mag filters differ (min linear and mag nearest under a linear mip filter, clamp `lod_clamp(1.3, 2.7)`; min nearest and mag linear under a nearest one, `lod_clamp(2.505, 16)`), beside one whose filters agree, and `calculate_unclamped_lod`; a five-level 16x16 texture at levels -2, 2, 4 and 6 by bands of four rows | per band, `(83/64, 2, 83/64, -2)`, `(2, 2, 2, 2)`, `(172/64, 4, 172/64, 4)` and `(172/64, 4, 172/64, 6)`: each clamp on Metal's grid whatever the filters (measured on the M3 Max and an M4) |
|
||||
| `tib_imageblock_slices` | `tib_slot_half_slice`, `tib_argument_half_slice`, `tib_slot_short2_slice` | a 4x4 explicit kernel imageblock written through a slice narrower than the texture's format: a 1-lane `half` slice to the texture at slot 0, the same to the texture an argument buffer names (its format unknown when the function compiles), and a 2-lane `short2` slice to an integer texture | the slice's lanes, then zeros, in every format: `(v, 0, 0, 0)` in an RGBA16Float texel, `(v, 0)` in an RG16Float one, `(a, b, 0, 0)` in an RGBA16Sint one (measured on the M3 Max and an M4) |
|
||||
| `seq_programs` | `seq_copy`, `seq_mix`, `seq_rect`, `seq_color`, `seq_texel_read`, `seq_texel_write` | the functions of the parity harness's seeded differential sequences (`parity::sequences`): a word copied, a word mixed in place with another, and an instanced draw of whole-pixel rectangles from a buffer in colours from another, over an 8x8 target; texels of an 8-bit unorm texture read into words and written from them, a grid thread a texel | the bytes of every resource a sequence ends with, compared with Metal's records and the sequences' CPU model (no authored case) |
|
||||
| `zws_compositor` | `zws_box`, `zws_over`, `zws_plain` | a compositor's rounded, half-transparent boxes over a surface's prior contents: `zws_box` places a box given in pixels, `zws_over` blends `color + dst * keep` by programmable blending, `zws_plain` returns the color for the fixed-function blend; both discard outside the box's rounded corners (half-integers squared, exact) | `runtime_lane::window_surfaces`: a 1920x1080 `BGRA8Unorm` texture over a buffer holds the scene's exact bytes after each command buffer (every blend lands on an integer: even codes halved plus a multiple of 16) |
|
||||
| `px_edges` | `pe_nearest_*`, `pe_linear_*`, `pe_gather_*`, `pe_slot_sample`, `pe_slot_sample_offset`, `pe_slot_gather`, `pe_argument_sample`, `pe_argument_sample_offset`, `pe_argument_gather`, `pe_linear_zero_1d`, `pe_nearest_white_array`, `pe_linear_zero_array` | pixel-coordinate samples and gathers of a `texture2d<float>` (a 1D texture and a 2D array's layer 1 apart) at the coordinate each thread is given: constexpr `coord::pixel` samplers of each filter, clamping to the edge, to zero and to each border colour, without an offset, with a constant one and with a dynamic one; the runtime sampler at slot 0; an argument buffer's sampler beside its texture | the lane `runtime_lane::pixel_edges` holds every nearest access to Metal's texel at texel edges and centres of sizes that are not powers of two, and the constexpr samples' and gathers' results to Metal's on a device that samples through Metal's own sampler |
|
||||
| `zws_compositor` | `zws_box`, `zws_over`, `zws_plain` | a compositor's rounded, half-transparent boxes over a surface's prior contents: `zws_box` places a box given in pixels, `zws_over` blends `color + dst * keep` by programmable blending, `zws_plain` returns the color for the fixed-function blend; both discard outside the box's rounded corners (half-integers squared, exact) | a 1920x1080 `BGRA8Unorm` texture over a buffer holds the scene's exact bytes after each command buffer (every blend lands on an integer: even codes halved plus a multiple of 16) |
|
||||
| `px_edges` | `pe_nearest_*`, `pe_linear_*`, `pe_gather_*`, `pe_slot_sample`, `pe_slot_sample_offset`, `pe_slot_gather`, `pe_argument_sample`, `pe_argument_sample_offset`, `pe_argument_gather`, `pe_linear_zero_1d`, `pe_nearest_white_array`, `pe_linear_zero_array` | pixel-coordinate samples and gathers of a `texture2d<float>` (a 1D texture and a 2D array's layer 1 apart) at the coordinate each thread is given: constexpr `coord::pixel` samplers of each filter, clamping to the edge, to zero and to each border colour, without an offset, with a constant one and with a dynamic one; the runtime sampler at slot 0; an argument buffer's sampler beside its texture | every nearest access is Metal's texel at texel edges and centres of sizes that are not powers of two, and the constexpr samples' and gathers' results are Metal's on a device that samples through Metal's own sampler |
|
||||
| `fold_config_struct` | `cfg_vert`, `cfg_frag` | a fragment uber shader whose ten function constants (two layers' present flags, texture-function selectors and `uchar4` colour opcodes; a fetch flag, blend and destination selectors, a layer count) fill a program-scope `constant` struct through its static initializer, read from the struct; one read takes an index known only at run time | specialized (`tests::engine_specialized_folds`), the fragment stage is within an eighth of `fold_config_direct`'s words, with the same precision notes: SCCP reads the struct's integer fields as their constants |
|
||||
| `fold_config_direct` | `cfg_vert`, `cfg_frag` | `fold_config_struct` reading its configuration from the function constants directly (`DIRECT`) | the size `fold_config_struct` folds to |
|
||||
| `fold_loop_extract` | `uber_vert`, `uber_frag` | a fragment uber shader with feature booleans, `uint` selectors and a `uint4` of colour opcodes that a 4x4 loop of constant trip counts feeds to a 16-case switch, indexing the `uint4` by the outer counter | specialized (`tests::engine_specialized_folds`), the fragment stage is within an eighth of `fold_loop_extract_baked`'s words, with the same precision notes: the loops are unrolled and each copy's switch folds |
|
||||
|
||||
@@ -1283,8 +1283,8 @@ pub enum DriverWorkaround {
|
||||
/// GFX11): ACO compiled the product's `OpFMul` and the narrowing as one `v_fma_mixlo_f16` (a
|
||||
/// sum's narrowing too), and the product of 2.6822087e-7 and 1.0000001 answered `0x0005` where
|
||||
/// Metal's `half` of the `float` product is `0x0004`; the Radeon RX 7900 XTX (RADV NAVI31,
|
||||
/// GFX11) answered as the 780M did, 4,542 of the 253,958 product lanes off Metal's on each
|
||||
/// (`runtime_lane::half_conversions`). On the Radeon RX 550 (RADV POLARIS12, GFX8) the
|
||||
/// GFX11) answered as the 780M did, 4,542 of the 253,958 product lanes off Metal's on each.
|
||||
/// On the Radeon RX 550 (RADV POLARIS12, GFX8) the
|
||||
/// narrowing alone answers its own way (8,185 of the 253,958 lanes of a loaded `float`), every
|
||||
/// narrowing there records `PrecisionNote::NativeHalfConversion` already, and no fusion is told
|
||||
/// apart. A fact of RADV's compiler, keyed on RADV (`VK_DRIVER_ID_MESA_RADV`) on every GPU;
|
||||
@@ -1318,21 +1318,20 @@ pub enum DriverWorkaround {
|
||||
/// then masks the coverage with `1 << gl_SampleID`.
|
||||
MemoryWritingFragmentsRunPerSample,
|
||||
/// The driver's `InterpolateAtSample` and `InterpolateAtOffset` of a perspective input are its
|
||||
/// value at the pixel center extrapolated along the quad's coarse derivatives,
|
||||
/// `f(center) + (f(tr) - f(tl)) * dx + (f(bl) - f(tl)) * dy` (`tl`, `tr`, `bl` the centers of
|
||||
/// the quad's top-left, top-right and bottom-left pixels, `(dx, dy)` the read's distance from
|
||||
/// the pixel center), not the perspective interpolation at that location: a first-order
|
||||
/// answer, off by the input's curvature across the distance. A no-perspective input is linear
|
||||
/// in the framebuffer, so its extrapolation is exact. Measured on RADV
|
||||
/// (`VK_DRIVER_ID_MESA_RADV`), Mesa 26.2.6, on the Radeon 780M: of
|
||||
/// `runtime_lane::pull_model_interpolation`'s values (a triangle of clip `w` 1, 2 and 4 over a
|
||||
/// 6x6 target), the 52 offset reads and 1061 sample reads off Metal's were that form's, within
|
||||
/// 0.005, and up to about 1.0 from Metal's in a lane whose vertices hand 3, -2 and 0.5;
|
||||
/// the same reads of the no-perspective inputs were Metal's within the device's interpolation.
|
||||
/// value at the pixel center extrapolated along the quad's coarse derivatives, `f(center) +
|
||||
/// (f(tr) - f(tl)) * dx + (f(bl) - f(tl)) * dy` (`tl`, `tr`, `bl` the centers of the quad's
|
||||
/// top-left, top-right and bottom-left pixels, `(dx, dy)` the read's distance from the pixel
|
||||
/// center), not the perspective interpolation at that location: a first-order answer, off by
|
||||
/// the input's curvature across the distance. A no-perspective input is linear in the
|
||||
/// framebuffer, so its extrapolation is exact. Measured on RADV (`VK_DRIVER_ID_MESA_RADV`),
|
||||
/// Mesa 26.2.6, on the Radeon 780M: of the values of a triangle of clip `w` 1, 2 and 4 over a
|
||||
/// 6x6 target, the 52 offset reads and 1061 sample reads off Metal's were that form's, within
|
||||
/// 0.005, and up to about 1.0 from Metal's in a lane whose vertices hand 3, -2 and 0.5; the
|
||||
/// same reads of the no-perspective inputs were Metal's within the device's interpolation.
|
||||
/// Vulkan states no precision for interpolation, so the answer is the device's own (no form
|
||||
/// interpolates otherwise): a fragment function that reads a perspective input at a sample or
|
||||
/// an offset there records `PrecisionNote::ExtrapolatedInterpolation` (`lower::stage_io::plan`).
|
||||
/// It is keyed on the driver's release (`device::driver_facts`).
|
||||
/// an offset there records `PrecisionNote::ExtrapolatedInterpolation`
|
||||
/// (`lower::stage_io::plan`). It is keyed on the driver's release (`device::driver_facts`).
|
||||
PerspectiveReadsExtrapolated,
|
||||
/// The driver reads a mesh shader's store into one component of a vector output (an
|
||||
/// `OpAccessChain` to a component of `PrimitiveLineIndicesEXT` or
|
||||
@@ -1413,10 +1412,9 @@ pub enum DriverWorkaround {
|
||||
/// it reads them as Metal does in an entry that declares no float-controls mode, the scope
|
||||
/// `DriverDeviation::MetalFloatDenormals` was measured in (its probes compute no `half`).
|
||||
/// Vulkan leaves the 32-bit denormals of such an entry to the implementation, so this is the
|
||||
/// device's answer, not a defect. Measured by the gate lane
|
||||
/// `runtime_lane::driver_deviations::fused_pairs_answer_metals_nans_and_denormals` (the owned
|
||||
/// fixtures `fmx_fma_precise` and `fmx_fma_fast`, which compute `half` in 16 bits beside
|
||||
/// `float` `fma(a, b, c)`, `a * b + c` and `a * w`) on NVIDIA's
|
||||
/// device's answer, not a defect. Measured with the owned fixtures `fmx_fma_precise` and
|
||||
/// `fmx_fma_fast` (which compute `half` in 16 bits beside `float` `fma(a, b, c)`, `a * b + c`
|
||||
/// and `a * w`) on NVIDIA's
|
||||
/// (`VK_DRIVER_ID_NVIDIA_PROPRIETARY`) 615.71.09 on the RTX 5080 Laptop GPU and 620.70.06 on
|
||||
/// the RTX 3090 (2026-11-14, at 400efe7932): in each fixture 33 of 4,096 words keep a
|
||||
/// denormal where Metal answers zero, the lone product's alike (`1e-20 * 1e-20` answers
|
||||
|
||||
@@ -1109,7 +1109,7 @@ pub enum PrecisionNote {
|
||||
/// step's `float`, announced by the runtime at a draw or dispatch that binds such a texture
|
||||
/// there. Measured on MoltenVK 1.4.2 over the Apple M3 Max (macOS 27.0.1): toward zero, within
|
||||
/// one `half` ulp of Metal's (8,409 channels of the `_sRGB` twins over six surfaces and three
|
||||
/// matrices, `runtime_lane::ycbcr_textures`); unmeasured on other Apple GPUs.
|
||||
/// matrices); unmeasured on other Apple GPUs.
|
||||
HalfTexelConversion,
|
||||
/// The module samples a texture with a `half` result through a filter (linear minification
|
||||
/// or magnification, a linear mip filter, anisotropy, or a runtime sampler) that Metal's own
|
||||
@@ -1155,8 +1155,8 @@ pub enum PrecisionNote {
|
||||
/// and at the pipeline for a `float` input attachment whose color attachment is an sRGB format
|
||||
/// (`StageIo::decoded_fetches`). On a device that samples through Metal's own texture unit
|
||||
/// (`VkProperty::MetalSampler`: MoltenVK on Apple's GPU) the device's decode is Metal's, and
|
||||
/// the module requires the property instead. Measured over every code of `RGBA8Unorm_sRGB`
|
||||
/// (`runtime_lane::srgb_decode`): MoltenVK on an Apple M3 Max decodes each as Metal does, bit
|
||||
/// the module requires the property instead. Measured over every code of `RGBA8Unorm_sRGB`:
|
||||
/// MoltenVK on an Apple M3 Max decodes each as Metal does, bit
|
||||
/// for bit; lavapipe (LLVM 21.1.8, arm64) each color code within 5.25 table steps (0.00128, a
|
||||
/// third of a code's `1/255`) of Metal's value, alpha within one `f32` ulp; other devices are
|
||||
/// not measured.
|
||||
@@ -1165,17 +1165,16 @@ pub enum PrecisionNote {
|
||||
/// UNORM twin (`metal::texel_format::srgb_twin_on`: `R8Unorm_sRGB` and `RG8Unorm_sRGB` on
|
||||
/// lavapipe, `RG8Unorm_sRGB` on ANV and NVIDIA among the committed profiles), the slot's
|
||||
/// `SrgbTexture` variant decodes what the twin's view reads by the MSL transfer through the
|
||||
/// device's division and `Pow` (`pack::srgb_decode_texel`): a read, a sample, a fetch, a
|
||||
/// gather and a bicubic tap one texel's codes, a filtered sample (a linear filter, a linear
|
||||
/// mip filter, anisotropy, or a runtime sampler) the device's filter of the codes, the decode
|
||||
/// of the codes' blend where Metal blends the decoded texels. So does a read of an 8-bit sRGB
|
||||
/// storage texture held through its UNORM alias (`StorageImageClass::SrgbEncode`, Vulkan
|
||||
/// having no sRGB storage view), at a slot or held by an argument buffer
|
||||
/// (`lower::texture::heap_storage_conversions`). Both are recorded outright, on every device: Metal's table
|
||||
/// rounds the transfer to a twelve-bit step, up to half a step (`1 / 8190`) from it, where
|
||||
/// MoltenVK's `Pow` read within `1.83e-7` of the transfer through the alias
|
||||
/// (`runtime_lane::srgb_storage`). Validation derives no tolerance from it: the class is
|
||||
/// unbounded.
|
||||
/// device's division and `Pow` (`pack::srgb_decode_texel`): a read, a sample, a fetch, a gather
|
||||
/// and a bicubic tap one texel's codes, a filtered sample (a linear filter, a linear mip
|
||||
/// filter, anisotropy, or a runtime sampler) the device's filter of the codes, the decode of
|
||||
/// the codes' blend where Metal blends the decoded texels. So does a read of an 8-bit sRGB
|
||||
/// storage texture held through its UNORM alias (`StorageImageClass::SrgbEncode`, Vulkan having
|
||||
/// no sRGB storage view), at a slot or held by an argument buffer
|
||||
/// (`lower::texture::heap_storage_conversions`). Both are recorded outright, on every device:
|
||||
/// Metal's table rounds the transfer to a twelve-bit step, up to half a step (`1 / 8190`) from
|
||||
/// it, where MoltenVK's `Pow` read within `1.83e-7` of the transfer through the alias.
|
||||
/// Validation derives no tolerance from it: the class is unbounded.
|
||||
SrgbTexelDecode,
|
||||
/// The module samples a texture with a `float` result through a filter that Metal's own
|
||||
/// sampler (`VkProperty::MetalSampler`, MoltenVK) answers otherwise than Metal filters the
|
||||
@@ -1198,13 +1197,11 @@ pub enum PrecisionNote {
|
||||
/// whose Function storage was not measured, up to the 192 KiB a thread Metal was measured to
|
||||
/// hold (`device::function_storage`). A driver backs that storage with scratch memory, and
|
||||
/// Vulkan states no amount it holds: past what it holds a driver can answer wrongly or hang the
|
||||
/// GPU with no error. Probed, the RTX 5080 Laptop GPU hung at 48 KiB and the RTX 3090 at
|
||||
/// 192 KiB (Xid 109), and the Iris Xe answered wrongly at 48 KiB and the Radeon 780M at
|
||||
/// 128 KiB. The module runs on this device all the same, resting on no measurement; a kernel,
|
||||
/// an object or a mesh function past the floor there is refused instead. Measuring the device
|
||||
/// (`runtime_lane::private_memory`) and adding its row removes the note up to its value.
|
||||
/// Validation keeps a difference as a mismatch: the class is derived as if the note were
|
||||
/// absent.
|
||||
/// GPU with no error. Probed, the RTX 5080 Laptop GPU hung at 48 KiB and the RTX 3090 at 192
|
||||
/// KiB (Xid 109), and the Iris Xe answered wrongly at 48 KiB and the Radeon 780M at 128 KiB.
|
||||
/// The module runs on this device all the same, resting on no measurement; a kernel, an object
|
||||
/// or a mesh function past the floor there is refused instead. Validation keeps a difference as
|
||||
/// a mismatch: the class is derived as if the note were absent.
|
||||
FunctionStorageAssumed,
|
||||
/// A fragment function runs a non-quad simdgroup operation (a reduction, scan, ballot,
|
||||
/// broadcast, shuffle, vote, or simdgroup matrix) before a discard on a path to it, in a
|
||||
@@ -1412,8 +1409,8 @@ pub enum PrecisionNote {
|
||||
/// one quad's pixels alone, so a reduction ahead of a `discard_fragment` counts no quad the
|
||||
/// discard drops, where an Apple GPU's 32-lane simdgroup counts the dropped quads of its 8x4
|
||||
/// pixel block. Measured on arm64 lavapipe, whose fragment stage states one subgroup size,
|
||||
/// 4 (`[minSubgroupSize, maxSubgroupSize]` is `[4, 4]`): the thirteen shapes of
|
||||
/// `runtime_lane::discard_hoist` all answer the survivors, where Metal's answer counts the
|
||||
/// 4 (`[minSubgroupSize, maxSubgroupSize]` is `[4, 4]`): thirteen discard shapes all answer the
|
||||
/// survivors, where Metal's answer counts the
|
||||
/// dropped quads in four of them. No required subgroup size reaches 32 lanes there, and
|
||||
/// nothing in Vulkan relates the invocations of two fragment subgroups, so no exact form
|
||||
/// exists on such a device.
|
||||
@@ -1524,7 +1521,7 @@ pub enum PrecisionNote {
|
||||
/// codes of an 8-bit or extended-range format. MoltenVK 1.4.2 on the M3 Max (macOS 27.0.1),
|
||||
/// which receives the 16-bit `half`, stores the value of Metal's measured rule in every channel
|
||||
/// of every measured blend draw of the sweep into `R16Float`, `RG16Float` and `RGBA16Float`
|
||||
/// (28 of 28 each, `runtime_lane::half_output_blends`), and into `R32Float`, `RG32Float` and
|
||||
/// (28 of 28 each), and into `R32Float`, `RG32Float` and
|
||||
/// `RGBA32Float` 28, 28 and 26 of 28, the two off at one channel by a zero's sign.
|
||||
///
|
||||
/// Also: a `float` color output (a scalar or vector of AIR's `float`) of a module compiled
|
||||
@@ -1644,7 +1641,7 @@ pub enum PrecisionNote {
|
||||
/// direction moved and projected onto the face again by the device, and a tap past the
|
||||
/// face's edge reads the next face as the device projects it, where Metal's is not measured.
|
||||
///
|
||||
/// Measured by `runtime_lane::anisotropic_filter` against the M4's answers on `rgba8Unorm`
|
||||
/// Measured against the M4's answers on `rgba8Unorm`
|
||||
/// at `maxAnisotropy` 2 to 16, with Metal's logarithm and blend (the device's are not yet
|
||||
/// measured there). With a linear filter, every channel is within a code: at most
|
||||
/// 0.53 (mean up to 0.071) on lavapipe, 0.41 (0.027) on ANV (Iris Xe), 0.91 (0.043) on RADV
|
||||
@@ -1982,7 +1979,7 @@ pub enum PrecisionNote {
|
||||
/// same driver rounds a computed sum (8192 of 8192 sums Metal's) but drops the pair of a
|
||||
/// `half` color output converted from `float` that it stores unblended into a 32-bit float
|
||||
/// attachment: the `float` itself, whose `half` is what it stores into a 16-bit float one
|
||||
/// (`runtime_lane::half_output_blends`, `R32Float`, `RG32Float` and `RGBA32Float`);
|
||||
/// (`R32Float`, `RG32Float` and `RGBA32Float`);
|
||||
/// - on a device that rounds toward zero, a finite value from 65520 up is 65504 where
|
||||
/// Metal's is infinity;
|
||||
/// - a result below the smallest normal `half` (`2^-14`) may be the zero of its sign on a
|
||||
@@ -2259,7 +2256,7 @@ pub enum PrecisionNote {
|
||||
/// which only MoltenVK on Apple's GPUs of the Apple M3 Max's macOS 27 identity takes: there
|
||||
/// Metal covers). The device converts the
|
||||
/// alpha to its coverage mask by its own algorithm. Metal's, measured over 639 alphas a sample
|
||||
/// count on an Apple M3 Max under macOS 27.0.1 (`runtime_lane::alpha_coverage`), covers a pixel
|
||||
/// count on an Apple M3 Max under macOS 27.0.1, covers a pixel
|
||||
/// at one sample where its alpha is above 1/2, and at two and four samples
|
||||
/// `ceil(alpha * n - t)` of its `n` samples, `t` a 2x2 ordered dither of the pixel's window
|
||||
/// coordinates (1/8 and 5/8 at even and odd `x` of an even row, 7/8 and 3/8 of an odd one),
|
||||
|
||||
@@ -4406,8 +4406,7 @@ fn float_min_max_are_the_device_s_on_every_profile() {
|
||||
assert!(!a.precision.contains(¬e), "{what}: {:?}", a.precision);
|
||||
}
|
||||
// The interpreter reads a denormal operand of `NMin` by its value; Metal's reading, a
|
||||
// zero, is the device's, measured by the driver facts and the gate lane
|
||||
// (`runtime_lane::driver_deviations`).
|
||||
// zero, is the device's, measured by the driver facts.
|
||||
if kk.name.contains("denormal") {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
//
|
||||
// At exit it appends its totals, the objects' origins and sizes, and the execbuffers per thread to
|
||||
// M2V_I915_SHIM_OUT (stderr without it); "execbuffers" counts amdgpu's command submissions too. A
|
||||
// program reads the totals so far through the exported m2v_i915_shim_counts (the validation lanes
|
||||
// runtime_lane::submit_costs and runtime_lane::commit_latency do).
|
||||
// program reads the totals so far through the exported m2v_i915_shim_counts.
|
||||
#define _GNU_SOURCE
|
||||
#include <dlfcn.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
Reference in new issue
Block a user