`Cells` had a field and a method both named `later`, so an intra-doc
link to `Cells::later` named either. The method that finds or enters a
key's cell is now `later_cell`; `Cells::later` names the map alone.
No behaviour change; verified by the merge check's build, clippy and
private-doc steps at this commit.
A render content's `VkPipeline`s made by the first draw that takes them
(the line and point class's where the descriptor names neither, and those
under other raster states) sat in one map, `Cells::later`, whose lock
`found` held across the driver's create. A draw of one content that needed
any other of those pipelines (another class, another raster state) waited
behind that create, and its wait was counted nowhere; a draw that needed
the same one waited on the lock and counted nothing either.
The map now holds a cell per key, the `Main` cell the content's main
pipelines already use: `Cells::later` finds or enters a key's cell under
the lock and returns it, and the make runs on the cell with the map's lock
released. A draw that meets another thread's make of the same key waits
on that cell's condition and is a first-use wait at the key's own site
(lines, points, raster); `Main::pipeline` now takes the site, the main
cells passing `Unfinished` as before. A make that fails keeps nothing and
wakes its waiters, which make it themselves, as a main cell's do, so no
waiter is left on a failed cell. The words twin's later pipelines, made
beside the plain one, use the same cells through `make_ahead`. The map
stays bounded at 15 keys; a cell of a failed make stays empty under its
key.
Docs: the line, point and raster first-use wait metrics count a draw that
waited for another thread's make in flight; the runtime README says a draw
needing another of the content's pipelines waits for no make but its own.
Tests: `later_cells`' two device tests (red at the commit before) and a
device-free `main_cells` test of a waiter whose make in flight fails.
A render content's `VkPipeline`s made by the first draw that takes them
(the line and point class's where the descriptor names neither, those
under other raster states) sit in one map whose lock `found` holds across
the driver's create. Two device tests show what that costs:
- a draw of points on one thread while another thread's draw of lines is
making the line class's pipeline must make its own and return, the make
of lines holding until it has (for at most 10 s, so a draw held behind it
fails the test rather than hangs it);
- a draw of lines that meets another thread's make of the line class in
flight must wait for that make and take its pipeline, counted as a
first-use wait of the line class, as the make's own draw is.
A test-only entry, `RenderCompiled::pipeline_during`, runs the draw's own
lookup with a hook inside its make, and the thread-local `WAITING` tells a
test when a call begins to wait for a make of a `Main` cell in flight.
Both fail at this commit: the draw of points waits behind the lock until
the make of lines gives up, and the second draw of lines blocks on the same
lock, so it never waits on a cell and counts nothing.
The known gap on a second topology class under RADV (no
dynamicPrimitiveTopologyUnrestricted) gave 225 ms as the heaviest second
compile measured on a 780M. A guest's session start compiles one far heavier:
the consumer's two diagnostic boots on the Radeon 780M with cold caches
(88012 at ea428bca8b plus the diagnostic prints, 88093 at cc13a21eb9 plus the
same prints) each made 4 second pipelines, all of the line class (topology 1,
the default raster state), 1,170.8 and 1,204.4 ms in all, the heaviest
1,165.8 and 1,197.6 ms and the other three under 10 ms each; the 4 lines
first-use waits matched them (1,171.3 and 1,204.8 ms). Counts from the
consumer's grep over each whole boot, classes and counts only. The gap now
states that figure, with no job or app named.
The 4:2:2 bullet lost its GPU-time figure when the decode shrank, since the
figure measured the decode before it. The committed timing test
time_a_linear_sample_of_a_1080p_frame (c08da02d8c) measured it again: a
linear sample through a runtime sampler (both decode arms, sixteen fetches)
at each texel of a 1920 by 1080 frame took 90.5 to 90.7 µs on an RTX 3090,
against 81.1 to 81.6 µs for the same kernel over RGBA8Unorm: 1.11 to 1.12
times, 3 rounds, each the median of 9 (job m3-max-88105, NVIDIA 620.70.06,
P0 throughout). The README states it as about 91 µs against 81 µs, 1.12
times.
The runtime README's 4:2:2 paragraph lost its GPU-time figure when the decode shrank (clamp-to-edge
taps, each footprint row's pairs fetched once): the figure measured the earlier sixteen-fetch decode
with a probe that was never committed. This is that probe as a committed test, so the figure has a
source.
tests::chroma_time's time_a_linear_sample_of_a_1080p_frame, #[ignore]d and run with --run-ignored
only (it prints GPU times and asserts nothing of time, as mesh_costs_print_per_card does):
- xr_samples' xr_sample_runtime (a linear clamp-to-edge sampler state at slot 0) and
xr_sample_constexpr (its constexpr linear clamp-to-edge sampler) sample each texel's centre of a
1920 by 1080 frame, one thread a texel, over a GBGR422 texture over a Private buffer at 3,840 bytes
a row and an RGBA8Unorm one at 7,680, positions and outputs in Private buffers;
- each dispatch is a command buffer of its own, timed by its GPU start and end; a round takes the
median of nine of each kernel over each texture, the four taking turns; unmeasured rounds run for
a second first (an NVIDIA card raises its clocks under load), then three rounds print each
kernel's two medians, their ratio and each texture's form (in place or the copy's cause);
- it asserts the decode ran (chroma_contents +2, chroma_launches = every GBGR422 dispatch, none for
RGBA8Unorm) and that every value written is finite and within [0, 1] (the outputs start as NaNs).
chroma_pairs' buffer_of, byte and GROUP are now pub(crate) for it.
Verification follows this commit: a run on lavapipe and one on the RTX 3090.
The known gap on the first bind of a 4:2:2 texture held placeholders for the
consumer's proof boot, and figures from the decode before the per-site
shrink. It now states the current figures only:
- the 40-site inline content (251 to 256 ms cold, 0.4 ms warm on the
Radeon 780M, beside the state's own 78 to 83 ms) and one site (4.0 ms);
- a camera preview's first open with the driver's shader cache empty: frames
held about a second (989 ms at the 99th percentile), the content's
translation 111 ms and its pipeline 870 ms; a second open in the same
session waits for nothing.
The rolled-shape sentence and the older figures go: the rolled shape (217 to
223 ms) is below the inline figure, and its slowdown against the older
decode is recorded in the bug list. The handle line no longer names a job.
Evidence: the consumer's boot m3-max-88093 at cc13a21eb9 plus the diagnostic
prints (build m3-max-88086), on the same Radeon 780M as boot 88012, with
fresh rt and Mesa caches: unfinished-pipeline waits 2 in 878.6 ms (1448.8 in
88012), the preview state's create 870.0 ms (1437.9), take-to-show p99
988.7 ms (1595.5), fragment 58,866 instructions and 737 fetches (80,978 and
821), translate 110.7 ms (149.0), 0 refusals, the picture right; the second
open made nothing and waited for nothing (p99 2.2 ms).
The bless at cc13a21eb9 (job m3-max-88077, BLESS_JOBS=4) moved only the
semantics line, 2396 to 2397, after firstopen's SEMANTICS_VERSION bump: no
cell changed, since no golden fixture lowers a 4:2:2 decode.
Clippy's indexing_slicing (denied in the tree) refused lower::texture::chroma::row's slices of
its fetched bytes and its store into the texels' array (merge check job m3-max-88057). The six
fetches are now three pairs of named texels, and the two texels are made by one closure. The
instructions are emitted in the same order as before, so the module is unchanged.
The runtime README's 4:2:2 paragraph now states the decode as the translator writes it:
- a row's two taps share six fetches, so a linear sample or a gather reads twelve texels;
- a constexpr sampler's sample holds its filter's decode alone, and any other sampler's holds both
decodes behind the filter branch, sixteen fetches;
- every tap clamps to the edge, citing MTLPixelFormat.h for both formats.
The paragraph's 135 µs RTX 3090 figure measured the earlier sixteen-fetch decode and is removed
until it is measured again.
A new known gap states that the first draw or dispatch binding a 4:2:2 texture at a state's slot
makes that state's content and waits for it, where Metal makes none, with the Radeon 780M's
figures (RADV, Mesa 26.2.6):
- 40 decoded sites in line: 251 to 256 ms cold, 0.4 ms warm (job m3-max-88049; a probe build that
writes no loop, the shape of the guest's 41 sites);
- the same sites where the translator writes them as a loop: 217 to 223 ms against 156 to 159 ms
before the rows shared their fetches (job m3-max-88041);
- one site: 4.0 ms cold;
- the camera preview's first open before the change (1,508 ms cold, about 145 ms warm), and
placeholders for the consumer's boot after it.
Handle re-makes: 0 seen in the consumer's session (boot 88012).
A camera preview's state re-made for a 4:2:2 texture at its fragment slot (41 decoded sample sites)
took 1438 ms to create on the Radeon 780M against 437 ms for its own content (boot 88012): each
site decoded 20 fetches behind the branch on its sampler's word, with every address mode's
arithmetic at each tap, about 1,111 instructions a site.
- Addressing: the decode clamps every tap to the edge, whatever the sampler states. Metal's
MTLPixelFormat.h says of both GBGR422 and BGRG422 "When sampling, ClampToEdge is the only usable
wrap mode". The other modes' arithmetic (the word's per-tap remainders, mirrors and border
texel, its position by mode and offset rule) is gone from the decode; a bicubic sample's taps
clamp too.
- Rows: a linear footprint's or a gather's two taps of a row share six fetches (the first tap's
pair and the pairs on either side of it; lower::texture::chroma::row), each texel's codes
converted once, each texel's arithmetic and values as before: 12 fetches for the 2x2 where 16
were.
- Static filter: a constexpr sampler's magnification filter is known in the translator, so its
sample holds that filter's body alone, with no branch; a runtime, argument buffer's or constexpr
array's sampler keeps both bodies behind the branch on its word. The coordinates' pixel flag is
likewise read here for a constexpr sampler.
- One position per axis, shared by both bodies.
Values are unchanged for ClampToEdge: the same codes, integer arithmetic, correctly rounded values
and FMix order. SEMANTICS_VERSION 2397.
Verified: tests::engine_chroma_pairs::a_four_two_two_decode_fetches_each_footprint_row_once, red at
the previous commit; the device and conformance values and the 780M's make time follow in this
lane's report.
What the decode adds at each site, over the module lowered without it, on every committed profile:
a sample through a runtime sampler 16 fetches (its linear body's 12, two rows of six shared fetches,
and its nearest body's 4) and one selection; a gather 12; a read 4; a sample through a constexpr
sampler its own filter's body alone (12 magnifying linearly, 4 nearest) with no selection; and no
integer remainder at any site, the taps clamping to the edge whatever the sampler states. Today a
sample decodes 20 fetches behind a branch even through a constexpr sampler, a gather 16, and each
tap carries every address mode's arithmetic. It replaces the size probe, printing every row's sizes
and grd_half_many_samples' 40 sites of fragment texture 3.
grd_half_many_samples (40 runtime-sampler samples of fragment texture 3, the slot the camera boot's
state decodes) joins the module size probe (with samples, selections and loops) and the driver's
make time, for the shape of the camera boot's 41 decoded sample sites.
A translator test prints each module a 4:2:2 decode lowers beside its plain module (instructions,
texel fetches, words), and a device test prints the driver's make of dl_runtime's plain content and
of its content lowered for a 4:2:2 texture at fragment texture 0. They measure the first-open stall of a
4:2:2 preview: the runtime README's figures for it come from them.
The bless at 79698bdd67 (job m3-max-88022, BLESS_JOBS=4) moved only the
semantics line, 2395 to 2396, after specwide's SEMANTICS_VERSION bump: no
cell changed. encodetime (e2964480ba) changes no translation, so the table
holds at this tip.
The count's doc named five kinds of make at encode and left out the content a compute or render
state makes for the 4:2:2 textures a dispatch or draw reaches, which Metrics::chroma_contents
counts and which the same make at encode also counts and times (render_pipeline_state and
PipelineInner::variant call Counters::translation_at_encode for it). It now names six. The
runtime README's known gap of makes at encode names that make and the depth range twin too,
and the new total translation_at_encode_nanos beside the count and the longest.
The test asserts Metrics::translation_at_encode_nanos; printing the device's total after the one
make at encode gives each run's cost of that make (a translation and its pipelines' compiles on the
encoding thread) beside the pass/fail.
Counters::translation_at_encode, which every make at encode calls with its nanoseconds of
host_time (the render content and its depth range twin, the compute content of a dispatch's
bindings, and a dispatch's partial-threadgroups variant on emulated SIMD groups), now sums them
beside the count and the maximum. Turns the unattached-colours device test of the previous commit
green.
Metrics kept a count of the translations made at encode and the longest one's time, but no total,
so a consumer could not say what those makes cost over a frame or a boot: a maximum does not
take the difference of two reads. This adds the field, read from its own atomic, with its doc
comment, and the signature table's row. The atomic is not charged yet, so the test fails here.
The test is the unattached-colours device test, which makes one render content at encode on
every device: the device's total is 0 after the matching draws (a fresh device, no make at
encode), rises at the first lacking pass's make and not at the second's reuse, and ends at least
the longest make's time. Expected red: the first lacking pass's total does not rise.
canon marks a load speculative where it runs in lanes the program did not run it in: each load
of a branch arm it speculates (a constant reference's, at offset 0) and each constant-reference
load the hoist moves. Lowering checks such a load at any offset against its slot's buffer, but
only on the static-root path. Where a phi, select or pointer cell joins the reference's pointer
with one loaded from memory, the reference is a wide pointer, and every access through a wide
pointer went unchecked: a speculated arm's load read the reference's first bytes in every lane
of the branch's block, through a binding the program never read there, past its end where the
guest bound it shorter than the load.
The fix: the dynamic family selects a speculative load through a wide pointer, of a leaf or of a
pointer, as DynStrategy::SpeculativeLoad: the static-root access of the one slot the pointer's
root set names, at the pointer's fixed offset, marked speculative, so note_variable gives the
slot its SlotBounds, the zero range is placed, and emit::prepare checks the load and reads zero
outside, as for a static-root speculative load. The slot still joins the dynamic plan's slots
(plan_entry), so it keeps the device address every wide-reached slot has, on a bound-form device
too. A speculative load through a wide pointer of another root set or of an offset not fixed is an
invariant violation: canon marks no such load. Its census name is the static-root load's it
emits (access.load.psb.checked, or access.dynamic.load_pointer.psb for a pointer).
Which fix, and why this one: (a) lowering checks the load, against (b) speculate.rs leaving such
an arm unflattened. (a) is the smaller structural change: about 90 lines in the dynamic family,
all reusing the static-root check, and it moves only the loads the bug names. (b) cannot see
width: a wide pointer is lowering's decision (the memory plan's dynamic component), so canon
would have to over-approximate with const_hoist's shared-pointer walk, which also unflattens
arms whose loads go through narrow joined pointers and are checked today, giving their group
operations the AIR's lanes where Metal speculates them (rule 1), or carry the memory plan's
provenance into canon.
const_hoist's module docs no longer say lowering checks a wide pointer's access nowhere.
SEMANTICS_VERSION 2396.
Verified: engine_hoist_contain's two wide-pointer tests fail at f4a0f4e628 (lavapipe's address
form and every committed profile, jobs m3-max-87967 and m3-max-87970): no SlotBounds for k's slot,
and the interpreter's OutOfBounds trap in the short-binding case of both forms (word: 4 bytes read
from a 2-byte binding; pointer: the second word of an 8-byte load past a 4-byte one), while the
whole, unbound and flag-on cases pass. The green run with this commit is named in the lane's
report.
engine_hoist_contain gains a third kernel, `wide`, in two forms: a short arm beside a
quad_broadcast_first, which canon's arm speculation runs in every lane of the branch's block,
loads `k`, a constant reference (a 4-byte word, or an 8-byte pointer whose address the arm
truncates), where a select joins k's pointer with one loaded from memory. That select makes k a
wide pointer, so the arm's speculative load goes through the wide-pointer family, which checks no
access: the load reads k's first bytes in every lane whatever k's binding.
Two tests:
- a_speculated_arms_load_through_a_wide_pointer_is_checked: on every committed profile under the
identity domains, with and without the bound form's query, k's slot reads its SlotBounds and
the module the zero range, and the arm's load is not a wide-pointer load (one
access.dynamic.load, the select's own, and no access.dynamic.load_pointer.wide).
- a_speculated_arms_load_through_a_wide_pointer_reads_nothing_outside_a_short_binding: on the CPU
interpreter (lavapipe's address form), with the arm's condition off and k bound half as long as
its load where its mapping ends, the load must not trap; with k whole or unbound, and with the
condition on, out holds the program's words.
Expected red at this commit: no SlotBounds for k's slot, and the interpreter's OutOfBounds trap
at k's address in the short case of both forms. The unbound case is a control: the nil buffer's
64 KiB holds the load.
Pin AC's short round failed every card's replay on the two 4:2:2 linear-sample
rows (chroma-pair-texel-linear-samples-gbgr422 and -bgrg422). Their venue is *,
and their answer was the digest llvmpipe and KosmicKrisp on an Apple M3 Max give.
The RTX 5080 Laptop GPU, RX 7900 XTX, Iris Xe and RTX 3090 all give one other
digest per format (70c2266e... for GBGR422, 3f65b2f3... for BGRG422), so each
card read the row as both unlisted and no longer held.
The gap is the same on every venue: PrecisionNote::BicubicFilterArithmetic,
the decode's own filter arithmetic in f32. Its value differs by a property no
venue description states, so each row keeps venue * and lists both answers
with the ledger's separator, as known_gaps.rs allows. The gap text names the
run each answer came from. A third digest still fails as a new gap.
Verified: the four replays' proposed rows (jobs m3-max-87952, 87957, 87958,
87961) give the same two digests; the coverage document regenerates unchanged.
The replays of this commit follow.
The published crates' doc comments on EntryPoint::mismatched_component_counts (metal2vulkan-air
abi) and LoweringInputs::widened_varyings (metal2vulkan pipeline::lower_inputs) named lab jobs; so
did the module docs of the conformance cases chroma_pairs and one_level_filters and of the runtime
tests chroma_pairs and mismatched_varyings, all added in pin AC's range. Each now names the Apple
M3 Max and macOS 27.0.1 alone, as a8cec25600 did for docs/API.md. The paragraphs are rewrapped at
100 columns; the conformance ledger's reason column keeps its job ids. No code changes, and no file
here is a runtime-sources input (pin-compute.py gives the committed 870c1824... at this tree).
The golden table re-blessed at ae78d6c14f (pin AC's stack on pin AB' cb574b06fa), on the Apple M3
Max, job m3-max-87911 (inventory, golden, printouts, linkhalf and chains each exit 0):
- the semantics line moves 2394 -> 2395, yuv422's number;
- no cell moves and no row is added, the metal-as fixtures included: a 4:2:2 texture's decode
lives only in a content re-lowered for its bindings, so no default module changes.
The worker memory watchdog summed each process-group member's resident size: VmRSS on Linux,
proc_pid_rusage's ri_resident_size on macOS. Under memory pressure the system takes a worker's
pages out of its resident set (macOS's compressor; Linux's swap, to a disk or to compressed RAM
such as zram), so a group holding more than the 500-MiB ceiling could pass it unseen. On CI's
macOS job at 9e7034c214, worker_memory_watchdog_enforces_aggregate_limit ran into its 20-s
deadline: its two 256-MiB children (one written byte a page, nearly all zero) never summed to the
limit. That is the product ceiling going soft under pressure, not only a test problem.
What a member is charged (process_charged_bytes) is now:
- macOS: the larger of ri_resident_size and ri_phys_footprint, from the same proc_pid_rusage call.
The SDK's sys/resource.h declares both in rusage_info_v2 with no comment; footprint(1) defines
the ledger: "phys_footprint - the current value of the kernel ledger tracking the amount of
dirty memory owned by a process", Dirty "includes "(Swapped)" memory, ... and memory written to
implicitly, such as zero-filled", and (Swapped) is "A subset of Dirty memory that has been
compressed or swapped to storage by the kernel". The footprint leaves out clean file-backed
pages the resident size counts, so the larger of the two never trips later than before.
- Linux: VmRSS + VmSwap from the same /proc/<pid>/status read (status_charged_bytes). The member
rules of process/linux.rs are unchanged: a member before its exec that shares its parent's
memory is charged nothing, a copy-on-write one is counted (an overcount, never an undercount),
and every other member is charged its own VmRSS and VmSwap, read after its flags.
Names that would lie are renamed: worker_resident_bytes -> worker_charged_bytes,
member_resident_bytes -> member_charged_bytes (both platforms). process_resident_bytes keeps
the resident size alone for own_resident_bytes, whose figure (corpus-triage's parent_rss_bytes,
the supervisor-heap test) stays resident memory; its doc no longer says it is read as workers'
are. The stop's message says "process-group memory budget". Docs that called the sampled figure
RSS (worker.rs, compile.rs, alloc.rs, audit.rs, budgets.rs, translation_audit.rs,
authored_compile.rs, corpus-pipeline.rs, corpus-triage's usage, docs/HOWTO.md's recipe) now say
memory; report keys (peak_*_rss_bytes, peak_resident_bytes) keep their names.
A stop at the ceiling is a recorded `failed oom` row of the engine census and of the
specialization lane's attempts, and its detail is the stop's message, so the measure can change
a recorded row: ENGINE_CENSUS_VERSION 8 -> 9 and SPECIALIZATION_AUDIT_VERSION 6 -> 7, as both
were bumped when the member charging last changed (engine 5, specialization 2). The authored
compile census records no worker stop (failures are never cached), so its version stays.
The fixture is unchanged: it now trips on its zero-filled pages wherever the system compresses or
swaps them.
Verified: a_members_swapped_memory_is_charged failed at the parent commit (lavapipe-free CPU
job m3-max-87876: left 307200000, right 563200000; 19 other worker::process tests passed). The
macOS arm is unchecked before the push (no Mac job); it stands on libc 0.2.189 and 0.2.191's
rusage_info_v2 (pub ri_phys_footprint: u64, beside the ri_resident_size this code already read)
and on CI's macOS job.
The worker memory watchdog sums each process-group member's VmRSS on Linux
(process_resident_bytes) and ri_resident_size on macOS. Under memory pressure
the kernel takes pages out of the resident set (swapped out on Linux, to a disk
or to compressed RAM such as zram; compressed on macOS), so a worker holding
more than the 500-MiB ceiling can pass it unseen: on CI's macOS job,
worker_memory_watchdog_enforces_aggregate_limit ran into its 20-s deadline
with two 256-MiB children that the limit never stopped.
This commit draws the status read's charge out as status_charged_bytes,
unchanged (VmRSS alone), and adds a_members_swapped_memory_is_charged: a
synthetic /proc/<pid>/status with VmRSS 300000 kB and VmSwap 250000 kB must be
charged 550000 kB. It fails here; the next commit charges VmSwap.
conformance times --runs 8 --write over chroma-pair-texel-gathers-gbgr422, -gathers-bgrg422,
-linear-samples-gbgr422 and -linear-samples-bgrg422 on the Apple M3 Max, macOS 27.0.1, job
m3-max-87887. The run adds times to the four recordings and changes no answer: 508 lines added,
none removed. times::every_case_carries_its_timing failed without them (conformance suite job
m3-max-87880, 1062 of 1064 passed with the textures guard); this commit closes it. Coverage
regenerated.
With GBGR422 and BGRG422 held as their bytes in R8G8_UNORM, the translator's byte format of each
is a 2-byte texel, so the guard asked the textures round-trip table for them
(cases::textures::tests::the_table_is_exactly_the_formats_whose_texels_are_metals_bytes failed,
conformance suite job m3-max-87880). Their host round trips are chroma_pairs' copy cases', on and
off the 2-texel pairs, so the guard sets them aside as it sets aside the copies-only formats.
The planner's one timing for the known gap (job m3-max-87867, an RTX 3090 at P0, 620.70.06): a
linear sample at a quarter point of each texel of a 1920 by 1080 frame through fpv_swz_sample,
three alternating rounds of 24 command buffers, the median GPU span of each round's last 20:
GBGR422 over a Private buffer in place 135,424 / 135,232 / 135,360 ns, RGBA8Unorm over a Private
buffer in place 80,544 / 80,576 / 80,512 ns, ratio 1.68. The content's make at the first dispatch,
the translation at encode, took 4,746,194 ns there (Metrics::translation_at_encode_max_nanos),
within the translator's bounded lowering as a state's make is, far inside the 20 s ceiling. The
timing test is a carried patch, not committed.
KosmicKrisp on an Apple M3 Max (job m3-max-87863, the pre-push replay at 4d09c9ed97) answers both
linear-sample sites with the digest llvmpipe gives (job m3-max-87851): the decode's filter is the
shader's arithmetic, so the rows' venue widens to *. Those two were the replay's only unexpected
lines. Coverage regenerated: no change.
texture-fills-240 and -241 make a GBGR422 and a BGRG422 texture, whose static note
(bicubic-filter-arithmetic, Texture::precision_note) the rt side announces; the replay at
bff946134f (job m3-max-87842, llvmpipe in the image) read it as undeclared at their notices site.
Every other row that run held was as the ledger lists. Coverage regenerated: no change.
From the replay in the lavapipe image (job m3-max-87827) and the commits since:
- heap-sizes-422's 20 rows go: each site now matches Metal under the accepted difference of the
device's own heap sizes.
- chroma-pair-texel-reads, -samples and -gathers (both formats) go: reads were announced
(device-texel-conversion, a native note), and the sampling cases now declare the notices the rt
side announces.
- chroma-pair-texel-linear-samples-* are divergent rows on llvmpipe: the decode's own filter
arithmetic, the texture's static note BicubicFilterArithmetic, as ruled.
- chroma-pair-copies-* name Gap::ChromaPairsUse of CloseRows at the 30-byte-row blit (step 37).
- texture-fills-240 and -241 now reach the rt side's fillTexture, Unavailable as every other
fill row.
The replay at this commit checks the rows.
The changed behaviour of a run: GBGR422 and BGRG422 map to R8G8_UNORM with
FormatEmulation::ChromaPairs (metal/format/mod.rs, a pinned runtime input) instead of the
Decoded RGBA8 twin, so RUNTIME_VERSION moves with the hash (870c1824..., by pin-compute.py, which
gives development's committed pin at 9e7034c214). The guard failed at 27104ce862 (job
m3-max-87839). SEMANTICS_VERSION takes 2395, after 2392 (pin AB') and varyflag's 2393 and 2394.
Also: the ChromaPairsUse basis names CloseRows without a link, so REFUSALS.md carries no bracket.
The lavapipe conformance replay (job m3-max-87827, in the image) named what changed once 4:2:2
textures are made:
- A linear or bicubic sample of a 4:2:2 texture filters the texels the lowered content decodes,
in the shader's arithmetic. The texture now states PrecisionNote::BicubicFilterArithmetic as
its static note (Texture::precision_note, as a block-compressed texture states its own), fixed
by the format, so the note is announced where the texture is made and not only in the content
lowered at the first dispatch.
- Metal takes a blit between a buffer and a 4:2:2 texture whose buffer rows are closer together
than the region's rows are long (chroma-pair-copies, rows 30 bytes apart for a 32-byte row, an
Apple M3 Max). The runtime refused it as no layout Metal takes. It is now
Gap::ChromaPairsUse { cause: ChromaPairsGap::CloseRows }: one Vulkan copy region takes no row
stride below its width (VUID-VkBufferImageCopy-bufferRowLength-09101), and one region a row
would build it with no extra copy, which the README's known gap says. Planner's ruling: a gap
in this pin, built when a guest meets it.
- The conformance cases declare the notices the rt side announces for them:
bicubic-filter-arithmetic for every 4:2:2 case, and pixel-sampler-scaling for the sampling and
gathering ones, through the fixture's runtime sampler slot.
REFUSALS.md and the API signatures regenerated.
Which buffer form the device took for the decoding kernels (rule 2's bound buffers or their
addresses) goes beside the chroma counters in each card's lines.
A texture shaders read takes an index; the test made its plain 4:2:2 texture without one and met
Refusal::TextureIndex before the view it asks (job m3-max-87817, llvmpipe).
A texture of GBGR422 or BGRG422 asked with render-target usage met the format query first, which
offers the bytes' R8G8 image no render-target use on any device, and answered Gap::TextureFormat
instead of Gap::ChromaPairsUse { cause: RenderTarget }. The use is now asked first, keyed by the
format as Metal's 4:2:2 rules are.
Found by the device test every_device_refuses_what_metal_refuses_of_four_two_two_textures on
llvmpipe (job m3-max-87813), whose read, sample and gather test passed there (chroma_contents +6,
chroma_launches +80).
The Draws and Interface literals of tests/indirect.rs and tests/compute.rs
missed the new field (job m3-max-87802, E0063). The README's 4:2:2 known gap
now states the content lowered for the texture, its counters and costs, and
the refusals and gaps; PrecisionNote::BicubicFilterArithmetic's doc and its
docs/API.md entry name a 4:2:2 texture's linear sample.
A GBGR422 or BGRG422 texture is made (FormatEmulation::ChromaPairs, its image
R8G8_UNORM of the bytes), over a buffer as any 2D texture. Only a content
lowered for it reads its texels as Metal's:
- KernelKey carries a Chroma: the texture slots bound to a 4:2:2 texture per
stage, and whether a stage may reach one through a handle while one lives
(PipelineInterface::handle_float_images and Gauges::chroma_textures).
- A dispatch picks the kernel state's content for it beside the sRGB and word
variants (ComputePipelineState::variant), a draw the state's content for its
draws (RenderPipelineState::for_draws); both are made at the first need,
counted in Metrics::translations_at_encode and Metrics::chroma_contents, and
kept in the device's map of contents (LRU, KERNEL_ENTRIES), whose
fill-past-capacity test is tests/kernel_map.rs's
the_map_holds_its_cap_and_forgets_the_least_recently_used. A draw or
dispatch on one counts in Metrics::chroma_launches. A state without either
runs its own module as before.
- Refusal::ChromaPairs (metal-measured, Metal's own asserts): a type other
than 2D (texture buffers included), an odd width, more than one level, a
view.
- Gap::ChromaPairsUse: ShaderWrite (and unknown) usage, RenderTarget usage, a
swizzle at the make, and a function compiled outside the runtime bound to
one or reaching one through a handle (the consumer never hands the runtime
such a kernel).
- Buffer::new_texture's doc states that Metal refuses a linear 4:2:2 texture
and why the runtime takes one.
The device test now asserts the six kernel states' contents, the 80
dispatches on them and the live gauge, and a second device test the
refusals and gaps. docs/REFUSALS.md and basis.rs regenerated (the
TextureSwizzle row's site list was stale at the base and is current now);
the API signature table blessed. Not yet built.
The emission context has no lowering inputs: selection records
LoweringInputs::chroma_pairs in each texture slot's plan (SlotPlan::chroma) and
chroma_handles beside heap_extended (AccessPlan::heap_chroma), which the
decode reads. Fixes the E0609 errors of job m3-max-87777.
The specialization-constant gate weighed every float 2D sampling stage with the
dead decode arms (spirv::roll::weights counts every block), which moves the
roll, the kernels' helper path and the render stages' bound for pipelines that
never see a 4:2:2 texture. The decode is now a lowering input, as srgb_storage
and word_bound_buffers are:
- LoweringInputs::chroma_pairs names the texture slots bound to a GBGR422 or
BGRG422 texture: each read, sample and gather of a float 2D sampled image
there takes Metal's decoded texels alone, the order read from the slot's word.
- LoweringInputs::chroma_handles: each heap handle carries the 4:2:2 marks and
each access through a handle branches on them.
- Without either nothing of the decode is emitted, so a function's module is
the one it was. SpecKey::ChromaPairs is gone.
- StageInterface and PipelineInterface::handle_float_images state whether a
function reaches a float colour image through a handle (the plan's
heap_extended), which the runtime reads to choose the handles content.
- BicubicFilterArithmetic is recorded only where the input names the site's
texture and the sampler may magnify linearly.
- The clippy errors of job m3-max-87748 are gone (the unused READ_WORDS, the
indexed lanes).
ARTIFACT_FORMAT_VERSION 617 for the interface field. The API signature table
is blessed. New tests in src/tests/engine_chroma_pairs.rs: a slot named in
chroma_pairs decodes and validates on every committed profile and records the
note only for the linear-capable sample; a slot the kernel does not declare
and chroma_handles on a function without handles leave the module word for
word; a4_heap_sample under chroma_handles validates and differs. Not yet run.
Build fixes for 920324aeba (job m3-max-87745 failed its clippy on two borrows): border_bits takes the
context mutably, and the nearest arm makes its footprint before the decode.
GBGR422 and BGRG422 are held as R8G8_UNORM at full width (FormatEmulation::ChromaPairs), two bytes
a texel, which copies move unchanged. Every float 2D sampled image's read, sample, gather, pixel
fetch and bicubic sample keeps the device's access and, where the stage's new
SpecKey::ChromaPairs holds and the texture's word names a 4:2:2 format, a branch computes Metal's
answer from the decoded texels (lower::texture::chroma, lower::sampler::chroma). A heap handle
carries the format's marks in place of its word bits under the same constant. SEMANTICS_VERSION
2395 (its final number in pin AC).
Not yet built: this commit is the first build's input; fixes follow forward.
The four cases 0a26c673d9 added, recorded on the Apple M3 Max under macOS 27.0.1 (26A434), three
runs each with one outcome (job m3-max-87684 at 0a26c673d9):
- chroma-pair-texel-linear-samples-{gbgr422,bgrg422};
- chroma-pair-texel-gathers-{gbgr422,bgrg422}.
The job's tree showed only these four files new, so the four texel recordings taken before stay
current.
A device test of what the consumer's camera frames need: GBGR422 and BGRG422 textures made with
Buffer::new_texture over buffers laid out as 'yuvs' and '2vuy' surfaces (64x8 over Shared and
Private buffers at rows 128 and 192 bytes apart, and 640x480 at 1280 over a Private buffer, the
consumer's frame), each made in the form texture_copy_cause answers and the 640x480 one in place;
every texel read and nearest-sampled at its centre as Metal's decode (jobs m3-max-87650 and
m3-max-87653: own luma, chroma (3c + n + 2) >> 2 of its pair and the pair on its side, each code
c / 255 correctly rounded), each component gathered at every footprint corner, and linear samples
at the corners and a quarter between texels within f32 rounding of the decoded texels' mean.
It fails today at the texture's make, Gap::TextureFormat, on every device: the red half of the
4:2:2 form that follows.
chroma_pairs gains two accesses of each 4:2:2 format, so the form that makes these textures is held
to Metal's filtered and gathered answers as well as its reads and nearest samples:
- chroma-pair-texel-linear-samples-{gbgr422,bgrg422}: sample() through a linear clamp-to-edge
sampler at 552 positions (a quarter past each texel toward its right neighbour, the corner of
each 2 by 2 footprint, the centres of rows 0 and 7, and u at 0, 1, -0.25 and 1.25 in rows 0 and
15);
- chroma-pair-texel-gathers-{gbgr422,bgrg422}: gather() of each component through the nearest
clamp-to-edge sampler at the corner of each 2 by 2 footprint, 256 positions, one dispatch and
site a component.
Both read a texture of hashed bytes, whose neighbouring pairs' chroma do not all differ by
multiples of 4, so Metal's (3c + n + 2) >> 2 rounding shows; the step pattern the read and the
nearest sample recordings were taken over gives 3c + n a multiple of 4 at every texel
(the_hashed_texture_shows_the_decode_rounding). The accesses of one entry keep their recorded call
order and inputs, so the four existing texel recordings stay current.
The four cases are refused on rt at every venue today (Gap::TextureFormat at the texture's make),
the ledger's rows say so; their Metal recordings follow from the M3.
The runtime's README (Known gaps of memory blocks), memory.rs's IDLE_AGE_NANOS doc and
counters.rs's Metrics::submissions_during_frees doc each said that freeing host-visible memory
takes about 1.1 ms per MiB on the NVIDIA cards measured in Thunderbolt enclosures (the README also:
about 0.5 ms per 16 MiB on an internal card, and that the free holds any submit for its length).
The only record of those figures is 0280c19285's message, with no job on file. They go. The README
line now says a driver may hold a submit for a free's length and points to the measured NVIDIA rows
below it; the two doc comments keep only "a driver may hold".
The hold paragraph opened with "NVIDIA's Linux driver holds a submit ...", stated for every NVIDIA
driver. Its evidence is an RTX 3090 under 620.70.06 (rtsweep's standalone program, 9e250379d3 and
ef875741cc, and the consumer's walk m3-max-57463, 028a764c68) and an RTX 2080. It now names the
cards measured.
The paragraph's walk sentence keeps its figures (frees of imported blocks, 0.4 to 2.9 ms each and
52 in one second, held four submits for 5.2 to 6.9 ms). The walk's raw log is gone, but its derived
table is on file: the consumer's take-site table for m3-max-57463 (rt 2233c8962d, an RTX 3090,
336 s, allocate, free and submit timers on rt's own clock), sent to us on 11-20 and kept in the
consumer's session record. Its line reads: "73.5 s, four submits of 5.2-6.9 ms: 3-5 block-own
vkFreeMemory each, 0.4-2.9 ms apiece, on m2v-blocks. 97-100%. By stamp these are guest-memory
import frees, 52 in that second."
The per-claim source audit was lane uniarm's (its commit e2e4ae1bb7 on the parked
steelbrain/uniarm-landing, whose doc-comment hunks this takes unchanged). No code changes; the
README text names no job.
`conformance times --runs 8 --write` over sampler-one-level-filters-level and -bias on the Apple
M3 Max, macOS 27.0.1, job m3-max-87764. The run adds times to the two recordings and changes no
answer: 254 lines added, none removed. times::every_case_carries_its_timing failed without them
(conformance suite job m3-max-87753, 1061 of 1062 passed); this commit closes it.
coverage.py --check still reads "as derived".
sampler-one-level-filters-level and -bias, recorded on the Apple M3 Max, macOS 27.0.1, job
m3-max-87749 (3 runs, one outcome each). Every lane of every cell reads one filter. Under the
clamp [0, FLT_MAX] the magnifying filter takes -2, -0.5 and 0 and the minifying filter takes
1/64 and up. lodMinClamp 1 gives the minifying filter at every level, and lodMaxClamp 0 the
magnifying filter at every level. This holds for all three mip filters, both (min, mag) pairs,
level() and a kernel's bias(). So Metal reads the choice after the sampler's clamp and before
the clamp into the texture's one level, as 87718 showed for samplers without a mip filter. The
case's doc holds the table. level.rs's one-level paragraph now names the cases' facts, which
settle the sampler-clamp side.
docs/CONFORMANCE-COVERAGE.md regenerated by scripts/conformance-coverage/coverage.py; --check
reads "as derived". level.rs stays comment-only; pin-compute.py still prints the committed
runtime-sources hash.
Two cases, sampler-one-level-filters-level (unv_runtime_levels' unv_rpos2d, level()) and
sampler-one-level-filters-bias (mip_level_sampling's mip_bias_kernel, a kernel's bias()), over
a 16 x 4 R32Float texture of one level whose texels are distinct. Each samples a quarter of a
texel past every texel's centre (60 positions) at the nine levels of the Metal probe job
m3-max-87718 (-2, -0.5, 0, 1/64, 1/4, 1/2, 1, 2, 5), through the runtime sampler in 18 rows:
every mip filter x the two (min, mag) pairs whose filters differ x three clamps (Metal's
defaults, lodMinClamp 1, lodMaxClamp 0). A nearest sample there is the texel and a linear one
the texel plus 1/4, exact in float, so every lane names the filter that read it.
This is the evidence that the device's own sampler path, which takes Vulkan's choice (λ after
[minLod, maxLod], before the view's levels), matches Metal on a one-level texture. The test
the_recorded_filters_are_chosen_before_the_texture_levels_clamp holds every recorded lane to the
rule level.rs now states, and counts the lanes where the old reading (the choice after the
texture's levels clamp) names the other filter. Recordings follow from the M3.
level.rs stated Metal's rule as "every sampler magnifies where L + q is 0", with L + q taken after
the clamp into the texture's levels, and left a texture of one level unmeasured. A Metal probe of
the Apple M3 Max on macOS 27.0.1 (job m3-max-87718) measured it: a 16 x 4 rgba8Unorm texture of
one level, through runtime samplers without a mip filter whose filters differ (min nearest / mag
linear and the reverse), at level() and a kernel's bias() of -2, -0.5, 0, 1/64, 1/4, 1/2, 1, 2 and
5, 60 positions each, takes the magnification filter at -2, -0.5 and 0 and the minification
filter at every level from 1/64 up. The stated rule would have magnified at every level. So the
choice reads the level after the half rounding and the sampler's clamp, before the clamp into
the texture's levels. On a texture of more than one level the two readings agree, so the 2,230-
level probes the module cites still hold.
Comment-only. No code takes this choice where the module reads texels itself: an extended-range
sample's constexpr sampler with differing filters is refused, and a runtime word with mixed
filters reads nearest (extended's open gap). The device path follows Vulkan's rule (λ after the
sampler's [minLod, maxLod], before the view's levels), which the device paragraph now says matches
Metal's choice. No translation changes, so SEMANTICS_VERSION stays. level.rs is not a
runtime-sources input: pin-compute.py on this tree prints the committed e8f7cd09...6798, so
the pin does not move.
The golden table re-blessed at 6495aabffd (varyflag step 2 rebased on step 1's 47c09be7ae), on
the Apple M3 Max, job m3-max-87793 (inventory, golden, printouts, linkhalf and chains each exit 0):
- the semantics line moves 2393 -> 2394, step 2's own number (2392 at that bless, renumbered
when the stack moved onto pin AB');
- no cell moves and no row is added.
scripts/api-docs (ci-gaps leg m3-max-87688 at ae5f9bcd2f) refuses a lab job id in docs/API.md's
prose: the measurement is stated by its card and OS (Apple M3 Max, macOS 27.0.1 26A434); the
job, m3-max-87586, stays in the commit messages.
clippy under --cfg m2v_gpu and --cfg m2v_cpu_icd (job m3-max-87679 at ae5f9bcd2f) refused
chunks_exact with a constant size in mismatched_varyings (clippy::chunks_exact_with_const_size,
-D warnings). The texels are read as words, then as four-word arrays, both by as_chunks.
Verified by the rerun of both clippy configurations and the lavapipe run of the test in
the job named in the READY message.
serde_round_trips::lower_inputs failed at 5ab16afb13 (job m3-max-87672, on the
translator suite's focused run): JSON refuses a map whose keys are VaryingKey ("key
must be a string"). The field takes serde_pairs, with its default, as extended_range
and storage_images do.
Verified by the same job's rerun in the suites job named in the READY message.
The planner's ruling for the wide case of agx.allow_mismatched_component_counts: Metal
makes a render pipeline whose fragment function reads a varying at more components
than its flagged vertex function writes, and leaves the lanes past the output's
undefined (M3 Max, macOS 27.0.1, job m3-max-87586: 150 such lanes read 147 distinct
values, none written). One form on every device, decided at pipeline make by structure:
- LoweringInputs::widened_varyings (new public field, serde default): the user varyings
a flagged vertex function writes at fewer lanes than the pipeline's fragment function
reads, with the count it reads, of the same AIR scalar type. compile_render_pipeline
and render_variant_key derive it from the two Function stages' specialized entries
(compile.rs widened_varyings: return-struct field types against fragment-input
parameter types), only where the vertex entry carries the flag; a Compiled stage on
either side gives none. render_pipeline compiles the vertex stage, and only where its
StageIo carries the flag and the set is not empty compiles it again under the set;
render_variant_key hands it to the vertex inputs, so a runtime's stage-by-stage
compile under the keys widens too, and the pipeline key matches.
- Planning declares such an output at the read count (StageIo outputs list it so, so
link matches equal types) and marks its object in StageIoPlan::widened; store writes
the value's lanes then a constant 0 per extra lane (OpCompositeConstruct). Colour
outputs, whose declared components may differ from their form for other reasons, are
never marked.
- The key appends the set only when set: every other function keeps its key.
- Link is unchanged: a wider input behind a vertex function compiled alone stays
Unsupported{UnmatchedVarying, NotImplemented}, as does a mesh producer; flag 0 or
absent stays Metal's link error.
Docs: docs/API.md accepted differences gains the line (Metal undefined, we give zeros;
no precision note, per the ruling); the UnmatchedVarying, StageIo and link docs say
where the gap now remains; reach.tsv's line likewise; REFUSALS.md regenerated; the API
signature table blessed (LoweringInputs.widened_varyings); the inputs-encoding and serde
round-trip tests cover the field. SEMANTICS_VERSION stays at 2394 (the narrow
form's bump).
Tests: the red tests of 3f0fa825f4 (jobs m3-max-87655 lavapipe + translator, m3-max-87661
RTX 5080) go green in the jobs named in the READY message.
The planner's ruling for the wide case of agx.allow_mismatched_component_counts: Metal
makes the pipeline and leaves the lanes past the vertex output's undefined (M3 Max,
macOS 27.0.1, job m3-max-87586: 150 such lanes read 147 distinct values), so the vertex
function declares the output at the count the fragment function reads, decided at
pipeline make from the two entries, and writes 0 in every lane past its own.
Two tests, red until that form lands:
- engine_converter_module_flags: on lavapipe's profile, compile_render_pipeline of a
flagged vertex function writing 1 to 3 lanes behind a fragment function reading 2 to
4 (float perspective, no-perspective, flat; uint and int flat) compiles; every stage
passes L3; the vertex Output and fragment Input at the varying's Location have the
input's count; the stored composite carries a constant 0 for each lane past the
output's; the pipeline's key is render_pipeline_key's. Flag 0 stays Metal's link
error.
- metal2vulkan-runtime mismatched_varyings (device cfg): the same classes drawn into a
32-bit target of the class on every device: the output's lanes exact, 0 past them,
the fragment's sentinel past the input's; the narrow rows (4 to 2, 3 to 1) read the
output's first lanes.
Red expected: the wide rows fail with Unsupported{UnmatchedVarying, NotImplemented}.
Metal makes a render pipeline whose fragment function reads a user varying at
fewer components than the vertex function writes when the vertex module states
agx.allow_mismatched_component_counts as 1, and the input reads the output's
first lanes (Apple M3 Max, macOS 27.0.1, job m3-max-87586: 90 rows of float
under perspective, center_no_perspective and flat, uint and int flat). Link
answered it Unsupported{UnmatchedVarying, NotImplemented}.
Link now matches such an input to its output (reads_first_lanes: the same
class, fewer components, a vertex function of
StageIo::mismatched_component_counts, a description stating maintenance4), so
the input takes the output's location and component. Vulkan matches an input
of fewer components there under maintenance4 (spec 19.1.3; without it
VUID-RuntimeSpirv-maintenance4-06817 forbids it), which the runtime's floor
requires and enables: one form on every device, no query. A description without
maintenance4 keeps the gap, as do a wider input and any mismatch behind a mesh
function. No module changes: the fragment's input keeps its own width.
Docs: the varyings module docs, StageIo::mismatched_component_counts and
Feature::UnmatchedVarying say so. SEMANTICS_VERSION 2394 (a refusal becomes a
link).
The draw probe (Apple M3 Max, macOS 27.0.1, job m3-max-87586) measured that a
fragment input narrower than its vertex output reads the output's first lanes
when the vertex module states agx.allow_mismatched_component_counts as 1, for
float under perspective, center_no_perspective and flat interpolation and for
uint and int flat. Vulkan matches exactly that under maintenance4 (spec 19.1.3,
Interface Matching: "if the maintenance4 feature is enabled, they are declared
as OpTypeVector variables, and the output has a Component Count value higher
than that of the input but the same Component Type"; without it
VUID-RuntimeSpirv-maintenance4-06817 forbids it). The runtime's floor requires
and enables maintenance4 (Vulkan 1.3), so this is one form on every device.
The tests:
- link: a narrower vector or scalar input, float or uint, smooth or flat,
beside matched varyings, takes its output's location and component; a
description without maintenance4 answers the gap; a wider input stays the
gap, a mesh producer's either way, and no flag stays Metal's link error;
- engine, over text modules on lavapipe's profile: for each class and
interpolation, 4 to 2, 4 to 1 and 3 to 2 lanes link, both relocated modules
pass L3 (spirv-val under the profile's settings, maintenance4 among them),
and the input's Location is the output's, past a second varying.
Red: link still answers the narrower input with the gap.
The golden table re-blessed at 39e5964c2a (varyflag step 1 rebased on 9e7034c214), on the Apple
M3 Max, job m3-max-87716 (inventory, golden, printouts, linkhalf and chains each exit 0):
- the semantics line moves 2392 -> 2393, step 1's own number (2391 at that bless, renumbered
when the stack moved onto pin AB', whose PR 30 and fix-forwards took 2391 and 2392);
- no cell moves and no row is added.
The draw probe (Apple M3 Max, macOS 27.0.1, job m3-max-87586; 720 render
pipelines, one draw each, a pixel read back) measured what 87508 left open:
- flag 0 refuses every count mismatch, as no flag does (180 each); 1 makes all
180;
- under 1, a narrower fragment input reads the vertex output's first lanes
(90 rows: float under perspective, center_no_perspective and flat, uint and
int flat, a second varying absent, after or before);
- a wider input reads the output's lanes, and past them no constant: 150 lanes
read 147 distinct values, none of them 0, 1 or a value either varying wrote.
EntryPoint::mismatched_component_counts's doc now states these facts. Docs only.
Job m3-max-87508 ran each vertex and fragment module with the agx flag at 1
(alone or beside irc.version_*) and with no flag at all; it never ran a module
stating 0. The field's doc, and the commit messages of 7285b878a1 and
02b5d3d1a4, said the pipeline is refused at 0: unmeasured. The doc now says
the refusals measured (no flag on the vertex module, whatever the fragment's)
and that 0 is read as no flag, which is not measured. The decoder is unchanged.
Metal makes a render pipeline whose fragment function reads a user varying at
another component count than the vertex function writes when the vertex
function's module states agx.allow_mismatched_component_counts as 1 (Apple M3
Max, macOS 27.0.1, job m3-max-87508; float4 written and float2 read, and float2
written and float4 read; refused at 0, with no flag, and with the flag on the
fragment module alone; irc.version_* changed nothing). Link answered every such
pipeline Unsupported{UnmatchedVarying, NotRepresentable}, Metal's link error,
for a pipeline Metal makes.
- AIR: module_flags returns whether the agx flag is 1, and the decoder sets
EntryPoint::mismatched_component_counts on each vertex (post-tessellation
included) and mesh function the module defines; fragment, kernel and object
functions never carry it. The flag's docs state the probe's facts.
- Lowering copies it to StageIo::mismatched_component_counts.
- Link (varyings, mesh_fragment): a fragment input whose type differs from
its producer's output in component count alone (same numeric class and source
width), behind a producer carrying the flag, is
Unsupported{UnmatchedVarying, NotImplemented}; everything else stays
NotRepresentable. A mesh producer is not probed yet, so it stays the typed gap.
- Feature::UnmatchedVarying's doc says both; reach.tsv marks it rare;
docs/REFUSALS.md regenerated (it also drops TextureSwizzle's four translator
sites, which a49e4a61c4 and its neighbours removed without a regeneration).
- SEMANTICS_VERSION 2393 (a refusal's class and an interface fact change;
2392 is PR 30's and its fix-forwards', pin AB').
Verified: the red tests of 7285b878a1 (red in job m3-max-87576) pass here;
the green job is named in the lane's report.
The red commit's EntryPoint field left two test literals in the translator
crate without it (memory plan and simd uniformity tests); the red job
m3-max-87574 stopped at the build on them.
Metal makes a render pipeline whose fragment function reads a user varying at
another component count than the vertex function writes when the vertex
function's module states agx.allow_mismatched_component_counts as 1 (Apple M3
Max, macOS 27.0.1, job m3-max-87508: float4 written and float2 read, and float2
written and float4 read; refused at 0, with no flag, and with the flag on the
fragment module alone). Link refuses it as Metal's link error
(Unsupported{UnmatchedVarying, NotRepresentable}).
This adds the fact's two fields, set nowhere yet, and the tests that hold the
label:
- EntryPoint::mismatched_component_counts (AIR): the decoder test expects it on
the module's vertex and mesh functions under 1, nowhere else, and nowhere
under 0 or no flag.
- StageIo::mismatched_component_counts, encoded (ARTIFACT_FORMAT_VERSION 617).
- A link test: a flagged vertex or mesh producer writing wider or narrower than
the fragment input expects NotImplemented; an unflagged one, the flag on the
fragment alone, another numeric class or an unwritten key stay the link error.
- An engine test over text modules compiled on lavapipe's profile: the vertex
module's flag reaches the stage interface and the link answers as above; the
same count links.
Red: these three fail at this commit (the field is never set, link answers
NotRepresentable).
The golden table re-blessed at b991ca5474 (PR 30's head 6d9f774d63, its fix-forwards and SEMANTICS
2392), on the Apple M3 Max, job m3-max-87900 (inventory, golden, printouts, linkhalf and chains each
exit 0):
- the semantics line moves 2390 -> 2392 (PR 30's 2391 and the fix-forwards' 2392);
- no cell moves and no row is added: no committed fixture declares a memory intrinsic in the older
form.
A legacy memory intrinsic's alignment that is not a power of two (or above 2^32) is now refused
as a malformed record, not ImmediateNotConstant (f32b143935), and a legacy call whose volatile flag
is not a constant now meets the verifier the current form meets instead of failing decode's verify
(3e311ec8ac). Both change what decode answers for a module, so cached answers keyed by the old
version must not be reused.
Decode upgrades a call of the older LLVM's llvm.memcpy, llvm.memmove or llvm.memset (an i32
alignment before the volatile flag) by removing the alignment operand. Where the volatile flag is
not a constant in the function that makes the call, decode keeps the upgraded call
Callee::Unbound with its template, as it keeps a current-form call (bitcode/function.rs). The
verifier's legacy arm took only Callee::Llvm, so such a call failed Verify(OperandType) in the
Module::new that decode runs (bitcode/decoded.rs), refusing the whole module. The arm now also
takes Callee::Unbound { template: Template::Llvm(Memset | Memcpy | Memmove) }, under the same
conditions: not variadic, one operand short, and a five-parameter declaration whose fourth
parameter is i32 and fifth i1.
What such a call then meets, read on the current form's path (not run): canonicalization's SCCP
binds an Unbound call with Template::bind over its four operands and the current signature
(canon/sccp.rs), so where inlining makes the flag a constant the call becomes Callee::Llvm, the
form the PR already verifies and translates; where the flag stays a kernel parameter or a value
the run computes, the post-check refuses it at the call in the inlined entry as
InvalidInput(Intrinsic(ImmediateNotConstant)) (canon/mod.rs), the refusal a current-form call
with that flag meets (docs/API.md, OpenCL C kernels).
Makes a_legacy_memory_intrinsic_with_an_unbound_volatile_flag_verifies pass (expected; not run:
the brief holds every build and test until PR 30 merges). No SEMANTICS_VERSION bump here: PR 30's
2391 covers its decode change, of which this is part. Checked: cargo fmt clean.
New test a_legacy_memory_intrinsic_with_an_unbound_volatile_flag_verifies: a kernel
@k(ptr addrspace(1) %p, i1 %v) calls the older LLVM's llvm.memcpy.p1i8.p1i8.i64, declared
void (ptr, ptr, i64, i32, i1), as memcpy(%p, %p, 400, i32 16, %v). It expects decode to upgrade
the call (four operands, align 16 on both pointers), keep it Callee::Unbound with the template
Llvm(Memcpy), as a current-form call whose flag is not a constant is kept, and the module to
verify (verify_module_level, the Module::new that decode runs).
At ace196acec the verifier takes a call one operand short of the legacy declaration only when its
callee is Callee::Llvm, so this one, whose flag is a parameter, fails Verify(OperandType), and
the whole module is refused at decode. Expected to fail here; the next commit makes it pass.
legacy_copy_module gains LegacyAlign::VolatileParameter(bytes): a constant alignment, and the
volatile flag the kernel's second parameter, an i1. The other variants build the same module as
before.
Not run: the brief holds every build and test until PR 30 merges. Checked: cargo fmt clean.
Decode upgrades a call of the older LLVM's llvm.memcpy, llvm.memmove or llvm.memset (an i32
alignment before the volatile flag) by moving the alignment to the pointers' align. A constant
alignment that is not a power of two (or is above 2^32) was refused as
Intrinsic(ImmediateNotConstant), whose own doc says the operand is not a constant. It is now
Bitcode(MalformedRecord { block: FUNCTION_BLOCK, code: FUNC_CALL }), the decoder's answer to an
align attribute of such a value (attrs.rs). An alignment that is not a constant stays
Intrinsic(ImmediateNotConstant) at the call.
How: upgrade_legacy_memory returns a crate-private LegacyAlignmentError, Intrinsic(e) for the
immediate read's error and Malformed for a value Align::from_bytes refuses; the call's decode maps
Malformed to the CALL record's malformed-record error and Intrinsic(e) to the input error at the
record, as before. No public type changes; the outcome class is InvalidInput either way.
Makes a_legacy_memory_intrinsic_s_alignment_must_be_a_constant_power_of_two pass (expected; not
run: the brief holds every build and test until PR 30 merges). No SEMANTICS_VERSION bump here:
PR 30's 2391 covers the decode change, and only the error kind of an input refused either way
changes. Checked: cargo fmt clean.
a_legacy_memory_intrinsic_s_alignment_must_be_a_constant_power_of_two now expects a constant
alignment of 24 on the older LLVM's llvm.memcpy declaration to fail decode as
Bitcode(MalformedRecord { block: FUNCTION_BLOCK, code: FUNC_CALL }), and an alignment that is the
kernel's i32 parameter to fail as ImmediateNotConstant, as before.
Why: IntrinsicError::ImmediateNotConstant says "An operand that must be an immediate is not a
constant", and 24 is a constant. The decoder's precedent for a value that is not a power of two
where an alignment must be one is the align attribute's: MalformedRecord (attrs.rs).
Expected to fail at ace196acec, which reports both alignments as ImmediateNotConstant; the next
commit makes it pass. Not run: the brief holds every build and test until PR 30 merges.
Checked: cargo fmt clean.
Modules from older LLVM-based Metal frontends couldn't be translated. They declare llvm.memcpy,
llvm.memmove and llvm.memset with an i32 alignment before the volatile flag, and that declaration
was refused as Intrinsic(DeclaredSignatureMismatch).
The declarations involved:
- llvm.memcpy and llvm.memmove: void (ptr, ptr, i64, i32 align, i1 volatile)
- llvm.memset: void (ptr, i8, i64, i32 align, i1 volatile)
- seen in typed-pointer bitcode from metalfe-32023.35
What changes: decode upgrades such a call the way LLVM's own reader does (UpgradeIntrinsicCall): the
alignment operand is removed, and its value becomes the align of the pointer operands. In detail:
- the removed operand's attributes go with it, and later attributes move down one place;
- the alignment replaces any align the call states, and an alignment of 0 removes it
(setDestAlignment, setSourceAlignment);
- a non-constant alignment, or one that is not a power of two, is refused as ImmediateNotConstant;
- the verifier accepts the one-short call only when the declaration has exactly that legacy form.
No public API changes.
Evidence:
- On 466 real libraries from one metalfe-32023.35 game, all refused before: 66 now translate (48
render or compute functions, plus 18 kernels given a stage-input descriptor). Each is
byte-identical to the translation of the same library after llvm-dis upgrades it with LLVM's
reader. The other 400 stop at an unrelated later refusal (Lowering(StageIo)), the same on both
forms.
- New tests: a_legacy_memory_intrinsic_states_its_alignment_on_its_pointers,
a_legacy_memory_intrinsic_s_alignment_must_be_a_constant_power_of_two,
a_legacy_memory_intrinsic_s_attributes_move_with_its_operands,
a_memory_intrinsic_call_one_short_only_of_the_legacy_declaration. Undoing each part of the change
on its own makes at least one of them fail.
- Linking a legacy-form module with a current-form one is not tested.
Version: SEMANTICS_VERSION becomes 2391, because inputs refused before can now compile.
Golden table: unchanged; this change adds no fixture.
Not run: the GPU device tests, the Windows clippy legs and the CI matrix.
The golden table re-blessed at 3c3d214397 (PR 29's head 8f117956ef and its docs fix-forward), on
the Apple M3 Max, job m3-max-87637 (inventory, golden and printouts each exit 0):
- the semantics line moves 2389 -> 2390, PR 29's own number;
- one row is added, the new fixture vertex_stack_return_aggregate.ll (stack_return_vertex), the
same hash on every profile.
No existing cell moves, as the PR's reading predicted: no committed fixture loads or stores a
whole aggregate in thread memory.
The fix-forward of PR 29's reading (lane pr29read; docs only, no code):
- engine_stack_return_aggregate.rs says it compiles on one profile, `nvidia-rtx50-linux`, and
that its expectations row holds the fixture to `ok` on every committed profile, as the
converter-flags engine test does since d3316d621e.
- canon/aggregates.rs's module doc drops "left whole, it was refused" (history); the refusal a
whole access of a larger aggregate meets is named where the doc says lowering refuses it.
- The PR's new comment lines over 100 columns are wrapped: aggregates.rs's opening paragraph,
canon/mod.rs's pass list and its call-site comment, and tests/aggregates.rs's module doc.
Checked: cargo fmt --all makes no change; the comment lines the PR added are at most 100
columns.
Vertex functions that build their return value on the stack couldn't be translated. A whole struct
stored to or loaded from an alloca reached lowering, which handles only scalars and vectors there,
and was refused as Lowering(Access) AccessType.
The shape involved, seen in modules Apple's Metal shader converter wrote:
- a store of zeroinitializer to an alloca of the return struct;
- stores to its members;
- one load of the whole struct.
What changes: the split that already turns a whole-aggregate access of device, constant and
threadgroup memory into its members' accesses now covers stack memory too. Still kept whole, and
refused by lowering as before:
- a volatile access;
- an aggregate that holds a pointer;
- an aggregate with more members than the split takes.
No public API changes.
Evidence:
- a_stack_aggregate_is_split checks the member stores and loads, their alignments and byte offsets,
the two insertvalues, and that no whole-struct access is left.
- what_is_not_split_stays_whole gains the three stack cases above.
- The new fixture compiles, links and validates.
- a_stack_aggregate_is_split and a_return_value_built_in_a_stack_slot_compiles fail without this
change.
- No release-mode timing was taken; the split adds a bounded walk per whole stack access.
Version: SEMANTICS_VERSION 2389 -> 2390, because inputs refused before can now compile.
Golden table: left for the bless on development; golden_hashes_match_the_table lists the new
fixture's cells. The fixture's expectations row is included.
Not run: the GPU device tests, the Windows clippy legs and the CI matrix.
CI run 47469915099 at 69664cbc1a failed "Clippy under each feature alone" on both
legs: with no feature, `slot` in pipeline/api_tests.rs is never used (dead_code under
-D warnings). a49e4a61c4 removed its last caller outside `serde_round_trips`, and the
merge check runs clippy only with all features, so nothing caught it before the push.
The helper and the three `sym` types it names move into `serde_round_trips`, where
every caller is. The empty `bind_serde_round_trips` module goes with it: it holds
nothing.
Checked: cargo fmt clean. The per-feature clippy (metal2vulkan none, serde, ash,
cli; metal2vulkan-air none, serde) runs on this commit as its own leg.
PR 28 (74e4ad9d3a) added the owned fixture kernel_converter_module_flags, whose cells the
contribution left for this bless, and the hoist containment (7a066a4b80) checks a load the
translator makes where the program did not run it in the address form, which moves that form's
cells. golden_hashes.tsv gains the fixture's row and 23 rows move, re-blessed on macOS (M3 Max,
job m3-max-87519, BLESS_JOBS=4); after the bless the job's golden, inventory, printouts, linkhalf
and chains checks report 0. Data only: no source changes.
7a066a4b80 (a load made where the program did not run it is checked in the address form) bumped
SEMANTICS_VERSION from 2387 to 2388. Rebased onto d3316d621e, whose development already says
2388 (1c685f0524, the hoist's number after PR 28 took 2387), the same textual change merged
without a conflict, so the containment shared the hoist's number. A cache written at the hoist
alone holds unchecked entry loads in the address form; 2389 keys the checked ones apart.
Verified: the version line diffed against d3316d621e at staging (2388 at the base, 2389 here);
the touched suites at this tip run in the CPU job named at landing.
engine_hoist_contain gains a second kernel: a short arm beside a quad_broadcast_first, which
Metal's backend speculates, reads k, a 4-byte constant reference, behind a store to out that
keeps the hoist away. canon's arm speculation runs that load in every lane of the branch's block
and marks it speculative (99bcd849f6); the test asks that on every identity profile the address
form reads k's SlotBounds and the zero range, and loads it through a selected address. At
8f8617ca5d, where speculate marked nothing, the load is at a constant offset and unchecked, so
the test is expected to fail there (not run at the base).
Evidence for 99bcd849f6 and this branch, recorded here as that commit is already reported:
- Consumer use of InstKind (the public field InstKind::Load::speculative): the consumer's
checkout at development 985ecd39f0 and its 27 steelbrain/* tips younger than a day,
git grep -w -F InstKind and git grep -F metal2vulkan_air::ir over *.rs: 0 code hits.
- The three guest kernels the hoist was timed on: their SPIR-V is equal at 8f8617ca5d and at
960999d529 on all 10 committed RADV, ANV and NVIDIA profiles (job m3-max-87433, release
command line), and equal to the hoist lane's measured tip build, so the hoist's gains on the
RX 7900 XTX, the Iris Xe and the RTX 3090 are expected (same SPIR-V as the measured build on
the bound-form profile). It differs only on the address-form profiles (lavapipe,
gate-lavapipe-x86_64, moltenvk-m3), where the hoisted load is now checked.
- Golden table at 960999d529 (job m3-max-87441, every changed cell listed): 60 cells move, all
on the five address-form profiles, none on a RADV, ANV or NVIDIA profile.
- Authored-compile census at 960999d529 (job m3-max-87432): 2390 cases, 0 differences,
0 regressions, 0 failed, 0 table rows changed; slowest compile 1120 ms.
On a profile with the bound form, flag's slot is a storage view, so the module has one
device-address load (extra's, selected), not two. Job m3-max-87420 at 99bcd849f6 failed only this
count on amd-780m-hawkpoint-radv ([1, 0] against [1, 1]); its bounds and zero-range assertions
held, as did every other engine_hoist_contain, engine_identity_contain, engine_bound_buffers and
engine_word_phases test and the api_signatures table.
The constant-reference hoist makes a kernel's load of a constant T& at a fixed offset in its entry
block, so every thread of every dispatch reads it where the program read it only behind a
branch. Metal requires the reference's binding only where the program reads it, so an app may
leave it unbound, or bound shorter than the object, while that branch is not taken. In the
bound form the pipeline's robust buffer access contains the read (a null descriptor or a short
range reads zero), but where the slot is reached by its device address an access at a constant
offset was never checked: a short binding was read past its end by every thread, and an unbound
one past the nil buffer's 64 KiB under a larger object, a GPU fault where a mapping ends.
The mark: InstKind::Load gains `speculative`, false for every decoded load. const_hoist sets it
on each load it moves; speculate sets it on each load of an arm it flattens (a constant
reference's, at offset 0, run in every lane of the branch's block: the same window, narrower);
aggregates carries it to a split load's members. Lowering reads it: a speculative load's slots
are noted as reached at a variable offset (SlotBounds and, for a device-address read, the zero
range), and emit::prepare checks it against the slot's buffer whatever its offset, reading zero
outside, as an access at a run-time offset is. The bound form is unchanged: a bound slot drops
its bounds and its view is not checked in the shader. Covered: a device without the bound form's
queries, a slot bound below its argument's alignment on one with them, and every render stage.
const_hoist also leaves a reference whose pointer another root may share (the parameter or an
address step from it as a phi, select or insert operand, a stored value or the result): such a
pointer may meet one loaded from memory, and lowering then reaches the reference by a device
address no check bounds.
Docs: const_hoist's and speculate's module docs, canon's list, ARCHITECTURE.md, API.md sections
1 and 5, the runtime README's bounds paragraphs and push layout, PushField::SlotBounds. The
public signature table is re-blessed for InstKind::Load (no consumer use of InstKind: zero hits
in the consumer's development and its day-old steelbrain/* tips). SEMANTICS_VERSION 2388.
Tests: engine_hoist_contain (red at the base in jobs m3-max-87402 and m3-max-87403: no
SlotBounds for the hoisted load's slot on any identity profile or for a word-bound slot on a
bound-form profile, and the interpreter traps OutOfBounds at EXTRA+98304 and NIL+98304 with the
flag off); constant_hoist's loads are speculative where moved and a shared reference keeps its
loads; speculate's arm load is speculative where speculated and not where kept.
The case loop stopped at the first trap, so the red showed only the short binding. Each case now
runs and every failing one is named, so the base shows the unbound case (an object over the nil
buffer's 64 KiB) as well.
Verified at the base in job m3-max-87402 on the parent commit: the short case traps OutOfBounds
at the hoisted load.
The constant-reference hoist makes a kernel's plain load of a constant T& at a fixed offset in its
entry block, so every thread of every dispatch reads it where the program read it only behind a
branch. Where the slot is reached by its device address, a load at a constant offset is never
checked against the slot's bounds, so a binding shorter than the object, or an unbound one (the
runtime's 64 KiB nil buffer) under an object over 64 KiB, is read past its end by every thread.
engine_hoist_contain's kernel reads extra (a 128 KiB constant reference) at byte 98304 only
under a flag from another buffer. The new tests ask that, in the address form, the hoisted load
read its slot's bounds and go through an address selected toward the zero range on every
identity profile; that a slot bound below its argument's alignment on a bound-form profile do
the same, and a bound view stay unchecked; and that on the CPU interpreter, with the flag off,
extra bound 16 bytes long or unbound reads nothing outside (no trap) and out keeps its words.
Expected red at the base: the three assertions on the check fail, and the interpreter traps
OutOfBounds at the hoisted load for the short and unbound cases.
PR 28's engine test compiles its fixture on nvidia-rtx50-linux alone, while its row in
public_fixture_expectations_engine.tsv holds it to ok on all 15 committed profiles. The module
doc now says which test covers what. Documentation only; no behaviour changes.
PR 28 (74e4ad9d3a, the converter's module flags, merged on GitHub by fast-forward) bumped
SEMANTICS_VERSION from 2386 to 2387. The constant-reference hoist (062b71cf63, rebased onto the
PR head) made the same textual change, 2386 to 2387, so the rebase merged the two without a
conflict and both changes shared one number. A cache written under the PR alone and one written
with the hoist must not match, so the hoist's translation takes 2388.
Verified: the rebased development differs from its pre-rebase tip (8f8617ca5d, kept as
steelbrain/dev-before-pr28) by exactly the PR's diff less its version line (6 files, +115/-3).
The hoist (494bf5f743) moves a kernel's constant-reference loads into its entry block, so the SPIR-V of
the kernels it reaches changes. 11 rows of golden_hashes.tsv move, re-blessed on macOS (M3 Max, job
m3-max-87341, BLESS_JOBS=4); after the bless the job's golden, inventory, printouts, linkhalf and chains
checks report 0. Data only: no source changes.
A kernel often reads a constant T& parameter only behind its bounds branch
(if (gid >= n) return; out[gid] = in[gid] * scale;). canon::const_hoist
moves each such load into the entry block, its value reaching its uses by
dominance, where all of these hold, each read from the body's structure and
the entry's ABI:
- a plain load (not volatile, not atomic) of an integer, a float or a vector
of them; a pointer's or an aggregate's load stays;
- its address is a parameter the ABI binds as a constant-space buffer with a
stated air.buffer_size and no function-constant predicate (a constant T&),
or that parameter plus GEPs at constant, non-negative indices and bitcasts,
which move with it; the bytes read lie inside [0, air.buffer_size). The
address is then one address for every thread, and each form contains it at
the entry as where it stood: the same slot, a bound storage view under its
robust buffer access, or a device address at a constant offset, which no
check clamps in either place. A constant T* (no size), an offset past the
object and an offset the run computes stay;
- no instruction on any path from the function's start to the load may write
device memory or order another thread's writes before it: a store or
memory intrinsic whose destination is not thread or threadgroup memory, an
atomic or atomic load of any space, a fence or barrier, a texture write,
or any call but arithmetic, conversions, group operations, built-in reads
and texture reads and queries. A forward reach from every writing block
marks the blocks a write may precede; a load's own block counts up to it.
Where it lives: a new canon pass beside speculate, not inside it.
speculate.rs is a fidelity pass: it gives Metal's measured if-conversion of
group operations, keyed by Metal's budgets, and its moves change what a
program observes. This one changes nothing a program observes and its rule
is soundness alone (no write before, the access contained), so it has no
place in speculate's measured decisions; it shares rewrite::BodyEdit's moves
with it. It runs after aggregates::expand, so an aggregate load of a
reference, split into its members' loads, moves too, and before the
OpenCL hidden buffers and the program-scope bindings add parameters. Kernels
only: the measured kernels are compute kernels.
The planner's measurement (the audit seat's lab pass, which moved every load
at a constant parameter itself) on the compute benchmark's guest kernels FM
copy, FM vertical and Fluid's pressure step, GPU time of 20 dispatches, arms
alternated, output digests equal in every pair: the RTX 3090 -3.6%, -0.1%,
-9.5%; the RX 7900 XTX -7.3%, -0.7%, -12.2%; the Iris Xe +0.4%, 0.0%,
0.0%. On the Iris, ANV sinks the loads back into the branches: FM copy's
compiled code goes from 134 to 132 instructions (1026 to 912 cycles), its 8
SENDs unchanged (read from INTEL_DEBUG=cs, not from Mesa's source).
SEMANTICS_VERSION 2386 -> 2387: a kernel whose constant-reference loads move
translates to other words.
Verified: pending the green job.
canon/tests/constant_hoist.rs builds the bounds-branch shape of the three
compute kernels the hoist was measured on, synthetic and ours:
kernel k(device float* out, constant uint& n, constant float& scale,
constant P& p, uint gid) { if (gid >= n) return; out[gid] = float(gid) *
scale + p.bias; }, and specializes it.
- Positive: the loads of scale (the parameter itself) and p.bias (a GEP at
byte 4 of the 8-byte object) are made in the entry block beside n's, and
the store stays behind the branch. Red today: both loads stay behind it.
- Refusals, each keeping its load behind the branch: a store to out before
the loads; an AIR atomic add before them; a callee that stores to out and
then reads scale (inlined); p.bias read at an offset the branch's block
computes ((&p.first)[gid & 1]); scale as a constant float* (no
air.buffer_size); p.bias read at byte 8, past p's 8 bytes. These pass
today (nothing moves); each goes red with its guard removed.
Verified: pending the red job.
Extends every_device_imports_host_memory_and_releases_it_after_the_free: the fill of the import's
second half is committed held for a shared event's value, and the buffer and then the block, the
consumer's last handles of the import, drop while it is pending. The release must not have run 20 ms
later; once the event's value lets the fill run, the release runs, the gauges come back, and the
pages hold what the fill wrote (the first half the host's bytes). The test then writes the pages
again as their owner, commits a later command buffer, waits for the device to go idle, and checks
the pages hold its own bytes: nothing of the runtime wrote them after the release. Before, the test
waited for the fill and read the pages while the import was still held.
A texture made in place over host memory's import (integrated or CPU devices) restores the
import's bytes with a save, a move home and a write-back in one batch of the runtime's own, and the
make waits for that batch through Done::wait. Done::wait returned any result of vkWaitSemaphores
other than VK_TIMEOUT as an Error::Vulkan. Where that result was VK_ERROR_OUT_OF_HOST_MEMORY,
VK_ERROR_OUT_OF_DEVICE_MEMORY or VK_ERROR_UNKNOWN on a live device, the make returned Err while the
batch, and with it the write-back of the saved bytes, was still pending: the import's pages were
written after the caller saw the make fail, and may have released or reused them.
Vulkan's words: vkWaitSemaphores lists those results as failures and says nothing of the wait's
condition with them (only that with a loss the call "must return in finite time with either
VK_SUCCESS or VK_ERROR_DEVICE_LOST"); a failed call leaves every submitted batch pending, executing
as the queue runs it, whatever the host's wait returned. Only a loss ends what is pending: "for the
purpose of determining whether a command buffer is in the pending state ... a return value of
VK_ERROR_DEVICE_LOST is equivalent to VK_SUCCESS" (Lost Device).
So Done::wait now makes such a call again through complete::wait_through, as the device's idle wait
and an import's bind wait already do, until it succeeds or the device is lost, and returns Err only
at a loss, as its doc already said. Every caller of Done::wait gets that: the restoring make's
drain and batch waits, the upload room and staging span waits, a surface making's wait, and a
texture read's staging wait (whose span went back while its copy could still write it). A lasting
failure on a live device waits as long as it lasts. The README's restore paragraph says the make's
wait returns only once the batch completed or the device is lost.
The tests' stand-in for a failed wait (Core::fail_waits, inside wait_through) now reaches
Done::wait. New device test failed_waits::a_failed_restore_wait_is_made_again: with a Busy gate
holding the device's queue, a make in place whose batch wait fails at its first call must not
return while the gate holds the batch, then returns the texture in place once it opens, counted as
one restoring make with its two restore copies, and the pages hold the host's bytes.
crates/metal2vulkan/src/device/mechanism.rs moved in fddfdd2ce1, so the
runtime-sources fingerprint moves with it. The validation suite at the
lane's tip (job m3-max-87020) failed only this guard and printed the new
hash; pin-compute over development's tree gives the same value.
- crates/metal2vulkan-runtime/src/error.rs: both RuntimeFact causes
(the draw's and the kernel's) gave "ResourcePresence" as an example
fact name; that fact no longer exists. The example is now "FlatGrid"
(RuntimeFact::name of RuntimeFact::FlatGrid, which neither the
kernel's nor the draw's fact match in the runtime names). The
kernel's cause also named "a resource's presence or a sampler's
coordinates" as facts the runtime does not name; neither is a
RuntimeFact now, so the examples go.
- crates/metal2vulkan/src/tests/engine_extended_range/levels.rs: the
module doc and the 3D test's doc told of development's resident-table
tests and "the one form, as development's default policy did". They
now say what holds: the conformance probe extended_linear_mip_blends
measures Metal's mip filters, and the identity domains refuse such a
sample with its texture argument.
- crates/metal2vulkan-validation/src/executor_contract/out_of_bounds/
tests.rs: the identity-domains containment test's doc ended with a
sentence on the resident table and the handle table, which the test
no longer runs; it goes.
Searches: git grep -n 'ResourcePresence\|resident-table' over crates and
docs -> 0 hits after (3 before, all these sites).
refusal_surface.py --check passes.
Correction to 6d3a51f4fe's body: open_cl_1d_images at f6fc9cf282 is
8 hits in crates/metal2vulkan-air and 3 in crates/metal2vulkan, not 7
and 4. The total, 11, was right.
Entry.open_cl_1d_images held the texture indices of an OpenCL-mode
kernel's 1D images. No caller in this tree read it: metal2vulkan's two
readers were test literals setting it to the default, and
pipeline::compile's bound_entry dropped canon::opencl::entry's set
(`let (ep, _) = ...`). Deleted:
- the field, and its binding in canon::specialize;
- the set canon::opencl::entry built, along with the AbiInt match that
filled it; entry now returns the EntryPoint alone, and its retyping
of each 1D image to the 2D texture Apple's OpenCL binds is unchanged;
- the BTreeSet imports of opencl.rs and tests/opencl.rs;
- the two test literals.
opencl_1d_images_take_their_2d_textures_types now checks, in place of
the set, that without the mode each image keeps its own 1D type: the
names bound_texture leaves at indices 1 to 3.
Searches:
- this tree at f6fc9cf282: git grep -n open_cl_1d_images -> 11 hits
(crates/metal2vulkan-air 7, crates/metal2vulkan 4 with the signatures
table); 0 after.
- reims-vgpu c16328ee3d (and cc1f47b30b): git grep -n open_cl_1d_images
-> 0 hits.
The signatures table is blessed: exactly one record removed
(metal2vulkan-air::Entry.open_cl_1d_images).
Correction to 141dabb1e8's body: its swizzled_storage count at
f6fc9cf282 is 33 hits, not 32 (crates/metal2vulkan/src/cache/mod.rs has
5, not 4).
LoweringInputs::swizzled_storage and VariantKey::swizzled_storage have
no setter outside the translator's own tests. Since the identity domains
refuse any slot whose SlotPlan::swizzle is set
(IdentityCause::TextureState), a slot of the variant could only lead to
a refusal or to nothing. Nothing else reads the swizzle any more: the
emit side went in 6a08124f54.
Deleted with it:
- the cache key's "swizzled-storage" block;
- lower::texture::swizzled_storage and ::swizzles;
- SlotPlan::swizzle (identity_lowered now tests offset_base alone);
- the NotImplemented(TextureSwizzle) refusals of the variant's ulong,
short-lane and imageblock-slice accesses (Feature::TextureSwizzle
stays: bind/heap.rs refuses with it);
- the bicubic and packed-normalized sampling arms that read the
variant, and the read path's storage_swizzle alpha term;
- the public RuntimeFact::TextureSwizzle, which only swizzles()
produced, with its codec entry, mechanism, identity_unsourced arm and
name. The mechanism test's variant index 35 now holds PrivateList and
the covered range is 0..55.
Tests: tests/engine_swizzled_storage.rs goes (its reference rules
checked only its own helpers once the emit side was gone), and
engine_extended_range/bicubic.rs loses its swizzled cases. Docs fixed:
LoweringInputs, VariantKey, the sampler select and extended module
docs, IdentityCause::TextureState's examples, and the runtime README's
identity refusal list (TextureSwizzle no longer named).
No compile with empty inputs changes: every deleted arm was gated on
the set. The RuntimeFact encoding loses a variant; the
ARTIFACT_FORMAT_VERSION bump to 616 in 9cc7dd223a on this branch covers
it.
Searches:
- this tree at f6fc9cf282: git grep -n swizzled_storage in
crates/metal2vulkan{,-runtime,-air,-validation,-harness,-devtools}
and docs, fixture names (rrp_swizzled_storage) and the conformance
case module aside -> 32 hits, all in crates/metal2vulkan; 0 after
(crates/metal2vulkan-runtime: 0 before).
- reims-vgpu c16328ee3d (and cc1f47b30b): git grep -n swizzled_storage
-> 0 hits; git grep -n RuntimeFact -> 0 hits.
The signatures table is blessed: exactly 3 records removed
(VariantKey.swizzled_storage, LoweringInputs.swizzled_storage,
RuntimeFact::TextureSwizzle). refusal_surface.py --check passes, so
docs/REFUSALS.md does not change.
StageSpec.unread_bits and the public SpecConstant.unread_bits were set
and never read. spirv::spec_bits::mark_unread computed them on every
compiled module, and link::specialize intersected them per key. Nothing
read the result: not the runtime (crates/metal2vulkan-runtime has no
hit), not the validation or conformance crates, and not the consumer.
Deleted:
- both fields, with their codec entries (cache/codec.rs);
- link::specialize's unread map and its doc sentence;
- compile.rs's mark_unread call;
- spirv/spec_bits.rs (the demanded-bits pass, 299 lines);
- its test module tests/engine_spec_bits.rs (149 lines);
- api_tests.rs's literal field.
engine_skeleton's expected StageSpecs are now plain StageSpec::new.
The SPIR-V a compile emits does not change: the pass only wrote the
interface fields.
ARTIFACT_FORMAT_VERSION goes from 615 to 616: StageInterface and
SpecializationLayout lose a field from their encoding.
Searches:
- this tree at f6fc9cf282: git grep -n unread_bits -> 13 hits, all in
crates/metal2vulkan (the fields, codec, link, spec_bits, three tests,
the signatures table); 0 after.
- reims-vgpu c16328ee3d (and cc1f47b30b): git grep -n unread_bits -> 0
hits.
- reims-vgpu c16328ee3d: git grep -n spec_bits -> 3 hits, all in
crates/reims-vgpu-c/link-order.txt (a link order list of symbol
names; its doc says a function removed since is skipped and costs
only the order's speed).
The signatures table is blessed: exactly one record removed
(SpecConstant.unread_bits). The proof jobs at the branch tip carry the
suites and clippy.
The engine's candidate now draws object and mesh cases through the
runtime's mesh pipeline, so the Linux qualification step runs the 13
committed mesh and object cases that draw on lavapipe against their
Metal rows. Two committed cases stay out: the object function's
threadgroup memory (3ff818075803), which the runtime refuses at the
state's make and the candidate meets as mesh_threadgroup_memory, and
the mesh function that numbers its primitive from its payload
(d2c517d1426d), whose mesh function aborts lavapipe's LLVM ("Cannot
emit physreg copy instruction").
Verified: the 13 cases matched Metal on lavapipe through corpus-vulkan
at c1bdd1e491 (job m3-max-86906); this commit's script run follows.
The previous commit also raised mesh_threadgroup_memory from a case's authored threadgroup_memory
(executor_contract::case_requirements). The mesh case's mapping refuses the case's literal
families (require_case_families), so the authored compile census's preparation, which sets the
requirement aside to compile the case, was refused too (the lavapipe validation suite, job
m3-max-86881: the_census_compiles_the_mesh_pipelines, engine_case_families_follow_the_case_literals
and the engine_mesh threadgroup test failed). The function's reflection alone raises it
(mesh_threadgroup_memory_requirement), as it raised the requirement this one narrows.
The runtime makes and draws mesh render pipeline states (Device::new_mesh_render_pipeline_state,
the render encoder's set_object_*, set_mesh_* and draw_mesh_* calls), so the engine's candidate
now draws an object or mesh case as the Metal oracle draws it, instead of refusing every one as
mesh_render_pipeline. candidate::platform::runtime_mesh makes one mesh render pipeline state of
the oracle's descriptor (MeshTemplate::descriptor: the case's own function and the partners its
draw names from the row's library, the generated stages of an observation or object launch from
the companion's, its color formats or the 1x1 R8Unorm sink without rasterization), makes and
binds the own stage's buffers, argument-buffer members, textures and samplers through that
stage's setters (runtime_render's Stages, which now binds a stage of either pipeline kind and
selects a stage's output for both), makes each color target a Shared 2D texture of one sample
written from the case's bytes (Targets::of_colors), draws once (draw_mesh_threadgroups or
draw_mesh_threads), and reads the output back. A threadgroup within Metal's maximum and past the
state's on the device (Limit::MeshThreadgroupThreads) records not_enabled, as a sample count the
device makes no texture of does.
One vocabulary: mesh_render_pipeline is retired, and the one shape the runtime refuses keeps a
requirement of its own, mesh_threadgroup_memory (Limit::Runtime): an object or mesh function that
declares a [[threadgroup(n)]] argument (its reflected threadgroup buffer), and a case that authors
an object function's threadgroup_memory. Its doc names the runtime's refusal it mirrors, in the
runtime README's words: "An object or mesh function with a [[threadgroup(n)]] argument is refused
at the creation (Gap::RenderPipeline), as setObjectThreadgroupMemoryLength:atIndex: and its mesh
form are not built". The authored compile census still prepares such a case to compile it
(prepare_compile), so no compile cell changes. Classification, the case checker, the executor,
the triage, census, executor-contract, requirement and compile-census tests, the validation
README, docs/VALIDATION.md and the runtime README's sentence about validation's mesh cases follow.
Versions: the structural-triage analyzer v87 (rows' requirements change). ENGINE_EXECUTOR_ABI is
not bumped: no recorded row observes the change, as the executor refused every object and mesh
case before any device and stored no row of one. SEMANTICS_VERSION is untouched: translation
output does not change. The authored compile census version is untouched: no cell changes.
Venue: lavapipe lists VK_EXT_mesh_shader with taskShader, meshShader and multiDrawIndirect, the
runtime's mesh set, so lavapipe draws mesh pipelines and is the device test's venue.
A device test (candidate::tests::engine_mesh, under m2v_cpu_icd and m2v_gpu on Linux) admits each
owned object and mesh fixture of mesh_cases for the engine's candidate, prepares it and runs it as
a run of the candidate does (run_prepared, now pub(crate)), and holds the output to the words
Metal drew for it: a mesh grid through its fragment partner, an object case through its mesh and
fragment partners, a mesh function's device write without rasterization, a mesh grid through the
generated observer, an object case's launch through the generated mesh function, and the payload
a generated object function writes (payload_order on a GPU only, as its fixture states). The
fixtures now compile for the Linux device tests too.
At this commit the test fails: the candidate refuses every object and mesh case before it maps
(mesh_render_pipeline). The next commit makes the candidate draw them through the runtime.
Verified: the red run is named in the lane's report.
Metal makes a function and its pipeline state from a specialization that leaves a required
function constant without a value, and runs it (the probe undefined_function_constant_values.m,
cases set0 and ib/*, the Apple M3 Max under macOS 27.0.1, job m3-max-86943), though Apple's
MTLFunctionConstant.required page says such a constant needs a value. What a program computes
from it is undefined, and the translation does not emulate Metal's answers, which follow no one
rule (the probe's kib, kib2 and derived reads against its gate kernel kg).
docs/API.md's "Function constants" says so, and names the case seen: a kernel whose explicit
imageblock argument is gated on a bool derived from the constant, and whose body still reaches the
imageblock on the way taken, is refused Unsupported{Imageblocks} with ImageblockCause::Missing.
The runtime README's known gaps of pipeline states records the same refusal of a state
(Error::Translation): the runtime compiles the consumer's specialized FunctionDescriptor as given
and does not consult FunctionDescriptor::needs_specialization, so a guest's specialization that
leaves the constant out reaches it.
engine_undefined_imageblock_gate pins today's answers for the probe's kib shape (its slice write
left out), on every profile that takes threadgroup memory: without a value for the constant,
Unsupported{Imageblocks} with ImageblockCause::Missing; with 0 or 0xffffffff, the kernel compiles.
Behaviour is unchanged, so no SEMANTICS_VERSION bump.
Apple's MTLFunctionConstant.required page says a required constant needs a value to specialize
the function. The probe now answers what Metal does when a specialization leaves one out, and
what it does with a kernel whose explicit imageblock argument is gated on a bool derived from one.
- A function Metal does not make prints the error's domain and code with its text.
- Cases ib/<kernel>/<how>: kib and kib2 gate an explicit imageblock on a bool derived from a
required uint constant (index 40), kib branching on the bool and kib2 on its negation; each is
made with no value, with 0 and with 0xffffffff, dispatched once, and its imageblock length,
buffer words and two texels printed. Case ib-source prints their library's source for xcrun
metal.
WHAT IT MEASURED, in the header: on the Apple M3 Max under macOS 27.0.1 (build 26A434), job
m3-max-86943, set0 (six required constants left out) makes the function and the state and
completes; kib with no value runs its buffer way with no imageblock (length 0), kib2 with no
value runs its imageblock way (length 1024) and its slice writes the expected texels. No case
errors, so no domain or code was printed.
bind/heap.rs, bind/state.rs and metal/format/mod.rs changed in the deadcode landing
(aa623881f4, 6a08124f54 replayed); pin-compute.py over the 50 listed modules (69 inputs) at this
tree gives d545bf4f7314, as the lane's validation job m3-max-86923 reported at its tip.
20030f2954 removed the open_cl_lines set from canon::opencl::entry and
from StageEntries::specialized's key, but three callers in
pipeline/compile.rs still passed it: bound_entry passed an empty set to
opencl::entry, and the render-stage and fragment lookups passed
(false, &BTreeSet::new()) where specialized now takes the bool alone.
They now pass `first` alone and `false`. bound_entry's comment loses
"whatever a variant binds": no variant binds a 1D image as a line now.
Verified: clippy job m3-max-86910 at e9ed4d85e4 reported exactly these
three errors (E0061 at compile.rs:704, E0308 at 1385 and 1624); the
rerun at this commit is the next clippy job.
of_params, deleted one commit back with the open_cl_lines variant, was the import's only user
(a.index()); clippy's unused-imports failed metal2vulkan-air at 20030f2954 (job m3-max-86909).
That commit's body names 37 hits for git grep -n open_cl_lines -- crates docs at 9db78abe7d;
the count is 53 (the same files), 0 after.
LoweringInputs::open_cl_lines, VariantKey::open_cl_lines and metal2vulkan-air's
SpecRequest::open_cl_lines named the 1D images of a kernel of OpenCL mode that a 1D texture is
bound for, which then kept their 1D type and operations. metal2vulkan-runtime never asks for
that variant: it refuses a 1D texture bound for such a kernel (Gap::OpenClLineTexture, the
encoder's check of interface.open_cl_mode), since no reading of one is documented Metal, and
nothing else in the tree sets the field.
Consumer search: reims-vgpu cc1f47b30b (its development, read only): git grep -n open_cl_lines
-> 0 hits (its only OpenCL hits are its own open_cl_mode fields and the
RGFX_COMPUTE_PIPELINE_OPENCL_MODE flag). Its generated link-order.txt names
VariantKey::lowering_inputs' closures, not the field.
Deleted:
- metal2vulkan-air: SpecRequest::open_cl_lines; canon::opencl::entry's lines argument (every 1D
image of the kernel now takes its 2D texture's type); canon::opencl_1d's kept parameters
(site, of_params, kept_params), so expand rewrites every 1D operation it lists; the doc lines
that named the variant. Entry::open_cl_1d_images stays: its doc drops the variant.
- metal2vulkan: LoweringInputs::open_cl_lines, VariantKey::open_cl_lines (is_empty and
lowering_inputs), the function key's "open-cl-lines" part (appended only when set, so every
surviving key hashes the same bytes), and compile.rs's plumbing: InputsFrom::open_cl_lines,
StageEntry::open_cl_lines, the lines half of the stage entries' (mode, lines) match,
given_inputs' clearing and the request's lines.
- Tests: the variant's half of the AIR test (renamed
opencl_1d_images_take_their_2d_textures_types, which keeps its OpenCL-mode type names and
open_cl_1d_images assertions), the api round-trip values, and the field in every
SpecRequest and LoweringInputs literal (air canon tests, memory plan tests, air_canon,
validation's check.rs).
- docs/API.md's OpenCL image paragraph named the variant; it now says each Mac's reading of a
1D texture there, which the kernel does not take.
Public surface: python3 scripts/api-signatures/signatures.py --bless removes exactly the three
field records (metal2vulkan-air::SpecRequest.open_cl_lines,
metal2vulkan::cache::VariantKey.open_cl_lines, metal2vulkan::pipeline::LoweringInputs.open_cl_lines),
a breaking change of the two published crates. refusal_surface.py reads no such field:
--check passes unchanged, docs/REFUSALS.md does not move.
Output: none moves for any input the runtime makes. A kernel compiled with an empty set, the
only one anything sent, specializes and keys as before; SEMANTICS_VERSION stays (as at
a7dd2e846e for the binder's inputs). The per-parameter meter ticks of kept_params go with it.
Search at 9db78abe7d: git grep -n open_cl_lines -- crates docs: 37 hits across compile.rs,
cache/mod.rs, lower_inputs.rs, key.rs, the AIR canon and the tests; 0 after.
texture::Declared::swizzle and Declared::offset_base, the TextureSwizzle word and the
OffsetBaseAxes tests of a slot, were never inserted: their specializations are gone. Every
emit-side lookup of them therefore failed, and none was reached: a function that reads a slot's
bound swizzle (SlotPlan::swizzle, set with RuntimeFact::TextureSwizzle by texture::swizzles) or
places an offset by a view parent's base-level size (SlotPlan::offset_base) is refused at the
end of select by identity_admits (SlotPlan::identity_lowered, IdentityCause::TextureState),
which runs on every plan before any emit, and select builds the only Plan. Every flag the emit
side read (Sampling::swizzle and offset_base, extended::Sample's, routine::Extended's,
texture::Read::storage_swizzle, texture::Write::swizzle) was true only in such a function.
Deleted:
- texture: Declared::swizzle and offset_base, OffsetBase, Read::storage_swizzle,
Write::swizzle; emit's swizzled read and unswizzled write arms and their helpers
(swizzle_lanes, swizzled_texel, unswizzled, swizzled_float, swizzled_held, swizzled_gather,
held_lane, sampled_lane).
- sampler: Sampling::swizzle and offset_base, with shared_shape's test of them and their
estimated words (SWIZZLE_WORDS); emit::swizzled_value, texel_and_word and offset_base;
extended::Sample::swizzle and offset_base, Texture::swizzle and parent, swizzled(), and their
words; routine::Extended::swizzle and offset_base; bicubic::At::parent and the parent
argument of footprint_of_image, axis and placed_offset; position::offset_dropped's parent
argument and PARENT_RULE_WORDS.
- bind::state: TextureFacts::offset_base_axes, parent_relative_level and parent_base_size, and
TextureShape::Texture::offset_base_axes, which only those read (bind::state is
crate-private).
- position/tests.rs: the parent-bit test the_offset_rule_reads_the_parent_s_base_through_the_view_bit;
the rule kernel keeps its two parentless forms, which its other tests read.
Kept: the selection side. A read, write or sample of a swizzled_storage slot still calls
texture::swizzles (the TextureSwizzle fact and SlotPlan::swizzle), and a wrapped offset still
sets SlotPlan::offset_base or, on a heap element, notes ViewBaseTexelOffset, so every refusal is
the one it was; the NotImplemented(TextureSwizzle) refusals are untouched.
Docs that named the deleted specializations now say what is true: RuntimeFact::TextureSwizzle,
LoweringInputs::swizzled_storage, VariantKey::swizzled_storage (the runtime asks for none:
git grep swizzled_storage -- crates/metal2vulkan-runtime has 0 hits), SlotPlan's two flags,
texture::swizzles and swizzled_storage, position's module doc, extended's module doc and
engine_swizzled_storage's.
Output: none moves. Every deleted branch ran only where its flag was true, in a plan the
identity domains refuse; offset_dropped with no parent emits the same instructions as before
(the (base, None) arm without the disjunction, the (None, None) arm as was). The estimated
words that leave counted only refused functions, so no census moves.
Search at 9db78abe7d: git grep -n 'offset_base\b\|OffsetBase\b' -- crates: 45 hits, now the two
SlotPlan flag writes, its field and identity_lowered's read, and the docs; git grep -n
'swizzle.insert\|offset_base.insert' -- crates: 0 (never inserted); git grep -n
'OffsetBaseAxes\|SpecKey::TextureSwizzle' -- crates docs: 0 after.
The runtime-sources inputs move: crates/metal2vulkan/src/bind/state.rs (bind/).
The nil-arm test (removed one commit back) was its only user (s.words()); clippy's
unused-imports failed the lib test build at 4d40d42166 (job m3-max-86868).
lower/texture/absent.rs walked the body for the blocks the default ResourcePresence
specialization never runs and counted their words under the census key
texture.is_null.absent_arm, for an output-size gate to except them. That constant is gone: a
static slot's is_null reads its resource ID's element (emit::identity_id), a run-time value no
driver folds at pipeline creation, so the walk's premise is false and its key named words the
module runs like any other.
Deleted: absent.rs (absent_arm, ABSENT_ARM), TexturePlan::absent_arm, its call at the end of
select, Plan::census's arm split, StrategyCensus's doc of the key, the texture module doc's
nil-arm paragraph, and engine_texture.rs's nil-arm kernels and their test
a_nil_textures_arm_is_counted_apart, with queries_and_null_checks's assertion that its kernel
keeps no arm. texture::declare's doc named presence constants it no longer declares. The
output-size exceptions file the test named (validation/budgets/output-size-exceptions.json)
does not exist; validation's budgets read no census key.
What moves: the strategy census alone. An instruction of a nil texture's arm now counts its
words under its own strategy, as every other instruction does, and no texture.is_null.absent_arm
entry is made. Module words, refusals, requirements, interfaces and notes do not move (the walk
fed the census alone), so SEMANTICS_VERSION stays: its doc lists what a bump covers and the
census, reporting only, is not in it. The walk's meter charge goes with it.
Search at 9db78abe7d: git grep -n 'absent_arm\|ABSENT_ARM' -- crates: absent.rs, texture/mod.rs,
select.rs, artifact.rs's doc and engine_texture.rs; nothing outside the translator (no
validation, runtime, script or doc reader).
bind::heap::member_storage_format admitted a storage heap member viewed through a converting
alias (SwizzleBgra, SrgbEncode, SrgbEncodeBgra) where bind::heap::storage_conversions listed its
texel class and red-blue order, for the texture lowering to convert by the handle's class
(lower::texture::heap_storage_conversions). That lowering is gone: a heap element's storage
class is Identity (lower::texture::storage_class), and an argument buffer's texture is the
element its resource ID's index names in its class's array. So the arm and its list go:
- member_storage_format refuses every aliased member, as it refused an aliased one the list
did not name. Its only caller is tier_read_gaps, over Metal's read-write tier formats
(device::metal::READ_WRITE_TIER1/2_FORMATS), none of them sRGB or blue-first, so none takes a
converting class (metal::format::storage_choice gives SwizzleBgra to BGRA8Unorm and
BGR10A2Unorm and the SrgbEncode classes to the sRGB formats alone): the arm never held for
any input that reaches it, and tier_read_gaps answers the same on every profile.
- StorageConversion, storage_conversions and its test a_heap_converts_by_class_and_red_blue_order.
- metal::format::red_blue_exchanged, read only by them, and its test
a_red_blue_exchange_is_a_blue_first_format_s.
- pipeline::artifact::PrecisionNote::SrgbTexelDecode's doc named the deleted lowering: it now
says a slot's SrgbEncode read decodes, and an argument buffer's texture converts nothing.
Search at 9db78abe7d: git grep -n 'storage_conversions\|StorageConversion\|red_blue_exchanged'
-- crates docs: the definitions, member_storage_format, the two tests and three doc mentions;
git grep -n heap_storage_conversions: the two docs alone, no definition.
The runtime-sources inputs move: crates/metal2vulkan/src/bind/heap.rs and
crates/metal2vulkan/src/metal/format/mod.rs are in crates/metal2vulkan-validation/build.rs's
list. No output changes: no lowering read the list.
- lower::texture::SlotPlan::presence: select set it for a slot's is_null; nothing read it. A
slot's presence is its resource ID's (emit::identity_id), which the IsNull strategy reads
without the plan's flag.
- lower::sampler::ConstexprArray::words, each candidate's sampler word, and
constexpr::sampler_word, its only writer. Nothing read the words: a constexpr sampler array is
matched by its first handle and its candidates' state words, and each candidate's index is
pushed (PushField::ConstexprSampler). sampler_word could fail only where state_of fails on
undecodable words, which finish's constexpr_desc still runs for every candidate, so no input
changes outcome; descriptor's filters never fail (min_mag answers every filter).
Search, at 9db78abe7d: git grep -n '\.presence\b\|presence:' -- crates/metal2vulkan/src: the
field, its initializer and the one write; git grep -n 'sampler_word(' -- crates: select.rs:642
alone for constexpr::sampler_word (the others are emit::sampler_word, a separate function); no
reader of ConstexprArray.words (git grep -n '\.words\b' over lower/sampler). Behaviour: none;
translation output unchanged (golden tables untouched).
Six test docs still named the resident-table domains, which are gone: every committed profile
is now derived by Device::from_queries alone (pipeline::testing::profile,
spirv::testing::committed_profiles). Each says that now:
- engine_rate_map.rs profile_with, engine_rotated_colors.rs devices, fuzz_interp.rs
CpuInterp::new, public_fixtures_engine.rs (module doc), api_surface.rs device: the profile
as Device::from_queries derives it.
- engine_workgroup_layout.rs (module doc): its two profile sets are both from_queries', the
committed description as stated and without its pipeline-robustness feature
(identity_profiles), not the resident-table and the identity domains.
- api_surface.rs device_under named a policy parameter it does not take.
Comments only; no code moves. Search: git grep -n 'resident-table domains' -- crates at
9db78abe7d: 6 hits, 0 after.
options() now refuses an option a command line gives twice, "--NAME is
given twice", before anything runs: exit status 2 and the usage
printed, as for an option the subcommand does not take. Before, the
second value replaced the first in the map with nothing said, so a
script that spliced options after its own (`--until-frame X
${PLAY_ARGS}`) played the splice's value unnoticed. The module doc and
with_options' doc say so.
docs/REPLAY-STREAM.md section 10 named the options each subcommand
takes only in part, though it said each takes "the options its usage
names". Its play synopsis now lists all twenty, adding --state-log,
--state-threads, --state-keys, --state-digests, --prepass-width and
--dump-command-buffers with --dump-dir. A paragraph after the
states-only one now says what the state options and --prepass-width do,
from the module doc. dump and shapes show [--blobs DIR]. The rule now
reads: each option once, none it does not take.
Callers audited at development 039f7a9350 for an option given twice
(the 9db78abe7d audit of unknown options covered the same callers): the
orchestration's round script and its leg scripts, every orchestration
job script that runs the player, the scripts of every carry repository
at its HEAD (104 invocations in all), the consumer's tree (no caller),
CI, CONTRIBUTING.md and the docs (none runs the player), and the
in-tree tests. No invocation names an option twice. Where options are
spliced from the environment, the values on record don't repeat an
option either: PLAY_ARGS (--check-presents), PLAYARGS (empty or
--managed two-copy) and UNTIL (becomes --until-frame, in scripts that
do not pass --until-frame themselves). Three splices have no recorded
value and stay unaudited: FS_PLAY_ARGS, EXTRA and PARGS.
Verified: the red commit's every_subcommand_refuses_an_option_given_twice
fails at its parent (lavapipe-free run, job m3-max-86867: 1 passed, 1
failed). The jobs for this commit are named in the lane's report.
command-replay's options() refuses an option a subcommand does not take
(62e9d045c3), but an option given twice still goes into its map in
silence, the last value winning: `play ... --until-frame 3 --until-frame
5` plays to frame 5. A script that splices options from its environment
after its own (`--until-frame X ${PLAY_ARGS}`) would play the splice's
value with nothing to say so. A repeated option should be a bad command
line instead.
replay_options::every_subcommand_refuses_an_option_given_twice runs each
of the six subcommands with one option given twice, required or not
(play --until-frame, dump --stream, shapes --blobs, snippet
video-surfaces --handle, compare-dumps --a, compare-plays --frame), and
expects exit status 2, a standard error line "--X is given twice", no
play report and no snippet written. Red here: dump, shapes and the
snippet run to exit 0, and play writes its report.
every_subcommand_refuses_an_option_it_does_not_take now runs
compare-dumps too (--frame), the one subcommand it left out. It passes
here, as the refusal is in place; its red is a negative control, the
fix's commit names it. The two tests share their setup and their checks.
The UHD 630 numbers answer the question attachment_read_copy_bytes_after_barrier_narrowed was
added to size (9db78abe7d): a form whose memory barrier forgets only the rectangle bounding the
pass's draws' scissors would remove at least half the attachment-read copy bytes, or it is not a
lane. On Intel's Windows driver 101.2145 for the UHD Graphics 630 (Windows 11, the consumer's
x86-64 guest, no feedback loop), whole-boot counts at a test tree with the split:
- desktop boot (130 s, 15,678 copies, 72,587,189,668 bytes): after barrier 56,148,113,276,
narrowed 25,369,581,904, so the form would remove 30,778,531,372 bytes, 42.4%;
- 40 s 1080p H.264 playback (25,551 copies, 138,558,378,988 bytes): after barrier
75,057,769,016, narrowed 39,566,419,316, so it would remove 35,491,349,700 bytes, 25.6%.
Both under the planner's 50% bar, so the form is not built and the count that sized it is
deleted (rule 4), with what fed it: shadow::Held's dropped areas, rendered rectangle and
may-write flag, Held::drew and Held::narrowed, held_texels, Area::meet, the per-draw update in
draw() and the scissor_of helper it shared with drawn_through (inlined back as before). Held keeps
one flag for the moment counters. The other five split counters (own pixel, whole texture, first
in pass, after barrier, beyond held) stay: the consumer prints them.
The README's sentence on the counter becomes the measured shares (card, driver, OS; no job ids).
The signatures table loses the field. The device test and the host test drop the narrowed column;
the host test of the narrowed texels goes with the code it tested.
Verified: pending (clippy x3, rustdoc, lavapipe rt suite).
Lane kktess read the driver's source (Mesa 26.3.1, kk_cmd_draw.c kk_launch_tess, kk_tessellation.cl):
for an indirect tessellated draw the vertex and control-point grids are computed as thread counts and
dispatched as threadgroup counts. The control-point work past the last instance's patches writes into
the same allocation as the draw's vertex outputs, so a one-instance indirect patch draw carries the
overrun too; the bare repro's one-instance draws were right 8 of 8, so this is a source read, not a run.
The forms weighed (instance count folded into the vertex count, one indirect command per instance,
a direct draw, device-generated commands) each either write a new indirect command from the guest's
arguments, which Vulkan allows only outside a render pass (VUID-vkCmdDispatch-None-10672 and the
copy, update and fill VUIDs), so every indirect patch draw on every device would copy the arguments
and end and restart its pass, or read the counts back, or need a query-chosen form past the floor.
The known gap stays; the lane parked on its trigger. Docs only; no job.
What: six Metrics counters part attachment_read_copy_bytes, the copies a draw makes into a
shadow on a device without the attachment feedback loop (and for a surface plane, a texture in
place over a buffer without the feedback usage, a Direct3D 11 plane, on every device):
- by read: attachment_read_copy_bytes_own_pixel (a slot read only at the fragment's own pixel,
or a fetched colour attachment) and attachment_read_copy_bytes_whole_texture (every level and
layer the texture reaches); the two sum to attachment_read_copy_bytes;
- by moment: attachment_read_copy_bytes_first_in_pass (the shadow has held nothing since its
pass began), attachment_read_copy_bytes_after_barrier (a memory barrier after draws, or a
fetching draw after draws, left it holding nothing) and attachment_read_copy_bytes_beyond_held
(it holds something and the draw reads past it); the three sum to attachment_read_copy_bytes;
- attachment_read_copy_bytes_after_barrier_narrowed: for each copy after a barrier, what a form
whose barrier forgets only the rectangle the pass's draws rendered would have copied: what of
the copy lies in the rectangle bounding the scissors (cut to Metal's render area) of the
pass's draws since the shadow began to hold what it held, in the attachment's level and layer,
plus what of it the shadow did not hold when the barrier dropped it; the whole copy where one
of those draws may have written memory (Draws::writes_memory, or an indirect command buffer's
execution), which may reach the image other than as its attachment. At most the after-barrier
part.
No copy is added, removed or resized.
Why: the consumer's Intel UHD 630 under Windows, which has no feedback loop, counts tens of
gigabytes of these copies in a desktop boot and a video playback. A narrower form, a barrier that
forgets only the rendered rectangle, is a lane only if it would remove at least half the bytes;
the existing two counters cannot say. The rectangle counts from the shadow's first copy after it
held nothing, not from its last copy: a later copy only adds areas, and the areas copied earlier
are stale where the draws between rendered.
How: shadow::Held keeps what it held at the barrier, the rectangle and a may-write flag;
Held::narrowed works out the kept texels by inclusion and exclusion over at most eight held
areas, only at a copy after a barrier. The per-draw cost is one rectangle update for each shadow
of a pass that has one (Held::drew at the draw's end); a pass with no shadow does nothing more.
No speed is measured.
Verified, at dd1913401b (this tree; the message alone changed since):
- lavapipe (llvmpipe, LLVM 23.1.1), job m3-max-86812: the runtime suite under --cfg m2v_cpu_icd,
1025 passed, 4 skipped. Among them
d3d11_reads::every_device_parts_the_bytes_it_copies_into_a_direct3d_11_planes_shadow, which
drives the shadow route on every device through a Direct3D 11 plane (R8Unorm, 16 x 8): an
own-pixel read under a small scissor, a whole read, a memory barrier, a draw under another
small scissor, a whole read; it asserts copies 3, bytes 280, own pixel 24, whole texture 256,
first in pass 24, after barrier 128, beyond held 128, after barrier narrowed 60. And three host
tests in tests/shadow.rs (moments, the narrowed texels over overlapping held areas, a
may-write draw, another level or layer; the parts' sums).
- Red control, lavapipe, job m3-max-86813: this tree with the six split adds removed; the
device test failed with [3, 280, 0, 0, 0, 0, 0, 0] against [3, 280, 24, 256, 24, 128, 128, 60].
- clippy --workspace --all-targets --all-features -D warnings: plain job m3-max-86814,
--cfg m2v_gpu job m3-max-86815, --cfg m2v_cpu_icd job m3-max-86816. rustdoc -D warnings,
scripts/api-docs and the signatures check: job m3-max-86817.
- The signatures table is blessed (six Metrics fields); refusal_surface.py wrote no change.
Not run: a device without the feedback loop through any route other than the Direct3D 11 plane.
extended_unorm::mapped takes a texel's code as floor(w + (nudge - 384)) with
the sum undecorated, so a device may fuse the code space's product into it,
fma(u, m, nudge - 384), rounding once from the exact product. The exact
sum's fraction stays near 1/128 to 0.992 for a BGRA10_XR field and
0.5 +- 0.016 for a BGR10_XR one, far past one rounding's error, so the
floor cannot cross an integer.
a_fused_texel_sum_floors_to_the_code now holds that for every code of both
formats, each of a BGRA10_XR field's 64 low-bit patterns and a BGR10_XR
code widened by replicating its bits included: the sum is formed exactly in
i128 (steps of 2^-46) and rounded once to the nearest f32, ties to even, and
its floor, and the unfused sum's, is the code less 384. A later edit that
moves a nudge or the scale off those margins fails it. The module docs and
mapped's comment say why the sum stays undecorated.
Test-only: the emitted code is unchanged, so no SEMANTICS_VERSION bump; the
runtime-sources hash is unchanged (c9ff784a...).
Shaders made by Apple's Metal shader converter could not be translated. The converter writes four
module flags the translator did not know, and an unknown flag is refused with Abi(UnknownKey).
The four flags:
- agx.allow_mismatched_component_counts (an i32, 0 or 1)
- irc.version_major, irc.version_minor, irc.version_patch (integers; 3.0.0 in the shaders seen)
What changes: the decoder accepts these flags and ignores them, as it treats wchar_size,
frame-pointer and the debug-info flags. It still checks them:
- each flag appears at most once;
- the agx flag is 0 or 1;
- the version parts are integers.
Anything else is refused as before. No public API changes.
Evidence:
- A new fixture with these flags compiles to the same SPIR-V as the same shader without them, on
all 15 profiles: the flags change nothing in the translation.
- converter_module_flags_are_checked_and_dropped and the kernel_converter_module_flags fixture fail
without this change.
- Of 12 converter-made shaders, 8 carry these flags. They now get past the flags, but each stops at
a different, unrelated refusal; none compiles with this change alone.
Version: SEMANTICS_VERSION 2386 -> 2387, because inputs refused before can now compile.
Golden table: left for the bless on development; golden_hashes_match_the_table lists the fixture's
15 new cells. The fixture's expectations row is included.
Not run: device tests, the Windows clippy legs, the CI matrix.
scripts/api-docs (CI's API reference step) refuses a lab job id in the prose docs, and
e849ae4665's two known-gap bullets cited six. They now name each measurement's card, driver and
OS: RX 7900 XTX (RADV, Mesa 26.2.6, Linux), Iris Xe (ANV, Mesa 26.2.6, Linux), RTX 3090 (NVIDIA
620.70.06, Linux), and KosmicKrisp (Mesa 26.3.1) on an Apple M3 Max, macOS 27.0.1. The ids stay
here: the GPU-time arms m3-max-86672 (XTX), 86676 (Iris), 86692 (3090); KosmicKrisp creation
m3-max-86686 and 86724; ANV creation m3-max-86719. Found by the pin Z prepush m3-max-86741
(STEP api_docs EXIT=1); the grep over the four prose files is now empty.
The golden hash table re-blessed at development e849ae4665 (SEMANTICS_VERSION 2386: the pixel
sampler's single quotient sample and the extended-range decode's straight-line select moved the
artifacts). M3 job m3-max-86734 (bless-job.sh): inventory, golden, printouts, the AIR fixtures'
metallib half and the opened chains each exit 0; only golden_hashes.tsv changed (725 rows). The
engine inventory, the printouts and the opened chains are unchanged. The authored compile census
at dc3e7e5add (m3-max-86670) changed no table row; its run at e849ae4665 is in the merge check.
What: the known gaps of textures say what the straight-line decode costs.
- The bullet that described the per-site branch and its price now describes the select: every
float sample, gather and read maps its lanes and selects where the word names BGR10_XR or
BGRA10_XR; a texture of another format pays the arithmetic and the select, and a
robustness-bounded read its in-range test. Its GPU-time price against the branch, base
dc3e7e5add against 14d30efdfe, four alternated rounds' p50 medians: RX 7900 XTX (RADV,
m3-max-86672) +0.3% sampling, +2.7% constexpr_sampling, +0.8% texture_read; Iris Xe (ANV, Mesa
26.2.6, m3-max-86676) +0.5%, +1.3%, -0.2%; RTX 3090 (m3-max-86692) +0.1%, +0.8%, 0.0%. It says
these predate 571a22f97a's uncontracted difference.
- A new bullet: one guest fragment function of 318 float samples, first created with every driver
cache off, takes 23 s on KosmicKrisp (Mesa 26.3.1, Apple M3 Max; m3-max-86686 at 14d30efdfe and
m3-max-86724 at 571a22f97a) and 9.2 s on ANV (Mesa 26.2.6, Iris Xe; m3-max-86719 at 571a22f97a),
against 14 to 18 s and 4.0 s for the same function without the map (pin W, the same jobs and
main's three earlier KosmicKrisp tables). Both are past the 5 s ceiling, as at W.
Why: the planner's ruling for pin Z: if Z ships the select form, its creation cost is stated as
measured, beside the row already owed for that variant.
Verified: the figures are the named jobs' lines; KosmicKrisp's 0 MTLLibrary failures at both W and
571a22f97a (m3-max-86724). Docs only; no code changes.
What: the straight-line decode (14d30efdfe) moved alpha's clamp after the difference, which made
the difference's operand the product w = u * m itself, and dropped the difference's NoContraction.
The RTX 3090, the RTX 5080 and KosmicKrisp then fused the two into fma(u, m, -384): n rounded once
from the exact product, where Metal's code space rounds w first. A nearest sample's w is the code,
so the fused n was a fraction off it, and the decoded value with it. The difference is decorated
again, as at pin X. A texel's floor (reads, gathers) was unaffected: floor(u * m + nudge - 384) is
the code less 384 fused or not.
Why: the replays at 7459e4d8ba moved 14 cells, the same counts on the RTX 3090 (round
7459e4d8ba-1204-1147, job 86698), the RTX 5080 (86700) and KosmicKrisp (86694): the samples of
extended-swizzles-bgr10xr (0ag1, ar10, bgra, gggg, rgba; sl and sn) and extended-swizzles-bgra10xr
(0ag1, bgra, gggg, rgba; sl), e.g. bgr10xr gggg/sn 336 elements at X, 504 now on the 3090.
Lavapipe (job 86688) showed none: it does not contract.
Test: a_runtime_samplers_implicit_sample_is_one_sample checks, on every committed profile, that the
module's one difference of 384 is decorated NoContraction; it fails without this change.
SEMANTICS_VERSION 2386. runtime-sources.sha256 unchanged.
What: docs/API.md's BGR10_XR / BGRA10_XR paragraph describes the straight-line decode of 14d30efdfe:
every lane mapped and selected where the word names one of the formats, no branch; the sum alone
decorated NoContraction; a slot's test, flags and constants made once per binding in the function's
first block; a robustness-bounded read testing its operands at every such read. No code changes.
Evidence for 14d30efdfe (generated code identical at 7459e4d8ba and here):
Words, runtime-floor, the largest variant 3f4cca857dfa (m3-max-86685, .json sidecars included):
W 162,351; pin X's per-site branch at dc3e7e5add 211,959; 14d30efdfe 176,844, about 175,630
without sidecars against W's 161,140 (+9.0%, under the 177,254 bar). The decode costs 14,493 words
over W where the branch cost 49,608, about 46 words a site over its 318 sites, the per-binding
decodes included. On the other 14 profiles: 170,128 (the RADV and ANV ones), 170,112 (the two
RTX 50), 170,100 (the three lavapipe), 176,880 (Pascal), 197,547 (moltenvk-m3). Small rows:
54f0489eefb5 1,692 (dc3e7e5add 1,680), 2a423fb525e7 2,394 (2,403).
GPU time of a float texture that is not extended-range, the harness's sampling (sample_down, a
runtime sampler), constexpr_sampling (sample_up) and texture_read (texels_out, a read the device's
robustness bounds, which now pays its in-range test at every read), base dc3e7e5add against
14d30efdfe: four rounds, the arms' order alternated each round, 200 timed runs each, the median of
the four GPU p50s in microseconds, the four's range in brackets:
- RX 7900 XTX, RADV (m3-max-86672): sampling 16.05 (16.00-16.10) -> 16.10 (16.10-16.40), +0.3%;
constexpr_sampling 29.95 (29.90-30.30) -> 30.75 (30.40-30.90), +2.7%; texture_read
45.40 (45.40-45.40) -> 45.75 (45.70-45.80), +0.8%.
- Iris Xe, ANV (m3-max-86676): sampling 394.90 (393.70-395.70) -> 396.90 (394.70-398.60), +0.5%;
constexpr_sampling 820.60 (818.60-821.80) -> 831.45 (827.70-837.40), +1.3%; texture_read
1564.25 (1561.70-1566.30) -> 1561.10 (1557.20-1566.40), -0.2%.
- RTX 3090, NVIDIA's driver (m3-max-86692): sampling 61.80 (61.70-61.80) -> 61.85 (61.80-61.90),
+0.1%; constexpr_sampling 65.90 (65.80-66.00) -> 66.45 (66.30-66.60), +0.8%; texture_read
134.65 (134.60-134.70) -> 134.65 (134.60-134.70), +0.0%.
Every workload is within 3% on each card; the XTX's constexpr_sampling, +2.7%, is the closest.
Check m3-max-86665 at 14d30efdfe: 3907 passed, 1387 skipped. Lint m3-max-86683 at 7459e4d8ba:
fmt, clippy plain, m2v_gpu and m2v_cpu_icd, rustdoc all clean.
What: lower::texture no longer re-exports emit::identity_id; its callers are emit.rs itself and
words.rs, which names it by path. The extended-range decode (14d30efdfe) read a slot's word through
the re-export and now reads it through identity_word.
Why: rustc's unused_imports warning, seen in the harness arm build m3-max-86667; warnings are errors
in CI.
Verified: cargo fmt; the build is the lint job that follows.
What: a float sample, gather or read of a sampled image no longer branches on the texture's word at
each site. The site computes Metal's value of every lane (the code space, a texel's code whole, the
clamp, the two products and their sum) and selects it where the binding's decode maps the lane: no
block, branch or phi of its own. The decode (the word's test folded into its bits, the lanes' flags,
the scale, the bounds and a texel's nudge) is made once per texture slot, lanes kind and source, in
the function's first block (EmitCx::extended_decode, from the slot's word, a push field loaded
there); a heap element's at its site, from its handle. A read the device's robustness bounds still
selects 0 for a code lane outside the image, now at every such read.
The arithmetic is X's, rearranged where the bits are provably the same:
- the clamp moves from the code w to n = w - 384, alpha's bounds [0, 510]: w - 384 is exact on
[384, 894] and rounds below 0 and above 510 outside it (clamping_the_difference_clamps_the_code,
every f32 near the bounds, every 64th elsewhere in [0, 1024));
- a texel's floor takes its nudge less 384, so it is n itself: every code of both formats, the low
six bits of a 16-bit field and NVIDIA's replicated 10-bit codes (the module's tests);
- a lane that is not alpha's is clamped to +-65536, finite, so no device's float controls change it;
- the sum keeps NoContraction, which forbids combining it with a product or factoring n out of it;
the products and the difference drop theirs (n has two uses, and the products feed only the sum).
Why: pin X's per-site arm (58988c6b83) put a test, a branch, a merge and a phi on each of the 318
float samples of the largest variant 3f4cca857dfa, +49,608 words at runtime-floor over pin W
(m3-max-86625: W 162,351, e1dd48a92b 211,959). KosmicKrisp failed that variant's MTLLibrary
(m3-max-86641: W 18 s, e1dd48a92b 100 s and a refusal) and Iris Xe took 9.3 s against W's 4.0 s
(m3-max-86640).
The affine lead does not hold: fma(u, fl(m/510), fl(-384/510)) misses Metal's quotient for 834 of
the 1024 BGR10_XR codes and 543 of the BGRA10_XR codes (543 and 575 with lavapipe's reciprocal
conversion), so the exact form stays.
Tests: a_runtime_samplers_implicit_sample_is_one_sample also asserts no OpSelectionMerge and no
OpPhi on every committed profile; the module's tests cover the shifted floor and the clamp. The
ARM_WORDS estimate is 48. SEMANTICS_VERSION 2385. runtime-sources.sha256 unchanged (none of its
listed sources moved). docs/REFUSALS.md unchanged.
Turnip limits read from Mesa 26.3.1 for the 196,608 sampled-image floor of 50b05dbce2: no targeted
driver sits between 131,072 and 196,608 (Turnip tu_device.cc:1080/1089 16,777,216; RADV
radv_physical_device.c:1998/2007 8,388,606; ANV anv_physical_device.c:1463/1472 201,326,592, ARL
33,554,432; lavapipe lvp_device.c:1160/1169 1,015,808; KosmicKrisp kk_physical_device.c:731/743
2^20).
The known gap for a Direct3D 11 plane's attachment reads said the frequency was near zero by one
desktop boot. The consumer's playback boot on the Intel UHD 630 (Windows 11, its tree at pin W
with the plane-import diagnostics; job m3-max-86661, build 86658) played a 40 s 1920 x 1080 30 fps
H.264 clip made on our hosts for 41 s in a video player: rt-diag plane-passes 0 in every shape
(one plane, both planes of one picture, with depth or stencil, with a colour attachment not a
plane, a plane as a resolve target, planes of more than one picture) at all five counts writes;
934 pictures drawn, 2,053 Direct3D 11 plane submissions; fatal 0, lost-device 0. The line now
names both runs and stays "expected", since two workloads are not every guest.
What: the NVIDIA venue's render-then-sample-magnified-linear row, as 2a406a848e removed it (pin W's
text): a linear magnified sample of a rendered 8-bit target, 30 elements a code from Metal's, the
device's own answer under device-sampling and device-color-conversion. docs/CONFORMANCE-COVERAGE.md
regenerated.
Why: 2a406a848e dropped the row as stale at pin X, where a runtime pixel sampler's second sample
moved this case's filter. With the pixel sampler back at W's single quotient sample (50b05dbce2), the
device's own linear filter shows again: the RTX 5080's replay at e1dd48a92b (job m3-max-86636)
reports exactly this row, 30 elements differ (U8), the largest difference 1, and nothing else
unexpected.
Verified: the 5080 replay above; the row's fields are the replay's line. The RTX 3090's replay at the
same sha is still running.
Fix forward for a3b78a142a: engine_identity's
a_constexpr_sampler_is_the_set_1_element_its_pushed_index_names asserted that the constexpr
sampler's vk::SamplerDesc was not unnormalized, and that field is gone with the form. The test
still makes the device sampler and holds the PixelSamplerScaling note. Found by the build of
job m3-max-86604 (E0609, metal2vulkan lib test). Test-only; no version moves.
The runtime's unnormalized twins were the last maker of a device sampler with
unnormalizedCoordinates (8fb26059c7 and 27a6c1ebd3 kept the form for them alone). With the twins
gone in the previous commit, nothing builds such a sampler, so the form goes (rule 4):
SamplerUse::unnormalized and SamplerUse::with_unnormalized, vk_sampler's unnormalized arm (the
invariant check, the nearest mip mode at [0, 0], the dropped anisotropy and bias),
metal::sampler::unnormalized_reads, vk::SamplerDesc::unnormalized (its key, its codec field and
ash_interop's unnormalizedCoordinates, which is now always false), and their tests.
Consumer: reims-vgpu at 9889a815bb names none of them (git grep -w over its Rust sources:
with_unnormalized 0, unnormalized 0, SamplerUse 0). The signature table loses the two fields and
the method. The codec change rides on ARTIFACT_FORMAT_VERSION 615 of the previous commit (one
tip); metal/sampler.rs, vk/structs.rs and ash_interop/convert.rs are runtime inputs, so
runtime-sources.sha256 is re-pinned; RUNTIME_VERSION 2579 of the previous commit covers it, and no
run reaches a removed arm.
The planner's ruling on pin X's fragment growth (12-04). The level-0 arm that 8f69218029 put on
every implicit sample and gather through a runtime sampler slot (a test of the slot's word, a
second, explicit level-0 sample through the state's unnormalized twin, and a branch with a phi)
doubled large fragment shaders: the largest corpus variant went from 161,140 to 318,071
runtime-floor words, and its pipeline creation from 4.0 s to 28.1 s on the Iris Xe and past
300 s on KosmicKrisp. What it bought was last-bit filter weights of a linear downscale, never
another texel.
Translator: a slot sample or gather is the one W form again. The pixel coordinate reaches the
device's normalized sampler as the coordinate over the level-0 size, chosen in ALU by the slot's
word (and its texel centre for a nearest pixel state), under PrecisionNote::PixelSamplerScaling.
Gone: Sampling::level_zero, the level-0 test and value, TextureSlot::level_zero_samplers (and
its codec field), LEVEL_ZERO_ELEMENT, UNNORMALIZED_TWIN_ELEMENT, SamplerWord's
UNNORMALIZED_FILTERS, UNNORMALIZED_LINEAR, UNNORMALIZED_MODES and reads_unnormalized, and
emit's offset_texels, which only the level-0 value read. The follow-ups go with it: c99bf0c6c3's
linear-only test and its red test, 69a3254e1a's DeviceSampling paragraph on the unnormalized
sampler's sub-texel step (no form reaches that sampler now), b58c67e981's count, 77e2a4f187's,
9fe45f0043's and a86f5ed62b's test counts. The translator test
a_runtime_samplers_implicit_sample_is_one_sample holds a fragment's implicit slot sample to one
implicit sample and no explicit one on every committed profile (at X the level-0 arm's explicit
sample made it fail).
Runtime: set 1's sampled array holds the textures and their second elements, 131,072, and the
plain sampler array 8,000 again: no unnormalized twins, no level-0 elements, no level-0 views
(Gauges::level_zero_views and its harness and replay entries go, with tests/level_zero.rs and
83bb95724d's bind check). The floor's descriptor limits are what those arrays need: sampled
images 196,608 (textures, second elements, read texture buffers), samplers 24,000, per-stage
resources 393,216 plus the attachments, all pools 417,216; X asked 262,144, 32,000, 458,752 and
490,752. These still hold the second elements on every device at the floor, so
Capabilities::attachment_reads stays always true and 7a6b0d10bc stays: no guest-visible answer
moves (W's own floor, 131,072 sampled images, would have made it a per-device answer again).
runtime-floor.json and regen_device_profiles.py state the new floor.
Docs: PixelSamplerScaling's doc and its docs/API.md entry keep W's text without the level-0
clauses; the measured line names the cards: a linear downscale by 8 through a slot within
0.88/255 of Metal's on KosmicKrisp and RADV, 0.95/255 on the Iris Xe, 1.19/255 on the RTX 3090
and 1.375/255 on lavapipe (the ledger rows' largest differences). The runtime README, RESOURCE-ID
and the pixel_samplers module doc drop the level-0 elements and twins.
Ledger: the pixel-downscales rows return on the seven venues (RX 7900 XTX, Radeon 780M, RX 550,
NVIDIA, Iris Xe, llvmpipe, Apple M3 Max) and the pixel-samplers slot rows on five cards and
lavapipe, from 24cb048066, ed46bdbfc5, 82b7d9e4a2, bb7661f09a and 0c70839937's removed lines;
the frac/slot rows that said ours read as the device's own answer under note
pixel-sampler-scaling. Coverage regenerated. The replays at this tip are the check.
Versions: SEMANTICS_VERSION 2384 (slot samples lose the level-0 arm), ARTIFACT_FORMAT_VERSION 615
(TextureSlot's codec loses level_zero_samplers), RUNTIME_VERSION 2579 (set 1's sizes, no twins or
level-0 elements, the floor's limits); runtime-sources.sha256 re-pinned. The signature table and
api_surface lose the removed items; docs/REFUSALS.md is unchanged (refusal_surface --check).
Consumer: reims-vgpu at 9889a815bb names none of the removed items (git grep -w: 0 hits each for
LEVEL_ZERO_ELEMENT, UNNORMALIZED_TWIN_ELEMENT, level_zero_samplers, level_zero_views,
reads_unnormalized, UNNORMALIZED_LINEAR, UNNORMALIZED_FILTERS, UNNORMALIZED_MODES).
The README said the shadow is of the attachment's format and that the pass's clear stands for
the first copy into it. The encoder takes the clear only where the shadow's format is the
attachment's (render_encoder.rs, Shadowed::cleared); the shadow keeps its texture's format, so
an attachment that is a view of another format copies at its first read as well. The Render
encoders section and the known gap for a device without the attachment feedback loop now say so,
with the two copies the view test asserts (d95c47603b; seen as (0, 2) on the Intel UHD 630,
Windows, job m3-max-86637).
every_device_reads_its_attachment_through_a_view_of_another_format expected the shadow route to
copy once: the pass's clear standing for the shadow's first copy, the read after the barrier
copying. The shadow keeps its texture's format (RGBA8Unorm), and the encoder lets a pass's clear
colour stand for a copy only where the shadow's format is the attachment's
(render_encoder.rs, Shadowed::cleared), so an RGBA8Unorm_sRGB view's first read copies too:
two copies, which is the runtime's intended form (a clear of the UNORM shadow with the sRGB
view's colour would store other bits).
Seen on the Intel UHD 630 (Windows, driver 101.2145, no attachment feedback loop), job
m3-max-86637: "loop reads and copies (0, 2)"; the other 1027 tests passed, 5 skipped. Every
device the lab runs with the loop takes the (2, 0) arm, unchanged. The test now expects (0, 2)
on the shadow route; its rerun is the UHD 630 leg at the next pin's tip.
Rule 2's clause for the attachment feedback loop said a device without the loop reads a render
target through a counted copy of that target. Since 1baee4fb75 a Direct3D 11 plane's image takes
only its texture's bind-flag usage, never the loop usage, on every device, so a draw that reads
such a plane in its own pass takes that same counted copy on a device that has the loop too. The
clause now says so: "a device without it, and on every device a Direct3D 11 plane, whose image
takes only its texture's bind-flag usage, reads a render target through a counted copy of that
target, recorded as a known gap".
It adds no query and no form chosen by a device, so rule 2's count of fourteen stands. The
runtime README's known-gaps entry for the plane states the same route.
The owner approved this clause as worded (Telegram 3777, "A", relayed verbatim by the bridge
session), on the planner's proposal after the 181 lane landed.
The known-gaps entry for a Direct3D 11 plane read as an attachment of its own pass (1baee4fb75)
gains how often that happens: expected near zero for decoded video, not verified. The one count
on file is the consumer's 93 s Windows desktop boot on the Intel UHD 630 (rt at 865592b96b), whose
plane-pass diagnostic counted no render pass over a plane in any shape; that boot drew two video
pictures, so it bounds desktop use, not playback. On a device with the attachment feedback loop
each such draw now pays the counted shadow copy; the count bounds that cost until a boot that
plays video reports it.
Docs only; verified by reading the entry in place.
An attachment view in a format other than its image's (a texture view of another format, a
texture whose views are extended, a surface plane under a texture of another format) was made with
the image's usage that the format holds, masked to the attachment usages and the feedback usage
(VkImageViewUsageCreateInfo). That mask dropped VK_IMAGE_USAGE_SAMPLED_BIT. A pass whose draw
reads such an attachment renders it in VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT, which
enables the feedback loop for it (Vulkan's "Non-Overlapping Access Between Resources"), and
VUID-VkRenderingAttachmentInfo-imageView-10780 asks such a view for the feedback usage, an
attachment usage, and the sampled or input attachment usage. The view now keeps the sampled usage
where it keeps the feedback usage; elsewhere its mask is as before. Not Windows-only: any device
with the attachment feedback loop.
Red, then green, under the Khronos validation layer 1.4.363.0 on the Radeon 780M (RADV PHOENIX,
Mesa 26.2.6, VK_EXT_attachment_feedback_loop_layout present), the same tests in both:
- red, this tree without the attachment view change (job m3-max-86610, archive built in job
m3-max-86606): view_loop_reads and d3d11_reads both fail, two
VUID-VkRenderingAttachmentInfo-imageView-10780 each ("imageLayout is
VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT, but image view usage is
COLOR_ATTACHMENT|ATTACHMENT_FEEDBACK_LOOP"): the RGBA8Unorm_sRGB view, and the R16Uint plane under
an RG8Unorm texture made with the feedback usage;
- green, this tree (job m3-max-86609, archive built in job m3-max-86607 from a commit of this tree
but the README): 2 of 2 pass, no message.
Lavapipe (llvmpipe, Mesa 26.2.4, which has the loop), this tree, job m3-max-86608: 81 tests run
(the attachment read, view, surface, plane and shadow tests), 81 passed, 948 skipped by the filter.
Tests: view_loop_reads (new, every device of a device cfg): an RGBA8Unorm render target made for
views of other formats and its RGBA8Unorm_sRGB view at an index; a pass over the view reads it at
its own pixel, through the loop on a loop device (2 loop reads, no copy), else its shadow (1 copy),
every texel exact. d3d11_reads' control, the plane made with the feedback usage beside, now covers
the chroma plane (R16Uint image, RG8Unorm texture) too. Its stand-in image is moved once to the
general layout by a command buffer of the test's own before its texture is made, as Direct3D 11
leaves its texture (the layout every acquire of a plane names), and its usage assertion compares
raw flags (ash's flags have no Debug here): both fix the previous commit's test, which did not
compile under a device cfg and, run, met VUID-vkCmdBeginRendering-pRenderingInfo-09592 against
its undefined stand-in (lavapipe job m3-max-86589, the 780M job m3-max-86595).
compatibleHandleTypes: the Direct3D 11 import's image format query
(VkPhysicalDeviceExternalImageFormatInfo of VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT) read
only IMPORTABLE. VUID-VkImageCreateInfo-pNext-00990 asks the handle types an image is made with to
be among the query's compatibleHandleTypes; a usage the query answers otherwise is now one the
import does not offer, so a plane none of whose usage it offers is Limit::NoImport, as before for
one not importable. Windows only: compiled by the Windows clippy named on landing; the Windows rt
leg (UHD 630) is main's to run.
The runtime README says the attachment view's usage, and the Direct3D 11 import's compatible
handle types. The runtime-sources pin is unchanged (3b7da9e9...); docs/REFUSALS.md regenerates
unchanged.
A Direct3D 11 plane's image (Device::import_d3d11_surface, on Windows) took the usage its
texture's bind flags give (0x17 for RENDER_TARGET | SHADER_RESOURCE) and, on a device with the
attachment feedback loop, where its texture was a render target shaders read, also
VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT (0x80017), the one usage Direct3D 11's description
has no counterpart for. Vulkan states no rule for an image over memory another API made with
other parameters than that API's (its rule for an import of Vulkan's own export is the same image,
VUID-VkMemoryDedicatedAllocateInfo-image-01876). The consumer's issue 181 (device lost on AMD's
legacy Windows driver while work touches imported planes, its logs counting 134 to 20,261 loop
reads over all attachments) points here; nothing shows this is 181's cause, and the lab's Windows
card (UHD 630) has no loop, so no lab device has run a plane made with the loop usage.
The plane's image now takes exactly the usage its bind flags give, on every device: the import
asks no feedback usage and makes none. A draw that reads such a plane as an attachment of its own
pass takes the route rt already has for a surface plane whose image took no feedback usage
(Device::surface_texture): a copy into the plane's shadow, on a device with the loop as on one
without it. One form, no query added, nothing keyed. The cost: on a loop device such a draw pays a
counted copy (Metrics::attachment_read_copies), recorded in the runtime README's known gaps of
render encoders; the import's section and the attachment reads' copy paragraph say so.
How often a draw reads a plane it renders to, from a files read of the consumer (reims-vgpu
development 9889a815bb, read only): the consumer's own work over the planes is copies and clears
(render passes with no draw); the guest's render passes over a video plane are counted by its
boot diagnostics (rt-diag plane-passes) with no count on file, and no counter of the consumer's
splits the loop reads by planes. Not settled by the files; expected rare for decoded video.
Tests: d3d11_reads (new, every device of a device cfg): planes made as d3d11_plane_texture makes
them but for the import (no Direct3D 11 off Windows), an R8Unorm luma and an R16Uint chroma under
an RG8Unorm texture, of usage 0x17, read at their own pixel by draws of a pass over a view of each:
one copy into the shadow and no loop read, one plane submission, every texel exact; the control,
the luma with the feedback usage beside on a loop device, reads through the loop. The Direct3D 11
usage test (Windows) now imports under a render target shaders read and asserts the usage is the
bind flags' exactly, the textures not looped. Verified by the jobs named on landing.
The runtime-sources pin is unchanged (3b7da9e9...): no translator file moved. docs/REFUSALS.md
regenerates unchanged.
A command buffer with nothing for the GPU that takes a Managed buffer's copy-in has the copy-in as
its submission and completes after it. Its retirement gives it one GPU time, at its queue's last end
or its kernel end, whichever is later, as Metal reports a command buffer with nothing for the GPU,
and it fed those same times to the runtime's stage metric. So the copy's whole GPU run was counted
in gpu_end_to_handler, with its steps and tail, the figure the round and the plays read as
completion latency. The perf audit found it on the gb-3090-r3 play on the RX 7900 XTX: 52 command
buffers over 16 ms. One copy-in it dumped was 274 MB and 38.8 ms of GPU time, about 7 GB/s (jobs
m3-max-86564, m3-max-86566). The copy itself is Metal's didModifyRange: point on a discrete GPU;
only its attribution was wrong.
The submit thread now marks such a command buffer as its group goes. For each copy-in that
Captured::take hands to a lead, the finished member with that lead's number gets
Gpu::copy_in_only, if it has nothing for the GPU. An empty command buffer has one segment, so it is
always among the finished. Retirement leaves a marked command buffer out of scheduled_to_gpu_start,
gpu_run and gpu_end_to_handler, and out of the behind, steps and tail sums that go with them. Its
commit_to_scheduled still counts. What the guest sees does not change: gpu_start_time and
gpu_end_time are still one time, computed as before. A command buffer with nothing for the GPU that
took no copy-in counts as before.
Why leave it out rather than count the copy-in's own timestamps as its run:
- runtime_command_buffer_gpu_nanos already counts the copy-in's run as the runtime's own, and its
doc says that is no Metal command buffer's gpu_run.
- A member of a group sent member by member retires before the copy-ins of its submission, so its
retirement could not read their timestamps without moving the copy-ins' retirement.
- gpu_run would then differ from the command buffer's own gpu_end_time - gpu_start_time, which
stays Metal's answer.
Test: empty_commit_takes_named_ranges (tests/managed.rs) now asserts the stage counts the command
buffer added: [1, 0, 0, 0] where its one submission was the copy-in, [1, 1, 1, 1] otherwise. Its
existing assertions show the path ran: 256 bytes captured, one submission, one runtime command
buffer.
Red: at 6f6e322f16 (scratch; development plus the test alone), on lavapipe (llvmpipe, LLVM 23.1.1;
job m3-max-86583), the declared-buffer and no-effects-dispatch tests fail in the two-copy view, each
counting [1, 1, 1, 1]. 39 of the 41 selected tests passed and 2 failed.
Green: at e6bdfe999a (scratch; this tree on development), on lavapipe (job m3-max-86581), the
runtime's Managed, gpu_span and stage-histogram tests passed: 41 passed, 986 skipped (filtered).
Docs: the doc of Metrics::scheduled_to_gpu_start and the runtime README now name this exclusion.
runtime-sources.sha256 does not change, because no input of its fingerprint changed (pin-compute.py
reads 3b7da9e9).
What: the NVIDIA rows of half-texel-nans-r16f, -rg16f, -rgba16f, -r32f, -rg32f, -rgba32f and
-rg11b10f at case/words/widened list two answers, the RTX 3090's and the RTX 5080 Laptop GPU's, and
say which run each came from. The 5080 narrows a 32-bit texel to half as Metal does and differs from
Metal in NaN bits alone; the 3090 keeps a 32-bit texel's own bits through the half read, its existing
difference under native-half-conversion. The same module runs on both.
Why: pin X's round read the 5080's replay red on these 7 sites (m3-max-86484), against rows recorded
on the 3090; the 5080 replay was last run at pin T. Planner ruling: alternatives in the NVIDIA rows
if every differing word is a NaN on both sides.
Verified: the words of the 7 cases at a0db12ed89 on both cards (scratch probe, not committed: 3090
m3-max-86496, 5080 m3-max-86497), against Metal's recording of each case: the 5080 differs from
Metal in 9,644 widened words, every one a NaN in both answers, its counts equal to its replay's
(558, 1111, 2216, 641, 1279, 2559, 1280); the 3090 differs in 9,983, of which 1,193 in the three
32-bit cases are not a NaN on either side (a denormal for Metal's ±0, FLT_MAX for Metal's infinity,
1/3 unrounded), its existing rows' counts. The other 28 columns are equal on both cards.
What: 132 rows, 44 for each card venue (RX 7900 XTX, Iris(R) Xe, NVIDIA), of extended-swizzles-bgra10xr
and -bgr10xr: the 44 sites the llvmpipe rows (58988c6b83) and the Apple M3 Max rows (35ca0e4606) hold,
each with its card's own answer and the llvmpipe row's cause: a sample past the edge through a
border address mode reads the device's border in code space, and a BGRA10_XR linear sample filters in
the fields' low 6 bits, the runtime's known gaps, not built (one parked fix row). The NVIDIA venue
covers the RTX 3090 and the RTX 5080 Laptop GPU, whose answers are equal at all 44 sites. The NVIDIA
row of render-then-sample-magnified-linear at case/sampled/texels goes: both NVIDIA cards now answer
Metal's texels there. The commit that made them match is not named (expected: the nearest pixel
sampler's texel centre, c99bf0c6c3; unaudited). docs/CONFORMANCE-COVERAGE.md is regenerated.
Why: pin X's short round read every card replay red on these lines (xtx m3-max-86478, iris 86482,
3090 86483, 5080 86484); at pin W the three card replays were green. main/ad recorded the llvmpipe
rows alone, and no merged check or pre-push set ran a card replay.
Verified: the answers are the four replays' own, at a0db12ed89. The card replays with these rows are
this pin's pre-push proof.
The bless commit c4bcc45c28 left its attribution pending on the M3's jobs. This commit carries it and changes
no file.
The authored compile census at the bless differs from pin W's in 162 cells (18 of them regressions), and none
is unexplained. Each attribution point was checked out on the M3 and its census blessed alone against its own
tree's table (m3-max-86314 over 17 points, m3-max-86420 splitting 27a6c1ebd3..e649629fde at 5 more), and the
tables were diffed in history order. Most points also move the artifacts_at product line, which is not counted
below. The last table equals the one c4bcc45c28 commits.
- 41438f2693, a depth cube's read by face samples its cube view: 9 cells from refused (IdentityDomains) to
compiled.
- 58988c6b83, BGR10_XR and BGRA10_XR textures held as UNORM codes: 1520 artifacts move in 304 cases.
- The span ending at 43f22a5661 (8f69218029, the level-0 elements): 360 artifacts move in 72 cases.
- The span ending at c99bf0c6c3 (a nearest runtime pixel sampler keeps its texel centre): the same 360 cells
move again, none back to its artifact before 43f22a5661.
- f514d6f283, a bicubic sample of a format with no bicubic treatment is the runtime's limit: 18 cells, 2 cases
on 9 profiles, from compiled to not_supported{tooling_requirement:bicubic_texels}. The two public
engine/bcx_rules cases bicubic-8-bit-normalized-and-srgb-sums-near-the-rounding-tie (63d0f152) and
bicubic-rounding-of-random-float-and-srgb-texels (cbf5dd18) bind RGBA8Unorm_sRGB textures that their kernel
samples through a bicubic constexpr sampler, which the runtime refuses at dispatch (Gap::BicubicTexels); the
intended refusal, classified as the runtime's limit.
- 7948443887, object and mesh functions need the mesh extension's two stages and the two indirect draw features
together: 135 cells in 15 cases change the MeshShading refusal's label to name every feature.
- 8a80dd27df, an object function reads its draw's group counts at an address: 90 of those cells go to
compiled, and 45 change label.
- ecdce9a3b5, a mesh pipeline without an object function draws through a launcher task stage: 24 artifacts move
in 6 cases.
- 07d9577c20, the mesh stages no longer require drawIndirectCount: 60 artifacts move and 15 cells change label.
- 8fb26059c7, aea7564c29, fbf7edb539, e649629fde, ee45758ba9, 5bfaa69869, f7c56cd4d2, 3e3deb25b9, 27a6c1ebd3,
763caf0270, b01d5e529d and 970e710e4c move no cell.
The golden hash table moves from pin W's (865592b96b) to the blessed one by these commits. Each attribution
point was checked out on the M3 and blessed alone (m3-max-86313, and m3-max-86372 at c226c542b2, which takes
the place of f7c56cd4d2, whose library tests do not compile), and the tables were diffed in history order.
The last table equals the one c4bcc45c28 commits.
- ee45758ba9, SEMANTICS 2371, a sparse read through a sampler reads its texel: 2 rows added
(a2_sparse_read_through's .ll and .air.ll).
- 41438f2693, SEMANTICS 2372: 30 cells in 2 rows (unk_read_depth_cube).
- 58988c6b83, SEMANTICS 2373: 10808 cells in 723 rows.
- 5bfaa69869 (SEMANTICS 2374): the semantics line alone.
- The span ending at 43f22a5661, SEMANTICS 2375: 3277 cells in 219 rows.
- The span ending at c99bf0c6c3, SEMANTICS 2376: 3277 cells in 219 rows, and the runtime-floor profile line.
- The span ending at c226c542b2 (SEMANTICS 2377) and 3e3deb25b9 (SEMANTICS 2378): the semantics line alone.
- e649629fde, SEMANTICS 2379, the identity domains lower object and mesh functions: 1212 cells in 82 rows.
- 763caf0270, SEMANTICS 2380: 8 rows added, and 15 profile lines.
- 8a80dd27df, SEMANTICS 2381: 282 cells in 32 rows.
- ecdce9a3b5 (SEMANTICS 2382): the semantics line alone.
- 07d9577c20, SEMANTICS 2383: 176 cells in 88 rows.
- 27a6c1ebd3, b01d5e529d and 970e710e4c move no cell.
In all, 19062 cell moves, and 10 rows added.
What: 12 rows of venue Apple M3 Max for what KosmicKrisp (Mesa 26.3.1) answers in half-texel-nans:
- 9 rows of R16Float, RG16Float and RGBA16Float at a nearest sample, a read and a read through a
sample (515, 1026 and 2045 elements): every differing element is a NaN in both answers, the
device's NaN bits (rule 1), Metal's texel bits kept where the device answers 0x7e00.
- 3 rows of R32Float, RG32Float and RGBA32Float at a nearest sample (42, 85 and 171 elements):
0x7bff in Metal's answer, 0x7c00 in the device's, a texel past 65504 that Metal saturates and the
conversion takes to the infinity of its sign (PrecisionNote::HalfTexelConversion), as the other
venues' rows at these sites record.
Each row names its notes and marks the cause of the move as expected, not verified: the device
converting in the shader rather than in its texture unit since the extended-range select
(58988c6b83) follows every float sample. docs/CONFORMANCE-COVERAGE.md is regenerated. The runtime
README's bullet listing these rows as seen and not explained goes: no KosmicKrisp replay row is
left unlisted.
Why: the planner ruled these rows, with no code change, on a counted compare of the words the case
reads at 41438f2693 and at 58988c6b83 (a scratch probe, not committed): 0 of 147,456 words differ
on lavapipe (86398), the RTX 3090 (86400) and the RX 7900 XTX (86401); on KosmicKrisp (86403,
86421) 11,056 differ, 10,758 NaN to NaN and 298 the single pair 0x7bff to 0x7c00. llvmpipe's
nearest-sample rows exceed its read rows by the same 42, 85 and 171 elements.
Verified: the rows' answers and first elements are KosmicKrisp's own, from a replay of the eight
cases at 4e7f66642e (m3-max-86425, an Apple M3 Max). The runtime-sources pin is unchanged.
The XR families' 62 KosmicKrisp rows are recorded in known-gaps-rt.tsv by the commit before this
one (extended-swizzles 44, xr-blend, xr-gamut, xr-gradient and xr-masked 18), so the known-gaps
bullet that listed 74 rows seen and not explained now names the 12 half-texel-nans rows that stay
unrecorded for that venue.
Verified: the M3's KosmicKrisp replay with those rows (m3-max-86387, an Apple M3 Max) printed 12
unexpected lines, every one half-texel-nans. The runtime-sources pin is unchanged (README only).
What: 62 rows of venue Apple M3 Max for what KosmicKrisp (Mesa 26.3.1) answers in the XR
families, the same gaps the other venues' rows record:
- 18 rows of the device's blend of the codes (PrecisionNote::ExtendedRangeBlend and
ExtendedRangeBlendWindow) and its resolve (DeviceRoundedResolve): xr-blend (4), xr-gamut (9),
xr-gradient (3), xr-masked (2). The two premul blends differ from the other venues past the
window (the largest difference 53,463 against 24,637), unexamined against Vulkan's clamp of a
fixed-point source, as their rows say.
- 44 rows of extended-swizzles-bgra10xr and -bgr10xr, with the llvmpipe rows' cause: a sample
past the edge through a border address mode reads the device's border in code space, and a
BGRA10_XR linear sample filters in the fields' low 6 bits (the runtime's known gaps, not built).
docs/CONFORMANCE-COVERAGE.md is regenerated.
Why: the replay of KosmicKrisp at development (m3-max-86361) listed them as unlisted; the planner
ruled both families rows, the extended-swizzles fix a bug row of its own.
Verified: the answers are KosmicKrisp's own, from that replay. The replay of the whole ledger on
KosmicKrisp with these rows (m3-max-86387, an Apple M3 Max): 12 unexpected, every one
half-texel-nans (not these families), 0 of the 62.
The red on KosmicKrisp (Mesa 26.3.1) on the Apple M3 Max was the test's, not the driver's. The word
its region row read outside the region, 1048575232, is 0x3E7FFD00: code 16383 read as 16383/65535,
not 0x3E7FFFC0 as the gap line said. The split test's new row, the 4-sample Depth16Unorm cleared to
0.25 and read with no copy, reads it too (M3 leg job m3-max-86335 at 9e6ec32898, build
m3-max-86328):
cleared, no copy, 8 x 8: 256 of 256 samples are not Metal's ... the words read: 0x3E7FFD00 x 256
4 x 3 at (2, 1) of 8 x 8: 208 of 256 ... the words read: 0x3E7FFD00 x 208
So the device's clear converts 0.25 (16383.75 in codes) to 16383, and the copy's load and store keep
it exactly. Vulkan's "Conversion From Floating-Point to Normalized Fixed-Point" (3.10.2) returns
"one of the two unsigned binary integer values ... closest" (it should round to nearest), and the
test took only 16384. A sample the clear leaves now holds either code nearest 0.25 * 65535, each
still read within 1e-7 of its code; inside units stay exact. Metal's own code for this clear is not
recorded.
The runtime README's KosmicKrisp bullet in the known gaps of blit encoders (353bf003e8) described a
driver fault that is not one, and goes. The module docs' list items no longer open with a link
followed by a colon, which clippy under --cfg m2v_gpu and m2v_cpu_icd read as a link reference
definition (doc_nested_refdefs; job m3-max-86330 at 9e6ec32898).
Test and docs only: no version bump; the runtime-sources pin is unchanged (3b7da9e9...). Verified by
the jobs named on landing.
On KosmicKrisp (Mesa 26.3.1) on the Apple M3 Max the 4 x 3 Depth16Unorm region row fails (the
runtime README's known gaps of blit encoders), and since the M3 leg reads known gaps by exact test
name, that one row darkened the whole test there: its stencil rows, its whole-texture rows and the
128 x 128 all-codes row, which never ran on that device because the test stopped at the region row.
The row moves to every_device_reads_the_clear_of_a_multisample_16_bit_depth_alone_and_outside_a_region_copied_in,
beside a new row that clears the same 4-sample texture to 0.25 and reads every sample with no copy.
One run on the device tells which driver step leaves the outside samples' value: the clear (or the
fetch of a cleared image) if that row reads it too, the region's load and store if it reads a code.
Each device's rows now all run and print what the kernel read (M2V-READ: the count, the first, and
each distinct word read with its count) before any read is checked, so a failing row no longer hides
the rows after it.
Not widened: the clear's expectation stays code 16384, though Vulkan 3.10.2 also lets a device
convert 0.25 to 16383. Allowing it only outside the region needs the inside test bound apart
(several lines); the one-line form would also accept 16383 for an inside unit of value 16384, which
FragDepth's (c + 1/4) / 65535 does not allow.
Test only: no version bump; the runtime-sources pin is unchanged (3b7da9e9...). Verified by the jobs
named on landing: clippy plain and --cfg m2v_gpu, the rt suite on lavapipe, and one M3 leg.
The M3's KosmicKrisp conformance replay at development c4bcc45c28 (job m3-max-86361) differs from
Metal's answers in 74 rows that known-gaps-rt.tsv does not list for that venue; it differed in none
at pin W (round 865592b96b). Three families: extended-swizzles of BGRA10_XR and BGR10_XR (44 rows),
the xr-blend, xr-gamut, xr-gradient and xr-masked cases (18), and half-texel-nans (12). The planner
ruled that pin X does not wait for them: the line says what is seen, not why, and the next pin
carries a fix or a recorded row with its cause per family.
A clear's depth conversion: KosmicKrisp clears a Depth16Unorm texture to 0.25 as code 16383 (M3
leg m3-max-86335: 0x3E7FFD00 = 16383/65535 on all 256 samples of a clear with no copy), which
Vulkan's fixed-point conversion allows; rounding to nearest gives 16384. No static note covers a
clear's conversion, so the README says so; none is built for this pin (planner). Docs only: no
version moves, and the runtime-sources pin is unchanged.
Blessed at 970e710e4c on the M3 (bless m3-max-86311: inventory, golden, printouts, link half and
opened chains each exit 0; census m3-max-86312, census-exit 0); development's tip 353bf003e8 adds
a README line alone, which moves none of these tables.
- golden_hashes.tsv and public_fixture_expectations_engine.tsv: the cells W..X moved (the
attribution commit names each moving commit).
- air_input/mesh_simd.txt: the printout of the mesh branch's new fixture.
- opened_chains.txt: 28 contexts enable VK_EXT_mesh_shader with taskShader, meshShader and
multiDrawIndirect (members +3, extensions +1); the two without the extension are unchanged.
- authored-compile.tsv: 322 rows (AUTHORED_COMPILE_CENSUS_VERSION 11), among them the two bicubic
cases' 18 cells, compiled to not_supported{bicubic_texels}, and the mesh functions that now
compile.
The Mac host's device leg (KosmicKrisp, Mesa 26.3.1, on the M3 Max) fails
tests::multisample_bytes' 4-sample Depth16Unorm part row since pin V (rounds at 133c992dad and
865592b96b, job m3-max-86090): 208 of 256 samples, exactly those outside the 4 x 3 region at
(2, 1), read 0x3E7FFFC0 (262143 / 2^20), which no 16-bit code gives (Vulkan 3.10.1: c / 65535;
16384 is 0x3E800080, 16383 0x3E7FFD00). Inside the region every code reads right, and the
whole-texture and stencil rows pass there.
The copy renders the region alone (rt blit/samples.rs: render area and scissor the region, the
depth loaded and stored); Vulkan's load and store operations update only values within the render
area (8.5 "Render Pass Load Operations", 8.6 "Render Pass Store Operations"), so the outside
samples keep the clear's code, as the RTX 3090, RX 7900 XTX, Iris Xe and lavapipe read them. A
files-only read (lane kkd16) found no path of ours that reads the outside samples in another
form: one OpImageFetch through one view reads inside and outside alike, and the copy-out reads
the region alone. Recorded as a known gap with no second form; which driver step leaves the
value (the clear, or the copy's load and store) is not isolated. Docs only: no version moves,
and the runtime-sources pin is unchanged.
The line read as if the RTX 3090 and the RX 7900 XTX kept the map's operations uncontracted, a
per-card form. NoContraction is on every device (58988c6b83); those two cards' timings (85290,
85291) were taken before it, and all three cards' before the gather's nearest code. Docs only.
The mesh branch (devpolicy) bumped both past an older base; its rebase onto main/s3 and
then onto main/s4 collapsed them into the stack's own numbers (ARTIFACT 613 is the interface
deletions' 27a6c1ebd3, RUNTIME 2577 is s3's). Mesh changes the artifact encoding (its stage
facts and pipeline fields) and the runtime's behaviour (mesh states draw, the floor's mesh
features, a mesh draw under a past depth range refused as Viewport), so each takes the next
number. SEMANTICS 2383 is already past the stack's 2378. Stack staging only; no code moves.
The XTX's one-group launcher draw took 8 times a one-triangle vertex draw,
and the row could not say whether the launcher's shape or any task stage
costs it. The cost test's new row answers on the card: a one-group draw of
a state with an object function, whose task stage is the guest's
function, took 74,560 ns where the launcher's took 64,720 ns and the
triangle 7,920 ns. The known gap says so, and its XTX figures are now that
one run's: 8.2 times, and 1.39 times at M 256 against M 4 (221,120 and
159,280 ns; 2.39 ns a group).
Verified: RX 7900 XTX (RADV, Mesa 26.2.6), job 86149 at 50a3d29e17, carry
8840414fd2, mesh_costs_print_per_card unvalidated, medians of nine
command buffers.
On the RX 7900 XTX (RADV, Mesa 26.2.6, job 86024) a one-group mesh draw
through the launcher took 63,560 ns against a one-triangle vertex draw's
7,920 ns, 8.0 times; on the RTX 3090 it took 0.84 times. The row cannot
tell whether that cost is the launcher's shape or any task stage on that
driver. mesh_costs_print_per_card now also times a one-group draw of a
state with an object function (mesh_draws_object, 1 object thread), whose
task stage is the guest's function, not the launcher: printed as
"object 1 group N ns" beside the launcher's row. Nothing asserts on time.
Verified: see the job named in the handover.
The handover from pr2627-c: the second of it and devpolicy to land carries
the mesh rule, the fold where the mesh function writes no per-primitive
viewport index and a typed refusal where it does, and until that fold
exists a mesh draw under a past range is refused as Viewport, under the
same row. pr2627-c landed first (1d6054b189), and its twin (d2a12e948c, in
the stack this branch now sits on) folds the range into a vertex function
alone, so a mesh draw has nothing to fold.
The encoder's route now answers DrawKind::Viewport for a mesh state where
the range shows, as it does under the Clamp mode, so a mesh draw reads its
refusal from the one field every draw reads and no twin is attempted. A
mesh state lowers none of its functions apart from its compile, so its
fragment function from AIR is taken to read [[position]]'s z or w
(Content::reads_position_depth, set when the content is made): its draws
under such a range are refused with or without a depth attachment, and a
fragment function the consumer compiled answers its own.
No red commit: rebased onto the twin, RenderPipelineState::folded already
answered Viewport for a state with no vertex descriptor (its let-else), so
a mesh draw was refused at bind_content before this change. The route
makes it the draw's one check and keeps the twin out of the mesh path.
Docs: set_viewport, DrawKind::Viewport, and the runtime README's twin
known gap and Gap::Draw list. docs/REFUSALS.md regenerated (no change
expected: the refusal's sites are the same). runtime-sources.sha256
re-pinned.
Test: tests::mesh_state::on_device::
a_mesh_draw_under_a_depth_range_past_0_1_is_refused draws a mesh state of
mesh_draws under [0, 2] (refused, Gap::Draw Viewport) and under [0, 1]
(drawn, one launch counted).
Verified: see the job named in the handover.
The mesh known gap said the lowering had never been compared with Metal
on a GPU. It now says what was: the conformance suite's 44 cases of mesh
pipelines, recorded on an M3 Max under macOS 27.0.1, replayed on lavapipe
(Mesa 26.2.4), the RTX 5080 Laptop (NVIDIA 615.71.09), the RTX 3090
(NVIDIA 620.70.06), the Radeon 780M and the RX 7900 XTX (RADV, Mesa
26.2.6), each answering 9 exact, 5 announced, 29 refused as the ledger
lists and 1 divergent: mesh-barrier-readers, whose fragment-stage
barriers the M3 answers outside its family's supported set (feature set
tables, note 3), so the header's order is kept. It names the device test
that draws an object grid past the task total in pieces, and the venues
it ran on, since no conformance case draws one.
The planner asked for the launcher's cost and the idle invocations' cost
at the state's maximum M as known-gap rows, on the RTX 3090 and the RX
7900 XTX, with the ratios: the 3090's one-group launcher draw is 0.84
times a one-triangle vertex draw and its 65,535 groups of 4 threads 1.01
times as long at M 128 as at M 4; the XTX's are 8.0 times and 1.39 times
(at M 256). The sentence that no replay stream or live session used one
is dropped: the bullet already says so.
Verified (jobs, carry b11f9ecd63 built at 19bf5ff006):
- lavapipe, mr6 85972: 9 exact, 5 announced, 1 divergent, 29 refused;
ledger drift 0; the pieces test passed.
- RTX 5080 Laptop 85920, RTX 3090 85935, Radeon 780M 85955 (carry
999b3e4cdf at 26d0420861): 9, 5, 1, 29 each; RX 7900 XTX 86024: the
same.
- Pieces test (4,194,305 object threadgroups, one counted in pieces,
nothing drawn whole) with the validation layer: RTX 3090 86010, Radeon
780M 86017, RX 7900 XTX 86024.
- Costs, mesh_costs_print_per_card unvalidated, medians of nine command
buffers: RTX 3090 85935, RX 7900 XTX 86024.
The RX 7900 XTX (RADV, Mesa 26.2.6) replayed the 44 cases of mesh
pipelines at 19bf5ff006 (job 86024, carry b11f9ecd63) and answered as the
RTX 5080 Laptop, the RTX 3090 and the Radeon 780M did: 9 exact, 5
announced, 1 divergent, 29 refused. Its 25 lines of drift are exactly the
rows those venues carry, so the same rows are written for the venue
"RX 7900 XTX": the ThreadgroupMemoryLength and IndirectObjectGrid
refusals, the two CommandTypes cases, the eight divergent sites of
mesh-barrier-readers with the reason quoting the header and note 3 of
the feature set tables, and the twelve mesh-limits cases refused at
maxTotalThreadsPerThreadgroup.
docs/CONFORMANCE-COVERAGE.md regenerated (coverage.py).
Verified: job 86024 printed the 25 lines these rows answer, and the same
job's device tests passed 8 of 8 with the validation layer. A replay of
this commit on the card, to show no drift, follows.
The mesh replay on the Radeon 780M (RADV, Mesa 26.2.6), job m3-max-85955 at 26d0420861 with the
carried binaries, held the same 25 sites as the RTX 5080 Laptop and the RTX 3090 (jobs 85920 and
85935), case for case, site for site and answer for answer, and nothing else: 9 exact, 5
announced, 1 divergent (mesh-barrier-readers, the ruled rows), 29 refused. Those 25 rows come in
for venue 780M. The runtime's 7 mesh device tests passed there under the validation layer.
The RX 550 (RADV, Mesa 26.2.6), which lists no VK_EXT_mesh_shader, replayed the same 44 cases in
job m3-max-85949 with exit 0: 25 lacking the feature, 7 exact (the creations Metal refuses), 12
refused at the `*` rows, so no per-venue row fires on a venue without mesh stages.
docs/CONFORMANCE-COVERAGE.md is regenerated in this commit (coverage.py --check passes locally).
The mesh replays of this lane (lavapipe, RTX 5080 Laptop, RTX 3090, Radeon 780M; jobs 85712,
85920, 85935, 85955) counted 0 object grids in pieces on every card: no conformance case and no
device test drew an object grid past a device's task limits, so the multi-draw of host-written
records and the folded numbering by DrawIndex had run on no device. A form taken by a device's
limits needs evidence that it ran.
an_object_grid_past_the_task_total_draws_in_pieces draws 4,194,305 object threadgroups, past
the maxTaskWorkGroupTotalCount of 4,194,304 every committed mesh device reports (vulkaninfo on
each), with a descriptor stating one object thread so lavapipe runs it quickly. It asserts the
draw is counted in pieces and not whole, the command buffer completes (under the validation
layer where the device tests take it), and nothing is drawn: each object threadgroup launches
ctl.x + x by ctl.y mesh threadgroups and ctl is zero.
Verified: the next jobs run it on lavapipe and on each card.
The mesh replay on the RTX 5080 Laptop (NVIDIA 615.71.09), job m3-max-85920 at 26d0420861 with
the carried binaries, held exactly the rows lavapipe holds and nothing else: 25 sites "not listed"
on this venue, every one the same case, site and answer as its llvmpipe row (IndirectObjectGrid
at the two indirect object draws, ThreadgroupMemoryLength at the lengths case, CommandTypes at
the two command cases, the tile getter at the 12 made mesh-limits states, and mesh-barrier-
readers' 8 fragment-to-* sites). Those 25 rows come in for venue NVIDIA.
The same run: 9 exact, 5 announced (the draw cases, under the device's native NaN encoding
note), 1 divergent (mesh-barrier-readers, the ruled rows), 29 refused; mesh-partial-barrier-
uniform is exact (its PredicationVote refusal is fixed in 0d7bbee12c). The runtime's 7 mesh
device tests passed there under the validation layer 1.4.363.0.
docs/CONFORMANCE-COVERAGE.md is regenerated in this commit (coverage.py --check passes locally).
Clippy in job m3-max-85855 (26d0420861, plain) stopped the runtime's lib on
clippy::large_enum_variant: once Made::Mesh held nothing (34fbfcf33f), the enum was a 952-byte
RenderPipelineDescriptor beside an empty variant. The field is now
Option<RenderPipelineDescriptor>: Some for a state of newRenderPipelineStateWithDescriptor:, None
for a mesh state, of which the state keeps nothing. A vertex state is the size it was before the
mesh work, and no Box is allocated per state. The four readers match Some and None as they matched
the two variants.
Verified by the error text of 85855 only; the next job runs the three clippy configurations.
The mesh cases were 49 rows of `*` refusing a call the runtime's side lacked (mesh_pipeline,
mesh_pipeline_limits, mesh_pipeline_for_commands, mesh_pipeline_bindings,
mesh_descriptor_facts). The adapter answers all five, and the lavapipe replay of job
m3-max-85712 (c6bd918103) read each of those rows as no longer held. They go, and the rows the
replay holds come in (47):
- `*`, the calls that make no pipeline: the mesh descriptor's label and binaryArchives (3 cases,
the consumer's own, as the render descriptor's) and the two reflection cases' 8 option sites
each (the consumer's own reflection).
- llvmpipe, the calls that make one, so a venue without mesh stages reads them as lacking the
feature and holds no row (a `*` row there fails as no longer held, now lacks the feature):
- IndirectObjectGrid at the indirect draw of mesh-object-draws and of
mesh-barrier-indirect-object-reader (the step-4 ruling: refused at the draw);
- ThreadgroupMemoryLength at indirect-mesh-commands-object-threadgroup-lengths' pipeline (the
object function's [[threadgroup(n)]] argument, refused at the creation, as ruled);
- CommandTypes at both mesh-commands cases' command buffer (the ICB ruling; its row's count:
0 of 22 kept streams, jobs 85614/85615);
- maxTotalThreadsPerThreadgroup, a tile getter, at 12 mesh-limits cases whose state is made
(an M3 Max answers 0 there; the runtime makes no tile state);
- mesh-barrier-readers, divergent at the attachment and drawn count of its four rows whose
barrier names the fragment stage in afterStages. main's ruling: the documented answer stands.
MTLRenderCommandEncoder.h says the barrier makes stores at or before afterStages coherent
with loads at or after beforeStages, which the runtime does; the M3 recorded the reader
without the fragment's words, and the Metal Feature Set Tables (October 23, 2026, note 3)
say Apple3 through Apple11 GPUs don't support barriers with the fragment stage in after.
The other mesh rows stay: function facts, the pipeline handler pair, the binary archive adder
and the visible-table stages answer as before. mesh-partial-barrier-uniform holds no row: its
PredicationVote refusal is fixed in 0d7bbee12c. The GPU venues' rows follow their runs.
docs/CONFORMANCE-COVERAGE.md is regenerated in this commit (coverage.py --check passes locally).
The lavapipe conformance replay of job m3-max-85712 (c6bd918103) refused mesh-partial-barrier-
uniform at case/pipeline: "a render pipeline state with DrawInput { cause: RuntimeFact { fact:
\"PredicationVote\" } } is not built". Its object or mesh function holds a workgroup barrier in a
loop that part of the threadgroup skips, so its predicated walk votes in a workgroup word of its
own beside the arena (lower::simd::divergent). The translator counts that word against the
stage's workgroup memory at the creation and refuses a function whose word does not fit
(divergent.rs, mesh::workgroup_limit). A compute state supplies the fact by counting the word
against threadgroup lengths a dispatch sets; a mesh state answers no threadgroup memory length
and takes no length from a draw, so the render state's fact check now accepts it for a mesh
state, as it accepts the other facts of an object or mesh function.
The check is the conformance case itself: mesh-partial-barrier-uniform compares on the next
replay (lavapipe in CI, and the GPU runs of this lane).
Job m3-max-85712 (c6bd918103) failed conformance_coverage's
the_conformance_coverage_document_is_what_the_sources_derive: MeshStateLimits'
max_total_threads_per_threadgroup became a Field in the adapter commit, and the coverage
generator finds a Field's leaf only as `Node::leaf("site", field(&self.x, ..))`. The node
recorded it through `state.` inside Creation<MeshStateLimits>::node.
The made state's leaves move to MeshStateLimits::with_sites (&self), in the same order and with
the same values; the creation's node adds them where the state was made. docs/CONFORMANCE-
COVERAGE.md is regenerated: MeshDescriptorFacts (label, binary_archives) and MeshStateLimits
(max_total_threads_per_threadgroup) join the table of refusable fields.
Verified: `python3 -I -B scripts/conformance-coverage/coverage.py --check` passes on this tree
(run locally, no cargo); the conformance suite runs in the next job.
Clippy in job m3-max-85712 (c6bd918103, plain, m2v_gpu and m2v_cpu_icd alike) stopped the
runtime's lib on two errors:
- dead_code: Made::Mesh held the MeshPipelineDescriptor, which only a test helper read. A vertex
state keeps its descriptor because a pass makes its content again from it (for_pass); no pass
does that for a mesh state. Made::Mesh is now a unit variant, and the test helper says a mesh
state keeps no vertex or fragment function (rule 4: nothing unused is kept).
- clippy::chunks_exact_to_as_chunks in mesh_draw::count_bytes: the three counts now go through
as_chunks_mut::<4>(), the same bytes.
Verified by the error text of 85712 only; the next job runs the three clippy configurations.
Job m3-max-85712 (the lane's check at c6bd918103, built on msi) failed two runtime tests:
- tests::mesh_draw::a_mesh_draw_gives_metal_s_counts_and_regions, row 2: a drawMeshThreads of
(3, 1, 1) threads with mesh threadgroups of (4, 2, 1) and no object function gives counts
(0, 0, 1), each axis rounded down (3/4 and 1/2), as the code does and as Metal drew nothing
for grid-threads-3x1-by-4 in the recording mesh-grid-draws. The row expected (0, 1, 1), as if
the threadgroup were one thread tall. The expectation is fixed; the draw was already empty.
- tests::translator_fields: GraphicsState::max_total_threads_per_object_threadgroup and
max_total_threads_per_mesh_threadgroup, added by the translator's mesh maxima, had no
verdict. Both are Applied: render.rs reads them to make each stage's capped maximum.
Verified by the failure text of 85712 only; the next job runs both tests.
The planner asked, before READY, what a Mac's mesh state answers for
maxTotalThreadsPerObjectThreadgroup and maxTotalThreadsPerMeshThreadgroup when the descriptor
states nothing and when it states 1024, so the runtime's default maximum matches what a guest
reads. The probe had `plain` (nothing stated) and no 1024 case; it gains `max-1024-1024`.
Measured on the M3 Max under macOS 27.0.1 (26A434), job m3-max-85757, each case a first
compile (a new salt), the same salt again, and for `plain` and `max-1024-1024` unsalted:
`plain` answers 1024 and 1024, `max-1024-1024` 1024 and 1024, `max-64-32` 64 and 32, and
`no-object` 3 and 1024, every run alike. The runtime's default, 1024 capped by the stage's
Vulkan limit, is Metal's answer for both.
The conformance recording mesh-limits-plain holds 128 and 128 because the suite records each
thread maximum as the least of the answer and THREAD_FLOOR (128) on both sides
(pipeline_limits.rs, "The thread maxima are compared up to Vulkan's floor"): Metal's 1024 is
stored as 128, and the runtime's answer is floored alike. It stays as recorded.
The mesh floor's extension list, the object stage's thread maximum, the mesh draw module, the
conformance descriptor reads and the replay's form counters each carried a doc line past the
tree's 100 columns, written in this lane's earlier commits. Rewrapped; no word changes.
Verified: the diff is whitespace and line breaks in comments only.
An object or mesh function with a [[threadgroup(n)]] argument stays refused at the creation
(Gap::RenderPipeline): setObjectThreadgroupMemoryLength:atIndex: and its mesh form are not built.
The known gap now says what starts that build: the first replay stream, consumer walk or guest
that makes a mesh state whose object or mesh function declares such an argument. The stream
greps of this lane found no stream making a mesh state (jobs 84938 and 85231: 25 kept streams,
0 naming newRenderPipelineStateWithMeshDescriptor, a mesh draw or setObjectThreadgroupMemoryLength).
Docs only; the paragraph's tail is reflowed to 100 columns. Verified: the README diff alone.
Before READY the planner asked for the launcher's cost and the cost of a stage's
workgroup at the state's maximum M, one card per vendor, as known-gap rows.
mesh_costs_print_per_card (m2v_gpu, ignored; run under
METAL2VULKAN_TEST_UNVALIDATED=1 with --run-ignored only, once per card) times,
as the median GPU time of nine command buffers after two unmeasured:
- a mesh-only draw of 1 group (the launcher's task workgroup and one mesh
workgroup) against a 1-triangle draw of a vertex state on the same kind of
pass: the launcher's fixed cost;
- 65,535 groups of 4 threads on a state at its default M (capped by the
device) and on one at M 4: the idle invocations' cost, as a ratio;
- the time per group between 1 and 65,535 groups at the default M.
It prints one "mesh_costs:" row per device and asserts nothing about time
(main: no test-only link, the cheap launcher row, lavapipe left out).
Verified: JOBLINE
Condition 7 asks for the path's counter on each venue the mesh cases run on.
Three new metrics count each recorded mesh draw by the form it took:
- Metrics::mesh_draws_launched: a state without an object function, one task
workgroup of its launcher (direct and indirect draws);
- Metrics::mesh_object_grids_whole: an object grid within the task limits, one
vkCmdDrawMeshTasksEXT of its counts;
- Metrics::mesh_object_grids_in_pieces: an object grid past them, one
vkCmdDrawMeshTasksIndirectEXT of its pieces.
A grid the host knows is empty records nothing and is not counted. The
conformance replay prints, for each case that drew any, "mesh forms: CASE on
DEVICE: a launched, b object grids whole, c in pieces", beside its other form
lines; no verdict reads it. The lavapipe device test a_mesh_draw_draws_metal_s_grids
asserts the count of each draw's form. The README's mesh line and
draw_mesh_threadgroups' doc name the three; signatures blessed.
Verified: JOBLINE
The runtime README's Mesh stages section names the four venues that list no
VK_EXT_mesh_shader, where a mesh render pipeline state is refused
(Unsupported{MeshShading}): the Radeon RX 550 (RADV, Mesa 26.2.6), the Iris Xe
(ANV, Mesa 26.2.6), and the M3 Max under KosmicKrisp (Mesa 26.3.1) and MoltenVK
(1.4.2). A table gives the others' limits that decide a mesh draw: the task
grid (count and total), the task and mesh invocations and width, and
maxTaskPayloadAndSharedMemorySize:
- RTX 3090, RTX 2080 (NVIDIA 620.70.06); RTX 5080 Laptop (NVIDIA 615.71.09):
task (4194304, 65535, 65535), total 4194304; 128 task, 128 mesh; 32768.
- RX 7900 XTX, Radeon 780M (RADV, Mesa 26.2.6): task (65535, 65535, 65535),
total 4194304; 1024 task, 256 mesh; 65536.
- lavapipe (Mesa 26.2.4 and 26.2.6): task 65536 per axis, total 4194304;
1024 and 1024; 32768.
It then says what the caps mean: the NVIDIA cards answer at most 128 for each
stage where Metal answers up to 1,024, a larger threadgroup's draw is
Limit::MeshThreadgroupThreads, and the AMD cards cap the mesh stage at 256.
These are the CAP ruling's known-gap rows.
Verified: docs only; each number read from vulkaninfo on that card.
Since the step-4 ruling no mesh draw reads a GPU-written draw count: an
indirect draw of an object function is the runtime's refusal at the draw
(DrawKind::IndirectObjectGrid), a mesh-only indirect draw is the launcher's one
task workgroup (vkCmdDrawMeshTasksEXT(1, 1, 1)), and an object grid's pieces past
the task limits take a host-written count through multiDrawIndirect. Rule 4
(anything unused is deleted) drops it, as the planner ruled through main:
- lower::mesh::FEATURES and floor::MESH_STAGES hold taskShader, meshShader and
multiDrawIndirect; device creation enables VK_EXT_mesh_shader with those
three where the device reports all three.
- The cond-1 tests iterate the three; the floor test also shows a device
without drawIndirectCount given the mesh stages, and the device test no
longer reads it.
- The README's Mesh stages section and its extension row, docs/API.md, the
compile_mesh_pipeline and new_mesh_render_pipeline_state docs, and the
requirement's own doc say three.
- SEMANTICS_VERSION 2370 (placeholder; main renumbers): the MeshShading
refusal's needs change on a profile without drawIndirectCount (the M3 Max
under MoltenVK reports it false).
No lab device changes: every card that lists VK_EXT_mesh_shader reports
drawIndirectCount (vulkaninfo on the RTX 3090, RTX 2080, RTX 5080 Laptop,
RX 7900 XTX, Radeon 780M and lavapipe). REFUSALS.md and the signatures were
regenerated and did not move; the runtime sources pin was rewritten.
Verified: JOBLINE
Since the step-4 ruling no mesh draw reads a GPU-written draw count: an
indirect draw of an object function is the runtime's refusal at the draw, a
mesh-only one is the launcher's one task workgroup, and an object grid's pieces
take a host count through multiDrawIndirect. The new test compiles every object
and mesh function of mesh_order and mesh_outputs, and mesh_draws' pipeline with
and without its object function, on each committed profile that lists
VK_EXT_mesh_shader, with drawIndirectCount removed from the device. It fails
until lower::mesh::FEATURES stops requiring the feature.
Verified: JOBLINE
The rt side answered every mesh call with Unavailable. It now answers them
through the runtime's mesh render pipeline states (new module rt_side/mesh.rs):
- mesh_pipeline and mesh_pipeline_for_commands: new_mesh_render_pipeline_state
of the case's object, mesh and fragment functions over RGBA32Uint colour
attachments, the second with support_indirect_command_buffers set.
- mesh_pass: one pass over the targets, each cleared to zero and stored, every
step encoded whatever an earlier one answered (the set_object_*,
set_mesh_*, set_fragment_buffer, draw_mesh_threadgroups, draw_mesh_threads
and draw_mesh_threadgroups_indirect calls; both barrier forms are the
runtime's memory_barrier, whose doc names both), committed and waited for
within WAIT; the states it set announce their notes.
- mesh_pipeline_limits: the descriptor's limits with rasterization disabled,
the state's answers floored as the Metal side floors them, or Metal's
refusal where the runtime's error is one (refuses_as_metal, now shared).
- mesh_descriptor_facts: the translator's MeshPipelineDescriptor stated and
read through descriptor_reads (new state_mesh and read_mesh; the colour
attachments' stating and reading are now one helper each, shared with the
render walk).
- mesh_pipeline_bindings: the consumer's own (reflection_is_the_consumers).
- mesh_command_buffer: the runtime's indirect command buffer of both mesh draw
types, which it refuses as CommandTypes (the planner's ruling: not built).
Three getters the runtime has no counterpart of become fields a side refuses
alone, the other getters still compared, as the render facts already do: a mesh
descriptor's label and binaryArchives, and a mesh state's
maxTotalThreadsPerThreadgroup (a tile threadgroup's). The Metal side answers
each as Ok, so the recordings' sites are unchanged.
The answered-calls test gains the five mesh calls with a case that reaches each.
Verified: JOBLINE
The runtime README's known gaps of indirect command buffers gain a line for
MTLIndirectCommandTypeDrawMeshThreadgroups and MTLIndirectCommandTypeDrawMeshThreads:
refused as IndirectCommandsKind::CommandTypes, and what lifts them. Two general
gaps come first, because the conformance suite's three mesh command cases
(mesh-commands-own-state, mesh-commands-unordered-draws and
indirect-mesh-commands-object-threadgroup-lengths) each set their own pipeline
state (CommandPipelines) and are encoded by the CPU, which is not built. With
both built, the mesh types take a command layout of their own
(VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_EXT) carrying the draw's group
counts and threadgroup sizes. CommandTypes' doc comment names the two mesh types
and the same order.
This is the planner's ruling on the mesh indirect command buffers: they stay a
typed refusal, not built in the mesh lane.
Verified: docs only. docs/REFUSALS.md regenerated with refusal_surface.py and
unchanged (its row is Gap::IndirectCommandBuffers, not the kind); the runtime
sources pin is EQUAL; cargo fmt --all.
What: a new DrawKind::IndirectObjectGrid. MeshCall::of refuses an indirect draw (MeshGrid::Indirect)
of a state with an object function with Gap::Draw of it, after the threadgroup checks and before
anything is recorded; draw_mesh_threadgroups_indirect's doc says so. Launch::Arguments, the
object grid's indirect command the previous commit drew, is deleted with its recording. An
indirect draw of a state without an object function is drawn through the launcher, as before.
The runtime README's mesh known gap records the refusal, where Metal draws, and that no guest has
met it (no replay stream or live session has used a mesh state).
Why: the planner's step-4 ruling. An object grid the GPU reads may lie past the device's task
limits (maxTaskWorkGroupCount, maxTaskWorkGroupTotalCount), where it runs in pieces whose number
only the counts decide; the runtime reads no GPU word on the host (condition 6) and no command
inside the pass can write the pieces' records (condition 5), and Vulkan leaves a task grid past
the limits undefined (VUID-VkDrawMeshTasksIndirectCommandEXT-TaskEXT-07322).
Tests: the parent's red tests pass here, narrowed to the kind: the no-device
tests::mesh_draw::an_indirect_draw_of_an_object_function_is_refused_at_the_draw and the lavapipe
draw test's indirect draw of mesh_draws' object state. docs/REFUSALS.md, error/basis.rs and
api_signatures.tsv are regenerated.
Verified: JOBLINE
What: tests::mesh_draw::an_indirect_draw_of_an_object_function_is_refused_at_the_draw asks
MeshCall::of for an indirect draw of a state with an object function and expects a
Gap::Draw; the lavapipe draw test asks the encoder's draw_mesh_threadgroups_indirect of
mesh_draws' object state and expects the same, before anything is recorded. Both fail at this
commit: the draw records the object grid's indirect command from the GPU's counts, which is right
only within the device's task limits.
Why: the planner's step-4 ruling, red first: an indirect draw of an object pipeline is a typed
refusal at the draw. The next commit makes it.
Verified: JOBLINE (expected to fail here)
What: RenderCommandEncoder::draw_mesh_threadgroups_indirect, Metal's
drawMeshThreadgroupsWithIndirectBuffer:indirectBufferOffset:threadsPerObjectThreadgroup:
threadsPerMeshThreadgroup:. The arguments (Metal's MTLDispatchThreadgroupsIndirectArguments,
three u32s) are checked as a vertex draw's are (OtherDevice, IndirectOffset,
IndirectArgumentsPastEnd at 12 bytes, ArgumentPlace; the checks are now one helper,
arguments_checked, for both). The draw pushes the arguments' address as the group counts'
address, so nothing is written to the ring and nothing read back:
- without an object function the state's launcher reads the GPU's counts there and emits the mesh
grid where Metal draws it, one task workgroup, vkCmdDrawMeshTasksEXT(1, 1, 1);
- with one, the arguments are the object grid's own indirect command, one
vkCmdDrawMeshTasksIndirectEXT record (Vulkan's command is Metal's layout).
The buffer counts as the draw's read (its hazards, a Managed buffer's copy, kept until the command
buffer retires), as a vertex draw's arguments. Call::Mesh carries the arguments; mesh_draw gains
MeshGrid::Indirect and Launch::Arguments. README and docs/API.md say the indirect form is drawn.
Why: R3 of the mesh build. The object pipeline's indirect form is drawn here as the task grid's
indirect command, which is right only within the device's task limits; the planner's step-4
ruling refuses it at the draw, which the next two commits do red-first.
Tests: tests::mesh_draw adds the indirect calls' counts, regions and launches; the lavapipe draw
test adds three indirect draws through the launcher: 3 groups by 8 at offset 8 (the M3's
grid-indirect-3x1-by-8 pixels and words), and an axis of 65,536 and 1024 by 1024, which draw
nothing, as on the M3. api_signatures.tsv and docs/REFUSALS.md are regenerated.
Verified: JOBLINE
What: GraphicsState::max_total_threads_per_object_threadgroup's doc, docs/API.md's mesh
pipelines section and RenderPipelineState::max_total_threads_per_object_threadgroup's doc now
say the rule's last step, 1024 where neither the descriptor nor the function states a maximum,
is as an M3 recorded it (an M3 Max, macOS 27.0.1, a first compile, the conformance probe
mesh_pipeline_limits.m), and that Metal's headers state no default.
Why: the planner's wording ruling on T9: the value is measured, and the doc says where from.
Verified: comment and doc text only; cargo fmt; runtime-sources.sha256 unchanged (the pinned
set holds none of these files).
What: the render encoder binds the object and mesh functions' tables (set_object_* and
set_mesh_*: buffer, buffer offset, bytes, texture, sampler state with and without LOD clamps) and
draws a mesh state directly: draw_mesh_threadgroups and draw_mesh_threads. The device loads
VK_EXT_mesh_shader's commands where it enabled the extension (Core::mesh). A new module,
mesh_draw, holds the draw's grid:
- each threadgroup is checked against Metal's maximum for its stage (Refusal::ThreadgroupSize for
no threads or past it) and then against the state's capped maximum, a new
Limit::MeshThreadgroupThreads naming the stage, the size, the state's maximum, the Vulkan limit
that holds it (a new public WorkGroupLimit, maxTaskWorkGroupInvocations, maxTaskWorkGroupSize[0]
or their mesh siblings) and that limit's value, counted in a new
Metrics::mesh_threadgroups_past_device. The object size is read only where the state has an
object function.
- the draw writes three group counts into the ring and pushes their address
(GroupCountsAddress), and writes each stage's DispatchRegion: the mesh stage's L, and the object
stage's L with Metal's threads per grid and the partial flag for a draw of threads (no grid for
a draw of threadgroups, so the object function's is counts times L).
- without an object function the counts are the mesh grid (a draw of threads rounds it down, as
the M3 recorded in mesh-grid-draws), and the draw is the launcher's one task workgroup,
vkCmdDrawMeshTasksEXT(1, 1, 1).
- with one, an object grid within the task limits is one vkCmdDrawMeshTasksEXT of its counts;
past them it runs in pieces of the most workgroups the limits allow, one piece directly and more
as one vkCmdDrawMeshTasksIndirectEXT whose records lie in the ring (stride 12), the folded object
function numbering them by DrawIndex. More pieces than one ring chunk holds (5,461) is a new
Limit::ObjectThreadgroups.
- an empty grid records nothing; a mesh draw with a vertex function's state is Refusal::MeshDraw,
whose doc now covers both directions.
Each mesh draw fills its push bytes and blocks (its counts and regions are its own); it records
no topology (a mesh pipeline holds no input assembly, which leaves the recorded topology as it
was) and biases as triangles. No draw ends the pass and nothing reads a GPU word back
(conditions 5 and 6 for direct draws). The indirect mesh draw is not built yet: the README's known
gap says so, and the consumer refuses it itself.
Why: R2 of the mesh build, direct draws, in the ruled order after the state (R1b).
Tests: tests::mesh_draw (no device) checks the size refusals and the limit with its Vulkan names,
each call's counts, regions and launch against the region helpers, and the pieces on the 780M's
and the RTX 50's task grids (cover, minimality, the chunk limit). tests::mesh_state's new device
test draws mesh_draws' states into two RGBA32Uint targets and compares every pixel with the
fixture's words, which match the M3's recordings (mesh-grid-draws, mesh-object-draws): through the
launcher (3x2 groups by 4, 7x5 threads by 2x2), through the object function (2 groups of 2, 3
threads of 2 with a partial threadgroup), empty grids, and the refusals. It also prints each
device's task and mesh limits for the known gaps' per-card table. docs/REFUSALS.md, error/basis.rs
and api_signatures.tsv are regenerated; README and docs/API.md state the direct draws.
Verified: JOBLINE
What: Refusal's Display names MeshDraw. The indirect test's Draws and the render offsets tests
take four tables (crate::render::TABLES) where they wrote two.
Why: m3-max-85433 at ce095262a1 failed clippy (plain): Refusal's Display match did not cover
MeshDraw, and three test literals still had two tables after 06c4155ad9 made four. The device
cfg's render_offsets assertion on dirty_offsets is the fourth such literal.
Verified: the four places clippy named, and the one device-cfg literal of the same kind found by
grep. The next job's clippy steps read them.
What: the docs of MESH_EXTENSIONS, the floor's mesh feature field and its extension list name
taskShader, meshShader, multiDrawIndirect and drawIndirectCount in place of a link to the
crate-private MESH_STAGES.
Why: RUSTDOCFLAGS='-D warnings' cargo doc refused three public docs that linked a private item
(m3-max-85346, rustdoc EXIT=101, at bf42fe0b82); public docs never link to private items.
Verified: the three lines rustdoc named are the three changed. The next job's rustdoc step reads
them.
What: Device::new_mesh_render_pipeline_state(&MeshPipelineDescriptor, sampler_ids) makes a
RenderPipelineState of a mesh descriptor.
- The content is compiled with compile_mesh_pipeline at each creation. The translator gives no
key of a mesh descriptor before its compile, so neither the map of contents nor the cache
directory holds one.
- The draw tables become four: VERTEX, FRAGMENT, OBJECT and MESH, in Draws, OffsetLayout and the
render encoder's tables, blocks and dirty offsets.
- draws() maps the object stage (or the launcher) and the mesh stage to their tables, takes their
threadgroup facts, and maps DispatchRegion, GroupCountsAddress (new FieldValue::GroupCounts) and
the mesh stage's layer and viewport counts.
- MeshThreads holds each stage's answer: the translator's stated maximum capped by
maxTask/MeshWorkGroupInvocations and maxTask/MeshWorkGroupSize[0]. Its workgroup is that answer
in one row, rounded up to the stages' LocalSizeConstraint multiple.
- stage_module specializes ObjectLocalSize/ObjectFlatLocalSize, with ObjectMultiRegion 1, and
LocalSize/FlatLocalSize, with MultiRegion 0, to the two workgroups. A threadgroup memory length
stays refused.
- make() gives a mesh pipeline no vertex input or input assembly, and drops PRIMITIVE_TOPOLOGY and
PRIMITIVE_RESTART_ENABLE from its dynamic states (VUID-VkGraphicsPipelineCreateInfo-
pDynamicStates-07065 and -07066).
- The state answers maxTotalThreadsPerObjectThreadgroup, maxTotalThreadsPerMeshThreadgroup,
objectThreadExecutionWidth and meshThreadExecutionWidth (32), maxTotalThreadgroupsPerMeshGrid
(the descriptor's, else 1,048,576) and both required sizes. A state without an object function
answers 0 for its object stage, as docs/API.md's accepted differences say.
- New Refusal::MeshDraw (basis: ours) refuses a draw of primitives or patches, or an execution of
an indirect command buffer, with a mesh state (VUID-vkCmdDraw-stage-06481). The encoder records
no mesh draw yet; that is the next step.
- The runtime re-exports MeshPipelineDescriptor.
Why: step 2 of the ruled order (floor, state, direct, indirect, ICB, adapter), under the planner's
cap ruling: a made state answers the capped maxima.
Docs: the README's known gap now says mesh states are made and not drawn, each creation compiles,
threadgroup memory arguments are refused, and the maxima are capped. The stale identity-domains
bullet for object and mesh functions is deleted: 2761e27594 removed that refusal. docs/API.md is
updated. docs/REFUSALS.md and error/basis.rs are regenerated. api_signatures.tsv is blessed: new
runtime methods, the refusal and the re-export, with nothing removed.
Tests: tests::mesh_state, under a device cfg, on every device of the cfg's kind. Where the device
has the mesh set:
- mesh_pipeline_limits' four states (nothing stated; 64, 32 and grid 8; without an object
function, with and without grid 8) are made with their VkPipeline and answer the capped maxima;
- a draw of primitives with one is Refusal::MeshDraw;
- mesh_draws' rasterizing states into two RGBA32Uint colours, with and without the object
function, make their VkPipeline.
Elsewhere each state is refused naming MeshShading.
What: stated_threads takes the descriptor's required threadgroup size for the stage first: its
threads, then the descriptor's maximum, then the function's attribute, then 1024. mesh_fields
keys both required sizes, since the stated maxima now depend on them. The doc comments say where
each part of the rule was measured.
Why: the conformance probe mesh_pipeline_limits.m, measured on an M3 Max under macOS 27.0.1 with
each case a first compile, records the rule:
- `plain`, with nothing stated, answers 1024 for both stages. That is the source of "else 1024".
- A required size answers its threads, even below a function's own maximum:
required-object-32x2 answers 64, required-mesh-16x2 answers 32, and
required-object-32-attribute-64 answers 32.
- A maximum or an attribute answers itself.
The parent commit left the required size out. The descriptor's doc said no limit depended on it,
which those rows contradict.
Tests: a_mesh_pipeline_states_its_thread_maxima_by_metal_s_rule adds three rows:
- (32,2,1) required for the object stage gives (64, 1024);
- (16,2,1) required for the mesh stage gives (1024, 32);
- mesh_outputs with (32,1,1) required for the object stage, whose function states 64, gives
(32, 32).
The ARTIFACT_FORMAT_VERSION bump of the parent covers this, and every mesh pipeline's key moves.
api_signatures.tsv is re-blessed and unchanged.
What: mesh_stages_are_enabled_where_listed_with_all_four_features loops over MESH_STAGES' entries
in place of an index range.
Why: clippy's needless_range_loop refused the index loop under -D warnings (the runtime's lib
test target), so the clippy step of m3-max-85346 at bf42fe0b82 exited 101 on it alone.
Verified: the line clippy named; the loop's assertions are the same four. The next job's three
clippy steps read it.
What: GraphicsState gains max_total_threads_per_object_threadgroup and
max_total_threads_per_mesh_threadgroup, both Option<u32>. compile_mesh_pipeline sets them by
Metal's rule, before any device limit: the descriptor's maximum where it states one, else the
function's [[max_total_threads_per_threadgroup(n)]], else 1024. The object one is None without an
object function; every vertex pipeline states neither. The cache codec encodes both.
Why: a mesh render pipeline state answers maxTotalThreadsPerObjectThreadgroup and
maxTotalThreadsPerMeshThreadgroup, and the runtime specializes each stage's workgroup to that
many threads (capped by the stage's device limits, per the planner's cap ruling). The function's
attribute lives only in its compile, so the runtime cannot read it from the descriptor; the
pipeline now states it, as a compute pipeline's metal_info states its kernel's.
ARTIFACT_FORMAT_VERSION 609 (a placeholder; the number is set at landing): GraphicsState's
encoding has two more fields. A digest omits a field at its default, so no vertex pipeline's
content digest moves; a mesh pipeline's does.
Tests: engine_mesh's a_mesh_pipeline_states_its_thread_maxima_by_metal_s_rule, on the first
committed profile with the mesh stages: mesh_pipeline_limits with nothing stated (1024, 1024),
with 64 and 32 stated (64, 32), its mesh function alone (none, 1024), and mesh_outputs, whose
object and mesh functions state 64 and 32 (64, 32). The codec round trip carries both fields.
docs/API.md's mesh pipelines section states the rule and what a consumer does with it.
api_signatures.tsv is blessed: two public fields added, nothing removed.
What: link::mesh::Launcher. Link plans it for a mesh render pipeline without an object function.
Its push range is 8 bytes at the first offset no stage's range covers (tessellation's
push_offset; Unsupported{MeshShading} needing maxPushConstantsSize where none is free), and it
places its one field, PushField::GroupCountsAddress, as an object-stage placement, first in the
interface. compile_mesh_pipeline builds its module and puts it first among the stages, joining
its requirements:
- a TaskEXT entry of LocalSize 1 1 1 loads the three counts at the pushed address (4-aligned,
Metal's MTLDispatchThreadgroupsIndirectArguments layout);
- it emits that grid where each axis is within Metal's measured 65,535 and the device's
maxMeshWorkGroupCount, and the product within Metal's 1,048,575 and the device's
maxMeshWorkGroupTotalCount, tested as an object function's wrapper tests its grid; past them
it emits 0, 0, 0, so nothing is drawn, as Metal draws nothing;
- where the mesh function reads a payload, it declares an arena of that size
(memory::arena::declare_payload) and emits it unwritten, as VUID-RuntimeSpirv-MeshEXT-12380
requires.
Why: the planner's ruling on the mesh build, step 4, mesh-only pipelines. Every draw of such a
pipeline, direct or indirect, is then vkCmdDrawMeshTasksEXT(1, 1, 1) in its pass and in order:
for an indirect draw the address is the guest's buffer, so nothing is written before the pass,
and Metal's limits are held on the GPU. Direct draws take the same stage, with their counts
written to the ring, so the state has one form.
SEMANTICS_VERSION 2369 (a placeholder; the number is set at landing): a mesh-only pipeline gains a
stage. No function's own module moves.
Tests: the parent's red test passes. The identity-domains test checks each stage, the launcher
included, with spirv-val and the profile's requirements. docs/API.md's mesh pipelines section,
compile_mesh_pipeline's doc and the pipeline module docs describe the launcher.
runtime-sources.sha256 is unchanged.
Verified: see the job named below.
What: engine_mesh's a_mesh_pipeline_without_an_object_function_draws_through_a_launcher. On every
committed profile with the mesh stages, mesh_draws' pipeline without its object function has
three stages, TASK_EXT, MESH_EXT and FRAGMENT in that order, and places one push field for the
object stage, GroupCountsAddress (matched by name).
Why: the planner's ruling on the mesh build, step 4: a mesh-only pipeline draws through a task
stage of one invocation that reads the draw's group counts by address (the guest's buffer for an
indirect draw, the ring for a direct one) and launches that grid, and nothing past Metal's
measured limits; the draw is vkCmdDrawMeshTasksEXT(1, 1, 1), in the pass, in order.
Red: fails on every profile with the mesh stages: the pipeline has the mesh and fragment stages
alone.
What: a new push field, PushField::GroupCountsAddress: the device address of a draw's three
threadgroup counts in Metal's MTLDispatchThreadgroupsIndirectArguments layout (three u32s at a
multiple of 4). A folded object function, its one grid form, places it with its own
DispatchRegion, in place of the 32-byte record at ReplayRegionAddress:
- access::object_region builds the region the folded walk reads: the pushed DispatchRegion, its
first xyz replaced by the counts read at the address (three 4-aligned loads);
EmitCx::push_field routes a folded object function's DispatchRegion there
(held_push_field loads a field as its block holds it);
- its threadgroups per grid are the counts, and its threads per grid the counts times L,
wrapping as Metal's builtins do, or the region's grid where the draw states one (a draw of
threads, whose partial flag the region carries as before);
- plan_replay places the two fields for a folded object function; a folded kernel, a flat
variant and a replay variant keep their record;
- under the identity domains GroupCountsAddress is an admitted field, and ReplayRegionAddress
is refused for every stage (its object exception is gone).
Why: the planner's ruling on the mesh build, point 5: the counts need nothing beside them, so a
draw can point the field at counts as an indirect buffer holds them, and the threads per grid
come from the pushed L.
SEMANTICS_VERSION 2368 (a placeholder; the number is set at landing): every object function's
module moves. The engine golden table's object cells on the profiles with the mesh stages move
with it; they wait for the bless at the next named pin.
Tests: the parent's red test passes. The push field ordering test places GroupCountsAddress
after DispatchRegion. The field's encoding (cache codec) and its shape (u64) are added;
tests/api_signatures.tsv gains the variant; docs/API.md's mesh pipelines section, the dispatch
module docs, LoweringInputs::folded_groups and RuntimeFact::FoldedGroups say what the object
function reads. runtime-sources.sha256 is re-pinned.
Verified: see the job named below.
What: tests/api_signatures.tsv gains the five public items two earlier commits of this branch
added without the table: SubgroupModel's object and mesh fields (the stages' own subgroup facts)
and the runtime floor's MESH_EXTENSIONS with Features.mesh.
Why: signatures.py --check fails on a public item the table does not hold; the commits that made
them did not bless it.
Verified: python3 scripts/api-signatures/signatures.py --bless wrote exactly these five lines here
(and the next commit's push field, left to it).
What: engine_mesh's an_object_function_reads_its_group_counts_at_an_address. On every committed
profile with the mesh stages, mesh_draws' pipeline with its object function places, for the
object stage, PushField::GroupCountsAddress and PushField::DispatchRegion, and no
PushField::ReplayRegionAddress. The fields are matched by name, since GroupCountsAddress does
not exist yet. The identity-domains test and the new one share mesh_draws_pipelines, which makes
the pipelines once per profile.
Why: the planner's ruling on the mesh build, point 5: an object function reads Metal's three
group counts (MTLDispatchThreadgroupsIndirectArguments) by address and computes its threads per
grid from the pushed threadgroup size, so the counts need nothing beside them. Today it reads a
32-byte record at ReplayRegionAddress holding the counts with L, the threads and the flags.
Red: fails on every profile with the mesh stages, since the object stage places
ReplayRegionAddress alone.
The identity domains lower object and mesh functions since the identity
arm for them was deleted, so the authored compile census's one compile of
each committed mesh or object case's pipeline (lavapipe) now compiles
instead of being refused as not implemented under the identity domains.
The test that held the refusal now holds the compile; its name and doc
say so. A run's preparation still refuses those cases by
MeshRenderPipeline alone: no candidate draws a mesh pipeline yet.
Verified: the old assertion failed with outcome Ok(Compiled) for
a-mesh-grid-of-threadgroups-draws-through-its-fragment in m3-max-85222
(validation, lavapipe). The new form runs in the next job.
What: floor::MESH_EXTENSIONS (VK_EXT_mesh_shader) and floor::MESH_STAGES (taskShader, meshShader,
multiDrawIndirect, drawIndirectCount). The floor reads VkPhysicalDeviceMeshShaderFeaturesEXT from
a device that lists the extension. decide() enables the extension and all four features where
the device lists it and reports all four, and none of them otherwise. Device creation chains the
mesh structure where the extension is enabled. shader_enables states the four features and
ExtMeshShader to the translator. The README's Floor states the extension row and a Mesh stages
section with its table.
Why: condition 1 of the planner's ruling on the mesh build. The runtime enabled none of it, so
the translator's profile of every runtime device refused object and mesh functions. With this
commit, a device that offers the four gets them, and the translator's MeshShading query and
refusal (the translator commit before) decide the rest from what creation enabled. The four go
together because a mesh draw runs its grid as pieces of one multi-draw and an indirect one reads
its count of pieces from a buffer. No answer chooses a second form.
Tests: floor's mesh_stages_are_enabled_where_listed_with_all_four_features checks:
- at the floor, nothing is enabled;
- reported but not listed, nothing;
- listed and reported, the extension and all four, and the translator is told each;
- listed with any one of the four missing, none.
the_readme_states_the_floor holds the new rows to the code. Under a device cfg,
every_device_the_loader_lists_is_above_the_floor creates each device with the mesh structure
chained, and the device test expects the extension where the device reports all four.
Verified: see the job named below.
What: the profile's subgroup model now records the task and mesh stages (SubgroupModel::object
and ::mesh), read like the other stages from subgroupSupportedStages, the device's operation
classes, requiredSubgroupSizeStages under subgroupSizeControl, and the size range.
computeFullSubgroups gives full subgroups to the compute, task and mesh stages, as Vulkan says
("requiring full subgroups in compute, mesh, or task shaders"). STAGE_BITS names the two stages,
so a module's SubgroupStage and RequiredSubgroupSizeStage properties for them are in the enabled
capabilities. The stand-in that answered "no subgroups" for both stages (UNMODELED_STAGE) is
deleted.
subgroup::tier, width_needs, requirement and quad_free treat object and mesh functions as they
treat kernels (Stage::has_workgroup):
- full subgroups and a pinned 32 (Direct), or 64 or 128 split into 32-lane clusters;
- a local size multiple of that size, which dispatch::plan_kernel already states as
RuntimeFact::LocalSizeConstraint for the flattened form;
- quads tiered as cross-lane quad operations;
- a quad-only function at the size the stage gives.
The emulated tier stays the kernels' alone. An object or mesh stage that pins no size and runs
below 32 lanes (lavapipe) refuses a SIMD-group function as Unsupported{SimdWidth}, naming
subgroupSizeControl, the stage's RequiredSubgroupSizeStage and its maxSubgroupSize. Quad
instructions stay kernel-only (lower::simd), so an object or mesh quad is a shuffle, and the
requirement derivation still asks subgroupQuadOperationsInAllStages of a quad instruction in the
task and mesh stages.
Why: conditions 2 and 3 of the planner's ruling on the mesh build. An object or mesh function's
SIMD groups run on the native subgroup. Its workgroup is its pipeline's stated maximum (the
condition 4 commit), made a multiple of the subgroup size, and the invocations past a draw's
threadgroup are not live, so a partial SIMD group has Metal's inactive lanes; no threadgroup
size is refused for not being whole SIMD groups. The planner ruled (a) for lavapipe: the typed
device-lack refusal, decided by those queries alone, with no emulated tier. Main fires that
ruling's trigger: a real card's profile that lists the mesh extension but lacks size control
for the task or mesh stage.
The stage facts extend the existing subgroup queries to two more stages; no form is added.
Every profile's fingerprint changes with its subgroup model. SEMANTICS_VERSION 2367 (a
placeholder for the number at landing): object and mesh functions of SIMD-group operations
compile where they were refused.
Tests: the parent's red test passes. The tier golden table gains the object and mesh columns:
- Direct on the AMD, Arc and RTX 50 profiles;
- a width refusal on lavapipe;
- missing operations where the device lists neither stage (Iris Xe, UHD 770, Pascal, MoltenVK,
the runtime floor).
The invariants hold for object and mesh as for kernels.
object_and_mesh_stages_read_their_own_subgroup_facts checks the three queries apart on the
780M's description:
- a mesh stage outside requiredSubgroupSizeStages takes two 32-lane clusters of its 64 lanes
while the task stage pins 32;
- without computeFullSubgroups both are refused naming it;
- without the task stage listed, an object function is refused naming it while a mesh function
keeps Direct.
The narrow-subgroup and quad-only tests cover the two stages.
docs/API.md's mesh pipelines section states the stages' SIMD groups, the refusal and the quads.
runtime-sources.sha256 is re-pinned.
Reuse: the shape of this change was read in PR 25's device/subgroup.rs and device/derive.rs
(the model's two stages, STAGE_BITS, has_workgroup in tier, width_needs, requirement and
quad_free). Not taken: its change to the quad-instruction requirement, which would have dropped
subgroupQuadOperationsInAllStages for the task and mesh stages against Vulkan's "restricted to
fragment and compute stages", and its fixture and refusal.
Verified: see the job named below.
What: engine_mesh's object_and_mesh_simdgroups_run_on_their_stages_subgroups, and the owned
fixture engine/mesh_simd (MSL compiled by scripts/regen-air-fixtures; TOOLCHAIN names it): an
object function and a mesh function of SIMD-group operations (simd_sum, the exclusive prefix
sum, simd_ballot, simd_shuffle_xor) and a quad-only object function (quad_shuffle_xor,
quad_broadcast of a constant lane, quad_sum), each writing one record a thread.
On every committed profile whose device lists VK_EXT_mesh_shader, each must compile to a module
that passes L3, states full subgroups and RuntimeFact::LocalSizeConstraint (a multiple of at
least 32 for the SIMD-group functions), and holds no OpGroupNonUniformQuadBroadcast or
OpGroupNonUniformQuadSwap. The exception is a stage that pins no size and runs subgroups below
32 lanes, where the SIMD-group functions must be refused as Unsupported{SimdWidth} naming
subgroupSizeControl, the stage's RequiredSubgroupSizeStage and its maxSubgroupSize. Only
lavapipe profiles may refuse.
Why: condition 3 of the planner's ruling on the mesh build: an object or mesh function's SIMD
groups run on the native subgroup, at a local size made a multiple of it. Condition 2: quads stay
kernel-only instructions, so no object or mesh module needs subgroupQuadOperationsInAllStages.
The planner's ruling (a): lavapipe's task and mesh stages pin no size and run 8 lanes, so they
get the typed device-lack refusal, with no emulated tier.
Red: today every profile refuses SIMD-group operations in object and mesh functions, because
the profile models no task or mesh subgroup facts.
Verified: see the job named below.
What: identity_refusal no longer refuses a function for being an object or mesh function, and it
takes an object function's PushField::ReplayRegionAddress, the address of the region record its
folded grid's draw pieces read (bind::mesh_arguments); that field stays refused for every other
stage. IdentityCause::ObjectOrMeshStage, which nothing produces now, is deleted.
Why: the mesh build. Every profile refused object and mesh functions under the identity
domains, the one form, so no mesh render pipeline compiled anywhere.
Public item removed (api_signatures.tsv): metal2vulkan::error::IdentityCause::ObjectOrMeshStage.
Consumer search: reims-vgpu development 35cea45c0e plus its 210 steelbrain refs younger than a
day: 0 hits for ObjectOrMeshStage.
SEMANTICS_VERSION 2366 (a placeholder; the number is set at landing): object and mesh functions
compile where they were refused.
Tests: the parent's red test passes; the validation companion's mesh pipelines compile where they
were refused; the linked reflection test's mesh pipeline compiles with its unwritten fragment
input dropped, as the tessellated one does. docs/API.md's cause list no longer names the
deleted cause; runtime-sources.sha256 is re-pinned.
Verified: see the job named below.
What: engine_mesh.rs, on every committed profile whose device lists VK_EXT_mesh_shader with
taskShader, meshShader, multiDrawIndirect and drawIndirectCount: the owned fixture mesh_draws'
mesh render pipeline, with and without its object function and with its fragment function
writing two RGBA32Uint colors, must compile, and each of its stages must pass L3 (spirv-val and
requirements within the profile).
Why: the mesh build makes the identity domains lower object and mesh functions. Today every
profile refuses them as Unsupported{IdentityDomains} of cause ObjectOrMeshStage, so this test
fails at this commit.
Verified: see the job named below.
What: lower::dispatch's threadgroups at the stated maximum (DispatchPlan::at_max, for the object
and mesh stages). The stage's workgroup is its pipeline's stated maximum (sx, sy, sz), which a
runtime specializes once when it makes the pipeline, and Metal's threadgroup of each draw is
always the region's nominal size L within it:
- region() takes L from the region whatever MultiRegion says, and the folded object function's
position in the grid, its threads per grid and its partial threads take that L where a kernel
takes (sx, sy, sz);
- every threadgroup answers the threads it runs, L or a partial object threadgroup's, so
threads_per_threadgroup, the simdgroup and quadgroup counts and the position in the threadgroup
are Metal's, and an invocation at or past their product is not live: it returns from the body
before it starts, or walks the body predicated where the body holds a workgroup barrier;
- plan_partial_groups now plans the mesh stage too (its region is DispatchRegion; Metal never
makes a mesh threadgroup partial, so it records no PartialObjectThreadgroups), and
simd::divergent walks a mesh body predicated as an object body;
- the entry wrapper strides its slots over the workgroup's invocations (running_threads), not
Metal's threads, since every invocation runs it: its barriers, OpEmitMeshTasksEXT and
OpSetMeshOutputsEXT stay in uniform control flow;
- an object or mesh function whose predication vote word does not fit beside its arena is now
refused as the arena's limit refuses it; it no longer drops to running whole threadgroups only.
Why: condition 4 of the planner's ruling on the mesh build: one pipeline per state, made at
creation at the stated maximum, with each draw's sizes pushed and the extra invocations ending at
once. Apple's header holds every draw to the pipeline's maximum ("The maximum size of the product
of threadsPerMeshThreadgroup that can be used for draws with this pipeline", and the same for the
object stage), and drawMeshThreads rounds a mesh grid down to whole threadgroups. The
MeshPipelineDescriptor doc that said a draw is not held to the maximum is corrected.
Kernels are unchanged: their builtins take (sx, sy, sz) as before, so no kernel module word
moves. Every profile refuses object and mesh functions under the identity domains today, so no
output moves either, and SEMANTICS_VERSION stays.
Tests: dispatch's threadgroups_at_the_stated_maximum_match_metal runs one module of a 64-thread
workgroup on the CPU interpreter, in both local-size forms and both modelled subgroup widths:
draws of threadgroups of 1 to 64 threads with the region's grid stated or all 0, and an object
function's partial threadgroups flagged, each Metal thread once among the live invocations with
Metal's builtins and the rest not live. runtime-sources.sha256 is re-pinned.
Verified: see the job named below.
What: given_inputs compiles every object function folded (LoweringInputs::folded_groups), alone or
in a mesh render pipeline, so its draws run any object grid in pieces within the task stage's
limits (bind::mesh_arguments). The unfolded form is deleted: DispatchPlan::object_grid and the
decl's object_grid (an unfolded object function's threadgroups per grid, wrapped at 2^32),
lower::mesh::folds_object_grids with lower::mesh::mesh_stages, which only it called, and
compile_mesh_pipeline's choice between the two. The single-region builtins test keeps its kernel cases and drops the object grid's.
Why: condition 1 of the planner's ruling on the mesh build: one grid form, no device-chosen
second one. folds_object_grids chose the folded form on a device that runs mesh stages and has
device addresses, 64-bit integers, multiDrawIndirect and drawIndirectCount. Device::from_queries
refuses a device without the first two, and object and mesh functions now need the last two
with the extension, so every device that compiles an object function took the folded form and
the unfolded one was reached only by an object function compiled alone.
No SEMANTICS_VERSION bump: an object function's key holds folded_groups, so its key changes with
its module, and every profile refuses object functions under the identity domains today.
docs/API.md's mesh pipelines section and LoweringInputs::folded_groups say an object function
is always folded.
Verified: see the job named below.
What: lower::mesh::FEATURES lists taskShader, meshShader, multiDrawIndirect and
drawIndirectCount. An object or a mesh function, and so every mesh render pipeline with or
without an object function, now needs VK_EXT_mesh_shader and all four enabled; a device without
any of them refuses it as Unsupported{MeshShading} naming each one it lacks (plan_entry's
missing_caps). mesh_stages is that same test, and folds_object_grids no longer repeats the two
draw features.
Why: one query decides whether a device runs mesh pipelines. Before this, an object function
asked only for taskShader and a mesh function only for meshShader, and neither for the two draw
features a mesh draw's pieces take (a direct draw's pieces through multiDrawIndirect, an
indirect draw's through drawIndirectCount), so a device with only part of the set compiled stages
the draws could not run.
SEMANTICS_VERSION 2365 (a placeholder; the number is set at landing): a refusal names more
missing features on a device without the extension (both stages' features for either stage),
and a device with part of the set now refuses where it compiled. No committed profile with the
extension lacks any of the four, so no such profile's cell moves. The six committed profiles
without the extension do move: each refusal of an object or mesh function now names every one of
the four features the profile lacks. That is 246 golden cells and the same 246 engine inventory
cells, 41 on each of intel-irisxe-anv, intel-irisxe-rplp-anv, intel-uhd770-rpls-anv,
moltenvk-m3, nvidia-pascal-linux and runtime-floor, over the 14 engine fixtures that hold object
or mesh functions. They wait for the bless at the next named pin.
Tests: the red test of the parent passes, and the refusal test of profiles without the
extension expects the extension and each of the four the profile lacks. docs/API.md's mesh
pipelines section and compile_mesh_pipeline's doc state the set; runtime-sources.sha256 is
re-pinned.
Verified: m3-max-85179 at this commit's first build (tree equal to this one but for the base):
the parent's red test failed and passes here; clippy (plain) 0; the golden and inventory lists
against the base moved exactly the 246 cells above, each to the new refusal.
What: engine_mesh.rs, on every committed profile whose device lists VK_EXT_mesh_shader, with one
of taskShader, meshShader, multiDrawIndirect and drawIndirectCount removed from its description.
Every object function and mesh function of the owned fixtures mesh_order and mesh_outputs, and
mesh_draws' mesh render pipeline with and without its object function, must be refused as
Unsupported{MeshShading} needing exactly the removed feature.
Why: object and mesh functions run only where the device enables all four together with the
extension: an object function's draws need the mesh stage, a mesh function's pipeline may take
an object stage, and a mesh draw's pieces take multiDrawIndirect and drawIndirectCount. Today an
object function needs only taskShader and a mesh function only meshShader, and neither needs the
two draw features, so such a device reaches the identity domains' refusal of the stage instead.
Verified: see the job named below; the test fails at this commit.
Two public cases of engine/bcx_rules failed on lavapipe:
bicubic-8-bit-normalized-and-srgb-sums-near-the-rounding-tie (63d0f152) and
bicubic-rounding-of-random-float-and-srgb-texels (cbf5dd18). Each binds
RGBA8Unorm_sRGB textures at slots 4-6 and 13, which the kernel samples
through its bicubic constexpr sampler. Until 94adea1c61 (with 0a3a4fe911,
SEMANTICS 2365) the translator refused the whole kernel for its 1D bicubic
samples (slots 12-15), so the cases read as the product's refusal. That
commit built the 1D sample, as meant; the kernel now compiles, and the
runtime refuses its dispatch at slot 4 as Gap::BicubicTexels, an old known
gap its README states (bicubic_texels_word is None for 8-bit sRGB codes).
The executor counted that Gap as a failure, since the case's structure
did not classify it as refused. The refusal moved from the translator to
the runtime; this makes the classification say so.
ToolingRequirement::BicubicTexels ("bicubic_texels"): Limit::Runtime, it
stops the engine's candidate and keeps its cases Metal-qualified. The
checker raises it in checked_requirements
(executor_contract::bicubic_texels) when the case binds, at a texture
slot its function samples through a bicubic constexpr sampler, a texture
whose format gets None from the public
metal2vulkan::metal::format::bicubic_texels_word, so the rule is the
runtime's own. "Samples through a bicubic sampler" is read from the AIR:
an air.sample_* call (with gradients or not, no comparison) of a 1D or
2D colour texture, as the product decodes it, whose sampler operand is a
constexpr sampler (!air.sampler_states) with a bicubic min or mag filter,
as the translator decides it, and whose texture operand is an entry
texture argument, followed through the arguments of direct calls. A
runtime sampler is never bicubic and the translator refuses an argument
buffer's texture, so neither is claimed; a texture reached another way
(a texture array's element, a loaded pointer) is no claim. No census row
carries it: it needs the bound format, a case literal.
The device test that holds the refusal both ways on lavapipe already
exists: metal2vulkan-runtime's
tests::bicubic::every_device_pushes_each_bicubic_slots_format_treatment
(six formats' words pushed, the RGBA8Unorm_sRGB texture refused), with
the conformance ledger's bicubic-texel-classes rgba8unorm-srgb/dispatch
refusal. The requirement's doc names both.
samplers.rs gives each constexpr sampler's state by its global's name
(constexpr_sampler_states); min_lod_clamp.rs's call parsing is shared
(direct_call, operand_list); neither changes what classification
computes. The new module is listed beside depth_range.rs as the
checker's rule over case literals, not classification.
AUTHORED_COMPILE_CENSUS_VERSION 11: the two cases' cells move from
compiled to not_supported{tooling_requirement:bicubic_texels}, which a
cached cell would hide; the census is due a bless on development.
ENGINE_EXECUTOR_ABI is not bumped: no recorded candidate row holds
these cases (corpus/observations holds only their Metal rows).
SEMANTICS_VERSION is untouched: no translation changes.
Tests: requirement.rs's
a_bicubic_sample_of_a_format_with_no_treatment_stops_only_the_candidate
and the Runtime list; bicubic_texels.rs's own: every bcx_rules slot is
found; an RGBA8Unorm_sRGB texture at a 2D or 1D slot (or a texture
array's element there) raises it and RGBA8Unorm does not; a linear
sampler or a gather raises nothing; operands followed through direct
calls; and checked_requirements keeps the case for Metal and stops the
candidate.
Verified at this tree (f8eb488b95's), on lavapipe:
- job m3-max-86229: both cases read not_supported{tooling_requirement:
bicubic_texels} (refusal=1 failure=0 each), and the public batch
(ci-lavapipe, device type cpu, validation layer 1.4.363.0) reads
cases=1189 match=815 mismatch=15 noted_difference=164 refusal=195
failure=0 held_open=15 new_mismatch=0;
- job m3-max-86238, the same batch at db7bedc60d (the base): match=815
mismatch=15 noted_difference=164 refusal=193 failure=2, the two
failures these cases (exit=1, the runtime's BicubicTexels). The change
moves exactly them from failure to refusal;
- job m3-max-86228: fmt, clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd),
Rustdoc -D warnings, and the validation suite, 1349 passed, 2 skipped.
The device policy went with the resident core's deletion (device/policy.rs):
Device::from_queries takes the description alone and derives the profile from its queries
(docs/API.md, section 1). Three sentences still named a policy: HOWTO's first step ("describe
the Vulkan device as created and choose a policy"), its isolation recipe ("the device
description and policy ... equal description and policy give the same profile fingerprint and
keys") and ARCHITECTURE's device profile ("from the description's Vulkan queries and the
policy"). Each now names the description alone.
Docs only. Neither file is an input of runtime-sources.sha256, and no test or script reads
either file's prose.
Verified: on the CPU with no device, at this commit, git grep -i -w policy over docs/HOWTO.md
and docs/ARCHITECTURE.md finds nothing; DeviceDescription derives serde's Serialize and
Deserialize under feature serde (device/description.rs), as the recipe says.
A draw or dispatch whose function reaches a texture buffer through an argument buffer decides
between its plain pipeline and its words twin when it is recorded, from the live texture buffers
held as words (Gauges::word_texture_buffers; pipeline.rs's and render.rs's twin choice). On a device
that holds some format as words, a texture buffer held as words made after such a command is
recorded and before it runs, and reached through an argument buffer made resident by use_heap or
by a residency set, is accessed by the plain pipeline, through its R32_UINT view taken as the
format's own: the values are not Metal's. A use_resource of the texture names it at recording,
when it already exists, so the window is the heap's and the residency set's alone.
The ruling: no form; the window is a known gap, recorded in the textures' known gaps beside the
words' other costs. Its trigger is a guest report of wrong texture-buffer values on such a device.
runtime-sources.sha256 does not move: the README is not among its inputs. No code changes.
Verified, on the CPU with no device:
- m3-max-86179, at this commit: scripts/api-docs's prose check (its job-id grep over the runtime
README among others) passes, and the suites, whose tests read the README's Floor, Enabled, not
stated and consumer sections, pass but for the golden table, which fails at the base too.
The second half of the cleanup after the resident core's deletion (0ce2f39b71): crate-private
lowering paths whose inputs nothing sets, and the docs that still describe deleted machinery.
Unnormalized constexpr samplers. No selection picks PixelPosition::Unnormalized or
UnnormalizedTexel (pixel_position answers Scaled, Texel, TexelBySpec or TexelByWord), so they go
with BindingKey::unnormalized, PixelPosition::unnormalized(), emit's two coordinate arms and two
offset matches, the sampler.pixel_unnormalized and sampler.pixel_unnormalized_gather census arms,
pixel_note's and centre_denormals' arms, finish()'s invariant for an unnormalized identity
sampling, and constexpr_desc's zero bias for a SamplerUse of unnormalized coordinates, which no
constexpr sampler's use is. The runtime's unnormalized twins of linear pixel samplers
(SamplerUse::unnormalized, vk_sampler's form, offset_texels) stay.
Heap handle flags. AccessPlan's heap_class_index, heap_red_blue and heap_unreadable had no setter;
only heap_alpha is set. They go with carries_class(), Lookup::Flagged's class, red_blue and
unreadable fields (Flagged is now the alpha-carrying form alone), the handle constants
FLAG_TEXEL_CLASS, FLAG_RED_BLUE, FLAG_STORAGE_UNREADABLE, HANDLE_TEXEL_CLASS, HANDLE_RED_BLUE and
HANDLE_STORAGE_UNREADABLE, the sampler.heap.texel_class census arm, heap_element_of's unreadable
branch (its one caller passed false), and identity_refusal's HeapResource refusal of a flagged
form other than the alpha's, which could not fire. The handle-table search, which only the
function-table directory calls, in its element and entry forms, keeps its generic carry of the
alpha flag: Lookup is shared with the identity handle's form, whose element mask the heap accesses
read.
Docs that named deleted items now say what the code does: the PixelSamplerScaling entry (a
constexpr pixel sampler's linear sample or gather records it on every device; the runtime slot's
nearest test is its word, SamplerWord::nearest_pixel, not a specialization), ViewBaseTexelOffset
(no heap_raw; a slot's footprint placed so is refused, IdentityCause::TextureState),
SimdgroupAccessOrder (no resident-table profile), constexpr.rs, memory::handles (heap handles are
the identity arrays' elements; the handle table is the function-table directory's search),
bind::heap, lower::texture (is_null, border texels, level views and the out-of-bounds alpha come
from the resource ID's word), heap_raw's mentions in the sampler modules, the resident-table
mentions in access::object, provenance::objects and validation's tier table, the OpenCL line
variant's docs (the runtime refuses such a binding, Gap::OpenClLineTexture), and PushField's
TextureLevels. SlotPlan::border_texels, never set, goes. Tests: engine_identity's expected lookup
is Lookup::Flagged; the search's host-model test runs the element, flagged and entry forms; the
census assertions of sampler.pixel_unnormalized, which no arm names now, go.
Consumer: in reims at 7d016acc9c, and at 8f3ca9df99, nothing names a crate-private item here
(lower and memory are pub(crate)), and the public-item search is the previous commit's.
Nothing compiled changes: no selection reached the deleted arms, no flag was set, and the census
words of every plan are the same, so SEMANTICS_VERSION and ARTIFACT_FORMAT_VERSION stay.
runtime-sources.sha256 moves without a RUNTIME_VERSION bump: memory/handles.rs loses constants
and fields nothing set, and metal/sampler.rs, metal/texel_format.rs, metal/format/mod.rs and
bind/heap.rs change in comments and a test. docs/REFUSALS.md regenerates unchanged; the
signature table is unchanged.
Verified, on the CPU with no device:
- m3-max-86179, at the series' tip (the two cleanup commits and the README line): fmt, the
refusal surface's, the signatures', both coverage docs' and scripts/api-docs' checks, clippy
(plain, --cfg m2v_gpu, --cfg m2v_cpu_icd), Rustdoc, private docs (metal2vulkan and
metal2vulkan-runtime) and doctests pass. The metal2vulkan suites ran 3,492 tests: 3,491 passed,
24 skipped, and the failure is golden_hashes_match_the_table, which fails at the base too (a
bless due at the next pin). Validation ran 1,343 tests, all passed, 2 skipped; conformance ran
1,061, all passed.
- m3-max-86194 and m3-max-86213, at the tip and at its base db7bedc60d: the golden table's changed
lines are the same 5,114 at both, line for line, so no cell moves.
0ce2f39b71 deleted the resident core: every device compiles the identity domains, which read a
texture's presence, out-of-bounds alpha, swizzle, border texels and level count, and a sampler's
state, from the resource ID's words. The interface items the resident core stated for them stayed,
with nothing left that makes them:
- SpecKey's Presence, OutOfBoundsAlpha, TextureSwizzle, OffsetBaseAxes, NearestPixelSampler and
BorderTexels: no lowering declares them.
- RuntimeFact's ResourcePresence, OutOfBoundsAlpha, StorageTextureLevels, StorageTextureLevelViews,
OpenClLineTexture and BorderTexels: no plan states them.
- PushField::ControlPointIndexOffset: no plan places it. identity_pushes (lower/select.rs) named
it on its false side; that arm goes, and lower/push.rs's shape arm with it.
- PrecisionNote::F16IntConvDoubleRounding (metal2vulkan-degrade-f16-int-conv-double-rounding): no
lowering records it. Its catalogue entry in docs/API.md goes, with the conformance crate's
Degradation and the validation comparison's allowance and reach arms.
- Feature's LocalSize, TexelBuffer and GroupCount: no site constructs them (docs/REFUSALS.md listed
each with no site). Their reach.tsv rows go.
- CombinedSampler's unnormalized field, with_unnormalized, heap_index and from_heap_index: the field
was set only from lower::sampler's BindingKey::unnormalized, which no selection sets (none picks
PixelPosition::Unnormalized or UnnormalizedTexel) and finish() refuses as an invariant, and the
two index methods had no caller. sampler_use() now makes the use from the comparison and the
texel class alone. The runtime's DrawInputCause::UnnormalizedSampler and its two checks (a
constexpr sampler of a draw or dispatch with the field set) go with it.
The device sampler of unnormalized coordinates stays: SamplerUse::unnormalized, vk_sampler's
unnormalized form and SamplerDesc::unnormalized are what the runtime's linear pixel samplers'
twins are made with.
Tests: device/tests/mechanism.rs covers the 56 facts left; the assertions that a plan states none
of the deleted facts, and the spec values set for deleted keys, go; engine_spec_bits labels its
constant SamplerMinLevel; cache/tests.rs's round trip of OffsetBaseAxes goes; api_tests.rs's
SpecializationLayout round trip names SamplerMinLevel.
The consumer names none of them: in reims at 7d016acc9c, and at 8f3ca9df99, git grep finds 0 hits
each for unnormalized, Unnormalized, heap_index, F16IntConvDoubleRounding,
f16-int-conv-double-rounding, LocalSize, GroupCount, SpecKey::, RuntimeFact::, PushField::,
ControlPointIndexOffset, NearestPixelSampler, OffsetBaseAxes, ResourcePresence,
StorageTextureLevel, OpenClLineTexture, BorderTexels and OutOfBoundsAlpha. TexelBuffer's 2 hits
are maxTexelBufferElements and the runtime's TexelBufferTooLarge, DrawInputCause's 1 is
DrawInputCause::Slot, Feature::'s 10 are other variants and another crate's Feature, and
TextureSwizzle's 66 are Metal's MTLTextureSwizzle.
ARTIFACT_FORMAT_VERSION 612 -> 613 (renumbered at landing): the codec's lists are positional, and
SpecKey, PushField, RuntimeFact, PrecisionNote and CombinedSampler lose members. SEMANTICS_VERSION
stays: nothing that compiles changes. runtime-sources.sha256 moves without a RUNTIME_VERSION bump:
device/mechanism.rs loses the arms of the deleted facts, which no run reached. docs/REFUSALS.md and
the signature table are regenerated; the metal and conformance coverage docs regenerate unchanged.
Verified, on the CPU with no device:
- m3-max-86143, at this commit: clippy (plain, all targets and features) passes; the mechanism,
spec-bits, round-trip and texture-level tests ran 64 tests, all passed, 2,571 skipped.
- m3-max-86179, at the series' tip (the two cleanup commits and the README line): fmt, the
refusal surface's, the signatures', both coverage docs' and scripts/api-docs' checks, clippy
(plain, --cfg m2v_gpu, --cfg m2v_cpu_icd), Rustdoc, private docs (metal2vulkan and
metal2vulkan-runtime) and doctests pass. The metal2vulkan suites ran 3,492 tests: 3,491 passed,
24 skipped, and the failure is golden_hashes_match_the_table, which fails at the base too (a
bless due at the next pin). Validation ran 1,343 tests, all passed, 2 skipped; conformance ran
1,061, all passed.
- m3-max-86194 and m3-max-86213, at the tip and at its base db7bedc60d: the golden table's changed
lines are the same 5,114 at both, line for line, so no cell moves.
The runtime README's first known gap of textures said every float or half sample, gather and read
pays the BGR10_XR and BGRA10_XR word test and branch, with no number. It now gives the price the
compute harness measured, with and without the branch alternated in one job (GPU time, medians):
- Iris Xe (Mesa 26.2.6), m3-max-85317, 5 rounds: sampling +0.4%, sampling_distinct_512x512x16
0.0%, texture_read -0.2%.
- RTX 3090 (NVIDIA 620.70.06), m3-max-85290, 3 rounds: 0.0%, 0.0%, +3.0% (texture_read's base
rounds spread 3.2%, so that figure is within its noise; its mean is +2.0%).
- RX 7900 XTX (Mesa 26.2.6), m3-max-85291, 3 rounds: -0.2%, 0.0%, -0.4%.
These were measured on earlier forms of the branch: 85290 and 85291 before the map's operations
were kept uncontracted (NoContraction), and all three before a gather took its nearest code
(texel_nudge). Both changes add instructions inside the branch alone, which a texture of another
format does not run.
The red commit's test, and the conformance cases that render into either format, which the runtime
refused (Gap::TextureFormat on a RenderTarget texture).
Attachments. A BGR10_XR or BGRA10_XR color attachment is its texture's UNORM image
(FormatEmulation::ExtendedRangeUnorm, now admitted as a color attachment and, blended, as a blended
one): A2R10G10B10_UNORM_PACK32, and R16G16B16A16_UNORM with red and blue exchanged. The formats'
second, raw candidate and ExtendedRange::of_attachment are gone; the runtime makes a RenderTarget
texture of either, and a device whose format query lacks the usages is refused the pipeline,
naming them (the runtime's floor does not require R16G16B16A16_UNORM as a color attachment).
Writes (lower::stage_io::extended_unorm_color). A fragment function writes Metal's code of its
output (rounded to half, nearest even, then encoded as a kernel write encodes it) as the field's
value over its maximum, a little above the code (metal::format::extended_unorm_field: 10-bit
(c + 0.0005) / 1023, 16-bit (64 c + 0.25) / 65535), which a device's conversion stores as that code
whether it rounds to nearest, toward zero, by floor(x 1024) or, as lavapipe does for a 10-bit
target, through 16 bits (round(x 65535) >> 6; an offset of 0.25 stored code + 1 for the 251 codes
from 772). BGR10_XR's two alpha bits are written as ones, as Metal writes them. Clears store
Metal's clear codes (metal::format::extended_unorm_clear, the runtime's clear values). Masks are
Metal's on the image's channels (BGRA10_XR's red and blue exchanged; BGR10_XR's alpha bits written
with any color channel). A resolve is the device's AVERAGE of the codes, which average as the
values do; PrecisionNote::DeviceRoundedResolve now names a BGRA10_XR field's low bits. A fetch of
either attachment is refused NotImplemented(Format) at compile, and at link where the function
does not write it.
Blends (pipeline::extended_blend). Metal's blend into these formats, measured on an Apple M3 Max
(macOS 27.0.1) over the xr-blend recordings: the source clamped to the values of codes 0 and 1022
(a NaN to code 0) and alpha to [0, 1], a destination color code to 1022, half arithmetic, the
result rounded to a code. That model is every recorded channel's but 9 of 172,032 (premultiplied
source-over, one code each, listed in the ledger rows). The function clamps its output as Metal's
blend does; a blend that stores its source (one and zero, added) stores the clamped codes exactly.
Any other blends the codes in Vulkan with a source factor of one, the function writing the term
X that makes Vulkan's blend of the codes Metal's blend of the values; destination factors that read
the source read it from a second output (dualSrcBlend, in the floor), BGR10_XR's alpha too, so its
alpha bits stay ones. A factor pair the module does not cover (a BGRA10_XR destination alpha among
them) is refused NotImplemented(Format).
Notes, static per pipeline: PrecisionNote::ExtendedRangeBlend on every blend that does not store its
source (the device rounds each draw's result to the field, a BGRA10_XR field keeping the fraction of
a code in its six low bits); PrecisionNote::ExtendedRangeBlendWindow where the corrected term or a
second-output factor can leave [0, 1], which Vulkan clamps (pipeline::extended_blend::window_holds,
from the factors and operations at the corners of the source's range; a unit test classifies every
factor pair and operation at both formats). Both are in docs/API.md's catalogue with counts, and the
runtime's README records the window as a known gap with its trigger.
Ledger: 18 llvmpipe rows of the B cases that differ (the xr-blend addition and premultiplied
source-over, xr-gamut, the blended xr-gradient and xr-masked over draws, and xr-gradient's
unblended resolve), each citing its note, with counts from a model of our blend whose count of
differing elements is lavapipe's replay's to within 11; and the same cases' rows on the RTX 3090
(NVIDIA 620.70.06, m3-max-85796; there xr-gradient-bgra10xr-unblended-x1 too, 39 fields a code
off by the device's arithmetic of the gradient), the RX 7900 XTX (m3-max-85797) and the Iris Xe
(m3-max-85798), each pointing at the case's llvmpipe row, with that device's counts.
Cache key: LoweringInputs::extended_unorm_colors is hashed into the function key where it is set
(pipeline::compile::key), so a fragment function compiled for a BGR10_XR or BGRA10_XR attachment
never takes another's translation; the key test asserts that the attachment and the format each
change the key.
SEMANTICS_VERSION 2378 and ARTIFACT_FORMAT_VERSION 612. RUNTIME_VERSION 2577 (XR render targets
are made); runtime-sources.sha256 re-pinned. api_signatures blessed and
api_surface extended (ExtendedUnormBlend, ExtendedUnormColor, extended_unorm_clear);
docs/REFUSALS.md regenerated (the fetch's refusal site).
An arm64 guest walk met render pipelines and passes into MTLPixelFormatBGR10_XR (554) and
MTLPixelFormatBGRA10_XR (552); the runtime refuses a texture of either with RenderTarget usage
(Gap::TextureFormat), so no pass draws into one.
every_device_renders_extended_range_targets_as_metal_stores_them, on every device of the cfg's
kind, for both formats in Shared and Private storage (a Private target read back by a blit into a
buffer): a pass clears an 8 by 8 target to Metal's specials and code boundaries and the words come
back as Metal's clear stores them; rt6_samples' half4 fill over 64 values across and past the
codes' range (a NaN, the infinities, the ends) draws unblended, then blended with Metal's default
factors, one and zero, and each texel holds Metal's store (unblended: the half's code; blended: the
source clamped to codes 0 to 1022, a NaN to code 0, alpha to [0, 1]); over a Shared BGR10_XR target
whose words' two top bits are zero, a draw under straight alpha-over leaves those bits ones, as
Metal's store writes them.
The ledger's refused rows of the conformance cases that render into either format, which this
change's fix makes run, go: xr-draw, xr-clears, xr-clear-routes, xr-masked, xr-blend, xr-gamut,
xr-gradient and xr-unwritten, BGR10_XR and BGRA10_XR without sRGB (168 rows); the sRGB twins' and
the two-plane forms' stay. Coverage regenerated.
Job m3-max-85802, the twin's suites and lint at 52e98915ba on lavapipe, ran
two steps green: the runtime's device tests (red at 8672e74957, green at
52e98915ba) and the runtime suite (1003 passed, 4 skipped). Validation also
passed (1344 passed, 2 skipped). The translator's test build failed: api_tests'
round-trip literals of VariantKey and LoweringInputs name every field, and
lacked depth_range_fold (E0063). That failed the fold tests, tr_core and
clippy in all three configurations. The private rustdoc failed on one
unresolved link in RenderCompiled::content's doc
(Device::render_pipeline_state, a private method of crate::Device).
- api_tests: both literals set depth_range_fold: true, so the round trip
covers the new field.
- render.rs: the link names crate::Device::render_pipeline_state.
No product code changes. The runtime-sources pin does not move
(pin-compute). Verified: the READY gives the rerun's job lines.
The twin's known gap named its stall without a figure. Both figures come
from the twin's device test, which times its first draw through a twin. The
runs used release builds, three per card, with the drivers' disk shader
caches off (__GL_SHADER_DISK_CACHE=0, MESA_SHADER_CACHE_DISABLE=true), as a
first boot pays:
- lavapipe (Mesa 26.2.6, LLVM 23.1.4), job m3-max-85864: 1539, 1376 and
1350 us. The longest make at encode, which is the twin's lowering, was
1428, 1078 and 1275 us.
- RTX 3090 (NVIDIA 620.70.06), job m3-max-85826: 5054, 5067 and 5467 us.
The lowering was 808, 841 and 1303 us; the rest is the driver's
VkPipeline compile.
A debug build's first draw on the 3090 (job m3-max-85807) took 17.0 ms.
That figure is not used.
Docs only: no source, version or pin moves.
A render pipeline of a vertex function under the depth range fold was
refused under the identity domains: "unsupported: IdentityDomains (an
encoder value the function reads as DepthRangeFold)". That is the
runtime's every device: the first draw through a twin on an RTX 3090, job
m3-max-85794. identity_refusal (lower/select.rs) names each push field the
identity domains push, and PushField::DepthRangeFold was not in it. The
runtime does push it: draws() maps it to FieldValue::DepthRangeFold, and
fill_push writes the first viewport's [znear, zfar - znear].
The field joins the list, and identity_admits' doc names it beside
ViewportCount. No encoding changes: the fold's variant was refused before
and is made now. The versions stay at the fold's placeholders
(SEMANTICS_VERSION 2368, ARTIFACT_FORMAT_VERSION 609). The runtime-sources
pin does not move, because lower/select.rs is not one of its inputs
(pin-compute).
Verified: the READY gives the job lines (the commit before red, here
green).
Red first. The runtime's first draw through a depth range twin on an RTX
3090 (job m3-max-85794) answered "the translator made no pipeline:
unsupported: IdentityDomains (an encoder value the function reads as
DepthRangeFold)". The identity domains' list of the encoder values they
push (lower/select.rs, identity_refusal) does not name the fold's push
field. The fold's own tests compile the function alone, which that check
does not reach.
This test compiles a render pipeline of a folded vertex function
(VariantKey::depth_range_fold) into a Depth32Float attachment through
compile_render_variant on Device::from_queries' moltenvk-m3 and lavapipe
profiles, and asserts the fold's fact. Expected red here; the next
commit names the field.
The partial fix draws through a viewport depth range past [0, 1] where
nothing reads the depth, and refuses every other draw (DrawKind::Viewport).
Metal draws those too (M3 Max, macOS 27.0.1, job m3-max-85617). It reads
[[position]].z = znear + z * (zfar - znear) unclamped. It stores that, and a
[[depth]] output, clamped to [0, 1], and tests the clamped value. Clip
space's 0 <= z <= w clips whatever the range. Vulkan takes no such range
without VK_EXT_depth_range_unrestricted, which the floor does not have.
The translator commits before this one build the fold:
LoweringInputs::depth_range_fold. Under it, the vertex function stores
znear * w + (zfar - znear) * z as its z, from PushField::DepthRangeFold. It
stores z and w - z as two clip distances after its own. Under
depthClampEnable with the viewport at [0, 1], that clips, reads, stores and
tests what Metal does. This commit draws through it.
- RenderCompiled keeps what its content was made for (arrays, words, srgb)
and a OnceLock'd twin. depth_range_twin lowers the content's descriptor
again for the same inputs under VariantKey::depth_range_fold
(lowered_content, factored out of render_pipeline_state). It is made at
the first draw that needs it, counted (Metrics::depth_range_twins), and
timed as a make at encode. It is held as long as its content, and no map
keeps it. The translator's refusal of it is kept, so a later draw answers
it without lowering again. That refusal is the clip-distance limits.
- RenderPipelineState::folded gives the twin's state, its samplers numbered
at the state's indices, cached in RenderInner. It refuses (Viewport) a
vertex function the consumer compiled, and a twin that stores no fold.
- Fixed::fold (RuntimeFact::DepthRangeFold) makes every VkPipeline of the
twin take depthClampEnable. draws() takes the fact, and the vertex push
field as FieldValue::DepthRangeFold. fill_push writes the first
viewport's [znear, zfar - znear] as f32 bits.
- The encoder's route (in place of draws_refused) is found when the
pipeline state, the viewports or the depth clip mode are set. A draw
reads one field, as before.
- Under a past range that the pass's depth attachment or the fragment's
[[position]] z or w reads, draws go through the twin.
- The route refuses under the Clamp mode, and for a function that writes
[[viewport_array_index]] while the viewports set have different ranges.
- Only the viewports a draw reaches count: the first, or every one set
for a function that selects.
- bind_content composes the twin with the content for the draws' bindings
(for_draws). The viewports are recorded at [0, 1] while folded.
- RenderCommandEncoder::DEPTH_RANGE_NOTE (DeviceArithmetic) is the static
note of every draw through a twin. The docs/API.md catalogue says so.
Bounds: a twin holds at most 8 VkPipelines (Clip mode only), and 8 more for
its words twin, so a content holds at most 48 where it held 32, for its
life.
Docs: set_viewport, DrawKind::Viewport, Metrics::translations_at_encode,
and the runtime README's paragraph, Gap::Draw list and a known gap. The
known gap gives the first draw's stall, the twin's pipelines, the limit
refusal and the two refusals. REFUSALS.md and api_signatures.tsv are
regenerated. api_signatures also takes the translator rows of the commits
before (VariantKey and LoweringInputs depth_range_fold, PushField and
RuntimeFact DepthRangeFold). RUNTIME_VERSION 2576. The
runtime-sources pin does not move (pin-compute).
Verified: the READY gives the job lines (red at the commit before, green
here, on lavapipe and an RTX 3090; clippy in three configurations;
rustdoc).
Red first for the depth range twin. Two device tests, and the counter they
read (Metrics::depth_range_twins, declared here and counted by the next
commit):
- tests::draw: every_device_draws_through_a_depth_range_past_zero_to_one_as_metal_does
replaces the partial fix's test, whose refusals the twin turns into draws.
It draws Metal's fullscreen triangle one column at a time, each at the z
of its own texture, and checks the values the M3 Max recorded (macOS
27.0.1, job m3-max-85617, the conformance probe viewport_depth_past_unit):
[[position]].z = znear + z * (zfar - znear) unclamped under [-1, 1];
Depth32Float storing it clamped to [0, 1]; triangles past clip space's
0 <= z <= w not drawn; a [[depth]] output stored clamped under [0, 2];
Depth16Unorm storing the clamped depth (within 1 of the nearest code, the
device's conversion); the depth test comparing the clamped depth, Equal
and Less against 0, Equal and Greater against 1. A draw where nothing
reads the depth makes no twin; the Clamp mode is refused and Clip draws
again; one twin per content (3).
- tests::viewports: a vertex function that writes [[viewport_array_index]]
into a depth attachment is refused under viewports of two ranges (one
past [0, 1]) and draws through one twin under two viewports of the same
past range.
Expected red at this commit: the first draw through [-1, 1] that reads the
depth is refused (DrawKind::Viewport). The job line is in the next
commit's body.
Under LoweringInputs::depth_range_fold, a vertex (or post-tessellation
vertex) function that stores its position does three things at each
return:
- it stores the position's z as znear * w + (zfar - znear) * z, reading
[znear, zfar - znear] from PushField::DepthRangeFold;
- it stores z and w - z, of the z it returned, as two clip distances
after its own;
- it records PrecisionNote::DeviceArithmetic.
Drawn with the viewport's depths [0, 1] and depth clamping enabled, this
maps a viewport depth range past [0, 1] as Metal maps it (the M3 Max, jobs
m3-max-85541 and m3-max-85617): [[position]].z reads znear + z / w *
(zfar - znear) unclamped; the depth stored and tested is that, clamped to
[0, 1] by the clamp; and the clip distances keep Metal's 0 <= z <= w where
the clamp leaves z unclipped.
Planning:
- The function's own ClipDistance array is declared two longer, with its
own elements stored as before.
- A function with none declares ClipDistance of 2 (shaderClipDistance).
- Under the fold the declared count must fit maxClipDistances and
maxCombinedClipAndCullDistances, else Unsupported names
Feature::ClipDistance and the limit.
- The usual path's check (maxClipDistances alone) is unchanged.
- A function that stores no position, and any other stage, compiles as
without it.
docs/API.md's DeviceArithmetic entry says the fold records it on every
such compile and why. SEMANTICS_VERSION 2377 and ARTIFACT_FORMAT_VERSION
611 (a new push field and fact). runtime-sources.sha256
takes the translator's new sources, including the commit before's.
Verified: see the twin's READY job lines (the red tests at the commit
before fail, pass here).
Metal maps a viewport depth range past [0, 1] that Vulkan takes in no
viewport: position.z reads znear + z * (zfar - znear) unclamped, and the
depth stored and tested is that clamped to [0, 1], with clip space's
0 <= z <= w clipping as always (the M3 Max, jobs m3-max-85541 and
m3-max-85617). The twin a draw that reads the depth under such a range
runs folds the range into the vertex position: z' = znear * w +
(zfar - znear) * z, with the Vulkan viewport [0, 1] and depth clamping on,
and clip space's z bounds kept as two clip distances.
This adds the input and its plumbing, with no lowering yet:
LoweringInputs::depth_range_fold and VariantKey::depth_range_fold (vertex
stage), its key bytes, PushField::DepthRangeFold (a uvec2 of [znear,
zfar - znear]), RuntimeFact::DepthRangeFold (a Variant mechanism), and
the codec's names (appended).
engine_depth_range_fold's tests:
- on every committed profile, rfb_full, rfb_span and fan_clip_triangle
(six clip distances of its own) under the input state the fact, place
the 8-byte field, record PrecisionNote::DeviceArithmetic and declare two
clip distances after their own; without it, none of that; L3 both ways;
a fragment function's module is the same under it;
- seven maxClipDistances or maxCombinedClipAndCullDistances refuse six
plus two, naming the limit, and compile the function without the fold.
Red here: the input changes nothing yet.
lower/select.rs's identity_refusal kept a hand list of the encoder values (PushField) the identity
domains push, and refused a function whose plan placed any other as an encoder value
(IdentityCause::EncoderValue). A field the runtime pushes but the list missed was refused only
when a whole pipeline compiled, and nothing failed when the field was added: StageInStride
(a [[stage_in]] layout of MTLBufferLayoutStrideDynamic) and DepthRangeFold each met it.
The list is now identity_pushes, a match that names every PushField: the parameter block's
address where the push window holds it, a slot's bind offset where the kernel reaches its storage
views, the values identity_admits lists, and false for each other field by name, with no
wildcard. A field added to PushField does not compile until it is placed on one side of it.
StageInStride sits on the true side, as the list took it; DepthRangeFold is not yet a field, and
its commit places it.
Nothing compiled changes: every field answers as it did, so no version moves. lower/select.rs is
not an input of runtime-sources.sha256, which stays.
Verified, on the CPU with no device:
- m3-max-85928, at this commit on its base: with a probe variant added to PushField, cargo check
names lower/select.rs's match among the non-exhaustive ones (E0004, with cache/codec.rs and
lower/push.rs), and at the base it names only those two; without the probe it checks clean.
- m3-max-85885, at this change on 133c992dad, before its rebase (its doc comment's wording since,
and StageInStride then on the false side, as that base's list refused it): with a probe
variant added to PushField, cargo check names lower/select.rs's match among the non-exhaustive
ones (E0004, with cache/codec.rs and lower/push.rs), and at the base it names only those two;
without the probe it checks clean. The golden table passes (no cell moves); the refusal
surface's check, fmt, signatures, clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd), Rustdoc and
private docs pass.
select_read_as's comment on Metal's out-of-bounds alpha ended in half a sentence, "A texture
buffer's swizzle applies to its reads: Metal returns each channel from the source the bound",
whose second half went with the texture buffer's swizzle in the cutover to the one form: the
runtime makes no swizzled texture buffer (Gap::TextureBufferSwizzle), so the read takes none. The
comment now says that.
A comment only: nothing compiled changes, and lower/texture/mod.rs is not an input of
runtime-sources.sha256 (computed equal to the pinned hash). rustfmt passes on the file.
The refusal surface's Where column gave every variant of the runtime's Refusal, Limit and Gap a
device condition from its basis alone: "at the device's limit" for a device's own limit, and
"every device (a public call's own check of its arguments)" for every other, whether or not
anything builds it. Gap::CubicSampler has had no construction site since the runtime made a
sampler of Metal's undeclared filter 2 as nearest, and kept only because the consumer names it,
yet its row still said it refused on every device. The generator now gives such a condition only
to a variant with a site (or a helper that builds it), so a variant nothing builds reads "-", as
its Sites cell's 0 already said ("0 is a variant nothing builds today").
docs/REFUSALS.md is regenerated: CubicSampler's row alone changes; error/basis.rs does not.
Verified, on the CPU with no device: scripts/refusal-surface/refusal_surface.py --check reads both
outputs current, with 0 variants without a reach mark and 0 without a basis; Refusal (96 of 96)
and Limit (21 of 21) have a site each, and of Gap's 31 only CubicSampler has none.
Six MTLDevice items were filed in the coverage map as tile render pipelines ("tile render
pipelines; metal2vulkan-runtime makes none", size L, group tile): sparseTileSizeInBytes,
sparseTileSizeInBytesForSparsePageSize:, the two sparseTileSizeWithTextureType:pixelFormat:
sampleCount: forms and convertSparsePixelRegions:toTileRegions:... and
convertSparseTileRegions:toPixelRegions:.... They answer a sparse texture's tile size and convert
regions between pixels and its tiles, and have nothing to do with tile render pipelines. They now
read "sparse tiles", size S, group sparse, as MTLTexture.firstMipmapInTail, tailSizeInBytes and
isSparse already do; that group's name, "placement sparse page sizes", becomes "sparse page and
tile sizes", which it held already with those three. The tile render pipeline group keeps its
other 20 items.
docs/METAL-COVERAGE.md is regenerated: missing by size S 178 -> 184 and L 313 -> 307, the sparse
group 5 -> 11 items, the tile group 26 -> 20; the status totals do not move.
Verified, on the CPU with no device: scripts/metal-coverage/coverage.py --check reads the document
current; the table's status counts, which the validation suite's
the_coverage_documents_totals_are_the_tables compares with the document, are unchanged, and every
missing row keeps a size and a group.
The bitcode-reader census over the private corpus reported llvm.trap as an unlisted unknown
intrinsic: one row, 132 calls, each MSL's __builtin_trap (a call, then unreachable), all in
functions the kernel reaches. MSL 4.1 and Metal's headers do not define a reached trap. The row
translates today (runtime-floor translation audit, release: translated): canonicalization
removes every trap for its constants. The planner's ruling: the row is not refused, so it closes
with the name listed. UNDECODED now lists llvm.trap with that reason, so the census counts it
listed; its calls still stay Callee::UnknownIntrinsic, and a trap that survives canonicalization
is still refused as UnknownIntrinsic. No translation changes, so no version moves. The module and
list docs say the list holds llvm.* names too; api_signatures.tsv is reblessed for the
const-value.
Verified: see the READY line (census before/after on ms01, the list's unit tests red then green,
fmt, clippy plain).
The bitcode-reader census (pr2627's, over the private corpus) reports llvm.trap as an unlisted
unknown intrinsic: one row, 132 calls, each MSL's __builtin_trap (a call, then unreachable). The
row translates today: canonicalization removes every trap for its constants. A closed census has no
unlisted name, so the name is listed with its reason, and a trap that survives canonicalization
stays the typed UnknownIntrinsic refusal.
trap_is_listed_not_decoded asserts llvm.trap classifies Unknown and is listed;
known_families_decode_or_are_listed carries the name. Both fail here: undecoded_family("llvm.trap")
is None.
The runtime never raises it: Device::new_sampler_state makes a Cubic filter
(MTLSamplerMinMagFilterCubic, Metal's undeclared raw value 2) and filters it as nearest. The variant
stayed only because the consumer named it. The consumer's public tip no longer does: `git grep -n
CubicSampler 7d016acc9c` in reims-vgpu (its pin V move, push #97) has 0 hits.
The basis tests that used it as their Ours example use Gap::MemorylessTexture, also Ours.
docs/REFUSALS.md regenerated (the runtime's Gap: 31 -> 30 variants); api_signatures blessed (one
variant row out). RUNTIME_VERSION unchanged: no run of an artifact does anything else, since the
variant was never raised. runtime-sources.sha256 is unchanged: the runtime crate's error.rs is not one of
its inputs (computed equal, 1ab29fff…).
Two counts merged by hand when the exact pixel-sampler form was staged on the BGR10_XR and
BGRA10_XR reads: a_base_level_takes_the_whole_bias and
bias_and_clamp_outside_a_fragment_are_explicit_levels asserted 3 FClamps for sample_bias_kernel's
three samples. Each sample and each sample's level-0 arm passes its texel through the extended-range
arm, which clamps an alpha code once, so the module holds 6 (m3-max-86088 on gem10: left 6, right 3
for both). The assertions and their comments now say so. Test-only; no version moves.
The rows 3cd020278b wrote quoted two lab job ids, for the RTX 3090's per-element compare and
lavapipe's dumps. As the prose docs do, a row now states a measurement by its card and driver:
NVIDIA 620.70.06, and Mesa 26.2.6 with LLVM 23.1.4. The job ids stay in 3cd020278b's message.
Texts only; no answer changes.
A linear runtime pixel sampler's slot site hands the bound state's unnormalized twin the
coordinate itself at the texture's level-0 element. So each card's slot digest moves off the one
its normalized sampler gave at x / N.
Answers change on the 6 slot rows (rgba8 and rgba16f linear edge, zero and border) of:
- RX 7900 XTX (m3-max-85879, RADV 26.2.6)
- RTX 3090 (m3-max-85881, 620.70.06)
- 780M (m3-max-85882)
- RX 550 (m3-max-85883)
- Iris Xe (m3-max-85938, Mesa 26.2.6)
Each digest comes from that card's replay of the 20 pixel-samplers cases at 82b6989d59. The linear
arm is unchanged by 9cc5655c57. Every row of those cases at those venues takes a text naming the
new grouping of the four sources' digests. Answers change on slot rows alone: 32 rows, checked
against the parent's ledger.
On the 3090 (m3-max-85937, the same build with each source's results dumped), slot is nearer
Metal's answer than the normalized sources in every linear case. For example, rgba16f edge: slot
differs from Metal at 24 of 800 coordinates by at most 0.0142, the others at 45 by at most
0.0215.
lavapipe's two rgba8 rows (linear zero and border, case/output/slot) move to 7423f6db70a5. This is
the exact form's change, not an image change:
- The pinned-lavapipe check m3-max-85860 (msi's Mesa 26.2.4, LLVM 23.1.1) gives that digest.
- The merged check m3-max-85692 counted the same 4 drift lines among its 10, at the same product
code (3777af5b7a changes a test alone).
- Mesa 26.2.6 (m3-max-85845) gives it too.
Per element (85845's dumps, same sha256), slot differs from norm at 79 of 800 coordinates by at
most 2.35e-7, and from Metal's at 489 where norm does at 495, each by at most 0.00181. That is the
device's filter at Metal's coordinate. So the pin and the ledger's "# llvmpipe:" line stay.
No nearest or subnormal row changes. 9cc5655c57 keeps a nearest runtime pixel sampler's texel
centre, as shipped.
Coverage regenerated (scripts/conformance-coverage/coverage.py).
The exact arm hands the device's unnormalized sampler Metal's coordinate itself. Under a linear
filter that is the device's own filter at Metal's coordinate (DeviceSampling). Under a nearest
filter it moves texel selection onto the device sampler's own handling of the coordinate, and the
pixel-samplers replays at 82b6989d59 show new slot divergences where the cards matched Metal
before:
- RX 550 (m3-max-85883): rgba8 and rgba16f nearest-zero and -border.
- RTX 3090 (m3-max-85881): subnormal-zero and -border.
Metal's recorded answers for the subnormal cases read texel -1 at a negative subnormal and texel 0
at a positive one, so no flush of a subnormal to 0 is taken.
What changes:
- SamplerWord::reads_unnormalized holds only for pixel coordinates with linear min and mag filters
(no mip filter, isotropic, s and t clamped), the descriptor's unnormalized_reads of linear
filters.
- The shader's level-0 test compares the word's filter bits with UNNORMALIZED_LINEAR alone.
Two instructions fewer per test.
- A nearest word takes the form shipping before the series: the texel's centre over the size.
A gather through a nearest word takes x / N with its PixelSamplerScaling note, as before the
series.
- The runtime makes twins, and holds level-0 elements, only for linear states.
- SamplerWord::UNNORMALIZED_NEAREST is deleted. This series added it and nothing reads it now;
it is not on development.
- a_words_unnormalized_reads_are_its_descriptors now pairs the word with the descriptor's
unnormalized_reads of linear filters: 9 descriptors, linear with linear over 3 by 3 modes.
- Docs: the predicate's filters in docs/RESOURCE-ID.md and the runtime README; the sampler
module's pixel-coordinate list names the level-0 arm. The conformance pixel_samplers module
doc is corrected: a const site under the identity domains reads a normalized sampler, a linear
slot site the twin. SEMANTICS_VERSION 2376 and RUNTIME_VERSION 2575 (a nearest word's arm and
the runtime's linear-only twins and level-0 elements); the runtime-sources pin is recomputed.
Checks: red d9abcdde67 holds only_a_linear_pixel_samplers_word_reads_unnormalized. This commit's
gate and the family's card replays are named in the ledger commit that follows.
A runtime sampler slot's exact arm hands the device's unnormalized sampler the coordinate itself.
Under a nearest filter that moves the texel the device reads off Metal's: the pixel-samplers
family's replays at 82b6989d59 show new divergences at case/output/slot where the cards matched
Metal before, on the RX 550 (rgba8 and rgba16f nearest zero and border, m3-max-85883) and on the
RTX 3090 (subnormal zero and border, m3-max-85881). Metal's recorded answers read texel -1 at a
negative subnormal and texel 0 at a positive one.
This test states the rule the fix keeps: only a word of linear filters reads through the
unnormalized twin; a nearest one keeps the texel-centre form. It fails now: every nearest
pairing reads unnormalized.
The exact form (86b5171e25) hands a runtime pixel sampler's coordinate itself to the device's
unnormalized sampler through the texture's level-0 element, where `arg`, `norm` and `const` (a
constexpr pixel sampler, normalized under the identity domains) hand its normalized sampler the
coordinate over the size. lavapipe filters RGBA8 at 8-bit weights, where both coordinates read
one answer, but weighs an RGBA16Float texel pair at its own sub-texel precision, so the `slot`
site of pixel-samplers-rgba16f-linear-edge, -zero and -border answers its own digest; mirror stays
on the normalized path and nearest reads the same texel either way.
My miss: group C's gate replayed only the pixel-downscales cases on lavapipe, not the
pixel-samplers family, which also samples through a runtime pixel sampler; the staged check
(job m3-max-85692, lvp_conf on the pinned lavapipe) found the three rows stale.
Checked per element (job m3-max-85845, lavapipe Mesa 26.2.6, the same slot digests as 85692's
pinned 26.2.4), each source's 800 results against Metal's recorded answers: `slot` differs from
`norm` at 107 (edge) and 81 (zero, border) of 800 coordinates, by at most 1.31e-6, 81 and 55 of
them nearer Metal's answer and 21 farther; the largest difference from Metal's, 0.0107, is the
same for every source. RGBA8 and mirror: `slot` equals `norm` bit for bit on edge and mirror.
The device's filter at Metal's coordinate (rule 1, note device-sampling). Each case's four
llvmpipe rows take the new text; the slot rows take the new digests.
docs/CONFORMANCE-COVERAGE.md is regenerated.
a_words_unnormalized_reads_are_its_descriptors walks every pair of SamplerMinMagFilter values and
counts the descriptors the device's unnormalized sampler reads as they are. Its count was written
when the enum held two filters. It now holds three: Cubic, Metal's undeclared raw value 2, filters
as nearest since the cubic-nearest change (7d1dba5df0). So nearest with nearest, nearest with
raw 2 in either place, raw 2 with raw 2, and linear with linear are the 5 pairs that read as one
filter, 45 descriptors over the 3 by 3 address modes. The per-descriptor assertion, the word's
answer against the descriptor's, already held for every descriptor. Only the count was stale.
Found by the merged check m3-max-85692 (tr_core: 3175 passed, this 1 failed).
A draw whose bindings changed walks its functions' level-0 texture slots. It read each slot's
sampler bits first and the texture's written flag last, so a texture whose level-0 element was
already written still cost the sampler scan at every rebind. The bind line measured that, in
user-space instructions per repeated bind-and-draw of a pixel sampler and a multi-level texture
(the archives of job m3-max-85166, run by job m3-max-85379): 3353.3 at base 9886324e31 and
3463.3 at bc7f291710 on the RTX 3090 (+3.28%), 3932.8 and 4042.8 on the Iris Xe (+2.80%).
TextureObject::level_zero_held reads the one flag (true also where the texture has no level-0
element or no index), and hold_level_zero skips a texture it finds held before it reads any
sampler slot. A dispatch takes the same path. Nothing else changes: an unheld texture is held
exactly as before. The bind line at this commit is the check.
The exact form hands a pixel sampler's coordinate as given to the device's unnormalized sampler,
and on RADV that sampler's sub-texel step is not Metal's. PrecisionNote::DeviceSampling's doc and
its API.md catalogue entry now carry the measured bound.
Measured on seven linear downscales by 8 (the pixel-downscales cases' textures) at 306a517dc4,
against Metal's answers recorded on an Apple M3 Max:
- RADV, Mesa 26.2.6 (RX 7900 XTX job m3-max-85100, Radeon 780M job m3-max-85101, RX 550 job
m3-max-85161): at 172,665 coordinates whose x - 0.5 lies at a half step of the 1/256 grid on
both axes, the even steps (86,333) all differ from the normalized control at Metal's step and
the odd ones (86,332) none: round half to even where Metal rounds half up; the largest
difference is 1.906/255. At the case's 172,665 coordinates 2^-21 apart, 1.5% differ, 0.945/255.
- NVIDIA 620.70.06 (RTX 3090) and ANV Mesa 26.2.6 (Iris Xe), job m3-max-85099: the slot equals
the normalized control at Metal's step bit for bit at every coordinate.
- KosmicKrisp (Apple M3 Max), job m3-max-85028: Metal's answer bit for bit.
- lavapipe Mesa 26.2.4 (job m3-max-85083): within 1.375/255 in the compared windows.
The remainder is the device's: the same module answers Metal on KosmicKrisp, and the coordinate
reaches the sampler unchanged. pipeline/artifact.rs is not a runtime input; the runtime-sources
pin is unchanged.
The texture slot's runtime pixel sampler (`slot`) now samples the texture's level-0 element
through its state's unnormalized twin at the coordinate as given, so its answers moved. Each
venue's rows are rewritten from a clean replay of the seven cases at 306a517dc4 (the product
code of this tip), with new waiting-on texts:
- NVIDIA (RTX 3090, 620.70.06, job m3-max-85099) and Iris(R) Xe (Mesa 26.2.6, same job): `slot`
answers the argument buffer's normalized control's (`norm`) digest at every set, bit for bit
over every element (the probe's dumps, 172,665 a set).
- RX 7900 XTX (job m3-max-85100), 780M (alone on its node, job m3-max-85101) and RX 550 (job
m3-max-85161), RADV Mesa 26.2.6: `grid` and `ulp` answer Metal's digests; at `frac` `norm` lies
within 0.031/255 of Metal's and `slot` within 0.95/255, 1.5% of the samples at another sub-texel
step. The probe's half-step set shows RADV rounding a half step of the 1/256 grid to the even
step where Metal rounds up (every even one of 86,333, none of the 86,332 odd), the device's own
arithmetic: the same module answers Metal bit for bit on KosmicKrisp (job m3-max-85028).
- llvmpipe (Mesa 26.2.4, LLVM 23.1.1, the pinned image's; job m3-max-85083): `slot` and `norm`
answer one digest at `grid` and `ulp`; at `frac` `slot` lands within 1.375/255 of Metal's in
the compared windows, `norm` within 1/255.
No row says ours. docs/CONFORMANCE-COVERAGE.md is regenerated
(scripts/conformance-coverage/coverage.py).
The gate at bc7f291710 (job m3-max-85083) failed clippy under --cfg m2v_gpu and --cfg
m2v_cpu_icd on two chunks_exact calls of a constant size in the runtime's level_zero tests
(clippy::chunks_exact_to_as_chunks); they read as_chunks now. The translator suite failed two
counts the exact form changes: sample_bias_kernel's explicit-level samples are 6 (each sample's
and its level-0 arm's), and fragment_select_sample's 8 (each candidate's gradient sample and its
level-0 arm's).
clippy under --cfg m2v_gpu and --cfg m2v_cpu_icd (job m3-max-85038) found set_1_is_filled_at_creation
passing the second-element switch that the dead-path deletion removed from Arrays::new.
The texture slot's runtime pixel sampler now samples through the level-0 arm, at the coordinate
itself, so on KosmicKrisp (Apple M3 Max), whose filter is Metal's, the seven pixel-downscales
cases are announced with no divergence at any set: the 18 frac/slot rows of that venue no longer
diverge ("it now matches", job m3-max-85022, a clean replay of the seven cases on KosmicKrisp at
28d28599bd). docs/CONFORMANCE-COVERAGE.md regenerated.
The first build's legs (job m3-max-84933, lavapipe) found:
- clippy (m2v_cpu_icd): level_zero_test indexed SamplerWord::ADDRESS and ADDRESS_SHIFT, which
lower/ denies; it now zips the two arrays and takes the s and t axes;
- the level_zero device tests made Private textures, which replace_region refuses ("the CPU
reaches no Private or Memoryless texture"); they take the descriptor's default storage mode;
- floor::the_floor_profile_states_exactly_the_floor: runtime-floor.json's m2v_runtime_floor block,
and regen_device_profiles.py's RUNTIME_FLOOR that writes it, state the new limits (sampled
images 262,144, samplers 32,000, per-stage resources 458,760, all pools 490,752);
- eight translator tests that count a slot sample's instructions now count the level-0 arm's
explicit level-0 sample or operand-less gather beside the device path's, and its own sign
extract of a dynamic offset; the tests' operand-mask helpers read a mask only where the
instruction holds one.
With set 1's floor raised for the level-0 elements, every device that meets the floor holds the
sampled-texture array's second elements, so Capabilities::attachment_reads is always true and
every path for a device without it was dead. Deleted: the device core's attachment_reads field,
Arrays::new's second-element switch (second elements are always written null on displacement),
the device-level conjunct of Plan::reads_attachments and of the two readable tests in
RenderCommandEncoder::attachment_reads (the limit-driven Gap::Draw of AttachmentRead and
FetchedAttachment), and the tests' branches and skips for such a device (draw, fetch,
held_loop_reads, over_reads, real_size_overs, real_size_renders, visibility). The refusal's doc
no longer names the device-level cause.
Kept, by the consumer's checkout (reims-vgpu development 76e6c90369, git grep -w):
- floor::Capabilities::attachment_reads: 3 hits. rt_platform/device.rs:1589 reads it into its
forms report, and :2833 and :2846 are that report's test. The field stays, documented as always
true and read nowhere in the runtime.
- DrawKind::AttachmentRead: 6 hits (rt_platform/render.rs:298, rt_platform/diag.rs:26, 3069 and
3108, rt_platform/unbuilt.rs:21). The variant stays: texture-level causes still raise it (a
read from the vertex function, a written texture, a depth or stencil attachment, an image with
neither the feedback usage nor a shadow, two attachments of one image, a shadow's one layer, a
surface plane in its stand-in).
REFUSALS.md and the API signature table regenerated with no change; no public item removed, so
api_surface is unchanged.
The runtime's README describes set 1's sampled-image array of 196,608 elements (textures, second
elements, level-0 elements) and the plain sampler array's 8,000 unnormalized twins, the level-0
element written at the first dispatch or draw that samples a texture through a state that reads
unnormalized (Gauges::level_zero_views), the floor's limits (sampled images 262,144, samplers
32,000, per-stage resources 458,752, all pools 490,752; Vulkan's least with descriptorIndexing is
500,000), and attachment reads on every device. docs/RESOURCE-ID.md gives the two ranges, the word
test and what a consumer laying the arrays out itself writes; an argument buffer's sampler still
scales a pixel coordinate. The API signature table is blessed and api_surface names the two consts.
Versions: SEMANTICS_VERSION 2375 (slot pixel samples gain the exact arm, and the interface's
level_zero_samplers), ARTIFACT_FORMAT_VERSION 610 (TextureSlot's codec gains level_zero_samplers),
RUNTIME_VERSION 2574 (set 1's sizes, twins, level-0 elements and the floor's limits).
REFUSALS.md regenerated with no change.
The planner's group C ruling: a sample or gather through a runtime sampler slot whose state reads
unnormalized coordinates takes Metal's coordinates as they are, not scaled into normalized ones.
Translator: a slot sample or gather of a 1D or 2D texture, not an array, not multisampled, not
depth, with no compare, no residency, no footprint and no offset base, through [[sampler(n)]],
n < 16, records the sampler in TextureSlot::level_zero_samplers and branches on the sampler's word
(SamplerWord::reads_unnormalized: PIXEL with nearest or linear filters, clamp-to-edge or
clamp-to-zero or clamp-to-border s and t) and on the texture index (below 65,536). The exact arm
hands x itself, moved by its offset, at explicit level 0, to the sampler's unnormalized twin
(plain sampler element index + UNNORMALIZED_TWIN_ELEMENT) and the texture's level-0 element
(sampled element index + LEVEL_ZERO_ELEMENT); every other word runs the existing path.
Runtime: set 1's sampled array holds 3 x 65,536 elements (textures, seconds, level-0) and the
plain sampler array 16,000 (states, then their twins). A state whose word reads unnormalized
writes its unnormalized twin. A texture of one 1D or 2D layer writes its level-0 element at the
first dispatch or draw that samples it through such a state: its own sampled view for one level,
else a view of its first level it owns (Gauges::level_zero_views), released with the texture.
The floor's limits grow to hold the arrays (sampled images 4 x 65,536, samplers 32,000), which
every second element now fits, so Capabilities::attachment_reads is always true.
The planner's group C ruling builds the exact form for runtime pixel samplers with a texture's
level-0 element made at the first bind that needs it, not at the texture's making. This commit
adds Gauges::level_zero_views (the views of a texture's first level alone that textures hold at
their level-0 elements), its entries in the replay's gauge list, the harness's loop gauges and the
teardown's matrix rows, and the device tests in tests/level_zero.rs:
- texel centres sampled through a linear clamp-to-edge pixel state answer the texels, for a
37 by 23 RGBA8Unorm texture of one level and of six;
- a six-level texture makes one view at its first dispatch through a pixel state and none at its
making, through a normalized state, at its next binds or through a second pixel state; a
one-level texture makes none; the view goes with its texture;
- the same through draws (dl_runtime), the draws answering texel (0, 0);
- 200 textures made, sampled once and dropped hold the gauge at 1 while used and 0 after each.
Nothing raises the gauge yet, so the tests are red.
With their textures held as the UNORM codes of their bits (the previous commit),
ExtendedRange::of no longer names MTLPixelFormatBGR10_XR (554) or MTLPixelFormatBGRA10_XR (552).
Their srgb=false forms stay for the two live uses that hold raw codes: a texture buffer's words
(texel_words builds Bgr10/Bgra10 { srgb: false } itself; the words path decodes and encodes them
through lower::arith::extended_range) and, until their render targets are built, a render
pipeline's colour attachment (ExtendedRange::of_attachment, through the formats' second, raw
candidate; the pipeline is made as before, and no pass draws into one).
- ExtendedRange::HEAP_READ drops them (7 to 5): an argument buffer's 552 or 554 texture is an
element of the sampled float class, read through the step's arm (its handle's bit 30), not raw
in the unsigned integer class (bind::heap::raw_held). The heap's class layout loses the two
extended entries.
- texel_format::crosses_classes still excludes them (metal::format::extended_unorm), and a heap's
storage element of one is still refused NotImplemented(ArgumentBufferTextures).
- The attachment sites (color_writes' extended_range_colors and merges_extended, link's fetch
refusal, bfloat blend, written and unwritten attachments, alpha-to-coverage, stage_io's missing
attachment, write_conversion) read ExtendedRange::of_attachment: every answer for a 552 or 554
attachment is the one before.
- The extended-range sRGB twins and the two-plane forms keep their raw paths (RGB10A8_2P_XR10's
goes with its two images).
Tests: the format table test asserts both formats' first candidate is ExtendedRangeUnorm with no
raw-held form, an attachment form, a raw second candidate, and no cross-class read; a new runtime
test samples a BGRA10_XR texture through an argument buffer's half member and a BGR10_XR one
through its float member (examples/heap_samples' hs_sample, a constexpr and a slot sampler).
Consumer search (reims-vgpu at 35cea45c0e, *.rs, *.c, *.h): 0 hits for HEAP_READ, heap_read(,
ExtendedRange, "Bgr10 {", "Bgra10 {", WordLayout::Extended, texel_words and crosses_classes;
ExtendedRangeColor appears only in crates/reims-vgpu-c/link-order.txt. Formats still reaching
the raw-held path: the extended-range sRGB twins, the two-plane forms, the padded R10X6/RG10X12
forms and their twins, RGB10A2Unorm_sRGB and the bfloat forms.
SEMANTICS_VERSION 2374 (the heap's class layout and its reads). ARTIFACT_FORMAT_VERSION unchanged
(no encoded type changes). RUNTIME_VERSION 2573 (bind's heap class layout); runtime-sources.sha256 re-pinned.
api_signatures blessed: ExtendedRange::HEAP_READ is [ExtendedRange; 5] (a consumer indexing its
two first entries breaks; none in the consumer). REFUSALS.md unchanged.
An arm64 guest walk met MTLPixelFormatBGR10_XR (554) and MTLPixelFormatBGRA10_XR (552), which the
runtime refused (Gap::TextureFormat): the translator held them raw in an integer format whose
values the identity domains do not convert.
A texture of either is now held in the UNORM format of its bits (FormatEmulation::ExtendedRangeUnorm):
BGR10_XR in A2R10G10B10_UNORM_PACK32, bit-identical, its alpha read as one; BGRA10_XR in
R16G16B16A16_UNORM, viewed with red and blue exchanged. Copies, blits, getBytes and replaceRegion
move Metal's bytes unchanged. The emulation is admitted for sampling, linear filtering and min/max
reductions; a device whose format query lacks the usage is refused the texture. The runtime's form
admits it.
Every float or half sample, gather and read of a sampled colour image (lower::texture::extended_unorm)
tests the texture's word: a slot's pushed resource ID word, format (word >> 16) in 552..554; an
argument buffer member's handle, which now carries the word's low bits and bit 30 where the word
names one of those formats (AccessPlan::heap_extended). Where it does, each lane holding a channel's
code (the word's border-texel bits: code lanes, and alpha lanes) is mapped from the field's value u to
Metal's (c - 384) / 510: w = u * m (m = 1023, or 65535 / 64), a read's and a gather's code taken
whole (a 16-bit field's floor(w + 1/128), whatever its low 6 bits hold; a 10-bit field's nearest
code, floor(w + 1/2), as NVIDIA's gather on the RTX 3090 widens a 10-bit code by replicating its
bits, (c << 6 | c >> 4) / 65535, up to 0.015 of a code low, m3-max-85756), alpha clamped to [384, 894], and the quotient formed as n * KH + n * KL
(KH + KL the f32 split of 1/510), which rounds once to Metal's correctly rounded value at every code,
fused or not (unit tests over all 1024 codes of both formats, and of a replicated 10-bit code). The difference, both products and the sum are
decorated NoContraction: lavapipe otherwise factored the sum into n * fl(1/510), which misrounds 572
of the codes (the first try replay's reads one f32 step off at exactly the codes that misround). A read the device's robustness bounds
tests its operands inside the branch and reads a code lane outside as 0, Metal's out-of-bounds texel.
A sample is the device's filter of the codes, which the affine map keeps. On a real card a
nearest sample is Metal's value exactly: the RX 7900 XTX's every nearest sample of both formats,
m3-max-85664. Lavapipe converts a field by its reciprocal, c * fl(1 / (2^b - 1)), as
PrecisionNote::DeviceTexelConversion records, and the map keeps that: its nearest sample of
BGRA10_XR's code 602 is four f32 ulps from Metal's (m3-max-85482, LLVM 23.1.1; m3-max-85612, LLVM
23.1.4). The runtime test compares nearest samples exactly, on lavapipe (cfg m2v_cpu_icd) against
lavapipe's conversion so mapped.
A render pipeline with a 552 or 554 colour attachment is made as before, through the formats'
second, raw candidate (R32_UINT, R16G16B16A16_UINT; emulation ExtendedRange): their render targets
are not built, and a texture of either with RenderTarget usage takes that candidate, which the
runtime refuses (Gap::TextureFormat), so no pass draws into one. A storage element is not built
(the storage choice refuses the emulation).
Not built (the runtime's known gaps, docs/API.md): a sample past the edge through a border address
mode reads the device's border in code space (opaque white 1.2529, BGRA10_XR's 1.2549; black
-0.7529); a linear sample of a BGRA10_XR texel whose fields' low 6 bits are set filters them in
(within 63/64 of a code step); every float sample, gather and read of a sampled colour image pays
the word's test and branch.
SEMANTICS_VERSION 2373 (module words: the arm, the handle's bits). RUNTIME_VERSION 2572 (a run views an
extended-range format held as its UNORM codes); runtime-sources.sha256 re-pinned. api_signatures
blessed: FormatEmulation::ExtendedRangeUnorm added
(a consumer matching FormatEmulation exhaustively meets a new variant; the enum is non_exhaustive).
REFUSALS.md unchanged.
The ledger's llvmpipe rows for extended-swizzles-bgr10xr gain the four border sites (0ag1/g2,
0ag1/sl, 0ag1/sn, ar10/g1) the replay on lavapipe at the CI pin (Mesa 26.2.4, LLVM 23.1.1) shows,
m3-max-85482, and its BGRA10_XR rows of nearest and linear samples name the low-bits gap beside
the border's: most of the case's random fields hold low bits, which a sample filters in. Lavapipe's
conversion shows at none of the case's elements (each texel's fields checked against lavapipe's
reciprocal conversion). Coverage regenerated.
The runtime refuses a texture of MTLPixelFormatBGR10_XR (554) or MTLPixelFormatBGRA10_XR (552)
(Gap::TextureFormat): the translator holds them raw in an integer format whose values its identity
domains do not convert. An arm64 guest walk met them.
A new runtime test, every_device_reads_samples_and_gathers_extended_range_values, makes a 4 by 2
texture of each, holding codes at the ends, at the values 0 and 1, and alphas outside [0, 1], with
the bits Metal does not read set in every other texel, and through the owned fixture
fpv_swizzled_reads checks: the bytes come back from getBytes as replaceRegion wrote them; a read
and a nearest sample of each texel answer (c - 384) / 510 correctly rounded, alpha clamped to
[0, 1] and BGR10_XR's alpha 1; a gather of each component answers its four texels; a linear
sample between four texels answers the mean of their codes' value within 1e-3; and through a view
of the swizzle alpha, blue, zero, red each lane its source.
The conformance ledger drops the refused rows of texture-round-trip-552 and -554,
fresh-pattern-552 and -554, and extended-swizzles-bgr10xr and -bgra10xr, whose textures are made
next; the coverage doc is regenerated.
Red: the test fails at new_texture with the refusal, and the six cases' replays fail on the
unlisted refusal, until the next commit.
A read of a depth cube or depth cube array by face (depthcube<float, access::read>'s
read(coord, face, lod), air.read_depth_cube and air.read_depth_cube_array) was refused on every
profile, Unsupported{IdentityDomains; NotImplemented}: the read kept the 2D-array view
(RuntimeFact::ImageViewShape), which the identity arrays hold no element of. The resident tables
built it before the cutover to the one form, and that commit deleted its interpreter test with
them; the runtime's README listed it as a known gap.
A colour cube's read by face already samples its cube element, the texture's cube view, at the
texel's centre and the read's explicit level through element 0 of the plain sampler array (the
default sampler, nearest, every level), its operands tested in the shader. A depth cube's element
is its cube view of the depth, which that plain float sampler samples without a comparison as a
depth cube's sample() does, the depth the sample's first component. So slot::samples_cube_element
no longer excludes a depth shape: the read takes the same form, and the slot states no
ImageViewShape.
Tests:
- engine_texture's an_identity_cube_read_by_face_samples_its_cube_element compiles
unk_read_depth_cube too, on every identity profile: L3 passes, no ImageViewShape fact, its two
textures from the sampled float depth cube and depth cube-array classes, its sampler from the
plain array, OpImageSampleExplicitLod and no OpImageFetch. Red with slot.rs at the base.
- The runtime's tests::cube_reads gains cr_depth (a Depth32Float depth cube of three levels) and
cr_depth_array (a depth cube array of two cubes and two levels): every texel of every face,
level and cube reads its uploaded depth bit for bit, and each read outside the texture reads 0.
- scripts/qualify-public-cases, CI's step, qualifies the public case
depth-cube-and-cube-array-reads-at-32-and-16-bit-coordinates (3 x 3 depth textures, every
texel of every face and cube, depths over many binades) on lavapipe against its Apple M3 Max
observation.
Docs: lower::texture's module docs, slot.rs, emit.rs, API.md and RESOURCE-ID.md say a depth
cube's read by face samples its cube view; the runtime README's known gap loses the depth cube
read and names it lowered. engine_texture_unk's module docs no longer claim an interpreter run of
the depth cube reads.
Engine inventory: engine/unk_read_depth_cube.ll moves from Unsupported{IdentityDomains;
NotImplemented} to ok on all 15 profiles; its .air.ll twin moves at the M3 bless.
SEMANTICS_VERSION 2365 -> 2367 (a placeholder, renumbered at landing): the fixture's 15 golden
cells, one a profile, change from the refusal to modules, and no other cell moves. The golden
table and the authored compile census (the case's row, not_supported today) are re-blessed on
development.
Verified, at this commit's tree on 6459eaa946 (rebased since onto the sparse path's deletion,
whose only overlap is the SEMANTICS line):
- m3-max-85654, on the CPU with no device: the engine inventory's eight llvm_as parts differ
from the table by nothing (the row moved with the change). Red, with slot.rs at the base:
an_identity_cube_read_by_face_samples_its_cube_element fails at the depth cube; green: it and
the 20 other cube tests of the translator pass. The golden table's cells: 105 change at this
commit, the base's 90 (development's, blessed since) and unk_read_depth_cube's 15, the two lists
otherwise equal. The refusal surface's check, fmt, signatures, clippy (plain, --cfg m2v_gpu,
--cfg m2v_cpu_icd), Rustdoc, private docs, doctests and scripts/api-docs pass; the metal2vulkan
suites ran 3,471 tests: 3,470 passed, 24 skipped, and the failure is
golden_hashes_match_the_table, whose table is blessed on development; validation ran 1,344
tests, all passed, 2 skipped; conformance ran 1,053, all passed.
- m3-max-85654, on devices: the runtime's every_device_reads_a_cube_by_face_as_its_texels, with
the depth cube and depth cube array rows, passes on lavapipe (llvmpipe, LLVM 23.1.1, 256 bits,
m2v_cpu_icd) and on the RTX 5080 Laptop GPU (m2v_gpu).
- m3-max-85654, CI's lavapipe image: scripts/qualify-public-cases exits 0, every case's slot
current, the depth cube case's among them.
- m3-max-85857, on the CPU with no device, at this commit on the sparse path's deletion: clippy
of the workspace (all targets and features) passes, and the 34 cube and engine-inventory tests
of the translator all pass.
Metal 4.1's sparse_read(sampler s, coord, offset, lod), a read through a sampler whose function
observes bit 0 of its status word (sparse_color::resident()), was refused in the texture family
(Unsupported{Lowering(Texture); NotImplemented}): what a sampler's addressing does to the residency
of a sparse texture's texels was unmeasured, the M3 having read only a texture that is not sparse.
With an observed residency now the constant resident word and the runtime making no sparse
texture, the question is Metal's answer over a texture that is not sparse, through each kind of
addressing, inside the texture and outside it.
Measured, with the new owned fixture engine/a2_sparse_read_through (a texture2d<float> read at
p[i] through constexpr clamp_to_edge, clamp_to_zero, clamp_to_border of opaque white, and repeat,
storing each colour and each resident()), over a 4x4 RGBA32Float texture of two levels at twelve
positions: inside the texture, one and several texels past each edge, at level 1, and at levels 2
and 5, past its last. On the Apple M3 Max (macOS 27.0.1), plain and under Metal's validation layer
(which reported nothing), every residency is resident, at every position through every sampler,
and every colour is the one a read through that sampler reads (the read_through family's rules:
the edge texel through clamp_to_edge and repeat, the border texel through the two border modes,
zero in every lane past the last level). So the read takes the constant word as every other
observed residency does, and select_read's refusal goes. Nothing else changes: the read through a
sampler and the word were each built already.
Tests:
- engine_texture_oob/through.rs's
a_sparse_read_through_a_clamp_to_edge_sampler_reads_its_texel_resident runs sparse_edge (the
test's Metal 4.1 module, storing 1.0 in lane 3 where resident) and edge_plain (the same read with
its word unused) on every profile and class over a two-level 4x4 texture: inside, past each edge,
at i32::MIN, at level 1 and past the last level, each reads the clamp-to-edge texel (zero past
the last level) and sparse_edge's lane 3 reads 1.0 at every row; it links and passes spirv-val
on every profile where it translates. It replaces
a_sparse_read_through_a_clamp_to_edge_sampler_is_refused.
- engine_identity's a_sparse_access_of_a_texture_slot_is_resident compiles a2_sparse_read_through
too, on every identity profile and moltenvk-m3 without robustImageAccess2: L3 passes, the
interface states no specialization constant but the dispatch's, and the module holds no
OpImageSparse* instruction.
- The conformance case sparse-read-through (cases/sparse_read_through.rs, the fixture's kernel,
12 threads) records the M3 Max's colours and residencies, and Metal's times. It declares
simdgroup-access-order, which loosens no value: the kernel writes out[5 * i + k] for five k,
stores the translator does not find disjoint between two threads of one SIMD-group, so the
runtime's pipeline notes it on every device (announced on lavapipe), as for the other cases
with that store.
Docs: lower::texture's module docs (the read through a sampler, the status words) and API.md's
texture paragraph say a sparse read through a sampler reads resident, with the M3 Max's answer.
docs/CONFORMANCE-COVERAGE.md is regenerated.
The new fixture's companions (.ll, .air.ll, TOOLCHAIN's line) come from
scripts/regen-air-fixtures on the M3 Max; its air_input golden printout is blessed under the
pinned LLVM. Engine inventory: the new rows engine/a2_sparse_read_through.air.ll and .ll, ok on
all 15 profiles. The .air.ll row, which only macOS assembles, carries the .ll row's answer, as
every blessed pair in the table does (1,724 pairs equal; the 10 that differ are the previous
commit's, which the next bless moves); the M3 bless confirms it.
SEMANTICS_VERSION 2365 -> 2366 (a placeholder, renumbered at landing): a function with such a
read translated to a refusal and now translates. The golden table gains the new fixture's rows at
the next pin's bless; no other cell moves (the cells that change at this commit are the previous
commit's 237, cell for cell).
Verified:
- m3-max-85077, the Apple M3 Max (macOS 27.0.1): the fixture's companions from
scripts/regen-air-fixtures, and its kernel plainly and under the validation layer (the answers
above).
- m3-max-85084 and m3-max-85200, the M3 Max: the recording of sparse-read-through, plain and under
the validation layer, and its times.
- m3-max-85550, the M3 Max: the air_input golden printout, blessed under Homebrew LLVM 21.1.8,
the pinned major.
- m3-max-85515, on the CPU with no device, at this change before its golden and row: the engine
inventory's eight llvm_as parts differ from the table only by the new row (ok on all 15
profiles, now in it). Red, with lower/texture/mod.rs at the previous commit:
a_sparse_read_through_a_clamp_to_edge_sampler_reads_its_texel_resident and
a_sparse_access_of_a_texture_slot_is_resident fail, and the control
a_clamp_to_edge_read_clamps_its_coordinate_into_the_texture passes. Green: all three pass.
- m3-max-85600, on the CPU with no device, at this change before the .air.ll row and the
declaration: the golden table's cells at this commit and at the previous commit are the same
237, cell for cell; the refusal surface's check, fmt, signatures, clippy (plain, --cfg m2v_gpu,
--cfg m2v_cpu_icd), Rustdoc, private docs, doctests and scripts/api-docs pass; the metal2vulkan
suites ran 3,471 tests: 3,469 passed, 24 skipped, and the failures are
golden_hashes_match_the_table, whose table is blessed at the next pin, and
inventory_lists_every_fixture_in_order, which the .air.ll row now answers; validation ran 1,343
tests, all passed, 2 skipped; conformance ran 1,055, all passed. In CI's lavapipe image,
sparse-status-plain differed only as justified, and sparse-read-through differed only at its
notices, by simdgroup-access-order, which it now declares.
- m3-max-85750, at this commit: inventory_lists_every_fixture_in_order passes, conformance ran
1,055 tests, all passed, and in CI's lavapipe image both cases differ only as justified:
sparse-read-through by the simdgroup-access-order notice it declares, sparse-status-plain by
native-nan-encoding.
The bless commit b4d134337b left its attribution pending on the M3's jobs. This commit carries it and changes
no file.
The authored compile census at 458b5420d2 differs from pin V's in 45 cells. Every one goes from refused
(IdentityDomains) to compiled, and none is unexplained: 5 cases on 9 profiles, all sparse-residency cases
(0d627fc4, 2f94ada2, 667f44ce, 88e8c1ea, b8fd5c9e), compiled once a texture's observed residency is the
constant resident word (619e977d63, SEMANTICS 2368). The same commit moves the artifact digest of 6 more
cases (30 moved artifacts). Each commit of the range was checked out on the M3 and its census blessed alone
(m3-max-85975); every later step moves only the artifacts_at product line, and the last table equals the one
b4d134337b commits.
The golden hash table moves from pin V's (133c992dad) to the blessed one by these commits. Each version
mover between the two was checked out on the M3 and blessed alone (m3-max-85922), and the tables were diffed
in history order. The last table equals the one b4d134337b commits.
- 619e977d63, SEMANTICS 2368, a texture's observed residency is the constant resident word: 294 cells in 20
rows (the sparse fixtures' .ll and .air.ll rows: a27_spse_write_barrier, a2_sparse_status,
kernel_block_read's br_sparse, sps2_residency_probes and the spse_* probes).
- 2ec06b93e1 (the sparse path goes), c20024991d, 7c65d9875e and 458b5420d2 move no cell.
- b4f3ef18de (SEMANTICS 2369) and e9e52050d0 (SEMANTICS 2370) move the semantics line alone.
In all, 294 cell moves, no row added or removed.
Re-blessed on the Apple M3 Max at 458b5420d2 (job m3-max-85891: inventory=0, golden=0,
printouts=0, linkhalf=0) and the authored compile census (m3-max-85892: cases=2390,
cells=21510, failed=0, regressions=0, differences=45).
- golden_hashes.tsv: the semantics line moves 2367 -> 2370 and 20 rows change cells.
Attribution per commit: PENDING m3-max-85922.
- public_fixture_expectations_engine.tsv: 10 .air.ll rows of the sparse fixtures (a2's
deletion of the sparse path) move from Unsupported{IdentityDomains; NotImplemented} to ok,
as their .ll rows already read: on all 15 profiles for 7, and on 14 of 15 for
a27_spse_write_barrier, spse_write_barrier and spse_write_probes, whose last profile stays
Unsupported as their .ll rows do.
- authored-compile.tsv: 5 cases move from not_supported (IdentityDomains) to compiled on all
9 profiles (0d627fc4, 2f94ada2, 667f44ce, 88e8c1ea, b8fd5c9e); 6 more change only their
artifact digest; 0 failed, 0 regressions.
The probe takes a table of cases: each a range, a depth attachment (none,
Depth32Float or Depth16Unorm), a fragment (plain, or one that writes
[[depth(any)]] = [[position]].z), a depth clip mode, five quads' clip z, a
clear depth and a compare function. Each column prints whether a fragment
landed, the position.z and .w it read, and the stored depth.
Recorded on the Apple M3 Max, macOS 27.0.1 (job m3-max-85617), plain and
under API validation, byte for byte alike, in the probe's header:
- Clip mode: position.z is never clamped; clip space's 0 <= z <= w holds
whatever the range; Depth32Float, Depth16Unorm and a [[depth]] output
store the z clamped to [0, 1]; the depth test compares that clamped
value on both sides of 0 and of 1.
- Clamp mode: no z clip; position.z is never clamped; the stored depth is
clamped to the range's part in [0, 1] ([0.5, 2] stores 0.5 to 1).
Metal and its API validation take a viewport whose znear and zfar lie past
[0, 1] (OpenGL's [-1, 1]). The M3 Max (macOS 27.0.1, job m3-max-85541, the
probe in the commit before) reads [[position]].z = znear + z * (zfar - znear)
unclamped and stores that, and a [[depth]] output, clamped to [0, 1]. The
runtime refused such a viewport at set_viewport wherever it covered a pixel,
because VkViewport takes depths in [0, 1] alone without
VK_EXT_depth_range_unrestricted, which the runtime does not enable.
The cause is the depth range alone: clipping is in clip space on both APIs,
so the range shows only where something reads the window z. That is a depth
attachment, or a fragment function that reads [[position]]'s z or w. The fix
takes the range everywhere else:
- set_viewport and set_viewports keep the range; vk_viewport records it cut
to [0, 1].
- Whether a range is past [0, 1] is found once, when the viewports are set
(viewports_set).
- Whether draws are refused is found when the viewports or the pipeline
state are set (draws_refused, into the encoder's `refused` field).
AttachmentFormats comes first, then Viewport where the pass has a depth
attachment or the state's fragment function may read [[position]] z or w.
- A draw reads that one Option<DrawKind> where it read the renders_into
bool, so the usual path adds no per-draw instruction. The other draws
under such a range are refused there (Gap::Draw, DrawKind::Viewport), not
at the set.
- metal2vulkan: CompiledFunction::reads_position_depth (the stage's
position_depth with its FragCoord builtin), public, with its row in
api_signatures.tsv. No encoding change.
- metal2vulkan-runtime: RenderCompiled::reads_position_depth.
DrawKind::Viewport's doc, set_viewport's, depth_stencil's note and the
runtime README (the viewport paragraph, a known-gap paragraph for the range,
and the Gap::Draw list) say what is taken and what is refused.
docs/REFUSALS.md regenerated: no change (the refusal's sites are the same
two functions). RUNTIME_VERSION 2571 (renumbered at landing): a run that refused at
set_viewport now draws or refuses at the draw. The runtime-sources pin does
not move (no listed input changed).
Verified: see the READY's job lines (red at the commit before, this commit
green, clippy in three configurations, rustdoc, the runtime suite on
lavapipe).
A probe of setViewport: with znear -1, zfar 1 beside the control [0, 1]:
five quads at clip z 0 to 1 into an RGBA32Float target, with and without
a Depth32Float attachment, through a plain fragment and one that writes
[[depth(any)]] = [[position]].z. Each prints the position.z and .w the
fragment read and the depth the attachment stored, plain and under
Metal's API validation layer.
Recorded on the Apple M3 Max, macOS 27.0.1 (job m3-max-85541), in the
probe's header: Metal and its validation take the range; position.z is
znear + z * (zfar - znear) unclamped; the stored depth and a [[depth]]
output are clamped to [0, 1].
Metal takes a viewport whose znear and zfar lie past [0, 1] (OpenGL's
[-1, 1]); its API validation takes it too. The runtime refuses it at
set_viewport wherever it covers a pixel (Gap::Draw, DrawKind::Viewport).
The new device test sets [-1, 1] over the whole target and expects:
- set_viewport and set_viewports take it;
- a draw whose pass has no depth attachment and whose fragment function
reads no [[position]] z or w draws, as Metal draws it (clipping is in
clip space, so the range shows nowhere);
- a draw whose fragment function reads [[position]].z is refused at the
draw, alone or with the range as the second of two viewports, and
draws once the range is in [0, 1];
- a draw into a Depth32Float attachment is refused at the draw, and
draws once the range is in [0, 1];
- the refusal follows the state set: from the reading function to the
plain one and back.
Red here: set_viewport refuses the range. The fix follows.
What:
- ComputeCommandEncoder gains three methods:
set_buffer_with_attribute_stride (setBuffer:offset:attributeStride:atIndex:;
setBuffers:offsets:attributeStrides:withRange: is a loop of it, as every
other range call of the runtime is), set_buffer_offset_with_attribute_stride
(setBufferOffset:attributeStride:atIndex:) and
set_bytes_with_attribute_stride (setBytes:length:attributeStride:atIndex:).
- Each buffer slot's binding (Slot::Buffer, Slot::Bytes) keeps the stride's
low 32 bits, so MTLAttributeStrideStatic is 2^32 - 1. A new
FieldValue::StageInStride(slot) pushes it. It is mapped from the
translator's PushField::StageInStride, and the interface accepts
RuntimeFact::StageInStride.
- set_buffer, set_buffer_offset and set_bytes bind a stride of 0, which
clears an earlier one. That includes set_buffer of the buffer and offset
the slot already holds, which used to return early.
- Translator: the identity domains accept PushField::StageInStride
(lower/select.rs), as they accept the vertex analogue
PushField::VertexBufferStride. Before, a dynamic layout was their typed
refusal, EncoderValue "StageInStride(1)". The translator test
a_fixed_layout_records_no_stride_and_a_dynamic_one_records_its_own now
makes the pipeline, which records RuntimeFact::StageInStride of layouts 1
and 2 and none for layout 3, the constant step.
- Deleted: StageInKind::DynamicStride, unbuilt_stage_in and its call at
state creation. Gap::StageIn now names only IndirectRegion.
- Conformance:
- The runtime side plays the four attributeStride steps and
setStageInRegion:.
- The four DynamicStride ledger rows of attribute-stride-buffer,
-buffer-offset, -inline-bytes and -plural-buffers are replaced by each
case's dispatchType row (case/outcome/dispatch_type, the consumer's own),
which every compute-pass case carries.
- CONFORMANCE-COVERAGE.md is regenerated.
- Regenerated:
- REFUSALS.md and error/basis.rs;
- METAL-COVERAGE.md and coverage.tsv (the four setters are implemented);
- api_signatures.tsv (three methods added, one variant removed).
- Docs:
- The runtime README's compute section and its known gaps.
- Validation's ToolingRequirement::DynamicStageInStride doc: the runtime
builds the layout, and the engine's candidate does not yet bind with the
stride form. Its classification is unchanged.
- Versions, renumbered at landing: RUNTIME_VERSION 2570 and
SEMANTICS_VERSION 2370, because the
translator's refusal becomes a pipeline. runtime-sources.sha256 does not
move: lower/select.rs, cache/mod.rs and the runtime crate are not among
its inputs.
Why: the planner ruled DynamicStride BUILD. The translator already lowered
the fetch at PushField::StageInStride. The runtime refused the state because
its compute encoder had no attributeStride setter and no field that pushed
the stride, and the identity domains refused that encoder value.
What a plain bind reads: Metal documents no answer for a plain bind of a
slot that a dynamic layout reads, and the debug layer answers differently.
Probe dynamic_stride_plain_binds.m, job m3-max-85456 (Apple M3 Max, macOS
27.0.1), read stride 0 for every plain bind, alone and after a stride bind
(setBuffer:offset:atIndex:, setBufferOffset:atIndex:,
setBytes:length:atIndex:). Its stride-8 control read stride 8. The planner
ruled to build that answer without pinning it against Metal: there is no
conformance row for it. The setter's doc says Metal documents no answer, and
the runtime device test below holds the runtime's own behaviour.
Consumer search (git grep -n -w DynamicStride in the consumer's checkout at
a34e93e4fa): 8 hits.
- Code that will no longer compile:
- rt_platform/diag.rs:3077 and :3085 name rt::StageInKind::DynamicStride
in a test.
- Tests that will fail:
- rt_platform/compute.rs:1394 expects the dynamic-stride state to be
refused (StageIn-DynamicStride).
- Docs and comments:
- rt_platform/compute.rs:18 and :1246.
- rt_platform/diag.rs:7 and :3081.
- docs/accuracy-ledger.md:129.
Per compute.rs:14, the consumer binds the attributeStride selectors as the
calls without them. It can now call these setters.
Tests: every_device_fetches_a_dynamic_stride_layout_at_the_stride_each_bind_gives
makes ten binds and dispatches:
- strides 40 and 80, 2^32 + 40 (reads at 40), and MTLAttributeStrideStatic
(thread 0's element, then zeros);
- set_buffer of the same buffer and offset after a stride bind (stride 0);
- set_buffer_offset after a stride bind (stride 0, one element on);
- set_buffer_offset_with_attribute_stride;
- set_bytes_with_attribute_stride;
- set_bytes after a bytes stride bind, and after a buffer stride bind
(stride 0).
Verified, at this tree (2f654e598c before the fold):
- Device tests, filtered test(stage_in) | test(dynamic_stride), 8 tests
each, every one passed; each card printed the dynamic-stride test's line:
- lavapipe, job m3-max-85611 (998 skipped);
- RX 7900 XTX (RADV, Mesa 26.2.6), job m3-max-85587, --cfg m2v_gpu;
- RTX 3090 (NVIDIA 620.70.06), job m3-max-85588, --cfg m2v_gpu;
- Iris Xe (ANV, Mesa 26.2.6), job m3-max-85601, --cfg m2v_gpu.
- Conformance replay of attribute-stride-buffer, -buffer-offset,
-inline-bytes and -plural-buffers on the same four devices, same jobs:
EXIT=0. Each case's one refusal is its dispatchType ledger row, with no
divergence, so every stride slot read the words the M3 recorded,
MTLAttributeStrideStatic and the 2^32-truncated strides included.
- Suites, job m3-max-85586:
- product: 3471 passed, 4 failed, 24 skipped. One failure is
golden_hashes_match_the_table (the SEMANTICS placeholder; golden tables
are re-blessed on development). The other three are the fixture tables
inventory_lists_every_fixture_in_order,
engine_fixtures_match_their_golden_printout and llvm_as::part_5_of_8.
All three fail on engine/dvw_depth_views, which development's
aedc38190f added without rows in public_fixture_expectations_engine.tsv
or an air_input printout. No file of this change touches them.
- validation: 1344 passed, 2 skipped.
- conformance: 1059 passed, 0 skipped.
- doctests: EXIT=0.
- clippy: plain m3-max-85592, --cfg m2v_gpu m3-max-85593 and
--cfg m2v_cpu_icd m3-max-85602, each EXIT=0.
- rustdoc, api-docs and rustdoc --document-private-items: job m3-max-85599,
EXIT=0.
- refusal_surface, metal-coverage, conformance-coverage and api-signatures
--check: current.
What: every_device_refuses_each_unbuilt_stage_in_form_by_its_kind no longer
expects Gap::StageIn of DynamicStride for a [[stage_in]] attribute the kernel
reads through a thread-position layout of MTLBufferLayoutStrideDynamic. That
descriptor joins the constant step and the unread attribute in the list of
descriptors whose state is made. The indirect stage-in region
(IndirectRegion) stays refused at its call.
Why: the planner ruled DynamicStride BUILD. The translator already fetches
such a layout at the stride the binder pushes (PushField::StageInStride,
RuntimeFact::StageInStride). The runtime refuses it at creation only because
the compute encoder has no attributeStride setter and no field that pushes
the stride. This commit is the red half; the fix adds the setters and the
field.
Verified: on lavapipe (llvmpipe, Mesa 26.2.4, LLVM 23.1.1), job m3-max-85611, this tree fails
every_device_refuses_each_unbuilt_stage_in_form_by_its_kind with "a thread-position step of a
dynamic layout: a kernel's stage input of a form not built yet: DynamicStride" (filtered
test(stage_in) | test(dynamic_stride): 7 tests run, 6 passed, 1 failed, 998 skipped); with the fix
it passes.
A kernel reads one uint [[stage_in]] attribute through a thread-position
layout of MTLBufferLayoutStrideDynamic. Six rows bind its buffer:
- plain setBuffer:offset:atIndex: alone;
- setBuffer:offset:attributeStride:8 alone, the control;
- the stride bind followed by a plain setBuffer, by a plain
setBufferOffset, or by a plain setBytes;
- plain setBytes alone.
Each row prints the eight words its threads read and the stride those
words imply. Metal's headers name the stride setters as the ones to call
for such a layout and say nothing of what a plain bind reads, so the
runtime's binding of a plain setter's stride follows this reading.
Verified: the M3 oracle job that reads it follows. Here, xcrun clang
-fsyntax-only only.
cell::constant, the form of a constant pointer stored into a pointer cell, took a blob global's
address through blob::blob_ptr but matched Const::GlobalAddr alone. So it refused a constant
getelementptr or cast of the global (ConstantOperand), which blob_ptr takes since the commit
before last. It now matches Const::Expr too and stores the offset blob_ptr gives.
a_stored_constant_getelementptr_into_a_blob_global_is_its_blob_offset passes with this commit.
The SEMANTICS_VERSION placeholder of this series covers it.
A slot is written with a constant getelementptr into the constant table @k on odd threads and
with @k's address on even ones, then read back and indexed. @k is stored, so it is placed in
the blob, and the slot holds a blob offset either way. Run on every committed profile, each
thread reads its table word.
This fails here: the cell's constant form (cell::constant) takes a blob global's address but
refuses a constant getelementptr of one (ConstantOperand), the same defect as blob_ptr's before
the previous commit.
blob_ptr is the operand form every blob strategy takes for a pointer: a getelementptr's base, a
copy's source, a select's arms, a load's pointer, a memcpy endpoint, a pointer compare and a
fat-pointer select's blob side. It took a blob global's address as the global's blob offset, but
it refused a constant getelementptr or same-space cast of one (ConstantOperand). The arena
family's local_ptr already takes those at their exact displacement from the memory plan. blob_ptr
now does the same: the constant's addressed global (local::addressed_global, now visible to the
access family) gives the blob offset, and the plan's exact offset of the constant is added.
Like a getelementptr's constant, the sum wraps modulo 2^32, and a load through it is contained.
This is the same defect as the select's: a blob global's address as an operand was not taken in
the blob's operand form. a_constant_getelementptr_into_a_blob_global_is_its_blob_offset_and_
displacement (a select arm and a getelementptr base) passes with this commit. The
SEMANTICS_VERSION placeholder of the previous commit covers it.
BlobStrategy::Select read its arms through operand(), which refuses any constant other than
null. So a select between two constant globals' addresses was refused (ConstantOperand), even
though both arms are blob addresses. The arms are now LocalPtrs taken through blob_ptr at
selection and emitted through ptr_value, the same way the Gep base, the Copy source and the Load
pointer already take theirs. A global's address is now its blob offset.
That was the cause: the strategy did not take its pointer operands through the blob's operand
form. This commit checks every other site that can take a blob global's address as an operand:
- getelementptr base, bitcast/addrspacecast/freeze source, load pointer: blob_ptr (handled).
- a fat-pointer select's blob side (access::select_side): blob_ptr (handled).
- a memcpy endpoint (copy.rs) and a pointer stored as a value (cell.rs, which matches
Const::GlobalAddr itself): blob_ptr (handled).
- icmp of two blob pointers (pointer::compare): blob_ptr (handled). A blob pointer against null
or a fat pointer is refused (PointerCompare), typed.
- a store through a blob pointer: refused (ReadOnlyStore), typed. The blob is constant.
- ptrtoint of a blob pointer: not the static form, so it goes to the dynamic family, as before.
- a pointer phi with a constant incoming value: refused (ConstantOperand), typed and documented,
as for the arena families (blob::lowered_pointer).
- blob_ptr itself refuses a constant getelementptr or cast of a blob global, which the next
commit takes.
SEMANTICS_VERSION 2369 (renumbered at landing): a module refused before now
compiles. a_select_of_blob_globals_selects_their_blob_offsets passes with this commit;
a_constant_getelementptr_into_a_blob_global_is_its_blob_offset_and_displacement still fails here
and passes with the next.
Two kernels read two constant globals, @a and @b. A select between their addresses merges
them, so both are placed in the constant blob. The first test selects between the two
globals' addresses. The second takes a constant getelementptr into one global, once as a
select's arm and once as a dynamic getelementptr's base. Each test checks the census for the
blob pointer select, then runs on every committed profile and checks every thread's two words
on both runs.
Both fail here: BlobStrategy::Select reads its arms as plain operands, which refuse a constant
(ConstantOperand). blob_ptr takes a global's address as its blob offset but refuses a constant
getelementptr or cast of it, while the arena family's local_ptr takes one at its exact
displacement.
A texture over a buffer in host memory's import, on an integrated or CPU device, lies in place
where the device's external image query for host memory's handle answers a linear image of the
texture's format, usage and flags; otherwise it is the counted copy at each use. On the Apple M3
Max (KosmicKrisp, Mesa 26.3.1), the textures with render-target usage in a consumer's walk
were the copy. The known gap of memory blocks said why in one clause (the Mac driver makes no
linear colour attachment with or without a handle); it now names the query's answer and the
shapes it was asked for, and says the copy is chosen by that query alone. The ruling: the copy is
the device's form under rule 2 (a missing feature of the driver, not a bug), with no code change.
The answer, asked of KosmicKrisp with the runtime's own parameters for each of the four kinds of
texture with render-target usage the walk made over host memory (R8Unorm 1920 by 1080 and RG8Unorm
960 by 540, ShaderRead and RenderTarget; RGBA8Unorm at 18, 24, 36 and 48 pixels, ShaderRead,
ShaderWrite and RenderTarget; RGBA16Float at 16 to 1024 pixels, ShaderRead and RenderTarget):
vkGetPhysicalDeviceImageFormatProperties2 for linear tiling, usage transfer source and destination,
sampled and colour attachment (and storage for the written one), mutable format with the sRGB
sibling's format list where the format has one, and
VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT answers VK_ERROR_FORMAT_NOT_SUPPORTED for
each, and so it does without the handle and without the format list. Without colour-attachment
usage (transfer source and destination and sampled), it answers each format importable,
compatible (0x180), not dedicated-only, up to 16384 by 16384 and one layer; dropping sampled
instead leaves it refused.
The README's prose carries no lab job id (scripts/api-docs refuses one), so the job is cited here
alone. runtime-sources.sha256 does not move: the README is not among its inputs.
Verified:
- m3-max-85644, the Apple M3 Max (KosmicKrisp, Mesa 26.3.1, Vulkan 1.4.363, an integrated device
with VK_EXT_external_memory_host): a query program (no test) asked the answers above.
- On the CPU with no device, at this commit: scripts/api-docs's prose check (its job-id grep over
the runtime README, API.md, REPLAY-STREAM.md and VALIDATION.md) finds nothing; the runtime-sources
hash computed from the validation build's input list equals the pinned one; the README's readers
in the tests (its Floor section, its Enabled, not stated table, and its section of what the
consumer implements) read sections this change does not touch.
The public doc of OPTIONAL_EXTENSIONS linked the private EXTENDED_DYNAMIC_STATE, which rustdoc
refuses under -D warnings (job m3-max-85463: STEP doc and privdoc_metal2vulkan-runtime EXIT=101;
signatures and clippy in three configurations EXIT=0). The sentence now says what the extension
adds in words.
Device creation enables VK_EXT_extended_dynamic_state where the device lists it, and
extendedDynamicState where the device also reports it, and the translator's description states
each that is enabled. This is a form that is right on every device, taken unconditionally: no
vendor, driver or version is read, and nothing else changes. The runtime takes no state through
it, because every render pipeline's dynamic state is Vulkan 1.3's. At Vulkan 1.3 the translator
already counts extendedDynamicState as present, so no translation answer moves. The profile
fingerprint does move on a device that lists the extension, since the description's enabled set
is part of the profile: one cold compile per such device.
The cause is in the driver. RADV in Mesa 26.3.1 (released 2026-11-18; 26.3.2 is not out, so no
26.3.x release has a fix) creates device->ps_epilogs only when graphicsPipelineLibrary,
shaderObject, extendedDynamicState or one of five extendedDynamicState3 features is enabled
(radv_device.c:1706-1715). A pipeline whose depth or stencil test enable is dynamic, and whose pass
may have a depth or stencil attachment, marks a fragment shader's depth or stencil output as
needing an epilog (radv_pipeline_graphics.c:1604-1611 and 1784-1789; radv_shader_info.c:882-888).
At the draw, radv_before_draw goes through radv_emit_all_graphics_states and radv_bind_ps_epilog
(radv_cmd_buffer.c:14148-14149) to lookup_ps_epilog and radv_shader_part_cache_get
(radv_cmd_buffer.c:6832). That calls cache->ops->hash with ops still null (radv_shader.c:3312).
Every render VkPipeline of the runtime takes DEPTH_TEST_ENABLE and STENCIL_TEST_ENABLE as dynamic
state, so on that driver a fragment function writing [[depth]] or [[stencil]] into a pass with
such an attachment faults at its first draw.
Every RADV epilog goes through that one cache: colour outputs, depth, stencil, the sample mask and
an unknown alpha-to-coverage (radv_shader_info.c:882-888). So enabling the feature covers all of
them. The other shader-part cache, vs_prologs, is created only with vertexInputDynamicState,
graphics pipeline libraries or shader objects (radv_device.c:1700-1705). It is reached only by a
dynamic vertex input or a vertex stage without vertex input state
(radv_pipeline_graphics.c:1637-1646), and the runtime makes neither. Mesa 26.2.6's RADV, the lab's,
creates its epilog cache without the feature terms, and its epilogs serve colour outputs alone
(radv_device.c:1679-1684, radv_shader_info.c:850), so it never takes this path. This was read in
the release's source, not reproduced in the lab: no lab node carries RADV from Mesa 26.3.1.
The README has the extension row and an "Extended dynamic state" section with its feature table,
which the README test holds to EXTENDED_DYNAMIC_STATE. Under a device cfg, the every-device floor
test prints whether each card was created with the extension and its feature. The signatures table
takes OPTIONAL_EXTENSIONS' new entry.
The floor reads VkPhysicalDeviceExtendedDynamicStateFeaturesEXT where the device lists
VK_EXT_extended_dynamic_state, and device creation chains it where the extension is enabled;
nothing enables either yet. The new floor test asks for the four combinations of listed and
reported: the extension where listed, extendedDynamicState where also reported, and the
translator told of each that is enabled. It fails here at "listed and reported", which the next
commit makes pass.
RADV in Mesa 26.3.1 creates its fragment-epilog cache only on a device that enables
extendedDynamicState, graphics pipeline libraries, shader objects or one of five extended dynamic
state 3 features (radv_device.c:1706-1715 in the release). Every render VkPipeline of the runtime
takes Vulkan 1.3's dynamic depth and stencil test enables, under which RADV 26.3.1 draws a
fragment function's depth or stencil output through such an epilog. With the cache missing, the
draw's epilog lookup calls through a null pointer (radv_shader.c:3312). This was read in the
release's source, not reproduced in the lab: the lab's RADV is Mesa 26.2.6, whose epilogs cover
colour outputs alone.
The signatures table takes the new public field of floor::Features.
The doc comment above the thread_local! macro was an unused doc comment, which clippy
refuses under -D warnings in every configuration (lint job m3-max-85529). It moves inside
the macro, onto the static it describes. The runtime-sources pin moves with the file.
a_run_of_compiles_derives_no_profile_fingerprint reads a count of profile fingerprint
derivations. The count was process-wide, so when cargo test ran another test as a thread of the
same process and that test made a device between the two readings, this test failed. The count
is now thread-local. The device's making and the compiles the test counts run on the test's own
thread: compile_stage spawns no thread, and the translator's one scoped thread only hashes a
large metallib's bytes. So the count still sees every derivation the test asks about.
The change is in a cfg(test) item of device/profile.rs, so no run behaves differently.
runtime-sources.sha256 takes the file's new hash. It was computed with the build's hashing over
the working tree, which reproduced development's pin before the edit.
a_run_of_compiles_derives_no_profile_fingerprint reads a count of profile fingerprint
derivations before and after a device's making and its compiles. The count is process-wide, so
under a harness that runs tests as threads of one process (cargo test), a device another test
makes between the two readings fails it. The new test makes a device on a spawned thread and
asks that this thread's count not move, then makes one here and asks it to move by one. It fails
here, where the count is the process's; the next commit makes it the thread's.
The translator kept a second form for a function that observes a texture's residency: a slot's
sparse arm (OpImageSparse* and OpImageSparseTexelsResident under shaderResourceResidency) or its
tile map (a storage buffer of tile bits the consumer would mirror from each mapping), selected by
SpecKey::SparseTexture from the bound texture's MTLTexture.isSparse, with Metal's measured
footprint rule for a sample or gather, writes dropped under the same constant, and
PrecisionNote::SparseResidency where the device answered. With the observed residency now the
constant resident word, nothing builds either form, and nothing can need one: the runtime has no
sparse heap or sparse texture API, and the consumer tells no guest it has sparse textures (every
Apple family's supportsFamily NO, sparseTileSizeInBytes 0, isSparse NO; a sparse heap refused at
newHeapWithDescriptor:). So the path is deleted (rule 4).
Public items deleted, each searched for in the consumer's checkout at 76e6c90369 (0 hits for every
name):
- RuntimeFact::SparseTexture { slot, sparse_arm, tile_map } and its mechanism; the 12-03 cleanup
ruling that kept it in the produced-then-refused group is reversed for it alone;
- SpecKey::SparseTexture;
- ResourceKind::TileMap and BindingSource::TileMap, with pipeline::tile_map, the map's format;
- PrecisionNote::SparseResidency (metal2vulkan-degrade-sparse-residency), with its API.md
catalogue entry, the conformance Degradation and validation's C3 deferred near-equivalent;
- error::Feature::SparseTexture, which nothing constructed;
- bind::TextureFacts::sparse and TextureShape::Texture's sparse, which no binder set.
Crate-internal, gone with them: the texture family's residency use flags, sparse_arm, tile_map and
sparse_writes on a slot plan, their spec constants and tile-map views, resident_access, the tile
decoding (TileLevel), the read's sparse and tile-map arms, the census's ".resident" suffix and
RESIDENCY_WORDS; the sampler's residency and footprint fields and lower::sampler::footprint (Metal's
measured footprint rule, read only to answer from a tile map), the sparse arm in sample, gather and
pixel fetch emission, and lower::texture::residency (every caller sits behind the texture family's
own refusal of a word with another bit observed). The SPIR-V layer loses what only those built:
the builder's sparse_sample, sparse_fetch, sparse_gather, sparse_dref_gather, sparse_read and
texels_resident, the sparse flag of SampleForm and of the fetch, gather and read instructions,
Inst::ImageSparseTexelsResident, its serialization, requirement (SparseResidency, and with it
shaderResourceResidency) and the interpreter's unmapped texels. VkFeature::ShaderResourceResidency
stays: profiles and the device queries name it.
Nothing compiled changes: no module held a sparse instruction or the constant since the previous
commit, so SEMANTICS_VERSION stays. ARTIFACT_FORMAT_VERSION 608 -> 609 (renumbered at landing):
the codec's ResourceKind, SpecKey, RuntimeFact, PrecisionNote and BindingSource lose variants,
which moves later tags. runtime-sources.sha256 moves for bind/state.rs, bind/heap.rs and the
deleted pipeline/tile_map.rs; no run of an unchanged artifact changes. docs/REFUSALS.md, the
runtime's error/basis.rs and tests/api_signatures.tsv are regenerated.
Tests deleted with what they tested: the serializer's sparse sweep, the builder's sparse read
under texel operands, the mechanism table's three SparseTexture rows (the variant indices close
up), C3's SparseResidency deferral (the deferred-row tests now use CubeGradientFootprint).
Verified, on the CPU with no device:
- m3-max-85203, at this change on ec56957c00, after the previous commit's own run in the same
job: the golden table's cells are the previous commit's, cell for cell (237 at each, every cell
listed at both, the two lists equal); the refusal surface's check, fmt, signatures, clippy
(plain, --cfg m2v_gpu, --cfg m2v_cpu_icd), Rustdoc, private docs, doctests and scripts/api-docs
pass; the metal2vulkan suites ran 3,495 tests: 3,494 passed, 24 skipped, and the failure is
golden_hashes_match_the_table, whose table is blessed at the next pin; validation ran 1,343
tests, all passed, 2 skipped; conformance ran 1,054 tests, all passed.
- m3-max-85366, at this commit, rebased onto development past the deletions of the anisotropic
emulation and RowLockstep (select.rs's anisotropic call and sampler/anisotropic.rs go with
development's side; the mechanism table is development's without SparseTexture, its indices closed
up to 0..60): the refusal surface's, conformance coverage's and signatures' checks, fmt and clippy
(plain, --cfg m2v_gpu, --cfg m2v_cpu_icd) pass; 185 tests (the mechanism, cache, SPIR-V serializer
and builder, bind::heap and sample-coordinate tests, the two sparse tests and the engine
inventory's llvm_as parts) all passed. The golden cells are the previous commit's, cell for cell
(237 at each, the two lists equal).
A sparse_sample, sparse_gather or sparse_read (and a sparse block read) whose function observes
bit 0 of its status word (sparse_color::resident()) was refused under the identity domains:
the observed residency made the slot's RuntimeFact::SparseTexture, a texture state the identity
domains do not source (Unsupported{IdentityDomains; NotImplemented}, IdentityCause::TextureState).
The golden table and the engine inventory held the refusal for engine/a2_sparse_status, and the
runtime's README listed it as a known gap.
Metal's answer over a texture that is not sparse, measured with this kernel plain and under
Metal's validation layer (which reported nothing): every residency resident on the Apple M3 Max
(macOS 27.0.1) and on the AMD Radeon Pro 5300M (macOS 26.7.1), not resident on the Intel UHD
Graphics 630 of the same MacBook (macOS 26.7.1), with the same colours on all three. Both answers
are Metal's. The runtime makes no sparse texture: it has no sparse heap or sparse texture API, and
the consumer tells no guest it has sparse textures (every Apple family's supportsFamily NO,
sparseTileSizeInBytes 0, isSparse NO, and a sparse heap refused at newHeapWithDescriptor:).
So the word is the M3 Max's and the 5300M's answer, a constant: an observed residency is 0,
resident, of a slot and a heap element alike, with no query, no precision note and no second
form. lower::texture::residency answers false wherever the word's other bits are not observed (a
word with another bit observed stays refused), so no access marks its slot's residency and no
slot states a SparseTexture fact. The extended-range sample, which refused an observed residency,
takes the constant word too.
Tests:
- engine_identity's a_sparse_access_of_a_texture_slot_is_resident compiles a2_sparse_status on
every identity profile and moltenvk-m3 without robustImageAccess2: L3 passes, the interface
states no specialization constant but the dispatch's, the plan no SparseTexture fact, and the
module holds no OpImageSparse* instruction.
- engine_texture_oob's block_reads_read_their_texels_as_reads_do runs br_sparse (a sparse block
read storing 2.0 where resident) on every profile and class, where it asserted the refusal:
its alpha lane reads 2.0 at every point, inside the texture and outside.
- The conformance case sparse-status-plain (cases/sparse_status.rs, the a2_sparse_status kernel
over two 4x4 RGBA32Float textures, 16 threads) records the M3 Max's colours and residencies,
and Metal's times; its module docs state all three Macs' answers.
Docs: the runtime README's known gap for this residency goes, with the sparse residency in the
list of texture state the identity domains do not source; API.md's texture paragraph says an
observed residency reads resident, with the Macs' answers, and PixelSamplerScaling's entry (here
and on PrecisionNote) loses its observed-residency case.
Engine inventory (public_fixture_expectations_engine.tsv): 147 .ll cells move from
Unsupported{IdentityDomains; NotImplemented} to ok, every profile's of a2_sparse_status,
kernel_block_read's br_sparse, sps2_residency_probes, spse_address_probes, spse_array_probes,
spse_level_probes and spse_volume_probes (15 each), and every profile's but runtime-floor's of
spse_write_probes, spse_write_barrier and a27_spse_write_barrier (14 each; runtime-floor's stays
Unsupported{IdentityDomains; NotImplemented}). Their .air.ll twins, which only macOS assembles,
move at the M3 bless.
SEMANTICS_VERSION 2367 -> 2368 (renumbered at landing): the residency-observing fixtures' golden
cells change from the refusal to modules. The golden table is blessed at the next pin.
Verified:
- m3-max-85059, on the CPU with no device, at this change on an earlier development
(004f68b48f; rebased since onto ec56957c00, cleanly, then onto 6459eaa946, which deleted the
anisotropic emulation: this change's doc edits to sampler/anisotropic.rs and
PrecisionNote::DeviceAnisotropicFilter went with it). Red: the three tests below with
lower::texture, sampler/select.rs and sampler/anisotropic.rs at the base fail, with the engine
inventory's eight llvm_as parts (EXIT 100). fmt, signatures, clippy (plain, --cfg m2v_gpu,
--cfg m2v_cpu_icd), Rustdoc, private docs, doctests and scripts/api-docs pass. The metal2vulkan
suites ran 3,496 tests: 3,493 passed, and the failures are golden_hashes_match_the_table and
inventory parts 1 and 4, whose rows a27_memory_order, a4_device_fence and dispatch_builtins
that base had not blessed (ec56957c00 blesses them). Validation ran 1,344 tests, all passed, 2
skipped. Conformance ran 1,054: every_case_carries_its_timing failed, the new recording having
no times; they were taken on the M3 Max (conformance times --runs 8 --write) and are in this
commit.
- m3-max-85203, on the CPU with no device, at this change on ec56957c00:
a_sparse_access_of_a_texture_slot_is_resident, block_reads_read_their_texels_as_reads_do and the
engine inventory's eight llvm_as parts pass (10 tests run, 10 passed). The golden table's cells at
this commit, each listed: 237 change from Unsupported{IdentityDomains; NotImplemented} to a
module, 147 of them this commit's (a2_sparse_status, br_sparse, sps2_residency_probes and
spse_address_probes, spse_array_probes, spse_level_probes and spse_volume_probes, 15 each;
spse_write_probes, spse_write_barrier and a27_spse_write_barrier, 14 each) and 90 development's,
not yet blessed (a27_memory_order, a4_device_fence, dispatch_builtins's device_fence_store and
kernel_read_through's rt_heap_arg, rt_heap_ow and rt_heap_zero, 15 each). In the same job, at
the next commit's tree (this one and the sparse path's deletion), conformance ran 1,054 tests,
all passed, every_case_carries_its_timing among them.
- m3-max-85366, on the CPU with no device, at this commit on development (past the anisotropic
emulation's deletion): the same 10 tests, 10 passed, and the same 237 golden cells, 147 of them
this commit's; at the next commit's tree, the refusal surface's, conformance coverage's and
signatures' checks, fmt and clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd) pass.
- m3-max-84877 and m3-max-85200, the Apple M3 Max (macOS 27.0.1): the recording of
sparse-status-plain, plain and under Metal's validation layer, and its times.
- m3-max-84885, the Iris Xe (Mesa 26.2.6), at this change before its rebases and the times: the
conformance replay of sparse-status-plain differs from the recording only by announcing the
notice metal2vulkan-degrade-native-nan-encoding, which it justifies (EXIT 0).
- m3-max-84712, the MacBook Pro's Radeon Pro 5300M and UHD Graphics 630 (macOS 26.7.1): the
fixture's kernel, plain and under the validation layer.
Since the resident core's deletion (0ce2f39b71) an argument buffer's sampler is read through the
identity arrays, and since a sampler of Metal's undeclared filter 2 filters as nearest
(6706d5b97f) nothing tests the sampler's word for a cubic filter: no mask, no selection, no status
mark. Three places still described that test:
- lower/sampler/mod.rs: CUBIC_REACH_WORDS (64), an upper estimate of the test's words, was still
added to Sampling::words for Source::HeapSampler. It is deleted (crate-private: lower is
pub(crate)), and the comment above the estimate names what is left.
- lower/sampler/emit.rs: sampled_value's doc said "before an argument buffer's sampler's cubic
test"; it now says what it is: sampling_value of a sampling that is not Sampling::swizzle's,
before a constexpr sampler array's null select.
- tests/engine_identity.rs: the doc of
an_argument_buffers_sampler_samples_through_the_identity_arrays_by_its_resource_id named a
RuntimeFact::CubicArgumentSampler that no longer exists.
What moves: the estimated words of the sampler.argument_sampler.* strategies, 64 fewer a use. They
are only reported, in the artifact's StrategyCensus; no budget or decision reads them. The emitted
SPIR-V is unchanged, so the golden hashes do not move. No test reads those words: the census tests
read uses, and engine_texture's partition check is relative. runtime-sources.sha256 is unchanged
(no pinned file is touched).
The runtime keeps each refusal of a kernel's partial-threadgroups variant under a marker of its
cause in the cache directory (cache::REFUSALS), and refusal_marker answers the plain refused
marker for a structure the table does not hold, which reads back as VariantRefusal::Translator:
the cause is lost. The translator's PartialThreadgroupsCause is non_exhaustive, so no match in
the runtime can name every cause, and a_variant_refusal_keeps_the_translator_s_cause listed the
four structures by hand: a cause the translator adds without a marker passed it.
The test now reads the enum's variants from the translator's source (error/mod.rs), as
translator_fields reads the linked state's fields, and requires each to be kept under exactly
one marker, the vote word's or its structure's, and the table's structures to be those causes
but the vote word. Its other checks are unchanged, over the table's structures.
Verified (m3-max-85468, on the CPU with no device):
- green: the test passes at this commit (1 run, 1 passed);
- red: with a sixth cause added to the translator's PartialThreadgroupsCause and no marker, it
fails at that cause (kept under no marker: left 0, right 1);
- the hole: development's hand-listed test with the same sixth cause passes;
- fmt and clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd) pass.
Refusal::TextureCopyMismatch (BlitCommandEncoder::copy_from_texture between textures of two pixel
formats or two sample counts) stated a metal-measured basis: the probe blit_copy_format_pairs.m on
the M3 Max under Metal's validation layer alone, which stops every pair of two formats. A
consumer's probe on a MacBook's Radeon Pro 5300M (macOS 26.7.1) had Metal take ten pairs of one
texel size and copy their bytes, plainly and under the validation layer, so the basis was re-read
and measured on all three Macs.
Apple's page for the region copy says of the destination texture: "The pixel format is the same as
`sourceTexture`. The sample count is the same as `sourceTexture`." Outside that rule the Macs
answer apart (the probe, rewritten to run each pair plainly and under the validation layer, with
the bytes checked):
- Apple M3 Max, macOS 27.0.1, Shared and Private: plain Metal copies the bytes as they are; the
validation layer stops every pair of two formats ("[sourceTexture pixelFormat](...) must equal
[destinationTexture pixelFormat](...)") and two sample counts.
- AMD Radeon Pro 5300M, macOS 26.7.1, Private: Metal copies the bytes as they are, plainly and
under the validation layer, which takes the pairs of one texel or block size (depth and BC1
among them) and stops two texel sizes ("must be compatible with") and two sample counts.
- Intel UHD Graphics 630 of the same MacBook, macOS 26.7.1, Private: the copy completes, plainly
and under the validation layer, and leaves the destination unwritten; the layer answers as on
the 5300M.
So the refusal stays, and its basis is metal-documented, quoting the page; its doc carries the
rows above. Nothing it refuses changes.
The probe now holds every leg that ran: the ten pairs of one texel size and R32Uint into R32Float,
each with Shared and Private textures, plainly and under the layer, with the bytes compared; the
earlier depth, BC1 and sample-count cases and a pair of two texel sizes (the negative control)
under the layer alone, where plain Metal has no defined answer; a device index for a Mac of two
GPUs. Its header states what each Mac answered.
docs/REFUSALS.md and the runtime's error/basis.rs are regenerated (one Refusal moves from
metal-measured to metal-documented). The runtime README's blit paragraph names the documented
rule. The conformance rows whose refusals Justification::MetalValidation documents are unchanged.
Verified:
- m3-max-85147, the Apple M3 Max (macOS 27.0.1), and m3-max-85148, the MacBook Pro's Radeon Pro
5300M and UHD Graphics 630 (macOS 26.7.1): the probe as committed, every leg (the rows above).
- m3-max-85410, on the CPU with no device, at this commit: fmt, the workspace's Rustdoc, the
runtime's private Rustdoc, the refusal surface's check and scripts/api-docs pass; the runtime's
suite ran 230 tests, all passed, 2 skipped.
The bless commit 292331c613 left its attribution pending on the M3's job. This commit carries it and changes
no file.
The authored compile census at 8f04734a97 differs from pin U's in 216 cells. Every one goes from refused to
compiled, and none is unexplained:
- 144 cells, 16 bicubic cases on 9 profiles, were refused as IdentityDomains. A 1D texture's bicubic sample
lowering under the identity domains (94adea1c61, SEMANTICS 2365 at 0a3a4fe911) compiles them.
- 72 cells, 8 cases on 9 profiles, were refused for the seq_cst_fence tooling requirement. The seq_cst fence
taking the device's fence word (3fbbadbc6e) compiles them.
The golden hash table moves from pin U's (b531238180) to the blessed one by these commits. Each version
mover between the two was checked out on the M3 and blessed alone (m3-max-85499), and the tables were diffed in
order. The last table equals the one 292331c613 commits.
- 3fbbadbc6e, SEMANTICS 2360, the seq_cst fence: 90 cells in 6 rows (a27_memory_order, a4_device_fence and
dispatch_builtins' device_fence_store, .ll and .air.ll).
- e5b7498833, SEMANTICS 2361, an argument buffer's texture read through a sampler takes its border texels from
its resource ID's word: 90 cells in 6 rows (kernel_read_through's rt_heap_arg, rt_heap_ow and rt_heap_zero).
- 0a3a4fe911, SEMANTICS 2365, the 1D bicubic sample: 60 cells in 4 rows (bcu_forms and bcx_rules).
- ddfc3a6da4's range, SEMANTICS 2366: 10 rows added (150 cells), the fixture dvw_depth_views that aedc38190f adds.
No existing cell moves.
- 5dc5ea3315, SEMANTICS 2367, a seq_cst atomic operation takes the sequentially consistent fence: 86 cells in 6
rows (a27_memory_order's a27_fragment_atomics, a27_memory_order and a27_wide_and_float).
- 0ce2f39b71, 31d8a874f1 and fa5d051b64 move the 15 profile fingerprint lines and no cell. 71a5393966,
722503da23, 2d63c60193, 9886324e31, aa15ad6b5b, 09b6d0fb89, 6459eaa946 and 8f04734a97 move no cell.
In all, 326 cell moves over the steps. Some cells move twice: a27_memory_order moves at the fence and again at
the atomic operation. Net, 296 cells change, plus the 10 new rows.
Re-blessed on the Apple M3 Max at 8f04734a97 (job m3-max-85487: inventory=0, golden=0,
printouts=0, linkhalf=0) and the authored compile census (m3-max-85488: cases=2390,
cells=21510, failed=0, regressions=0, differences=216).
- golden_hashes.tsv: 36 rows out, 46 rows in. The 28,950 cells under changed profile
fingerprints and the 75 new cells found by m3-max-85323 at 48a22a206f, plus the cells the
later landings moved. Attribution per commit: PENDING m3-max-85499.
- public_fixture_expectations_engine.tsv: bcu_forms.air.ll and bcx_rules.air.ll move from
Unsupported{IdentityDomains} to ok on all 15 profiles (30 cells, the 1D bicubic's .air.ll
twins). dvw_depth_views.ll and .air.ll add 10 rows, ok on all 15 profiles (the
depth-colour-reads fixture).
- authored-compile.tsv: 1,625 rows re-blessed, 0 failed, 0 regressions.
The SSW doc comment on slice_cells linked [`slice`], which rustdoc resolves both
to the function lower::texture::emit::slice and to the primitive type, so the
private-items Rustdoc of metal2vulkan failed (merged check m3-max-85364, STEP
privdoc: "`slice` is both a function and a primitive type"). The link now names
the function. Docs only; runtime-sources.sha256 unchanged (pin-compute equal).
A seq_cst atomic operation on memory another thread reaches (an AIR 2.9 air.atomic.* buffer
atomic of order 5, its success order for a compare-exchange; an LLVM atomic load, store,
atomicrmw or cmpxchg of seq_cst) now takes the fence the landed seq_cst fence lowers to: an
acquire-release memory barrier at the operation's scope over the memories its order applies to,
then lower::sync::barrier's add of 1 on the device's fence word at Device scope with the
barrier's semantics. A store, a read-modify-write and a compare-exchange take it after the
operation; a load takes it before. Thread memory's atomics take none (no other invocation
observes their order); texture atomics of any order but relaxed stay refused; relaxed, acquire,
release and acq_rel operations are unchanged.
The fence before a load, derived: the stores' fences alone order every pair of fenced stores and
forbid store buffering and the R and 2+2W shapes, but two readers may still see two independent
seq_cst stores in opposite orders (IRIW), since a reader's two acquire loads synchronize with
nothing between them. MSL's single total order forbids that outcome. With an add on the one
fence word before each load, the two readers' second adds are ordered on that word; the earlier
reader's first load acquired its store, which then happens before the later reader's add and so
its second load, which must see it. A fence after a load would order nothing more.
Each such operation now costs one contended add on the device word: the runtime README's fence
known-gap line says so (every non-explicit atomic of MSL 4.1 is one), read from the fence's
measured rows. msl_4_1_orders_reach_spirv expects the fence's add after a27_wide_and_float's
float add and after each of a27_fragment_atomics' three atomics. reach.tsv drops the SeqCstFence
row, whose refusal no longer exists. The identity harness maps the device's fence word
(with_fence_word: its 4 bytes past the zero range, the rest still unmapped), and
engine_atomics' run_orders binds every kernel with it: the interpreter trapped on the fence's
add in the two contention tests whose kernels hold LLVM seq_cst atomics. SEMANTICS_VERSION
2367 (renumbered at landing; 2363-2366 went to arm 9, the blob move, the 1D bicubic and
the shared slice): a module holding a seq_cst atomic operation changes.
Verified:
- red 389e7cf44e, job m3-max-85066: a_seq_cst_atomic_operation_takes_the_fence fails at "a
fence's barrier" (no add follows the store); the fence tests and msl_4_1_orders_reach_spirv
pass. Green there: 4 passed.
- the product suite at the fix without the harness's fence word (85066): 3495 passed, 3 failed,
24 skipped. The failures were golden_hashes_match_the_table (re-blessed on development) and
engine_atomics' llvm_ and narrow_atomics_are_exact_under_contention, whose interpreter trapped
on the unmapped fence word. With it (85271): engine_atomics, engine_seq_cst and
engine_air_2_9 28 passed.
- validation 1344 passed, 2 skipped; conformance 1053 passed, 0 skipped; doctests EXIT=0
(85066).
- clippy plain 85270, m2v_gpu 85269 and m2v_cpu_icd 85268 EXIT=0 at this tree. Rustdoc and
api-docs 85093 EXIT=0 at the fix without the harness change, which adds test code only.
The planner ruled a seq_cst atomic operation a bug to build on the landed fence (owner order
3406). MSL 4.1, section 6.16 read whole: Table 6.26 gives memory_order_seq_cst as "Same as
memory_order_acq_rel, plus a single total order exists in which all threads observe all
modifications in the same order." (All OS: Metal 4 and later); 6.16.1 says "In Metal 4.1 and
later, you can specify memory_order values for atomic operations, atomic_thread_fence,
threadgroup_barrier, and simdgroup_barrier." (before it, "For atomic operations other than
atomic_thread_fence, memory_order_relaxed is the only enumeration value."); and 6.16.1.3 says
"Atomic operations that use memory_order_seq_cst order memory the same way as release-acquire
ordering — everything that happened before a store operation in one thread becomes visible to
the thread that performed the load. They also establish a single total modification order of
all atomic operations." Apple's compiler gives MSL 4.1's non-explicit atomics (atomic_store,
atomic_load, atomic_fetch_add) order 5, seq_cst, over every memory (mem_flags 31): our fixture
a27_memory_order, compiled at metal4.1. Today such an operation lowers to its acquire-release
half alone, which Vulkan does not order totally.
Count (structural: the order immediate of each air.atomic.* buffer atomic, load, store,
read-modify-write and compare-exchange success and failure, each texture atomic, and each LLVM
atomic load, store, atomicrmw and cmpxchg, in the functions each entry reaches by direct calls):
- the kept streams (the replay streams' blobs and two recordings; 659 distinct libraries, their
17831 functions through llvm-dis): 0 functions with a seq_cst operation (job m3-max-84869);
- the other kept streams (369 distinct libraries, 14758 functions): 0 (job m3-max-84888);
- the census's corpus (its local/sources and local/library-modules shards: 15378 and 14068
entries): 0 entries with a seq_cst operation, the positive control finding them in
a27_memory_order's three kernels (job m3-max-85277).
a_seq_cst_atomic_operation_takes_the_fence: on every committed profile, the store-buffering
litmus kernel with its store (or exchange) and its load in AIR 2.9's ordered form on device
memory. A seq_cst store or exchange is followed by the fence (a Device-scope memory barrier of
acquire-release semantics over the operation's memory, then a Device-scope add of 1 with those
semantics on the device's fence word, the function reading PushField::ZeroAddress); a seq_cst
load is preceded by it. Store-side fences alone forbid store buffering, but not two readers that
see two independent stores in opposite orders (IRIW), which the single total order forbids; the
fence before each load puts an add on the one fence word between a reader's two loads, so the
two readers' adds are ordered and the first reader's acquired stores happen before the second
reader's later load. A relaxed, release, acquire or acq_rel operation takes no fence and reads
no zero range. Every module passes L3.
Red at this commit: each case with a seq_cst operation has no fence.
Verified: the red/green job of the fix commit.
A comment only: cooperative.rs's paragraph on a partial threadgroup's
shared slice now names the case that carries the M3's recording
(compute-imageblock-slice-past-the-grid) beside the probe. The runtime
sources hash is unchanged (cooperative.rs is not one of its inputs).
Recorded on the Apple M3 Max (macOS 27.0.1) by job m3-max-85134
(record, three runs, one outcome, the validated leg ran without a stop;
times --runs 8 --write). Every grid thread's texel holds its own value,
(1 + x + 8y) / 64 and three zeros, and every one of the 22 cells past
the grid holds zero, neither the -1 sentinel nor any thread's value: the
answer the case's test pins, read from these bytes.
docs/CONFORMANCE-COVERAGE.md regenerated (coverage.py) for the case and
its dispatchThreads step.
A compute pass can now state dispatchThreads:threadsPerThreadgroup: as a
step (ComputeStep::DispatchThreads), on both sides: the runtime's
dispatch_threads and Metal's own call. The fixed Side::dispatch_threads
sets no imageblock size, so a kernel with an explicit imageblock could
not run a non-uniform grid through it.
The case compute-imageblock-slice-past-the-grid runs the owned fixture
tib_imageblock_slices's tib_slot_half_slice over a 6 by 7 grid in 4 by 4
threadgroups with a 4 by 4 imageblock, so three of its four threadgroups
are partial (x, y and the corner), and compares the whole 8 by 8
RGBA16Float texture, made holding -1 in every channel, with Metal's.
Metal's documentation says nothing of a slice's cells past the grid; the
case carries what the M3 records and claims no more. Its test pins that
recording to the grid threads' own values and zero past the grid.
The ledger row for the encoder's dispatchType is the one every compute
pass case holds (the runtime keeps no getter).
The recording follows in the next commit, from one record job on the M3.
Verified:
- the recording (next commit): M3 job m3-max-85134.
- replay, job m3-max-85149: on llvmpipe (Mesa 26.2.6, LLVM 23.1.4) and on the RX 7900 XTX
(RADV), the case's texels equal the M3's. Its one ledger row (dispatchType) holds on both, as
compute-imageblock-sizes' does.
- conformance suite 1055 passed, 0 skipped (m3-max-85298); clippy x3 and rustdoc as the change
before it.
- macOS: the M3 job's release build of the Metal side compiled without a warning. Clippy was
not run on macOS, since pd sends no build to the Macs.
The partial-threadgroups variant refused a kernel with an imageblock slice write every
invocation shares (texture::cooperative), as SharedSliceWrite. The walk guarded the shared
write like any other instruction, so its trailing workgroup barrier stood under `if live`,
and the walked invocations past Metal's threads skipped their shares. It now takes the shared
slice as one of the walk's synchronizations, on every tier (texture::shared_slice, in
SyncSet::WorkgroupBarriers and divergent::is_sync):
- every invocation reaches the slice's barrier;
- the invocations live at the slice write the slice's cells among them. In a partial
threadgroup those are Metal's threads: the first EmitCx::entry_threads invocations by lin.
The step of the shared loop is now that count rather than the workgroup's size, so Metal's
threads write every cell;
- a cell no thread of Metal's stored holds zero, the threadgroup arena's null initializer;
- the walked invocations store nothing in their cells before the barrier (the predicated walk).
The M3 Max recorded the same for Metal's own partial threadgroup, so this matches the
measurement rather than any documented rule. Probe imageblock_slice_past_the_grid, job
m3-max-85078: each cell of a thread past the grid lands zero, in two runs of two dispatches.
No MSL or Metal text says what such a cell holds, and the docs claim nothing beyond the
recording.
The shared slice is never by itself a reason to walk. Its guard's branch, at a
workgroup-uniform point, is taken by every invocation, so a kernel whose only non-uniform
synchronization is a shared slice keeps its unwalked module. Outside a walk the shared loop is
unchanged.
- error: PartialThreadgroupsCause::SharedSliceWrite goes, since nothing else raises it.
mesh::plan_partial_groups no longer refuses the variant for it. Feature::PartialThreadgroups'
and LoweringInputs::partial_threadgroups' docs drop it and say what the slice writes.
- runtime: its cache's refusal markers drop m2v-refused-slice (cache::REFUSALS has 5 entries).
PartialThreadgroupsSite::Structure's doc and the README's gap paragraph drop the slice.
Caches::refused now reads a variant's translation file in one lookup (the planner's
read-back of the cause table). It asked the store once per marker, and each Store::holds
opened the file in young and then old, and read it whole where its length was the marker's.
Three markers are 16 bytes, so one 16-byte file was read up to three times. Store::holds_one
takes the markers with their tags, opens the file once a generation, reads it only where its
length is a marker's, and matches the bytes against each. Store::holds is holds_one of one
marker. A hit in old still moves into young. Lookups count their opens under the tests
(Store::file_opens).
- tests:
- the red test turns green;
- each_structure_the_variant_does_not_take_names_its_cause keeps compute derivatives and
the tile function;
- the runtime's marker test drops the cause;
- api_signatures.tsv loses the two variant rows. REFUSALS.md and basis.rs regenerate
unchanged.
- a_variant_refusal_is_read_back_in_one_lookup_of_its_file writes each marker of REFUSALS
under a key of its own and reads each back with exactly one open. A missing key opens at
most twice, and a lowering of a marker's length is no refusal.
- SEMANTICS_VERSION 2366 (renumbered at landing: 2363-2365 went to arm 9, the blob move and the 1D bicubic): a partial-threadgroups
variant with a shared slice now compiles. RUNTIME_VERSION stays: no run of an unchanged
artifact differs, and the runtime-source fingerprint's inputs are untouched.
Verified:
- red d1d4b5cc9c, job m3-max-85298: a_partial_threadgroup_s_shared_slice_holds_zero_past_its_threads
fails at its compile ("unsupported: PartialThreadgroups: SharedSliceWrite"), and the filter's
other 20 tests pass. With Caches::refused asking once per marker, as before, the same job's
a_variant_refusal_is_read_back_in_one_lookup_of_its_file fails at 2 opens for
Structure(ComputeDerivatives). Green: 23 passed.
- suites (85298): product 3498 passed, 1 failed (golden_hashes_match_the_table, re-blessed on
development), 24 skipped; validation 1344 passed, 2 skipped; conformance 1055 passed,
0 skipped; doctests EXIT=0.
- clippy plain 85194, m2v_gpu 85193 and m2v_cpu_icd 85197 EXIT=0; rustdoc and api-docs 85195
EXIT=0, all at the tree of this change and the case that follows it.
- the guest's kernels, job m3-max-85164 (release, a Ryzen 7 7840HS): the two kernels this
refusal held in a recording's libraries lower and pass spirv-val on all 15 committed profiles,
under the plain module and both partial-threadgroups variants. The slowest row is moltenvk-m3's
emulated variant at 0.017 s, and the peak resident set is 32.6 MiB a process. Before this
change both variants were refused as SharedSliceWrite (job m3-max-85052).
- Metal's own answer, in the conformance case that follows (compute-imageblock-slice-past-the-
grid): recorded on the M3 (m3-max-85134), and equal on llvmpipe and on the RX 7900 XTX
(m3-max-85149).
The planner ruled the shared slice write in a partial threadgroup built (owner order 3406): the
walk's guest library 5ba5f694ad0576ff refuses the partial-threadgroups variant of kernels #81 and
#83 as SharedSliceWrite. The M3 Max recorded what Metal does (the probe
imageblock_slice_past_the_grid, job m3-max-85078, two runs of two dispatches each): the slice
write in a partial threadgroup writes every cell of the imageblock, and the cells of threads past
the grid land zero in every run.
a_partial_threadgroup_s_shared_slice_holds_zero_past_its_threads runs engine_imageblock's
shared_slice (4x4 threadgroups, a 4x4 imageblock, each thread storing (x, y, 7, 9) in its cell
before the barrier, the slice written by local id 0 at its threadgroup's origin) as the
partial-threadgroups variant over a 6x7 grid. Of its 2x2 threadgroups, one is partial in x, one in
y and one in the corner. The test uses the interpreter with the region flagged NONUNIFORM, on every
committed profile that lowers the plain kernel, in both scheduling orders. Each cell of a Metal
thread must land its (x, y, 7, 9), and every other cell of the slice must land zero. That pins the
reason as well as the result: an invocation past Metal's threads would store a nonzero cell if the
walk let it. engine_imageblock's texel helpers become visible to the test.
Red at this commit: the variant is refused Unsupported{PartialThreadgroups} SharedSliceWrite.
Verified: job m3-max-85298 fails it at its compile with that refusal, on the first committed
profile (amd-780m-hawkpoint-radv).
A kernel with an explicit imageblock stores each thread's grid position in its cell, takes a
threadgroup barrier on imageblock memory, and writes the slice from the thread at local (0, 0),
the shape the translator's cooperative slice write takes. It is dispatched with dispatchThreads
on a 21 by 13 grid of 8 by 8 threadgroups, so threadgroups at the x edge, the y edge and the
corner are partial. The probe prints, for each kind of edge, what the texels of the cells past
the grid hold after the write (the sentinel set before, a stored pattern, zero or other) and a
hash of them, over two dispatches a run. It is the reading the partial-threadgroups variant's
SharedSliceWrite form is checked against.
What it measured, job m3-max-85078 (the Apple M3 Max, macOS 27.0.1; two runs of two
dispatches, sentinels -1 and -2): every cell past the grid holds zero, 24 at the x edge, 48 at
the y edge and 39 in the corner, with no sentinel, no as-if-ran value and no other thread's
value; every grid thread's texel holds its own value; each command buffer completed, and the
hashes are equal across the runs and sentinels.
A Cubic sampler state is now made where the runtime refused it, so
RUNTIME_VERSION moves 2568 -> 2569 at landing. SEMANTICS_VERSION stays at
2365: no module's words change. runtime-sources.sha256 is unchanged
(cache/mod.rs is not one of its inputs; pin-compute equal).
MTLSamplerMinMagFilter's raw value 2 (SamplerMinMagFilter::Cubic) is
declared by no SDK header, Apple page or Metal Shading Language text, and
nothing a program asks tells it about the value, so it is undocumented
Metal and is not emulated. Metal makes the state on every Mac measured. An
Apple M3 Max filters it over a footprint wider than one texel, and a Radeon
Pro 5300M and an Intel UHD Graphics 630 read the nearest texel (the
conformance case's own inputs: jobs m3-max-85003 and m3-max-85004). The
runtime now makes such a state and filters it as nearest on every device:
no shader arm, no second pipeline, no query, no note.
- rt Device::new_sampler_state no longer refuses a Cubic min or mag
filter. Nothing raises Gap::CubicSampler now; the variant stays,
documented so, because the consumer names it.
- translator: SamplerWord::of sets no bit for a Cubic filter, so its word
is the nearest filter's. SamplerWord::CUBIC (bit 30) is deleted (its
one reader, the anisotropic word path, is gone on development). SamplerWord::FIELDS is now (1 << 30) - 1.
unnormalized_reads compares the two filters as the device's (a Cubic
filter's is NEAREST) rather than refusing Cubic. vk_sampler already
made NEAREST of Cubic.
- SamplerMinMagFilter::Cubic stays, because the consumer converts a
guest's raw 2 to it. It is documented through regen_metal_enums.py's
PRIVATE_DOCS as Metal's undeclared raw value 2, which the M3 Max filters
and the x86 Macs read as nearest, and whose device sampler and word here
are the nearest filter's. generated.rs is regenerated against the
macOS 27.2 SDK.
- docs: the runtime README's sampler line, RESOURCE-ID.md (the word's bit
30 is now 0, and the consumer makes a Cubic state as nearest),
resource_words.tsv's three Cubic lines (bit 30 cleared:
0x40000000 -> 0x00000000 twice, 0x58f6ab53 -> 0x18f6ab53), and the
comments in select.rs and extended.rs that said the runtime makes no
cubic sampler.
- reach.tsv's SamplerBicubicFilter row no longer names a runtime cubic
sampler as its reach. REFUSALS.md and error/basis.rs regenerated
(refusal_surface.py: Gap::CubicSampler has no raise site);
api_signatures.tsv blessed (SamplerWord::CUBIC removed, FIELDS changed).
- RUNTIME_VERSION: a Cubic state is made where it was refused, so it
takes a bump, set at staging (left at development's 2568 here).
SEMANTICS_VERSION stays, since no module's words change.
runtime-sources.sha256 re-pinned.
Consumer search (reims-vgpu development 1913fcbc15 and the steelbrain/*
refs from the last day): Gap::CubicSampler, 2 hits (development
crates/reims-vgpu-vulkan/src/rt_platform/diag.rs:3071 and :3109, a test
that counts the gap's name), kept. SamplerWord::CUBIC, SamplerWord::FIELDS
and SamplerMinMagFilter::Cubic by name: 0 hits. The consumer's
rt_platform::state::tests::states_on_vulkan, which expects None for
min_filter 2, now gets a sampler.
MTLSamplerMinMagFilter's raw value 2 (MTLSamplerMinMagFilterCubic) is
declared by no SDK header, by Apple's page, or by the Metal Shading
Language, and nothing a program can ask tells it about the value. Metal
makes a sampler state of it on every Mac measured. The case's own inputs
read a footprint wider than one texel on an Apple M3 Max (macOS 27.0.1,
job m3-max-85004) and the nearest texel on a Radeon Pro 5300M and an Intel
UHD Graphics 630 (macOS 26.7.1, job m3-max-85003). Undocumented Metal is not
emulated, so the runtime is to make the state and filter it as nearest, the
x86 Macs' answer, on every device.
The tests that hold that:
- rt every_device_shares_sampler_states_device_samplers: a state with a
Cubic min and mag filter is made (no Gap::CubicSampler), its word is the
nearest state's, and it takes no device sampler of its own.
- translator a_cubic_filter_is_the_nearest_filters: a Cubic min filter,
mag filter or both is the nearest filter's word, device sampler of each
use, and unnormalized reading, at normalized and pixel coordinates; and
a_sampler_word_holds_each_field_at_its_bits: a Cubic filter's word is 0.
- conformance sampler-cubic-filter: its ledger row (refused on every
venue) goes. The case drops its bicubic-filter-arithmetic declaration and
lets each lane's runtime red hold its own texel where the M3 Max's
recording differs (every lane but lane 0), under the new accepted
difference in docs/API.md. the_cubic_allowances_are_the_lanes_nearest_moves
pins those lanes to the recording.
docs/CONFORMANCE-COVERAGE.md regenerated (coverage.py): one ledger row
fewer, one tolerance more.
every_device_feeds_an_early_members_run_to_its_queue_as_the_last_retires asserted l_run * 3 < a_run:
that after A's handler the expected run fell by more than a third. The run falls by the GPU runs it
takes (QueueInner::ran halves it toward each shorter one, queue::next_run), so the bound held only
while A's and L's timestamped fill runs stayed short beside the run A's handler saw. Alone on
lavapipe at 256 bits the ratio is about 4 (125M ns at A's handler, 31M at L's). It failed once in
a full-suite run of the merged-tree check (m3-max-85067, llvmpipe LLVM 23.1.1 at 256 bits, the
test 0.94 s there against 0.11 s alone), where the CPU ICD's fills ran long.
The check is now exact: from the run A's handler saw, the run L's handler sees is next_run of A's
GPU run, then of L's, each its command buffer's gpu_end_time minus gpu_start_time. Those are the
spans the runtime fed (complete.rs feeds an early member's deferred span, and command.rs L's own,
from the same placed times it stores). Nothing in it depends on how long the runs took. With the
retirement count's +2 between the handlers, it says the queue took exactly A's run and then L's
after A's handler. The bound is not widened; the ratio is gone.
The suite's every_case_carries_its_timing failed on the new case (job
m3-max-84879). `conformance times --runs 8 --write depth-colour-reads` on
the Apple M3 Max (macOS 27.0.1, 26A434; job m3-max-85057) kept its figures
in the recording; its answers are unchanged.
docs/CONFORMANCE-COVERAGE.md regenerated (coverage.py): one module more
declaring a notice, from the depth notices the case now declares.
The case's replay on lavapipe (job m3-max-84879) announced
restricted-depth-range and restricted-depth-upload: the comparing stage's
note and the 32-bit float depth upload's. Every texel is 0.25 or 0.75,
inside [0, 1], and the notices site was the whole of their difference, so
the case declares both, as sampler_filtering's compare rows do.
The same job's replay with the colour allowances dropped printed the
runtime's own answers: a sample past the edge under an opaque white border
reads (1, 0, 0, 1), which fills the accepted difference's table.
Rustdoc refuses a public module's docs that link to a private item
(job m3-max-84879's doc step, EXIT=101): DEPTH_AS_COLOUR is the case's
own constant, so the docs name it in code and do not link it.
Recorded by conformance record on the M3 Max at bac637972d, three runs alike, the validated leg
taken. Every read answers as the probe did (m3-max-84755): (d, d, d, 1), the white border
(1, 1, 1, 1), the gather of green the depth taps and of alpha 1, the swizzled view (d, d, 1, 0),
and the depth2d reads (d, 0, 0, 0) and the comparison at quarter weights exactly.
The planner ruled that the runtime keeps Vulkan's (d, 0, 0, 1) for a depth texture read through
a texture2d<float> slot: the three Mac families answer three ways (M3 Max (d, d, d, 1), m3-max-84755;
Radeon Pro 5300M (d, d, d, d) and UHD Graphics 630 (d, 0, 0, 1), m3-max-84762), and the 630's is
Vulkan's. The case pins that answer: the owned fixture dvw_depth_views's five kernels over a 6x5
Depth32Float texture, thirteen reads (samples nearest and linear, at the edge and past it under
an opaque white border, gathers of green and alpha, a view swizzled (G, R, One, Zero), and the
depth2d sample and comparison). It is recorded on the M3 Max; each element where the 630's answer
differs from the M3 Max's may hold the 630's value as well (0), under docs/API.md's new accepted
difference, and everything else compares exactly. Lanes sit at exact coordinates, so a linear
weight is the same on every device.
docs/API.md section 10 gains the entry (its runtime border cell follows the replay). The recording
and the coverage regeneration follow in their own commits.
Verified: cargo fmt. Build, record and replay follow in their jobs.
An owned MSL fixture: texture2d<float> sample and gathers of green and alpha, and depth2d sample
and comparison, each through the runtime sampler at slot 0, one float4 per lane.
API.md now says the bicubic filter is not documented Metal, in 1D or 2D, and that what the
sample does is Metal's measured answer on an Apple M3 Max. For 1D that is the bilinear filter of
taps i and i + 1 in every format, at the fraction of q = floor(256 (x - 1/2) + 1/2) rounded half
up, with the taps clamped at both ends under clamp_to_edge. The 2D sample has the same status.
The basis, from Metal's own texts:
- The Metal Shading Language Specification 4.1 (2026-06-04), section 6.13.1 "1D Texture": "This
member function samples from a 1D texture. Tv sample(sampler s, float coord) const", and
"Because mipmaps are not supported for 1D textures, lod needs to be 0". Its Table 2.7 (sampler
state enumeration values) lists filter, mag_filter and min_filter as "nearest (default),
linear" only. "bicubic" appears nowhere in the specification or the feature-set tables.
- The Metal toolchain's header metal/__bits/metal_texture_common declares the enumerator
`bicubic` in `mag_filter`, `min_filter` and `filter` only under
`#if defined(__HAVE_BICUBIC_FILTERING__)`.
Metal's answer comes from an Apple M3 Max on macOS 27.0.1, job m3-max-85106: bcu_forms.metal's
1D lane over an 8-texel texture at 16 points, in RGBA32Float, RGBA16Float and RGBA8Unorm. At
x = 3.0, between texels 4 and 9, it reads 6.5, where a Catmull-Rom sum reads 6.25.
tests::bicubic_line (device cfg) runs the owned fixture bcu_forms through the runtime on every
device of the cfg's kind and compares its 1D lane (l.sample(bicubic_edge, uv.x), clamp to edge,
normalized coordinates) with Metal's answer for the same textures and points: an 8-texel 1D
texture of RGBA32Float, RGBA16Float and RGBA8Unorm, sampled at 16 points (fractions k / 256 between
two texels, the half-up rounding of the fraction at 1/512 and 1/1024 past a centre, and points
before and past both ends). The pipeline pushes the 1D slot's BicubicTexels word and carries
PrecisionNote::BicubicFilterArithmetic; the float formats' samples equal Metal's, and RGBA8Unorm's
lie within 1/4080 of Metal's, the note's bound at 8 bits.
Metal's answer: an Apple M3 Max, macOS 27.0.1, running bcu_forms.metal's metallib (job
m3-max-85106). It is the bilinear filter of taps i and i + 1 at the fraction k / 256 in every
format: at x = 3.0, 6.5 between texels 4 and 9, where a Catmull-Rom sum reads 6.25.
Functions that sample a 1D texture through a bicubic constexpr sampler moved from a refusal to a
module under the identity domains (the previous commit). Renumbered at landing: 2362-2364 went to
the partial-threadgroups cause, arm 9 and the blob move.
The identity domains refused every function that samples a 1D texture through a bicubic
constexpr sampler ("a bicubic filter of a 1D texture", IdentityCause::SamplerState), though its
lowering reads nothing the identity domains do not source. It is the 2D sample's on one axis: the
same footprint (lower::sampler::bicubic::footprint_on, q = floor(256 (x - 1/2) + 1/2)), the
level-0 size by OpImageQuerySizeLod of the bound image (the slot's set-1 element), the taps by
OpImageFetch of that image, and the bound format's treatment from the slot's
PushField::BicubicTexels word (bicubic::format_bits, which takes no dimension), summed by the
module's Routine::Line, which the default domains already emit: the device's FMix of taps i and
i + 1 at the fraction k / 256, then the normalized formats' clamps. Metal filters a 1D texture
bilinearly over those two taps whatever its format (the module docs; the committed M3 observations
of the bcu_forms and bcx_rules cases). The runtime writes the field per slot from the bound
texture whatever its type, so it needs no change. The refusal and BICUBIC_LINE_FORM go.
The sample keeps PrecisionNote::BicubicFilterArithmetic. No new form, query or copy.
The fixture inventory's bcu_forms.ll and bcx_rules.ll rows move to ok on all 15 profiles (30
cells); their .air.ll twins move at the next M3 bless. docs/API.md, the runtime README (its bicubic
paragraph and the identity domains' known gaps) and IdentityCause::SamplerState's doc no longer
list the form. docs/REFUSALS.md regenerated: unchanged. No public item changes.
Test: tests::engine_identity::a_bicubic_kernel_reads_each_slots_format_treatment_from_its_pushed_field
(red at 74dd91398f).
The identity bicubic test asserted that bcu_forms, which samples a 1D texture through a bicubic
constexpr sampler, is refused under the identity domains ("a bicubic filter of a 1D texture").
It now asserts what the 1D form should give: bcu_forms (a 2D texture, a 2D array and a 1D texture
at normalized coordinates) and bcx_rules (twelve 2D and four 1D texture slots at pixel coordinates)
compile, pass L3, push PushField::BicubicTexels for every texture slot, the 1D slots included, and
keep PrecisionNote::BicubicFilterArithmetic, on every profile. It fails until the refusal goes.
Both arms of such a select are blob addresses, and the strategy held them as plain operands, so
the case was refused (Apple's PVRTC decoder in MTLSimDriver's default.metallib picks its modulation
table this way). BlobStrategy::Select now holds the arms as LocalPtrs, each taken through blob_ptr
at selection and emitted through ptr_value, as BlobStrategy::Copy already does.
SEMANTICS_VERSION 2355: a module that refused before now compiles, with the select over the two
globals' blob offsets. Test a_select_of_constant_globals_selects_their_blob_offsets: a kernel
selecting between two 4-byte constant globals and loading through the result, run on every
committed profile.
Taken from x86sim/metal2vulkan's a980409cd, whose other parts are either already here (program
scope buffer bindings, 058fd25a7; an i8 [[front_facing]] argument, 7c6e9d1fc) or a consumer's
preference (memory::leaf's vector units).
Not run here: this port was made in an environment without the tree's Rust 1.98 toolchain, so
cargo fmt/clippy and the tests still have to run before it lands.
(cherry picked from x86sim/metal2vulkan commit a980409cd)
Co-Authored-By: Claude 5.5 <noreply@anthropic.com>
RADV of Mesa 26.3.1 draws a fragment function's depth or stencil output under a dynamic depth or
stencil test enable (Vulkan 1.3 core state, which every render pipeline takes) through a fragment
epilog, but makes the device's epilog cache only where the device enables extendedDynamicState,
graphics pipeline libraries, shader objects or a few extended dynamic state 3 features. With none
enabled, the first such draw dereferenced the cache's null operations in vkCmdDraw*: the guest died
in RenderCommandEncoder::draw at first app launch on a Radeon 610M, and the runtime's
stencil_export, depth_stencil_route and opengl_mode device tests segfaulted on that GPU. Mesa's
main makes the cache on every device since its commit 108edde0 (2026-11-24).
The extension is one of OPTIONAL_EXTENSIONS, its feature enabled where reported
(DYNAMIC_STATE_EPILOGS); the translator is told of both, which it already counts on every 1.3
device, so no answer changes. README tables and a floor test.
Not run here: this port was made in an environment without the tree's Rust 1.98 toolchain, so
cargo fmt/clippy and the tests still have to run before it lands.
(cherry picked from x86sim/metal2vulkan commit 584f3ad52)
Co-Authored-By: Claude 5.5 <noreply@anthropic.com>
What: the refusal of a constant blob past memory::blob::MODULE_BYTES moves from the identity
domains' check after planning (select::identity_refusal) to lower::access::blob::use_blob, where
selection first meets a read of the blob. The refusal keeps its cause (IdentityCause::ConstantBlob),
its class (Unsupported{IdentityDomains}, not implemented) and its words ("constant data of N bytes
read through memory").
Why: the plan only holds a blob that use_blob recorded, so the check after planning tested what
selection already knew at the read; refusing there names the cause where the translator meets it,
with no second pass over the plan.
SEMANTICS_VERSION 2364 (renumbered at landing: 2363 went to arm 9): a kernel that reads such a blob
and meets another refusal later in selection now gets the blob's refusal, where it got the other
one before.
Public items: none change (IdentityCause::ConstantBlob stays, and api_signatures.tsv and
docs/REFUSALS.md do not move; refusal_surface.py --check passes). The refusal-pin test is
engine_identity's a_constant_blob_past_the_modules_bound_is_refused_naming_its_size (cause, class
and words on every committed profile); engine_arena's struct DAG case of 128 KiB of blob keeps its
refusal check. runtime-sources.sha256 is re-pinned.
Verified: see the jobs named below.
What: the lockstep pass (lower::simd::lockstep) keeps one job: find whether an entry holds a pair
of accesses only a SIMD-group's lockstep orders, which sets Lockstep::unordered and the static
note PrecisionNote::SimdgroupAccessOrder. Everything that ordered such a pair is deleted: the
order key (OrderKey, Order::Rows, Decision), the barrier placement (stab, points, insert,
rewritten, the barrier declarations), the rows mode (Basis::Position, Lockstep::rows,
across_rows, orders_across_rows, dispatch's rows_may_split, RuntimeFact::RowLockstep and the
barrier plan's rows_only), the inserted barriers' own forms (barrier::Origin, the barrier's rows
guard, lockstep_class, BarrierPlan::uniform_placed and lockstep_simdgroup, the reconverges
helper), Lockstep's barriers, emulated and inserted, and the select arm that emulated SIMD groups
for a lockstep pair. The census names barrier.lockstep.* go; a program barrier keeps
barrier.simdgroup or barrier.threadgroup.
Why: the identity domains, which every state is translated under, take the key that orders
nothing, so no barrier was ever inserted and every arm deleted here was unreachable.
Public items removed (api_signatures.tsv): metal2vulkan-air Lockstep's across_rows, barriers,
emulated and rows fields and its inserted and orders_across_rows methods, and
RuntimeFact::RowLockstep. Consumer search: reims-vgpu development 76e6c90369 plus its 203 refs
younger than a day: 0 hits each for lockstep, Lockstep, RowLockstep, orders_across_rows,
across_rows and .inserted(.
Tests: the census checks that asserted no barrier.lockstep name are gone with the names (the
value checks of engine_simd_lockstep's kernels stay; its two tests that held only census checks,
the branch arms and the texture calls, go with their kernels); engine_quad_ops drops its
always-false lockstep_emulated; engine_store_quad, engine_ray_tracing and engine_simd_matrix drop
their reads of the deleted fields; the mechanism table loses RowLockstep (62 variants). The
test helper pipeline::testing::specialized_entry takes no profile, since the entry no longer
depends on one: engine_store_quad checks sst_lanes' entry once, and engine_texture_unit_bit_test,
engine_generic_pointers and engine_linking drop the profile they no longer pass.
No module word moves: the deleted arms never ran. SEMANTICS_VERSION and ARTIFACT_FORMAT_VERSION do
not move (the codec tags a fact by its name, and no artifact held RowLockstep). docs/API.md, the
runtime's error and test docs, the simd module docs, lockstep.rs's title and the engine
fixtures README's row_lockstep_tree row lose the clauses about inserted barriers;
runtime-sources.sha256 is re-pinned.
Verified: see the jobs named below.
What: the arithmetic family's word form of 64-bit integers is deleted: Held::Wide and every
arm on it, lower/arith/wide.rs (its word arithmetic, division, casts and lane moves) with its
tests, ArithStrategy::Wide and ArithPlan's wide and divides, the profile's wide forms
(wide_form_on, wide_demote, widen, widen_const, holds_wide), the two-word switch selector
(SelectorForm::Words), the chunked vector's two-word lanes, the ulong texel's word form
(TexelConv::U64Words loses its flag), the matrix descriptor's word form, and in the access
family the two-word address (pointer.rs's Address enum and its helpers, the handle table's
word entries and HandleIds, psb.rs's word base). The helpers the u64 paths still use move to
arith/ops.rs (low_word, zext_word) and access/psb.rs (Pair, split). Every !int64 refusal goes
with them: Feature::Int64Arithmetic, and Feature::PointerCompare, whose one producer was the
static guest plan's !int64 arm. LeafCaps::int64 is deleted, and the mesh fold no longer asks
for shaderInt64. BinOp::ISubBorrow, which only the word subtraction built, goes with its
interpreter and builder arms (the grammar's Op::ISubBorrow stays in spv.rs).
Why: Device::from_queries refuses a device without bufferDeviceAddress and shaderInt64
(IdentityDomains), and it is the only way to make a profile, so every profile has
shaderInt64 and every arm deleted here was unreachable. This commit's parent is the last that
holds the word form.
Consumer search: reims-vgpu development cadac770c2 plus its steelbrain refs younger than a
day (190 refs): 0 hits each for Int64Arithmetic, PointerCompare, LeafCaps and leaf.int64.
The profile's fingerprint changes on every device (the field leaves the profile's Debug
text), so the golden cells read "profile changed" until the table is re-blessed; no key
stays unchanged, so SEMANTICS_VERSION does not move. The module words do not move: the u64
paths emit the same instructions in the same order (the uvec2 the slot offset builds is the
same type the word form's type helper made).
Tests: chunk.rs keeps the chunked lane-move and fragment-shuffle bound tests, on 64-bit and
32-bit lanes held whole; the selector test drops the word cases; the tests that asserted or
filtered on the int64 field or Int64Arithmetic drop those lines; the dynamic move between
slots runs L3 on every profile.
docs/API.md (the object grid's needs), docs/REFUSALS.md, scripts/refusal-surface/reach.tsv
and tests/api_signatures.tsv are updated; runtime-sources.sha256 is re-pinned.
Verified: job m3-max-84770 at this commit (CPU only; the device steps on
lavapipe): clippy plain, --cfg m2v_gpu and --cfg m2v_cpu_icd EXIT=0;
rustdoc EXIT=0 and private-item docs of five crates with 0 diagnostics;
the translator's suite 2,594 of 2,595 passed, 20 skipped, the one failure
golden_hashes_match_the_table (28,950 cells under a changed profile
fingerprint, 0 changed under an unchanged key); air, runtime, devtools
and harness 872 passed, 4 skipped; validation 1,348 passed, 2 skipped;
conformance 1,053 passed; doctests passed; the conformance replay on
lavapipe EXIT=0 with 0 ledger drift lines; the refusal-surface and
signatures checks EXIT=0. The golden and engine inventory lists at the
parent and at this commit show 0 computed cells moved and no inventory
line.
What: BufferAccess and ProfileFields::buffer_access are deleted with every Floor arm:
the refusals that named addressed_needs (the Floor arms of DereferenceLoadedPointer,
Int64Atomics, GpuEncodedIndirectCommands in the indirect-command, replay and execution-range
paths, the de-indexed and private list forms, and the addressed function tables), the
memory planner's addressed flag and its loaded-pointer refusal, the plan's needs (MemNeeds:
that refusal read its dynamic_roots, and the handle classes beside it had no reader since the
handle table went), provenance's dynamic_deref field, the Floor mechanism of
RuntimeFact::FunctionTableRange, the Floor values of MetalDeviceProperties (argument buffers
tier, max buffer length), and the null pointer's static escape that only a profile without
device addresses took. Public items gone:
DeviceProfile::addressed_needs and Feature::{ArgumentBufferPointers, PointerToInteger,
BufferRange}, whose only producers were those arms.
Why: Device::from_queries refuses a device without bufferDeviceAddress and shaderInt64
(IdentityDomains), and it is the only way to make a profile, so no profile is Floor: every
arm deleted here was unreachable. This commit's parent is the last that holds the Floor form.
Consumer search: reims-vgpu development f054ad57c1 plus its steelbrain refs younger than a
day (188 refs): 0 hits each for addressed_needs, ArgumentBufferPointers, PointerToInteger
and BufferRange.
The profile's fingerprint changes on every device (the field leaves the profile's Debug
text), so every golden cell reads "profile changed" until the table is re-blessed; no key
stays unchanged, so SEMANTICS_VERSION does not move.
Devtools: the fuzz Target loses its addressed flag; the pointer-select generator draws the
loaded form on every target, the same draw a target with device addresses made.
Tests: the memory plan tests ask whether a buffer pointer is wide in place of the needs, and
drop the handle-table asserts; the profile tests drop the field's asserts (the max buffer
length test keeps its allocation-limit arm); the pointer-cell tests no longer accept
PointerToInteger; the atomic, kernel stage-in and tessellation tests no longer filter on the
field.
docs/REFUSALS.md, scripts/refusal-surface/reach.tsv and tests/api_signatures.tsv are
regenerated; runtime-sources.sha256 is re-pinned.
Verified: job m3-max-84770 (CPU only, no card): the golden and engine
inventory lists at the parent and at this commit show 0 computed cells
moved of 28,950 (every cell re-keyed by the profile fingerprint, which
this commit moves) and no inventory line. The stack's tip ran the whole
gate (see its message).
What: lower/sampler/anisotropic.rs and its tests, the emulated filter's
routine arm, SpecKey::SamplerAnisotropy, LoweringInputs and VariantKey's
anisotropic samplers, and PrecisionNote::AnisotropicFilter and
DeviceAnisotropicFilter (no producer is left) are deleted.
metal::sampler::check_sampler refuses a sampler of maxAnisotropy above 1
for a use that filters on a device without samplerAnisotropy
(Feature::SamplerAnisotropy, needing the feature): a constexpr sampler
where the function that samples through it compiles, a runtime or
argument buffer's sampler where it is made. A runtime slot's sample
compiles as the plain sample.
docs/API.md's precision-note catalogue loses the two notes,
docs/REFUSALS.md and scripts/refusal-surface/reach.tsv are regenerated
(SamplerAnisotropy is now a device refusal), api_signatures.tsv loses
the deleted items, and the runtime README line on the emulation goes.
SEMANTICS_VERSION 2363 (renumbered at landing: 2360, 2361 and 2362 went to
the seq_cst fence, the argument buffer border texels and the
partial-threadgroups cause). runtime-sources.sha256
is pinned at this tree.
Consumer search (read only), reims-vgpu development 4bb5db49fc and every
steelbrain/* branch younger than a day, 184 refs, git grep over *.rs,
*.toml and *.md: AnisotropicFilter, DeviceAnisotropicFilter,
anisotropic_samplers, SpecKey::SamplerAnisotropy and both degrade ids:
0 hits each.
Why: the planner ruled the emulation deleted directly after G1: under the
one form it is reached only on a device without samplerAnisotropy, where
Metal's anisotropic filter is not the device's, and the refusal names
the feature that device lacks.
Verified: job m3-max-84770 (CPU only, no card): the previous commit's red
test passes at this commit (1 run, 1 passed); the golden and engine
inventory lists at 9886324e31 and at this commit show 0 computed cells
moved of 28,950 and no inventory line (the table's 28,950 cells are
re-keyed by development's own profile changes, waiting for the pin's
bless). The stack's tip ran the whole gate (see its message).
What: engine_sampler_anisotropy.rs, on committed profiles with
samplerAnisotropy removed. A fragment function sampling at its implicit
level through a constexpr sampler of maxAnisotropy 2, 8 or 16 is refused
at compile as Unsupported{SamplerAnisotropy} needing the feature; one
through an isotropic constexpr sampler or a runtime sampler slot
compiles and links; and a runtime sampler of maxAnisotropy above 1 is
refused where it is made (metal::sampler::vk_sampler) for a float and a
depth-comparison use, while an integer texture's use, which filters
nothing, is made.
Why: under the one form the anisotropic emulation is reached only on a
device without samplerAnisotropy, and there a constexpr anisotropic
sampler ends in an internal error instead of a typed refusal.
Verified: red at this commit in job m3-max-84770 (CPU only, no card): the
test panics at engine_sampler_anisotropy.rs:132 (1 run, 1 failed).
A run in which a restoring make, a read of a texture's bytes, a ready
wait or a wait for room flushes uploads that use memory another API
shares while a group goes now submits those uploads as a part of their
own ahead of the group's first part, in the same vkQueueSubmit2, with
the hand-over of what they alone use, and the host's wait ends before the
group's command buffers. RUNTIME_VERSION 2566 -> 2568 (renumbered at
landing: 2567 went to the partial-threadgroups cause, which landed first).
SEMANTICS_VERSION is unchanged.
The own part for uploads the host waits for (a6dda529a6) released all it
used at its end and the group's first part acquired all it used again:
where both use one block, one more release and acquire than the single
part before. On the RX 7900 XTX (RADV) that pair put the group's GPU end
97 us later in the scratch probe (a 256 MiB fill touching the export the
waited zero fill is in; group GPU end from the resume, median of 8
alternated runs: 799 us red, 896 us green, run ranges apart; job
m3-max-84216), while the Iris Xe (84176, 1.001) and the RTX 3090 (84191,
0.976) showed none.
parts() now takes what each part acquires and what it releases as two
lists. Where the uploads go as a part of their own, submit() gives that
part an acquire of all they use and a release only of what the group's
first part does not use; that part acquires only what they did not and
releases all it uses. A block both use is so acquired once and released
once, as in one part; one the uploads alone use is still the other API's
again when the host's wait returns, and the uploads' value is signalled
at their last upload where they release nothing. Handed::is is now
pub(crate) for the difference. Every other part's two lists are the same
list, as before.
Docs (Work::flush, submit's, parts', the counters' external_acquires,
external_releases and restoring_makes_shared, Keep::Restore, RestoreFence,
Block and Surface wait_until_ready, the runtime README) say so. The
plane_parts test gains the shape of both lists.
Verified: jobs to follow.
An awaited flush (Work::flush and the other flush_awaited callers: a
restoring make, Texture::get_bytes of a texture without named bytes, a
ready wait of an exported block or surface whose making is not yet
submitted, and a call's wait for room in the uploads or the staging
ring) whose uploads go with a group signal the value below the group's
in a batch of their own. Where those uploads used memory another API
shares (a new buffer's zero fill in an exported block, a surface
plane's image an upload holds, a block a copy into a texture's image
reads), they signalled nothing: the wait ended at the release after the
group's first part, so it waited for that part's command buffers, for
as long as they ran.
submit() now gathers what the uploads use of such memory apart from
what the group uses. Where the host waits for them and they use any,
they are a part of their own: leads gains a 0 ahead of the group's
(prepended to the member-by-member leads where the group goes apart),
handed gains their list at its head, and parts() gives that part an
acquire at its head and a release at its end that signals the value the
flush gave (close() already numbers it below the group's first part).
That part goes in the same vkQueueSubmit2 as the part after it, so no
call is added; where the group goes member by member it rides the first
member's call. The group's first part hands its own memory over after
it, acquiring again what both use. Uploads the host does not wait for
are as before. Direct3D 11 plane submissions are now counted per call
from the acquires each call holds, so the call with two parts counts
once. restoring_makes_shared keeps its condition and now counts the
makes that took the own part; its docs, restoring_make_wait_nanos',
external_acquires', external_releases' and d3d11_plane_submissions'
say so, as do Work::flush, the RestoreFence docs, Block and Surface
wait_until_ready, and the runtime README (the restore, the fence
paragraph, the exported block's hand-over, Direct3D 11 planes and the
fence's known gap).
Cost on every awaited flush that rides a group and uses shared memory:
one more acquire and release pair (two runtime command buffers, two
hand-over barriers and one global barrier) and one more VkSubmitInfo2
in the same call.
The plane_parts test gains the own part's shape, as one part and
member by member. Verified: jobs to follow (red e8dbe38dc8 against this
on lavapipe and the Iris Xe).
restore_batch's scenario becomes a helper with a switch: where it is on, a
new buffer in an exported block (Device::new_exported_block) takes a GPU
zero fill between the held fill's commit and the restoring make, so the
uploads the make's flush awaits use memory another API shares. Today
those uploads signal no value of their own: the wait ends at the group's
part, past its release, so the make waits for the held fill and the test
fails after ten seconds. The existing test runs the same body unchanged.
Red: expected to fail on every device that imports host memory in place
and exports a handle; jobs to follow.
The translator refuses a kernel's partial-threadgroups variant for five structures, and
the refusal named none, so a walk could not tell them apart (a guest library's kernels
5ba5f694ad0576ff #81 and #83 refuse it with no cause) and the runtime reported each as
Gap::PartialThreadgroups at site Translator.
- error: PartialThreadgroupsCause (ComputeDerivatives, OtherForm, SharedSliceWrite,
TileFunction, VoteWord), Cause::PartialThreadgroups and Unsupported::partial_threadgroups.
Each site names its cause: compile.rs's analyze_one (the variant beside another form),
mesh::plan_partial_groups (a tile function, compute derivatives, an imageblock slice write
every invocation shares) and simd::divergent's barriers (the vote word, still needing the
maxComputeSharedMemorySize limit). Feature::PartialThreadgroups' doc lists today's causes
(the stage-input region and the emulated SIMD-group tier are no longer refused).
- runtime: VariantRefusal reads the cause (the vote word's, a structure's, or none) instead of
the needs; PartialThreadgroupsSite gains Structure { cause }, the translator's type
re-exported; Translator stays for a refusal that names no structure. The cache directory
keeps each refusal under a marker of its own (cache::REFUSALS: the old two plus one a
structure), so a refusal read back names the same cause.
- Tests: the red test, and a runtime unit test that every cause maps to its refusal and its
marker and back. README: the gap's sites. REFUSALS.md and basis.rs regenerated;
api_surface row; api_signatures.tsv blessed.
- SEMANTICS_VERSION 2362 and RUNTIME_VERSION 2567: the refusal and the dispatch's gap say
more (renumbered at landing: SEMANTICS 2360 and 2361 went to the seq_cst fence and the
argument buffer border texels, RUNTIME 2566 to the seq_cst fence).
Verified (jobs m3-max-84834, -84836, -84838, -84839, -85025):
- red, the red commit's crates over this commit's target: 3 tests run, 0 passed, 3 failed,
each refusal PartialThreadgroups with no cause; green: 4 tests run, 4 passed (the three and
a_variant_refusal_keeps_the_translator_s_cause).
- product suites: 3495 tests run, 3494 passed, 1 failed, 24 skipped; the failure is
golden_hashes_match_the_table, whose table is re-blessed on development. Validation: 1348
passed, 2 skipped. Conformance: 1053 passed, 0 skipped. Doctests pass.
- clippy --workspace --all-targets --all-features -D warnings: plain, --cfg m2v_gpu and
--cfg m2v_cpu_icd, each EXIT=0. Rustdoc with -D warnings and scripts/api-docs: EXIT=0.
Not verified here: which cause the walk's kernels #81 and #83 name (a probe on the walk's
library, reported apart).
A kernel's partial-threadgroups variant is refused as Unsupported{PartialThreadgroups} for
five structures (an imageblock slice write every invocation shares, compute derivatives, a
tile function, the variant asked beside another form, and a vote word past the shared
memory limit), and the refusal names none of them: a walk's probe of a guest library's
two kernels that refuse it (5ba5f694ad0576ff #81 and #83, both with imageblock barriers)
could not tell which. The tests now read each refusal's cause from its text:
SharedSliceWrite, ComputeDerivatives and TileFunction in a new test over every committed
profile that lowers the plain kernel, OtherForm and VoteWord in the two existing ones. The
imageblock and dispatch tests' kernels the new test reuses are visible to it.
Red: no refusal names a cause yet. Verified: the run follows.
The inventory's cells follow the translator, and only the M3 blesses its .air.ll twins. The seq_cst
fence (6113e89e0c) and the argument buffer border texels (e5b7498833) moved nine rows from refused
to compiled on all 15 profiles: a27_memory_order, a4_device_fence and dispatch_builtins (.ll and
.air.ll each), and three kernel_read_through.air.ll entries. No other row moved.
Verified: job m3-max-85040 on the Apple M3 Max at 004f68b48f, bless_engine_inventory 1 passed,
2642 skipped, STEP inventory EXIT=0; this commit is that job's patch applied as is (9 lines in,
9 out of tests/public_fixture_expectations_engine.tsv).
host_in_place's each_device_fences_a_host_writer_around_the_restore_alone
asserted held > 0 (the writer found the fence's gate held) on one fenced
make, which holds only where the writer's thread is scheduled inside the
span. On the Radeon 780M (pin T's round, job m3-max-84449) the writer
missed it: the make lost no word and kept its bytes, and held was 0.
The writer now tells a Handshake when it first finds the gate held,
before it waits there, and when it ends; the fenced make's Gate
(Gate::meeting) keeps the gate in after() until the writer has found it
held or ended. The writer stamps from before the make to after it
returns and needs about 130 ms to stamp every word, so it meets the gate
inside the span by structure, and lost == 0 still checks that the stamp
it then writes lands after the write-back. The other Gates (the refusing
one, in place alone, the timed makes) wait for no writer, as before.
The unfenced half keeps its four makes: its witness is a stamp between
the GPU's save and its write-back, which run in one batch with no host
call between them, so no handshake reaches it; the test's doc says so.
The runtime-sources pin is unchanged (pin-compute.py: the hash equals
the committed one). Test only, no version. Verified: jobs to follow.
Metal takes a viewport whose znear/zfar lie past [0, 1] (OpenGL's [-1, 1]; NanoTimeKit's
Metal watch faces set it, so x86Sim's Face Gallery drew Nike Bounce black). Its API
validation takes it too. Measured on an Apple M1 under macOS 27: a fragment reads
[[position]].z = znear + z * (zfar - znear) unclamped, and a depth attachment, Depth16Unorm
or Depth32Float, stores that clamped to [0, 1]; a fragment's [[depth]] output is clamped to
[0, 1] whatever the range.
Vulkan takes such a range only with VK_EXT_depth_range_unrestricted, which would also store
a float fragment depth unclamped, unlike Metal, so no runtime enables it. Instead
set_viewport takes the range, and a draw through it whose pass has no depth attachment and
whose fragment function reads no [[position]] z or w records the range clamped to [0, 1]:
there the depth shows nowhere (clipping is in clip space). Any other draw under such a range
is refused as before (Gap::Draw Viewport), now at the draw.
- metal2vulkan: CompiledFunction::reads_position_depth (StageIo::position_depth with the
FragCoord builtin), its row in api_signatures.tsv; no encoding change.
- metal2vulkan-runtime: RenderCompiled::reads_position_depth; set_viewport and checked take
the range; a draw refuses it as above; vk_viewport clamps the depth range. RUNTIME_VERSION
2563: a range past [0, 1] is refused at the draw that reads it, not at the set.
- test every_device_draws_through_a_depth_range_past_zero_to_one_where_nothing_reads_the_depth:
draws through [-1, 1] without a depth attachment; refuses a fragment function that reads
[[position]].z, and a draw into a Depth32Float attachment; draws again in [0, 1].
Not run here: this port was made in an environment without the tree's Rust 1.98 toolchain,
so cargo fmt/clippy and the device tests still have to run before it lands.
(cherry picked from x86sim/metal2vulkan commit 633ffbad4)
Co-Authored-By: Claude 5.5 <noreply@anthropic.com>
profile_fingerprint_derived read a process-wide count that tests running at the same time
also raised, so it failed whenever another test made a device between its two readings
(both full runs on 2026-11-28; alone it passed). The count is per thread now.
The x86sim/metal2vulkan commit this is taken from also changed
vec16_answers_metal_bound_at_a_multiple_of_4 for a consumer whose leaf selection never
uses uvec4 units; that half is left out, as this tree's leaf selection is already decided
by proven alignment (memory/leaf.rs).
(cherry picked from x86sim/metal2vulkan commit 335a6d717)
Co-Authored-By: Claude 5.5 <noreply@anthropic.com>
Older or upgraded AIR carries other constants in the access position; the call stayed
unknown and sample_texture_2d failed as UnknownIntrinsic. Known values still decode, and
the one reader of the intrinsic's access (unbound storage reads) treats none as storage.
SEMANTICS_VERSION 2354: such calls refused before now compile.
(cherry picked from x86sim/metal2vulkan commit b19d45320)
Co-Authored-By: Claude 5.5 <noreply@anthropic.com>
Metal 4.1's read(sampler, coord) of a texture an argument buffer holds was refused as
Unsupported{IdentityDomains} with cause HeapResource ("a texture handle that reads its table
entry beyond its element (Indexed ...)"): a read that may hand back the border texels made the
handle search's indexed form (Lookup::Indexed), whose uses read the border texels from a
handle-table entry, and the one form has no table. Metal gives the read to every guest device,
so it is built. The golden table's engine/kernel_read_through rt_heap_zero, rt_heap_ow and
rt_heap_arg, and the conformance cases read-through-a8, -heap-border, -heap-sampler, -r32f,
-rgba8 and -rgba8-swizzled, were refused.
The form is the slot's. Bits 0-11 of the texture's resource ID's word hold its border texels
(docs/RESOURCE-ID.md), and an argument buffer's member holds the whole ID, word included:
- AccessPlan::lookup no longer has an indexed form; a function with heap_border yields Element or
Flagged (alpha) as any other, which the admission takes;
- emit_identity_handle carries the word's low 14 bits (HANDLE_WORD, above the 16-bit element) in
every texture handle of such a function, ungated (the texture-buffer words keep their
TexelBufferWords gate where they alone need them);
- heap_element_index masks such a handle to its element at every use;
- heap_border_texels takes bits 0-11 of the carried word, and for a texture buffer whose word
holds a word layout's fields there, its format's border texels from its code, as a slot's read
does (words::slot_border_texels). It was an error stub;
- the read's words estimate counts that extraction (32 words) in place of two indexed flag reads.
Nothing builds Lookup::Indexed now, so it goes, with what only it used: HANDLE_ENTRY,
FLAG_BORDER_TEXELS, INDEXED_FLAGS_WORDS, heap_flags (a check for the indexed form; its two
callers wrap the handle themselves), the search's indexed arm and its test rows.
Test: engine_identity's
an_argument_buffer_textures_read_through_a_sampler_takes_its_border_texels_from_its_word compiles
rt_heap_zero, rt_heap_ow and rt_heap_arg on lavapipe, moltenvk-m3 and moltenvk-m3 without
robustImageAccess2. Each passes L3, plans heap_border, states no BorderTexels fact and no
specialization constant but the dispatch's, and on the CPU interpreter reads Metal's border
texels (metal::sampler::border_texel) of R32Float, RGBA8Unorm, A8Unorm and a swizzled RGBA8Unorm
for each entry's border colors, and the texel inside the texture. engine_texture_oob's
every_read_through_a_sampler_validates_or_is_refused_typed now validates the three entries where
it counted their refusal.
Conformance ledger (known-gaps-rt.tsv): the six `*` rows of those cases' rt_heap pipelines go.
With the pipelines made, each case runs whole, and llvmpipe's answers at 96 sites that a refusal
had left uncompared differ from Metal's by one f32 ulp in A8Unorm, RGBA8Unorm and swizzled
RGBA8Unorm texels. Those are the device's own 8-bit conversion (rule 1, note
device-texel-conversion), and each gets an llvmpipe row. docs/CONFORMANCE-COVERAGE.md is
regenerated.
Docs: the runtime README's forms list loses the entry for this read. API.md's identity paragraph
and RESOURCE-ID.md say an argument buffer's texture reads its border texels as a slot's does.
Engine inventory (public_fixture_expectations_engine.tsv): the 45 cells of
engine/kernel_read_through.ll's rt_heap_zero, rt_heap_ow and rt_heap_arg move from
Unsupported{IdentityDomains; NotImplemented} back to ok. Their .air.ll twins, which only macOS
assembles, move at the M3 bless.
SEMANTICS_VERSION 2360 -> 2361 (renumbered at landing: 2359 and 2360 went to checked naming and the seq_cst fence): the rt_heap cells of the golden table change from the refusal to
modules. The golden table is blessed at the next pin, not here. runtime-sources.sha256 moves for
memory/handles.rs alone: the deleted indexed form is translation code, and no run of an
unchanged artifact changes.
Verified, at this commit's tree:
- m3-max-84730, on the CPU with no device. Red: the new test and the read-through validation test
with the lowering and memory/handles.rs at the base fail (EXIT 100). Green: both pass, with the
search's tests (EXIT 0). fmt, signatures, clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd),
Rustdoc, private docs, doctests and scripts/api-docs pass. The metal2vulkan suites ran 3,494
tests, 3,493 passed, and the one failure is golden_hashes_match_the_table; the engine inventory
parts pass. Validation ran 1,348 tests, all passed, 2 skipped; conformance ran 1,053, all passed.
- m3-max-84829, on the CPU with no device: of the golden table's 28,950 changed lines, all are
"profile changed" lines of the table not yet blessed since the resident core's deletion, and 45
change a cell, every one an rt_heap cell of engine/kernel_read_through.ll, from the refusal to a
module.
- m3-max-84715, the pinned lavapipe image (llvmpipe, LLVM 23.1.1, 256 bits): the conformance
replay of the 13 read-through cases ends EXIT 0 with "the 96 row(s) above are exactly the open
gaps known-gaps-rt.tsv expects on this venue".
- m3-max-84619, on the Iris Xe (Mesa 26.2.6), at the same change on the base before the inventory
bless: the 13 read-through cases report 0 gap rows, EXIT 0.
The seq_cst fence build made pipeline::SEQ_CST_FENCE_WORD public without its
api_surface row, so api_surface and api_signatures (which counts the table's names
against the parsed surface) failed.
Verified: m3-max-84728 failed the_table_matches_the_source and
the_public_signatures_are_the_committed_table at f42ed033e3; signatures.py --check now
prints 491 names in the table, 491 parsed, and exits 0; refusal_surface.py --check exits 0.
The seq_cst fence's add on the device's fence word is a store the translator's
writes_memory scan sees like any other, so a function whose only write is that add is
taken for one that writes memory: its kernel's dispatches are recorded, a fragment
function of a multisampled pipeline carries DeviceFragmentRuns and the writer's sample
mask, and a device that draws [[stencil]] by bits refuses its pipeline. The known-gap
bullet of the seq_cst fence says so. No behaviour change.
Verified: read from spirv/requirements/writes.rs (every Atomic on a
PhysicalStorageBuffer pointer counts), pipeline/compile.rs (the StencilBitDraws
refusal), pipeline/private_state.rs (observes_sample_mask) and the runtime's
encoder.rs (a dispatch of a kernel without writes records nothing).
Clippy (assertions_on_constants) refused the runtime assert! of two constants in
the_fence_word_lies_past_the_zero_range_s_reads; both are const blocks now, the word's
alignment through is_multiple_of.
Verified: clippy --cfg m2v_gpu at f42ed033e3, job m3-max-84724, named this one error;
the three configurations rerun at this commit.
The seq_cst fence build moved RUNTIME_VERSION from 2564 to 2565 for the zero chunk's
fence word, a word of the runtime's ring that pipelines now add to; development took
2565 for the byte copies meanwhile, so this rebased branch takes the next number. The
runtime-sources hash is unchanged (no runtime input file of the product changed; the
build script's hash recomputed over this tree equals runtime-sources.sha256).
The store-buffering litmus declares air.atomic.fence alone, so llvm-as refused the
seq_cst test's MSL 4.1 barrier case (an undefined @air.wg.barrier) at both the red and
the fixed commit, before any assertion ran: the test now appends the three-operand
barrier's declaration for that case. ToolingRequirement::ALL kept its old length of 41
after SeqCstFence left it, which stopped the validation crate compiling; it lists 40.
The barrier selection's comment still said a device-scope seq_cst barrier is refused;
it now says it adds to the device's fence word.
Verified: m3-max-84697 showed both failures (llvm-as "use of undefined value
'@air.wg.barrier'"; requirement.rs:276 E0308); the rerun follows on the rebased tip.
Vulkan has no sequentially consistent order ("SequentiallyConsistent memory semantics is not
supported and must not be used", vkspec 1.4.366, Memory Semantics), and an acquire-release fence
lets two threads that each store and then load the other's word both read the old values, which
Metal's seq_cst fence forbids: it "establishes a single total modification order of all tagged
atomic operations" (MSL 6.16.1). Such a fence was refused, Unsupported{IdentityDomains}
SeqCstFence; five kernels of the first-setup walk's library aa5e72671a992cea meet it, each with
four air.atomic.fence(mem_device, seq_cst, device) (probe m3-max-84688).
The planner's ruled form, one for every device: a seq_cst air.atomic.fence at any scope beyond
the thread, an LLVM fence seq_cst, and a program's seq_cst barrier whose memory scope is the
device keep the acquire-release barrier they had at their own scope, then add 1 with
OpAtomicIAdd at Device scope, with the barrier's semantics, to the device's fence word. Adds to one
word are totally ordered and each reads the one before it, so the earlier fence's add (a release)
synchronizes with the later's (an acquire). Threadgroup and simdgroup fences take the device word
too (planner, option A): a stronger order than Metal names, with no workgroup memory and no
change to the threadgroup memory limit.
The word: pipeline::SEQ_CST_FENCE_WORD (256) bytes past PushField::ZeroAddress, in the runtime's
zero chunk: one per device (Core holds one Ring; the chunk is kept for the device's life and never
given back), made with every buffer usage, read only in its first 16 bytes (a checked load's unit
at ZeroAddress, psb::ZERO_RANGE_READ, and an indirect command buffer reset's index token of 0
bytes), its value never read. A function with such a fence reads ZeroAddress whether or not it
checks an access (access::place_zero_address keeps it). No new push field.
- lower::sync::barrier: total_order (selection: notes device scope, places ZeroAddress) and
add_to_fence_word (emission); Fence and Barrier carry `total`; require_seq_cst and
SEQ_CST_FORM deleted. lower::sync::memory_model: the LLVM fence's `total`.
- error: IdentityCause::SeqCstFence deleted (the consumer names it nowhere: git grep -n
'SeqCstFence\|SEQ_CST\|seq_cst_fence' at reims-vgpu f054ad57c1 finds only C __ATOMIC_SEQ_CST).
- Guards: psb.rs asserts ZERO_RANGE_READ <= SEQ_CST_FENCE_WORD at compile time; ring.rs asserts
the word fits its chunk; the_fence_word_lies_past_the_zero_range_s_reads checks both readers.
- Tests: the red test's threadgroup and simdgroup rows take the device add (option A); the
identity, dispatch and MSL 4.1 tests compile a4_device_fence, device_fence_store and
a27_memory_order where they asserted the refusal.
- Validation: ToolingRequirement::SeqCstFence and executor_contract::seq_cst_fence retired, as the
runtime runs the fence; a_seq_cst_fence_runs_through_the_runtime replaces the refusal test.
- Docs: the runtime README moves the fence from the identity refusals to a known gap with the
add's cost (RTX 3090 m3-max-84667, RX 7900 XTX m3-max-84666, Iris Xe m3-max-84668; device
fences, standing for threadgroup and simdgroup ones too); docs/API.md and ring.rs say where the
word lies. api_signatures.tsv blessed; REFUSALS.md regenerated, unchanged.
- SEMANTICS_VERSION 2360 (2359 went to checked naming, which landed first), RUNTIME_VERSION 2565 (a runtime word added; renumbered 2566 below).
Verified, potluck jobs on this branch rebased onto development 436dd1045e, each at a commit of
the branch (whose later commits declare the MSL 4.1 barrier in the test, count 40 requirements,
take RUNTIME 2566, satisfy clippy's assertions_on_constants and add the api_surface row):
- m3-max-84728: the red test at the red commit, with the barrier declared, fails on the
IdentityDomains SeqCstFence refusal (RED EXIT=100); validation 1344 passed, 2 skipped;
conformance 1053 passed, 0 skipped; doctests EXIT=0.
- m3-max-84778, at the tree of the branch's last commit: clippy plain EXIT=0; metal2vulkan,
air, runtime, devtools and harness 3494 run, 3491 passed, 24 skipped, 3 failed: golden_hashes
and the fixture inventory's parts 1 and 4, whose 45 moved cells are a27_memory_order,
a4_device_fence and device_fence_store on each of 15 profiles,
Unsupported{IdentityDomains} -> ok (re-blessed on development). The seq_cst test validates
every module with spirv-val on every profile.
- clippy -D warnings with the const assertions: plain m3-max-84758, --cfg m2v_gpu
m3-max-84759, --cfg m2v_cpu_icd m3-max-84761, each EXIT=0; rustdoc and api-docs at the last
commit's tree, m3-max-84817, EXIT=0.
- Cells against the M3 Max's committed Metal observations: a4_device_fence (8ebbfe8893f9) and
a27_memory_order (914fc7fd4040) Match on lavapipe (m3-max-84766) and on the Radeon 780M under
its venue amd-780m-radv (m3-max-84772); a_seq_cst_fence_runs_through_the_runtime and
a_fence_of_another_order_is_made_through_the_runtime pass on both.
The planner ruled the sequentially consistent fence built (owner order 3406; the walk's library
aa5e72671a992cea holds five guest kernels refused SeqCstFence today, L157 count m3-max-84638):
each seq_cst fence keeps the acquire-release barrier its order maps to and adds one
acquire-release atomic add of 1, with the barrier's semantics, on one word its scope's fences
share, so any two such fences are totally ordered and store buffering is forbidden.
a_seq_cst_fence_adds_to_its_scope_s_word_and_no_other_fence_does replaces
a_seq_cst_fence_is_refused_and_an_acq_rel_fence_is_a_barrier. On every committed profile, the
store-buffering litmus kernel with each fence form: an air.atomic.fence of seq_cst at device
scope, an LLVM fence seq_cst, and a seq_cst MSL 4.1 barrier whose memory scope is the device
each carry two adds at Device scope through a PhysicalStorageBuffer pointer and read
PushField::ZeroAddress; a seq_cst fence at threadgroup or simdgroup scope carries two adds at
Workgroup scope on a Workgroup word; acq_rel, acquire and release fences carry none and read no
zero range. Each add's semantics equal its barrier's and it adds 1; every module passes L3.
Red at this commit: every seq_cst case is refused Unsupported{IdentityDomains} SeqCstFence.
Verified: the red/green job of the fix commit.
What: AccessPlan gains bounded, the memory-plan slots reached by their
device address that read their PushField::SlotBounds (place_slots puts a
device-address slot there where AccessPlan::variable holds it), and
AccessPlan::check names a target of one checked. A load, store, quad
store or buffer atomic of such a slot carries .checked in its census
name, as a view's does. Copies' names are unchanged (they carry no
check). SEMANTICS 2359: census names change, no module word does.
Why: emit::prepare checks an access of such a slot whose emitted offset
is not a constant against the slot's pushed length, so the name now
says the check the module runs.
Verified (lavapipe and CPU interpreter, job m3-max-84692 at a8256703d8,
the same patches before the rebase onto 436dd1045e): the two flipped
tests fail at the red commit and pass here; clippy plain, m2v_gpu and
m2v_cpu_icd exit 0; translator 2620 of 2621 passed, 20 skipped, the
one failure golden_hashes with all 28950 cells under a changed profile
fingerprint (the table awaits its bless since the device policy went);
validation 1348 passed, 2 skipped; rustdoc and private rustdoc of the
seven crates clean; the lavapipe conformance replay exits 0 with no
ledger drift. Job m3-max-84598 (the same change on 848acada38): air,
runtime, devtools and harness 872 passed, 4 skipped; conformance 1053
passed; doctests 2 passed; the full golden and inventory lists at the
base and here move 0 values (28950 and 1233 cells).
What: two census assertions move to the checked name. The round trip in
a_compile_records_the_containment_it_compiled_under expects its store at
the thread's index as access.store.psb.checked (its load at a constant
offset stays access.load.psb), and int64_buffer_atomics_are_exact_through_
device_addresses expects access.atomic.buffer.cas.psb.checked.
Why: under the identity domains a device-address slot that an access
reaches at a run-time offset reads its PushField::SlotBounds, and each
such access whose emitted offset is not a constant is checked against it
(emit::prepare). The census names a view's checked access .checked but
not a device address's, so the name hides a check the module runs.
Verified: red at this commit before the fix, by the next commit's job.
KosmicKrisp (Mesa 26.3.1) on the M3 Max runs the family's five cases at 760b5f7de2 (job
m3-max-84640): the stencil cases exact, the 16-bit depth cases announcing their declared note.
Every row of the venue for them now matches, so each goes. CONFORMANCE-COVERAGE.md regenerated.
Where a render pipeline state's compiled content is made, beside the RenderContents gauge's rise,
a content whose translated pipeline interpolates at a sample (GraphicsState::interpolates_at_sample)
counts in Metrics::sample_interpolating_states. Red before it on lavapipe: job m3-max-84629.
The planner asks a replay to answer whether any guest interpolates at a sample without a probe
build: Metrics::sample_interpolating_states, the render pipeline states made whose fragment module
interpolates an input at a sample (GraphicsState::interpolates_at_sample), in the replay's
per-frame metrics beside sample_copies. This commit adds the field, its replay entry, the README's
counters line and the device test (pm_sample_id counts 1, pm_center 0); nothing counts it yet, so
the test is red. It rides RUNTIME_VERSION 2565.
Each of the family's five cases now runs where it refused (Gap::TextureBytes): the stencil cases
compare exact and the 16-bit depth cases announce their note (rounded-sample-depth-copy), which
they declare, on the RTX 3090 (NVIDIA 620.70.06, job m3-max-84576), the RX 550 (RADV, Mesa 26.2.6,
84577) and the RX 7900 XTX (RADV, Mesa 26.2.6, 84578), at d81831ad09, the change's tip before its
rebase. Their rows go, and so do the 780M's and the Iris Xe's, whose device test copies every row
bit for bit on the same runs (their conformance replays are next). On lavapipe (job m3-max-84579)
the 4-sample stencil cases are exact, and the 4-sample 16-bit depth case differs only in its
samples site, where the device's decode of a 16-bit depth to float is one ulp from Metal's, as
depth16-texel-reads records: a row of the device's own answer. The 2-sample rows there stay (no
texture of 2 samples). The three every-venue rows narrow to the Apple M3 Max, whose KosmicKrisp
venue is not yet run. CONFORMANCE-COVERAGE.md regenerated.
The all-codes row's 128 KiB of units did not fit the 64 KiB block the helper takes by default
(lavapipe job m3-max-84567... 84570: BufferPastBlock); the 8 x 8 rows passed there, stencil and
16-bit depth, whole and the region at (2, 1).
Lavapipe job m3-max-84567 ended in SIGSEGV at the row whose region starts at (2, 1): a quad the
region's edge cuts runs helper invocations outside it, whose pixel below the origin wraps the
offset, and lavapipe performs their loads. The fragment now reads the region's first unit where its
pixel lies outside the region (the block gains the region's rows, SampleBytes::HEIGHT_AT; BYTES
40 -> 48), so no invocation reads outside the region's bytes on any device.
The copies count as they record, so the count taken between recording and commit missed them
(lavapipe job m3-max-84558: the Stencil8 row copied back bit for bit, its count read 0).
The codec gains a PrecisionNote member (RoundedSampleDepthCopy), and a run of an unchanged artifact
now copies a buffer into and out of a multisample texture's stencil or 16-bit depth where it was
refused (Gap::TextureBytes, which now also carries a cause).
The second build (lavapipe job m3-max-84547) stopped on a match over SampleAspect in the runtime,
which #[non_exhaustive] forbids across crates, and on a Debug derive over ash's Format, which has
none without its debug feature. SampleAspect and SampleWrite become exhaustive (class E in
api_surface): a runtime handles each aspect and makes a draw of each write. The replay's per-frame
metrics gain stencil_bit_draws and sample_copies. The conformance side announces
Texture::SAMPLE_DEPTH_COPY_NOTE for a copy into a multisample Depth16Unorm, which the
buffer-depth-samples d16 rows declare; the case's doc states the current form and its refusal of a
32-bit float depth instead of the old form's -0 difference.
The translator's sample kernel named its heap slot under a stage that does not exist (Stage::Kernel
is the compute stage's); fixed with the other error the first build (lavapipe job m3-max-84536)
reported. The runtime README states the measured layout, the form, the refusals left with their
causes, and names this caller on the stencil-export known gap; API.md documents own_draw and
SamplesToBytes and catalogues PrecisionNote::RoundedSampleDepthCopy. The device test gains a
128 x 128 Depth16Unorm row at 4 samples whose 65,536 units are every code once, checks every unit
of the copy back out, and asserts the counts: 2 sample copies a row, and 8 stencil bit draws for a
stencil row on a device without stencil export, else none.
The form the planner approved: into the texture, one rendering of its attachment view over the
region (load, store) of the runtime's own draw, every sample shaded, each fragment reading its unit
at the buffer's device address and writing it (FragDepth for a 16-bit depth, FragStencilRefEXT
where the device exports stencil, else 9 draws by bits); out of it, one dispatch of the runtime's
own kernel reading each sample through the texture's element of set 1's sampled-image array. No
intermediate image and no staging buffer either way. Gap::TextureBytes carries a typed cause
(TextureBytesCause); the new static note PrecisionNote::RoundedSampleDepthCopy
(Texture::SAMPLE_DEPTH_COPY_NOTE); Metrics::sample_copies.
Not yet compiled: this commit is the first build's input; the next commits fix forward what the
build and the red test report.
What. The test made its textures at indices 4096 onward without granting them, so on lavapipe it
stopped at "Texture index 4096 is not granted" before reaching the copy it is red on (job
m3-max-84432). It now grants ROWS.len() texture indices from 4096 on each device, as the other
device tests that name an index do.
Verified: the red run named in the hand-off stops at the copy in.
What. A device test (tests/multisample_bytes.rs, under --cfg m2v_gpu or m2v_cpu_icd), red on
every device today. On each device it copies a buffer into a Private 8 x 8 multisample texture
through the plane option, Stencil8 with StencilFromDepthStencil and Depth16Unorm with
DepthFromDepthStencil. The rows are the whole texture at 4 and at 2 samples, where the device
makes a texture of that count, and a 4 x 3 region at (2, 1) at 4. The owned rt6_samples kernels
then read every sample, and the texture is copied back out into a buffer that holds 0xee. The test
asserts Metal's answer: copy unit i lands at texel (x, y) of the region, sample s, where
i = (y * width + x) * samples + s, rows bytesPerRow apart; samples outside the region keep the
clear; and the copy back out returns the buffer bit for bit. Today the runtime refuses the copy in
on every device (Gap::TextureBytes: "bytes are not copied to or from this texture of Stencil8"),
so the test fails at its first copy.
Why. Plain Metal does this copy, and a program has no way to ask whether it may, so a guest can
meet our refusal. The planner ranked this row BUILD.
What Metal does here is measured, not documented. Apple's pages for
copyFromBuffer:...toTexture:...options:, copyFromTexture:...toBuffer:...options:, MTLBlitOption and
its two plane options, and MTLBlitCommandEncoder.h say nothing of a multisample texture or of a
sample layout. The options' pages name only a combined format: depthFromDepthStencil "copies the
depth portion of a combined depth and stencil texture to or from a buffer", and
stencilFromDepthStencil "...the stencil portion...". bytesPerRow "needs to be: A multiple of the
source texture's pixel size, in bytes", and no page says what a pixel is at several samples. The
documentation is silent here, which is not the same as calling the result undefined. The answer
was measured:
- The conformance recordings buffer-depth-samples-s8-54-4, -s8-54-2, -s8-part-4, -d16-54-4 and
-d16-54-2 (Apple M3 Max, macOS 27.0.1, 3 runs each). Their validated field is "ran": Metal's API
validation let each case run. A script checked all five against the rule above with 0 samples
off it, the copy back equal to the input, and the part-4 row's other samples at 0x5a.
- A probe of our own (one Objective-C file of plain Metal on our own data, 54 x 54 at 4 samples,
each of the two formats and options), run plainly and under MTL_DEBUG_LAYER=1, with no
validation message, command buffer status completed and no error:
- Apple M3 Max, macOS 27.0.1: job m3-max-84400.
- Radeon Pro 5300M and Intel UHD Graphics 630, macOS 26.7.1 (25G241), run by the consumer: job
m3-max-84413.
All three devices agree exactly: 0 of 11664 (s8) and 23328 (d16) bytes differ on the copy back,
11664 of 11664 kernel reads follow the layout above (sample-minor), the copy back's sha256 is
the input's (42384bfd... s8, 852b4489... d16), and the reads' sha256 are the same on the three
devices (e63212e0... s8, 6d3cc97c... d16).
Verified: red on the job named in the hand-off.
The red commit's expectation of Imageblocks in the_imageblock_parameter_value_is_refused_where_it_is_read
took away the module's last use of LowerFamily, and -D warnings then failed the build on the unused
import (clippy, job m3-max-84479).
Verified: the next job's clippy and test lines.
The memory planner refused every read of the imageblock parameter's value before
access::select_param's ParameterValue arm, as Lowering(Access) PointerSource or PointerStore, so
that cause was never named. The planner now decides by the root, the parameter whose ABI role is
ParamRole::Imageblock, at its two sites:
- A pointer read out of an argument's aggregate (provenance resolve_walk): the imageblock
parameter's value is Imageblocks(ParameterValue). Any other argument's aggregate stays
PointerSource.
- A store of an aggregate that holds a pointer: when the stored value is built from the imageblock
parameter (through insertvalue, extractvalue, freeze, select and phi, each value visited once,
metered), Imageblocks(ParameterValue). Otherwise it stays PointerStore.
The PointerSource, PointerStore and ParameterValue docs say so. SEMANTICS_VERSION 2358: a
refusal's kind changes. REFUSALS.md regenerated, unchanged. No public type changes.
Verified, CPU-only potluck jobs at the pair's tip before its rebase onto development:
- m3-max-84488: the two red tests at the red commit, 0 of 2 passed (RED EXIT=100), and at the
tip 2 of 2 passed; metal2vulkan and metal2vulkan-air 3480 tests run, 3480 passed, 22 skipped;
metal2vulkan-validation 1349 passed, 3 skipped; conformance and runtime 1280 passed, 2
skipped; each EXIT=0.
- clippy --workspace --all-targets --all-features -D warnings: plain m3-max-84494, --cfg m2v_gpu
m3-max-84493, --cfg m2v_cpu_icd m3-max-84495, each EXIT=0.
- m3-max-84482: rustdoc -D warnings EXIT=0, the API reference check EXIT=0.
The planner's ruling for a multi-cause refusal: name its typed cause. The imageblock parameter's
value is refused by the memory planner before access::select_param's ParameterValue arm, as
Lowering(Access) PointerSource or PointerStore (job m3-max-84446), so a walk's counts could not
tell it from any other pointer source or store.
every_read_of_the_imageblock_parameter_s_value_names_it covers the six shapes that job read,
each checked by Unsupported::cause on every committed profile:
- extractvalue of the parameter;
- extractvalue through a freeze;
- the extracted pointer through ptrtoint;
- a store of the struct;
- a round trip through an alloca;
- insertvalue on the struct, then a store.
the_imageblock_parameter_value_is_refused_where_it_is_read now expects Imageblocks with that
cause, at the same place.
Expected red: all six give Access PointerSource or PointerStore today.
G1 (0ce2f39b71 and the stack through 848acada38) deleted the resident tables,
so every fixture now compiles under the one form the runtime ships. The
inventory still held the resident policy's answers. This bless records the one
form's: 252 rows, 2405 cells.
- ok -> refused: 1581 cells (forms only the resident tables built)
- refused -> ok: 588
- NeedsInput -> ok: 169
- NeedsInput -> refused: 67
The .ll rows match the moves devpolicy's comparison listed before the land
(job m3-max-84210). The .air.ll twins, which need metal-as, only the M3 covers.
Spot check against the golden table: the intersect kernels it already
refuses under IdentityDomains, and the ICB encode it already compiles, now
read the same here.
Verified: job m3-max-84596 (Apple M3 Max, macOS) ran bless_engine_inventory
at 848acada38: 1 passed, EXIT 0; the patch is this commit's whole diff.
What: the six read-through rows of known-gaps-rt.tsv (a8, heap-border,
heap-sampler, r32f, rgba8, rgba8-swizzled; venue *) take the answer the
translator now gives at their pipeline site, the identity refusal with
its cause: "...unreadable: false })): HeapResource; needs
NotImplemented" where the rows held "...unreadable: false })); needs
NotImplemented". Each row's gap names the cause too (IdentityDomains,
cause HeapResource: a texture handle that reads its table entry beyond
its element). No other file holds the old text (grep over the tree's
.tsv, .md, .rs and .json files). docs/CONFORMANCE-COVERAGE.md does not
move (coverage.py --check: as derived).
Why: G0 makes an identity-domains refusal name the form it met
(IdentityCause), so the six rows no longer matched the replay: the
lavapipe replay at da29ee6b55 (job m3-max-84580) reported 12 ledger
drift lines, each of the six "refused ... does not list it" and "no
longer refuses ... still lists it", and EXIT=1.
Verified by job m3-max-84585 at this commit's tree, on lavapipe
(llvmpipe, LLVM 23.1.1, 256 bits; Mesa 26.2.4): the conformance binary
builds (EXIT=0), and `LP_NUM_THREADS=1 conformance replay --cpu` reports
0 ledger drift lines and EXIT=0.
What: rustdoc's private pass (cargo doc -p metal2vulkan --all-features
--no-deps --document-private-items, -D warnings) found nine links to items
G1 deleted. Each sentence is rewritten to what is true now; nothing is
re-added or re-exported.
- lower/access/dynamic.rs: the module doc's wide pointers are the device
address they hold (a u64, their Metal address), a wide parameter its
slot's address read where it is needed; the root table, resident-set
search, sink and containment paragraphs go, and loads, stores, compares,
null constants, atomics and memory intrinsics through a wide pointer are
described at the address, unchecked. param_value's doc says it reads the
slot's address (emit_entry is gone).
- lower/access/handle.rs: a heap texture handle is the resource ID's index
masked below the set-1 arrays' length, with the alpha flag and the
texture-buffer word bits where the function uses them, and a heap
sampler handle is its resource ID with an out-of-range index replaced by
0; no handle or sampler table is searched (HandleTable::lookup is gone).
- lower/access/psb.rs: Reach::Rounded is the 4-aligned address PsbMem::at
takes, for a wide pointer's access and a function table's entry
(psb::prepare is gone).
- lower/sampler/bicubic.rs: an 8-bit sRGB texture's bicubic taps are the
device's decode through the slot's sRGB view (the raw-code path behind
Bicubic::raw is gone).
- lower/texture/emit.rs: the three swizzle helpers name swizzle_lanes,
whose doc now states the swizzle word's fields (swizzled is gone).
runtime-sources.sha256 does not move: none of these files is a pinned
runtime source.
Verified by job m3-max-84530 at this commit's tree: the private pass
(RUSTDOCFLAGS=-Dwarnings, CARGO_TERM_COLOR=never, cargo doc -p <crate>
--all-features --no-deps --document-private-items) is EXIT=0 with 0
diagnostics for each of metal2vulkan, metal2vulkan-air,
metal2vulkan-runtime, metal2vulkan-validation, metal2vulkan-conformance,
metal2vulkan-devtools and metal2vulkan-harness, and the public rustdoc
(cargo doc --workspace --all-features --no-deps, -D warnings) is EXIT=0.
At the parent, job m3-max-84501 listed the nine (metal2vulkan EXIT=101,
9 diagnostics; every other crate 0).
every_device_loads_through_a_select_of_a_typed_atomic_s_slot_and_another made the
ADDRESSED_AND_VIEWED state on every device, but its `ulong` add is a 64-bit buffer atomic, which
Vulkan's shaderBufferInt64Atomics answers (a rule 2 query). KosmicKrisp on the M3 Max does not
offer the feature, so the translator refuses the state there, Int64Atomics needing
ShaderBufferInt64Atomics, and the test panicked in its state helper (pin T's Mac leg, job
m3-max-84350: "Apple M3 Max: plain: refused: unsupported: Int64Atomics; needs
AnyOf([[Feature(ShaderBufferInt64Atomics)]])", then "the translator made no pipeline of
addressed_and_viewed").
The test now reads the feature from the translator's profile (what device creation enabled).
Without it, it asserts the state's refusal, Error::Translation of Unsupported Int64Atomics needing
AnyOf([[Feature(ShaderBufferInt64Atomics)]]), and runs nothing; with it, it runs today's value
checks. The 64-bit add stays: a typed atomic (a u64 one, or a native f32 add, which needs a feature
too) is what moves its slot to its device address, the shape under test. A third leg opens each
device without shaderBufferInt64Atomics (without_int64_atomics), so every device, lavapipe in CI
included, runs the refusal branch, and each device that has the feature runs the value checks in
its own form and in the address form.
The same assumption elsewhere: no other device test in the runtime, harness or conformance crates
uses a 64-bit atomic (searched for `atomicrmw ... i64`, `air.atomic.*.i64`, `atomic_ulong` and
`atomic<ulong>` in their sources, and in the 58 engine and example fixtures their tests load).
Verified: the observed red is pin T's Mac leg, job m3-max-84350 (KosmicKrisp 26.3.1 on the M3
Max), quoted above. Green on lavapipe (llvmpipe, LLVM 23.1.4, 256 bits), job m3-max-84503: the
test passed, printing its own form and the address form reading both slots, and the leg without
shaderBufferInt64Atomics "the state is refused, Int64Atomics". Green on the Iris Xe (RPL-P, ANV),
job m3-max-84505: the same, its own form the bound form. The M3's proof comes from the next
round's Mac leg.
Three tests check refusals by Unsupported::cause, the field, not the text:
- an_imageblock_of_no_cell_layout_is_refused_naming_its_layout: a kernel's explicit imageblock
whose air.arg_type_align_size is 3, not a power of two, is Imageblocks(Layout) on every
committed profile.
- a_cell_pointer_not_made_by_imageblock_data_is_refused_naming_it: an imageblock-space pointer
made by inttoptr in a kernel is Imageblocks(CellPointer).
- the_front_end_s_imageblock_refusals_are_the_multisample_operations: the front end refuses by
the Imageblocks feature exactly four undecoded names (air.get_imageblock_samples,
air.get_imageblock_num_colors, air.get_color_coverage_mask, air.store.implicit_imageblock.mask.),
and the translator names each MultisampleOperation. A name outside that list
(air.get_imageblock_coverage) is already a refusal of its own, Feature::UnknownIntrinsic with
no cause. So the test asserts that, and no fix is needed. A fifth name added to the list fails
the test, so its cause is decided then.
ParameterValue has no test here. Six IR shapes that read the imageblock parameter's value were
each refused first by the memory planner as Lowering(Access) PointerSource or PointerStore:
extractvalue, freeze, ptrtoint, a store of the struct, a round trip through an alloca, and
insertvalue. None reached access::select_param's ParameterValue arm.
Evidence for two commits already on development:
- 71a5393966 (its body says "Verified: pending"): job m3-max-84253 (CPU). In the red tree, all
crates at 97426a89e4, 3 tests ran and 3 failed; at the tip c5affc2ae8, 3 passed.
- e498cbaa54 ("the field check's run follows"): the same job, m3-max-84253, and the audit lane's
m3-max-84368 (94 tests, nextest exit 0).
Verified: job m3-max-84446 (CPU) passed the three tests at the same test code, and printed each
probed shape's refusal.
What, in tests only:
- a_slot_bound_inside_an_allocation_stores_its_metal_address keeps its
form assertion on all three profiles and runs its allocation arm only
where slot 0 is at its device address. The harness places a slot
inside an allocation only there; a bound view's buffer is the binder's
to place.
- stored_pointers_are_guest_addresses_that_resolve_back tests the null
pointer it reads back before reading through it. Under the one form a
loaded pointer is used as given, so a read through null is Metal's
undefined read; development's zero came from the resident tables. Its
volatile counts follow b2's planned form: two words through a view,
one u64 at a device address.
- static_pointers_convert_to_their_metal_addresses counts each stored
address the same way, by b0's planned form.
Why: each was hidden in the G1 runs by an earlier census assertion in the
same test, and failed in its translator suite once those were ported.
Verified by job m3-max-84364 at this commit, on G1's stack over
development ed75c57d5d: the three tests fail at the commit before (3 of
3) and pass here (3 of 3); clippy plain, m2v_gpu and m2v_cpu_icd EXIT=0;
translator 2617 run, 2608 passed, 9 failed (the golden table and the 8
inventory parts, which wait for their bless), 20 skipped;
air/rt/devtools/harness 872 passed, 4 skipped; validation 1348 passed,
2 skipped; conformance 1053 passed; doctests 2 passed; rustdoc clean.
Under the one form every order key orders nothing, so order_specialized runs
lower::access::quad::sink after the lockstep pass. The lockstep pass and the
specialization weigh their work explicitly (weights::LOCKSTEP, ::SPECIALIZE);
the sink took the weight of its caller. A compile asks for the order under
compile_bounded's weights::REST (10 sixteenths a unit); a creation's partition
check (kernel_observes_partition) asks outside it, at a whole unit a tick. The
check's StageEntries keeps the order with what it charged, and the compile that
finds it spends that charge, so the shared compile paid the sink's work at 16
where its own compile pays 10: library_entries_decode_once's
a_partition_check_and_the_kernels_compile_order_its_entry_once read 30535 work
units through the kept order against 30510 alone (job m3-max-83989, moltenvk-m3).
On development the resident form ordered, the sink did not run, and the two
agreed.
The sink now weighs weights::REST wherever it runs: a lone compile's charge is
unchanged, and a check's sink is charged as a compile's. No output changes, so
no SEMANTICS bump.
Verified: pending (the test above, in the next G1 job).
lower::sync::memory_model's contract says a coherent access through a device address has no
variable to decorate, so it needs the Vulkan model on every profile. A wide pointer's coherent
access selected the model itself, and an interlocked body that reaches a slot at its device address
did once the slots were placed (finish_interlock), but a function whose `*_coherent` accesses took
the GLSL450 form on a profile without vulkanMemoryModel and its device scope, and that reaches a slot
at its device address, kept GLSL450: its storage buffers decorated Coherent and its device-address
accesses plain, with no coherence at all.
The slot rule now covers both: finish_coherent_slots (finish_interlock renamed) selects the Vulkan
model for an interlocked body or a function whose coherent accesses took the GLSL450 form, where a
slot is reached at its device address, and check refuses it on a device without the model,
Unsupported{CoherentMemory, AnyOf[[VulkanMemoryModel]]}, as for the interlocked body. One rule, the
documented one; no decoration form beside it. Floor devices are unchanged: the floor requires
vulkanMemoryModel and its device scope, where coherent_access already takes the Vulkan model.
The refusal is an existing variant and text: refusal_surface.py --check passes with no change
(run locally). The stack's SEMANTICS 2351 covers the changed outcome.
Verified: (jobs named in the READY).
Without the Vulkan memory model a function's coherent accesses take the GLSL450 form: plain
operands through resources decorated Coherent. A PhysicalStorageBuffer access has no variable to
decorate, so where a kernel reaches its buffers at their device addresses (every buffer argument
of a kernel without the bound form) such an access had no coherence and still compiled, though
lower::sync::memory_model's contract says it needs the Vulkan model on every profile, as an
interlocked body that reaches a device address does (finish_interlock).
volatile_under_the_vulkan_model_adds_only_volatile runs its GLSL450 arm on a below-floor profile
whose kernel binds its buffers (amd-780m-hawkpoint-radv without vulkanMemoryModel and its device
scope; lavapipe binds none, its maxStorageBufferRange) and now asserts that one reaching its
buffers at their addresses ("runtime-floor without vulkanMemoryModel") is refused,
Unsupported{CoherentMemory, AnyOf[[VulkanMemoryModel]]}.
Red at this commit: the runtime-floor arm compiles (job m3-max-83747, before the change, met it
as "Load through %86: not Coherent under GLSL450"; the run at this commit is named in the READY).
Switch::name named a switch-at-use by its first arm's strategy, matching only the plain read,
write, atomic, query, null test, sampling and absent-argument strategies. Under the identity
domains a texture buffer's read, write and width query are lower::texture::words accesses
(TextureStrategy::Words), so a switch over texture buffers fell to "texture.null.switch", a name
that says nothing of the check its arms take. It now looks through a Words arm to its access
through its own view (Words::native), whose check it takes: texture.read_clamped.switch,
texture.write_guarded.switch and the others as for a plain texture buffer. One form: no words
family of switch names.
What the name reaches: the census only (FunctionArtifact::strategies, the validation coverage
report's strategy names). No SPIR-V word and no cache key carries it, so golden hashes do not
move; a cached artifact carries its census, and the (a) landing's SEMANTICS and ARTIFACT_FORMAT
bumps already invalidate every cached artifact, so no bump of its own. Coverage moves
texture.null.switch counts of texture-buffer switches to their read and write names.
Verified: (job ids added at the READY).
Under the identity domains a texture buffer's read, write and width query are
lower::texture::words accesses (TextureStrategy::Words), and Switch::name matches only the
plain strategies on its first arm, so a switch-at-use over texture buffers falls to
"texture.null.switch". a_switch_is_named_by_the_check_its_arms_take now collects every wrong
name before it fails, so its TexelRead and TexelWrite rows both show, and its doc says a texture
buffer's access is named by its access through its own view.
Red at this commit: the TexelRead row on runtime-floor without image robustness reads
[("texture.null.switch", 1)], not texture.read_clamped.switch (job m3-max-83747, lavapipe ICD,
compile only, the row the test met first before this change).
Every device now compiles the identity domains, the one form: a kernel's
buffer arguments are bound as storage buffers of set 0 where the device
binds them (DeviceProfile::binds_kernel_buffers) and are reached at their
device addresses elsewhere, as every other stage's are; vertex attributes
are fetched by fixed-function vertex input; textures and samplers are
elements of the identity arrays of set 1, named by their resource IDs.
What the one form does not lower is a typed refusal,
Unsupported{IdentityDomains, NotImplemented} with the IdentityCause the
previous commit names.
Deleted, with everything only they reached:
- the device policy (device/policy.rs) that chose the resident-table
domains, and the resident root table, handle table and their facts;
- the heap raw reads (lower/sampler/heap_raw.rs, lower/texture/heap_raw.rs),
sampler footprints, bind/texel_parts.rs and bind/status.rs;
- the lockstep orders' barrier tiers, which no order key adds now
(OrderKey::of orders nothing).
Tests: 274 tests that only the resident-table policy compiled (development's
DevicePolicy::RESIDENT_TABLES, which only tests built) are deleted, among
them 15 whole files (argument tables, cross-class, device replay, dynamic
roots, two extended-range files, image shapes, mesh barriers, profile F,
separate samplers, sparse unmapped, tile, wide, sweep and the footprint
tests); each deletion's reason is listed with the READY. The others are
ported to what the one form compiles and names today: census names,
push fields, refusals with their causes, and run values. A new interpreter
harness (tests/identity_harness.rs) binds a dispatch's buffers at device
addresses and its textures as identity-array elements. Census naming is
unchanged. The validation tests that read compiled modules (coverage,
companions, the authored compile census, specialization) assert the one
form's present strings. The extended-range levels and volume tests, whose
mip filters development built under the resident tables, become two tests
of the one form's answer, which is development's default policy's: a 2D or
3D sample of an extended-range slot texture is refused, TextureState
(lower::texture::identity_class holds no class for it); a padded form's 3D
sample stays the lowering's NotImplemented(Format). Development's new
thread-local test binds through the one form's harness, and its
handle-web test (every_handle_web_an_instruction_observes_is_refused)
compiles on the default profile.
SEMANTICS_VERSION 2355 and ARTIFACT_FORMAT_VERSION 607 (cached
translations and artifacts change). docs/REFUSALS.md is regenerated and
runtime-sources.sha256 is pinned at this tree.
Verified at the stack's tip, which differs from this commit only by the
five commits after it; the jobs and their results are named in the READY.
The one form samples through the identity domains' sampler arrays: a
function loads a sampler (or an element of a sampler array) and combines
it with an image by OpSampledImage, which the interpreter reported as
unmodelled, so no test could run such a module. The image model reads no
sampler state, so a sampler global (or an array of them) is now
GRoot::Sampler / Root::Sampler: loading it or indexing it yields the
stateless sampler, a byte access to it is malformed, and OpSampledImage
of an image and a sampler is the image, as OpImage of a combined image
sampler already was. Sampling itself is still not modelled; an exact
fetch through a sampled image runs.
Test-only (crate::spirv::interp); no product output moves. Verified by the
G1 suites that run the sampled modules through it (jobs m3-max-83989,
m3-max-84055, translator nextest).
Feature::IdentityDomains with Needs::NotImplemented covered every form the
identity domains do not lower behind one name; only a diagnostic symbol
said which, and slot.rs's refusal of a storage texture access without its
bound format named nothing. An identity refusal now carries
Cause::Identity(IdentityCause), one variant per refused family, the way an
access or tessellation refusal names its cause; sites that refuse the same
family share a variant, none is named by a file, a line or a string of its
own:
- ObjectOrMeshStage: a function of a stage other than a kernel, vertex or
fragment function (select.rs identity_refusal).
- Descriptor: a buffer argument not reached through its device address, or
a descriptor beyond a bound kernel's storage views (identity_refusal).
- EncoderValue: a push field the identity window does not carry
(identity_refusal).
- HeapResource: an argument buffer's texture of a type or handle class the
identity arrays hold no element for, read as raw extended-range texels,
decoded, read through another numeric type, or through a handle that
reads its table entry beyond its element (identity_refusal; link.rs's
handle-class binding).
- TextureState: a texture argument of a type the identity arrays hold no
element of, or state of a bound texture or sampler beyond its resource
ID (identity_refusal; sampler/mod.rs's identity sampling of a type with
no identity class).
- SamplerState: a sampler the identity sampling does not take, a minimum
level or emulated filter the function specializes, a 1D bicubic filter
(identity_refusal), and a reached anisotropic slot sample
(sampler/anisotropic.rs).
- ConstantBlob: constant data past the module's bound read through memory.
- SeqCstFence: a sequentially consistent fence (sync/barrier.rs).
- StorageTextureFormat: a storage texture access the device takes only
with a declared format, whose bound format no input names
(texture/slot.rs, which named no form before).
The diagnostic symbols stay. The device-level refusal of a device without
bufferDeviceAddress and shaderInt64 (derive.rs) names its needs and no
cause. Feature stays IdentityDomains, so validation's outcome key and the
census are unchanged, and the golden and engine table cells (feature and
needs only) do not move; no version bump.
Tests: the error module's Display test of an identity refusal with and
without a symbol; the cause asserted at the 1D bicubic, the storage texture
without its format, the constant blob, the seq_cst fence and the texture
argument refusals (engine_identity) and the replay variant's encoder value
(pipeline/compile tests).
api_signatures blessed (IdentityCause, Cause::Identity), api_surface lists
the enum, REFUSALS.md regenerated (the sites are built through
error/mod.rs's Unsupported::identity), docs/API.md's error table and the
identity domains' paragraph name the cause. runtime-sources.sha256
unchanged: no runtime input is edited.
Consumer uses (consumer-uses.sh, read-only, over the consumer's
development 90214271ed and its lane tips of the last day): IdentityCause,
Cause and IdentityDomains, 0 hits. The consumer reads Unsupported::cause
only through its Display (rt_platform diag.rs refusal_name, unbuilt.rs),
so an identity refusal's name there now carries its cause.
The README's list of the forms the identity domains do not lower named none of four structures the
golden table refuses with Unsupported{IdentityDomains} on every profile, so a reader of the known
gaps could not tell they are refused. Each now has its entry, beside the form it is nearest:
- a fragment function over its tile's threadgroup memory (`engine/cfit_fragment_tile_memory`, four
entries). Its entry says no guest of the consumer's can ask for one: Metal's feature set tables
give tile shaders and imageblocks from the Apple4 family, and the consumer's guest device answers
no Apple family on both its guests (reims-vgpu's graphics/device_info.rs at bb8738f7eb:
`cap_apple_families`, "today no for every one", and `supportsTileShaders` and
`supportsImageBlocks` answered no);
- the residency of a sparse operation on a texture that is not sparse (`engine/a2_sparse_status`);
- a bicubic sample of an extended-range texture through repeat with a constant texel offset
(`engine/xr_bicubic`'s `xrb_repeat_offset`, the only refused entry of that fixture);
- Metal 4.1's read(sampler, coord) of an argument buffer's texture (`engine/kernel_read_through`'s
`rt_heap_zero`, `rt_heap_ow` and `rt_heap_arg`).
The refusals are the golden table's cells at this commit's parent (15 of 15 profiles for each
entry). Which form each one's symbol names is not asserted here, so each entry cites the golden
table and quotes no symbol.
Verified on the CPU with no device, job m3-max-84445 at this commit's tree: cargo fmt --check 0
and the workspace's rustdoc with -D warnings 0. The golden cells are read from
crates/metal2vulkan/tests/golden_hashes.tsv at the parent; the consumer's answers from its
development branch, read-only.
The planner widened the job-id rule from the published crates' rustdoc to the four prose docs a
reader takes measurements from. Each lab job id (m3-max-NNNN, and the bare job numbers beside
them) and each commit sha comes out; the ids stay in the commit messages that already carry them.
A measurement keeps the card, driver and OS its sentence names. Where an id was the only basis a
sentence named, the sentence now says what was measured and on what:
- the runtime README's identity-domains paragraph cited five plays of recorded streams; it now
states what the states-only plays of the 26 kept replay streams on lavapipe show: each makes
every pipeline state its stream makes, and none of their render or compute states is refused,
a refusal under the identity domains among them (the plays of jobs m3-max-83458, -83494, -83695,
-83889 and -83954, each printing refused 0);
- the probe lists name the cards ("probes on the RTX 3090, the Iris Xe, lavapipe and the RX 7900
XTX"; "probes on a Radeon Pro 5300M and a UHD Graphics 630, both macOS 26.7.1");
- sentences that compared runs by id compare them by order ("failed in one run and passed in two
others"), and "the same job" is "the same run";
- "rt at <sha>" and "players built from <sha>" become what that build was ("a build of the runtime
that copied a texture over any import"), or go where the card and driver already say it;
- VALIDATION.md's harness count reads "the harness on lavapipe".
Two README tables lose their Job column (the import-cost table and the guest-buffers table). The
edited paragraphs are rewrapped at 100 columns; a token diff against the parent shows only the
ids, the shas, the two columns and the rewordings above.
submit.rs's three citations of two probe commits (06860a3848 and b15b306d2f) become "measured
with a probe build of the runtime" (and, for the split probe, "that timed each command buffer");
the IN_FLIGHT and infos comments are rewrapped at 100 columns.
So it does not grow back, scripts/api-docs first fails when the four docs name a job id
(`m3-max-NNNN`, or `job NNNN`); CONTRIBUTING.md, API.md's description of the script and ci.yml's
comment on its step say so.
docs/CONFORMANCE-COVERAGE.md is unchanged: its generator has no job column. Its 1772 lines with an
id are all in its last section, The ledger, which quotes the last field of known-gaps-rt.tsv; the
ids are in the ledger's own sentences, which the ruling keeps out.
Not widened, per the ruling: the ledger, known-gaps-rt.tsv, results.py, test comments and the
unpublished crates. The OS is not added to measurements whose sentence named a card and driver
but no OS.
Verified on the CPU with no device, job m3-max-84430 at this commit's tree: cargo fmt --check 0;
the workspace's rustdoc with -D warnings 0; scripts/api-docs 0, and 1 with a job id planted in
docs/VALIDATION.md, naming the planted line (the tree clean after its restore); the refusal
surface's --check 0; the 13 tests that read these docs passed (feature_enables, the floor, the
accepted differences, the precision-note catalogue, the consumer's objects and the guide's
example). Before the commit, no line of the four docs matched the check's pattern, and rustfmt
--check passed on submit.rs.
What: every_handle_web_an_instruction_observes_is_refused
(src/tests/engine_handle_words.rs) also counts the word webs the memory
analysis finds (`memory::plan::analyze_memory`'s `words`, through a new
helper `webs`, built as engine_word_phases.rs's `proven` builds its
plan): two in the control, where no instruction observes the two webs,
and none in each form that observes them (a compare of the two words
either way round, their difference, one web's word compared with a raw
resource ID).
Why: the test b5f7a1b805 added passes with and without that commit's
fix (its own message: 8 of 8 both ways), as AGENTS.md's "add a test or
a measurable check that fails without the fix" asks otherwise. The
refusal cannot tell one web spoiled from both: whichever web the old
loop left planned, the other's sink refuses the module with the same
Lowering(Access) / HandleUse. The analysis's count can: the old loop
spoiled only the web of an instruction's last operand, so each
two-web form left one web.
Verified on the CPU with no device. Job m3-max-84234, at this commit
on its first base (c887b9b7e9): the test at the fix's parent's
memory/provenance/words.rs red (1 failed, EXIT 100), green at this
commit (the 8 engine_handle_words tests passed); fmt, signatures, clippy
in the three configurations, rustdoc, private rustdoc, api-docs and the
refusal surface 0; the product suites 3756 passed, 24 skipped, 1 failed:
the golden table, which that base's blessed table did not match before
pin U's bless (this commit changes no product source); validation 1349
passed, 3 skipped; conformance 1053 passed; doctests 0. Job
m3-max-84368, at this commit rebased onto ed75c57d5d: the observed-webs
test, the L156 tests and the golden table, 94 tests, none failed. No
product source changes, so no SEMANTICS_VERSION bump and
runtime-sources.sha256 is unchanged.
What. The 28 rows of pixel-samplers-rgba8-linear-mirror and -rgba16f-linear-mirror at their
`slot` and `arg` sites (four sites on each of the seven venues) gain one sentence: Metal leaves
the sample undefined, so the difference is no wrong answer against documented Metal (rule 1).
Why. Apple's MTLSamplerDescriptor normalizedCoordinates page, as fetched: non-normalized
coordinates "should only be used with 1D and 2D textures with the following conditions;
otherwise, the results of sampling are undefined": the clampToEdge or clampToZero address mode,
the notMipmapped mip filter, equal minFilter and magFilter, and a maxAnisotropy of 1. MTLSampler.h
names ClampToEdge alone. These cases sample a pixel sampler under mirrored repeat. Of group C's 22
KosmicKrisp sites, the 18 pixel-downscales sites (clamp to edge, linear, not mipmapped) stay a
wrong answer of ours; these 4 are not one.
docs/CONFORMANCE-COVERAGE.md re-run with coverage.py: unchanged (its table shows each row's first
words).
Verified: 28 rows changed by script, 4 a venue on seven venues; the conformance suite runs on this
commit (job named in the hand-off).
What. The KosmicKrisp venue (Apple M3 Max) reads 22 sites as ours, not the device's
(5eeeb8d752): pixel-downscales frac/slot head, tail and digest at seven sizes (18), and
pixel-samplers-rgba8/rgba16f-linear-mirror slot and arg (4). The texture slot's runtime pixel
sampler hands the device's normalized sampler the pixel coordinate over the size, and that
quotient's rounding moves the linear filter's weights. KosmicKrisp's filter is Metal's, so its
controls isolate the quotient: `norm` (and `const`) give Metal's answer there, `slot` (and `arg`)
do not. The same 22 sites on lavapipe, NVIDIA, the RX 7900 XTX, the 780M, the RX 550 and the Iris
Xe still said "The device's own answer (rule 1)". This commit rewrites those 132 rows' words; no
row's case, venue, verdict, site or answer changes.
- pixel-downscales, 18 sites a venue (108 rows): "Ours, on top of the device's filter". On every
one of the six venues `slot`'s frac digest is not `norm`'s, where Metal answers the two alike,
and `norm` differs from Metal's by the device's own filter. Each venue keeps its own bounds
(lavapipe 2/255; NVIDIA 1.19/255 slot, 0.83/255 norm; RADV 0.88/255 slot, 0.031/255 norm; Iris
Xe 0.95/255 slot, 0.031/255 norm, and its grid/ulp one-ulp element).
- linear-mirror on the three RADV venues (12 rows): ours, on top of the device's filter; there
`arg` and `slot` share one digest and `norm` has its own.
- linear-mirror on lavapipe, NVIDIA and the Iris Xe (12 rows): left the device's answer, with one
sentence added. On those venues `slot` and `arg` answer `norm`'s digest, so the controls show
nothing of ours there; the quotient KosmicKrisp shows to be ours does not move these devices'
answers. Calling these rows ours would claim more than the controls show.
The frac/slot sites KosmicKrisp answers as Metal does (1000x1080 tail, 1366x1080 head and tail)
are not group C's and keep their words.
Why. A row's words say whose difference it is; a stale reading hid that this one is a wrong
answer of ours against documented Metal (planner, L371 group C: first the truth, then the fix).
docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py); --check
reports it as derived.
Verified: the 132 rows found by case and site from the KosmicKrisp replay's 22 lines (job
m3-max-82685's kept output) and rewritten by script, 22 a venue; the conformance suite runs on
this commit (job named in the hand-off).
What: every lab job id (m3-max-N) in a doc comment of the three
published crates' product sources is removed: 91 ids, and one list
written as a range and bare numbers, on 72 lines over 17 files. The
card, driver, OS and probe each sentence already names stay. Each
changed sentence is rewrapped at 100 columns from the id's line to its
paragraph's end. docs/REFUSALS.md is regenerated: its Basis column
carries those doc lines' evidence (14 rows).
Why: the planner's rule. Docs say the measurement (card, OS), not our
job numbers. The ids stay in the commit messages that already carry
them. A token comparison of each file against its parent shows only id
phrases removed: "(job m3-max-N)", ", job m3-max-N", "potluck job
m3-max-N", "(m3-max-N)" and id lists of the same forms. One line that
held only "(job m3-max-49358)." in submit.rs is folded into the line
above it.
Not changed here: the runtime README (217 lines with ids), docs/API.md
(20), docs/REPLAY-STREAM.md (2), docs/VALIDATION.md (1),
docs/CONFORMANCE-COVERAGE.md (1772, generated from the conformance
ledger), plain // comments (blit.rs 3, conformance cases 3, tests 5),
test modules' and unpublished crates' doc comments.
Verified: refusal_surface.py --check passes. basis.rs regenerates
unchanged. runtime-sources.sha256 is unchanged (44066e69...): none of
the files is its input. rustfmt --check passes on each file. Rustdoc,
private rustdoc and api-docs in the job the READY names.
What: new_heap_texture's Err list, heap_source's, and Gap::HeapTexture's
own doc name imported blocks (Device::import_host_memory, and on Unix
the dma-buf imports) beside exported ones, by form. On a device with
unified memory a texture in an imported block is Gap::HeapTexture. On
one without it, an imported block is Shared, so its texture is an image
of its own, as in any Shared heap.
Why: heap_source makes a Shared block's texture an image of its own on
a device without unified memory before it tests whether the block's
memory is its own. An import is a Shared block with memory of its own
(memory.rs: Own::Import is MemoryClass::Shared). So since 71b5a07856 an
imported heap's texture is made on a discrete card and refused on an
integrated one. The docs named only exported blocks for
Gap::HeapTexture, which left the import case unsaid in both forms. The
consumer makes heaps over the host's memory.
Verified: docs only; job m3-max-84317, on the CPU with no device: fmt,
workspace rustdoc, the runtime's private rustdoc, scripts/api-docs and
refusal_surface.py --check, all EXIT=0. docs/REFUSALS.md and basis.rs
regenerate unchanged. runtime-sources.sha256 is unchanged (44066e69...):
texture.rs and error.rs are not its inputs.
What: the `metal-measured` basis (refusal_surface.py's vocabulary, and
`RefusalBasis::MetalMeasured`'s doc, which states it for the API) now
says that Metal's API validation stopping the call counts: documented
Metal then defines no answer to it, whatever plain Metal does without
the validation. docs/REFUSALS.md is regenerated with it.
docs/VALIDATION.md's device-test part gains one sentence: the bound form
of a compute function's buffer arguments has its evidence in the device
tests on real cards whose query takes it (each test's `M2V-FORM` line,
`tests::pool_reach`'s assertion of the form the query chose), and CI's
lavapipe legs take the address form, since lavapipe's
`maxStorageBufferRange` of 128 MiB is below the 2 GiB and 15 bytes the
query needs there.
Why: the definition said "Metal itself refuses the input", while
runtime refusals declare `metal-measured` on the strength of Metal's
validation layer stopping the call (in error.rs, among them
IndexedPatchDrawWithoutIndexType, PatchIndexBufferOffset,
ViewportNotFinite and StencilAttachment), and the
conformance allowances say a validation stop "is not Metal refusing it"
for their own verdict. The two answer different questions; the
definition now says which one the basis answers. The lavapipe sentence
records that CI's lavapipe legs never run the bound form, so a reader
of a green lavapipe leg does not take it as that form's evidence.
The numbers: job m3-max-84123 (lavapipe, release, three runs a
workload) printed `bound_dispatches_per_run` 0 for all 48 harness
workloads, and `address_dispatches_per_run` above 0 for the 43 that
dispatch. lavapipe's limits are those of the committed lavapipe
profiles (maxStorageBufferRange 134217728, minStorageBufferOffsetAlignment
16, so the query needs 2^31 + 15).
Verified: refusal_surface.py --check passes, and the regenerated
basis.rs is unchanged; runtime-sources.sha256 unchanged (error/mod.rs is
not an input: 44066e69...). Rustdoc in the docs job the READY names.
an_imageblock_slice_writes_an_argument_buffer_texture checked for the text "Imageblocks:
SliceWrite;", but a refusal that names its intrinsic prints it after the feature ("Imageblocks
(air.write_imageblock_slice_to_texture_2d.i16.v4i16): SliceWrite; needs NotImplemented"), so
the text check failed on a refusal whose cause was SliceWrite. The test now compares
Unsupported::cause with Cause::Imageblocks(ImageblockCause::SliceWrite).
Verified: job m3-max-84245 (CPU) printed the refusal above, cause SliceWrite, with the text check
failing; the field check's run follows.
Feature::Imageblocks covered about ten structures with one untyped refusal, so a walk's counts
could not tell them apart. Each site now names the structure it met, in Unsupported::cause
(Cause::Imageblocks), as Cause::Access and Cause::Tessellation do:
- MultisampleOperation: the front end's undecoded multisample operations (get_imageblock_samples,
get_imageblock_num_colors, get_color_coverage_mask, the masked implicit store), set where the
front end's refusal converts;
- Stage: an explicit imageblock or an imageblock intrinsic outside a kernel or tile function, or
an imageblock view outside a fragment function (param_family, use_imageblock);
- TwoImageblocks, DataSize, Layout: why the planner gives the kernel's explicit imageblock no
region (more than one; no or zero data size; an alignment that is not a power of two, cells past
4 GiB, or an unaliased explicit one beside the implicit one). The planner's imageblock() returns
the cause and ArenaLayout keeps it (imageblock_refused) for use_imageblock to refuse with;
Missing where the kernel declares no imageblock at all;
- DataOperands: air.imageblock_data operands other than (coord, 0, 0);
- ParameterValue: the imageblock parameter's value selected (access::select_param);
- CellPointer: an imageblock-space pointer that air.imageblock_data does not make, outside a tile
function (the planner);
- FragmentData: a fragment function's [[imageblock_data]] input (fragment::select_param) or
output (stage_io);
- SliceWrite: a slice write of a shape not modelled (texture::select, texture::slice).
Golden tables are unchanged (their outcome text names no cause). REFUSALS.md regenerated, the
signatures table blessed (ImageblockCause, Cause::Imageblocks), the api_surface list and
docs/API.md's Unsupported row name the new enum. SEMANTICS_VERSION 2354 (main renumbers at
landing): a refusal's text changes. runtime-sources.sha256 follows from the job.
Verified: pending (the red tests and the suites).
The planner's rule for a refusal kind of several causes: it carries a typed cause, by the
structure met, so a walk's counts tell them apart. Feature::Imageblocks covers about ten.
each_imageblock_refusal_names_its_cause reads the cause from the refusal's Display (the form the
consumer's counts line keys on): a kernel's explicit imageblock of data size 0 (DataSize), two
explicit imageblocks (TwoImageblocks), an air.imageblock_data index operand of 1 (DataOperands),
air.get_imageblock_samples (MultisampleOperation), and the owned fixture's fragment imageblock
entries (FragmentData). imageblocks_are_refused expects Missing (a query with no imageblock), and
the integer heap slice SliceWrite.
Expected red: no Imageblocks refusal names a cause yet.
The known-gaps row of Shared heap textures gains the integrated card's line beside the RX 7900 XTX
and RTX 3090 lines: on a device with unified memory the form is unchanged, the texture placed in
its heap.
Verified: Iris Xe Graphics (Mesa 26.2.6) job m3-max-84238, the build before the form alternated
with this one: the shared-heap device test fails before (the two-copies view) and passes with it,
in both views; the texture-buffer heap test passes in both trees; sampling a 4096x4096
RGBA16Float texture took 24.697 and 28.540 ms in a Shared heap against 24.673 and 28.533 ms in a
Private heap (before, 31.107 and 24.650 against 31.164 and 24.671), each a median of 7 command
buffers.
The known-gaps row of Shared heap textures gains the form's measured speed beside the earlier
system-memory row: the same 4096x4096 RGBA16Float sampling kernel, Shared heap against Private
heap, the build before the form alternated with this one in one job.
Verified: RX 7900 XTX (RADV, Mesa 26.2.6) job m3-max-84221: before 203.355 and 203.266 ms against
2.093 and 2.096 ms (97x); with it 2.107 and 2.104 against 2.108 and 2.106 ms. RTX 3090 (NVIDIA
620.70.06) job m3-max-84144: before Gap::HeapTexture; with it 1.907 and 1.913 against 1.912 and
1.912 ms. Each a median of 7 command buffers, two rounds.
The L21 ruling, the third use of rule 2's unified-memory query (Vulkan's device type). On an
integrated or CPU device a Shared heap's image texture lies in its heap, as before. Elsewhere it is
an optimal image of its own in device memory, made as new_texture makes one but not zeroed (Metal's
heap textures are not), and its heap range is left unused. Before, a discrete device either
refused the placement (Gap::HeapTexture where its optimal images take no Shared type: the RTX 2080
and 3090 on NVIDIA 620.70.06) or bound the image in system memory, which every read crossed the
link for (97 times a Private heap's time on an RX 7900 XTX, job m3-max-79841).
How: heap_source decides by core.unified_memory() and the block's class. The own form checks the
placement against heap_texture_size_and_align's answers by the same rule the in-heap form uses
(heap_place, factored out of make: a heap range past its block, a texture past the heap's end, a
byte off the alignment are Refusal::HeapTexturePlace), then makes Source::HeapOwn: Bind::Pooled
(a place in a texture block or an allocation of its own, which spills as a texture's does), the
heap's hazard id kept, no alias Placement, and Under::Heap with at None, so use_heap still covers
it (heap_block) and blits see no shared span (bound). Texture buffers and textures over heap
buffers are untouched.
Docs: AGENTS.md rule 2's unified sentence gains the clause (the count stays fourteen); the
runtime README's heap text and known gaps (the device memory sum beside the heap's block, where it
runs out, and the earlier speed row); new_heap_texture(_for_views), heap_texture_size_and_align,
has_unified_memory and Gap::HeapTexture docs; docs/API.md and the conformance heap-size side's
step 2; docs/REFUSALS.md regenerated (HeapTexturePlace's site is heap_place).
RUNTIME_VERSION 2564 (renumbered at landing: development held 2563). runtime-sources.sha256 unchanged (guard PASS, m3-max-84127).
Verified: red FAIL / new PASS on the RTX 3090 (build m3-max-84138, run 84144), the RX 7900 XTX (84137, 84221; rt suite under m2v_gpu 993 passed, 4 skipped, 84222) and the Iris Xe (84227, 84238); CPU suites 84127 (conformance + rt 1279 passed, 2 skipped); clippy plain 84180, m2v_gpu 84172, m2v_cpu_icd 84181, rustdoc + api-docs 84182, all EXIT=0; states-only play on lavapipe 84256 equal to the base (gb-3090-r2 10643 render / 15299 compute, windrag-780m-b4-um790 8972 / 225, 0 refused). The consumer's arm64 guest walk on the RTX 3090 at pin S (m3-max-84046) asked for no texture on a Shared heap, so the evidence is the device tests and timing.
The L21 ruling: rule 2's unified-memory query picks the form of a Shared heap's image texture.
On an integrated or CPU device it lies in its heap, as today; elsewhere it is an optimal image of
its own in device memory, its heap range left unused. Today a discrete device either refuses the
placement (Gap::HeapTexture where the image does not take the Shared type, an RTX 2080) or
binds the image in system memory, which every read crosses the link for (97 times a Private
heap's time on an RX 7900 XTX).
every_device_samples_textures_placed_in_a_shared_heap now runs in both forms (the two-copy view
answers no unified memory). Without unified memory it expects each texture made whatever the
Shared-type query answers, in no alias placement and in the heap's use_heap block, the heap's
placement refusals at the size query's answers, and the source's texels kept after the host
writes 0xff over its heap range through a buffer placed there. In both forms: the size query
answers alike (what the consumer's heap accounting reads), and a linear texture over a buffer
placed in the Shared heap reads the host's bytes there. The heap texture-buffer test runs in both
forms too, unchanged.
Expected red: the two-copy run on an integrated device finds the image placed in the heap, and a
device whose image does not take the Shared type is refused Gap::HeapTexture.
What: Search::run's last loop (memory/provenance/words.rs) collects every
web whose integer an instruction reads otherwise than as a merge or a
sink, and spoils each one. It kept one Option that each operand
overwrote, so an instruction that read two webs (an icmp eq of two
joined handle words, or their sub) spoiled only the web of its last such
operand, and the other stayed a web: planned as handle indices while an
integer instruction read its words. The collection is one working
vector for the loop, grown through grow_working and charged to the
meter, as the loop above charges its operands.
Why: an analysis that marks a web usable while an integer instruction
reads its words is wrong where it stands. Today no output shows it: the
spoiled web "is no web, and stays refused" (lower/access/handle.rs), so
its handle use refuses the module whichever web was left planned. That
rests on a property nothing states, which the next refusal change could
remove.
Test: every_handle_web_an_instruction_observes_is_refused edits
sampler_word_select of the owned fixture kernel_handle_word_joins (as
the other refusal tests there do, so the fixture's AIR, which four
authored cases name by hash, is unchanged): a second web of the same
class beside the first, whose sampler samples too (its sink), then an
icmp eq of the two words either way round, their sub, and one web's word
compared with a raw resource ID. Each is refused: Lowering(Access) with
the cause HandleUse. A control compiles the same two webs with no
instruction observing them, so each refusal is the observation's and
both webs are webs. It guards that a module whose instruction observes
a web stays refused.
No SEMANTICS_VERSION bump: no module's output changes (the test is 8 of
8 with and without the fix). runtime-sources.sha256 unchanged
(pin-compute, 44066e69...).
Verified: job m3-max-84060 (msi): engine_handle_words 8 of 8 at the test
alone and 8 of 8 with the fix; clippy in the three configurations,
rustdoc and the suites as the lane's READY names.
What: Refusal::AttachmentPlace's Basis line said `ours`. It now says
`metal-measured` and cites the committed probe resolve_depth_planes.m
(conformance crate, Apple M3 Max, macOS 27.0.1, job m3-max-73495). With
Metal's validation layer on, a resolve into slice 3 of a 2D texture ends
the process at the encoder ("Slice is 3, but the texture has only 1
slices"), and so does a resolve at depth plane 3 of one ("depth plane is
3, but the texture has a depth of 1 at mip level 0"). With the layer off,
plain Metal writes slice and plane 0 instead. A level past the texture's
was not run, and the line says that part is ours. docs/REFUSALS.md and
error/basis.rs are regenerated by scripts/refusal-surface/refusal_surface.py.
AttachmentPlace's basis() now answers MetalMeasured, and the Refusal
table's counts move one row from ours to metal-measured.
Why: the bug row said plain Metal (layer off) takes resolveSlice 3 into a
2D texture, and the planner's 11-25 ruling was that it needed a read
first, with rule 1 applying if Metal's layer refuses it. The read is the
probe above: the layer refuses it, so the refusal stands under rule 1,
and its basis now cites that evidence. Behaviour is unchanged.
Verified: refusal_surface.py --check exits 0 on this tree. The
runtime-sources fingerprint, recomputed from the tree, is unchanged
(44066e69): the runtime crate's sources are not inputs to it. No
signature changes, so api_signatures.tsv is untouched.
AGENTS.md asks every public runtime item's doc to name its Metal counterpart and what differs or is
refused. These public items named neither a counterpart nor its absence: floor::VERSION,
INSTANCE_EXTENSIONS, OPTIONAL_INSTANCE_EXTENSIONS, TIME_DOMAINS, MAINTENANCE8, BUFFER_USAGE,
IndirectCommandLimits, Features and Missing; Limit; and HOST_DOMAIN (its three cfg forms). Each is
Vulkan's side or the runtime's own, so each now opens "No Metal counterpart:", as the runtime's
other such items do (IndexClass, BlockId, DeviceExtension).
Found by the audit lane's read of the public runtime items' docs (392 pub items in non-test
sources; the rest name a Metal selector or type, or say they have no counterpart, on the item or
its type). Doc comments only: the API signature table and the runtime-sources pin do not move.
Metrics::attachment_read_copies and Gauges::shadows said they arise on a device without the
attachment feedback loop. A texture in place over a buffer, a surface plane among them, reads its
own pass's attachment through a shadow on every device where its linear image took no feedback
usage: Texture's making takes the loop from the plan's linear_loop for an image laid over a buffer
and from the device for one of its own (texture.rs, the looped match before Shadowing), and every
shadowed read's copies count in attachment_read_copies (render_encoder.rs, shadow_copies). The
runtime README's render encoder section already says so ("Through a copy, on a device without the
feedback loop, and for a surface plane or a texture in place over a buffer whose image took no
feedback usage"). The two fields' docs now say the same, so a reader of a nonzero count on a
device with the loop knows it is that case.
Found by the audit lane reading the counts the consumer folds. Doc comments only; the
runtime-sources pin does not move (counters.rs is not among its inputs).
The host-memory texture row for the Radeon 780M (job m3-max-81673) read 696 against 537 us a
frame at one draw. The job's six alternating runs put the in-place arm's frame p50 at 529.3,
534.0, 536.1, 536.8, 537.9 and 542.9 us, a median of 536.45, so 536; the copy arm's median is
696.25, and the stated ratio 0.770 is 536.45 / 696.25, which stands. The four-draw pair (1025
against 793) and its 0.774 match the job.
Found by an audit of the docs' cited job numbers against the jobs' logs. Docs only.
Once the counters hold their 256 over-copy kinds, a copy of a new kind counted only in
Metrics::over_copies_unkept_kind, one number for every cause, so a consumer reading it (138 in
one arm of four of a walk on the Radeon 780M) could not say which cause's kinds went unnamed.
Such a copy now counts in its cause's field, over_copies_unkept_kind_<cause>, one for each of the
14 causes, named as the cause's pair is: host_memory, host_memory_restore, dma_buf, dma_bufs,
dedicated, surface, spilled, linear, linear_features, view_storage, pitch, render_reach,
alignment and image_memory. The aggregate stays and is now the causes' sum, read from the same
counters, so it cannot disagree with them. The kinds the counters keep, and their bound, are
unchanged.
The runtime README's over-copy paragraph names the fields. RUNTIME_VERSION 2563: what a run
records moves (the per-cause fields). The runtime-sources pin does not move (counters.rs is not
among its inputs).
Red: the_counters_name_each_copied_kind_once_up_to_their_bound, which the commit before this one
extended, read 0 for every cause against 2, 1 and 1; green with this.
Metrics::over_copies_unkept_kind counts the over-copies whose kind the counters did not keep,
the 256 kinds being full, as one number, so a reader cannot say which cause those copies had:
a consumer's walk on the Radeon 780M showed 138 of them in one arm of four, and nothing named
their cause.
This adds one field a cause, over_copies_unkept_kind_<cause>, beside the cause's pair
(over_copies_<cause> and over_copy_bytes_<cause>), and extends
the_counters_name_each_copied_kind_once_up_to_their_bound: filled past the bound with kinds of
the causes in turn, the three unkept kinds (dedicated twice, surface and spilled once each) must
count under their causes, and the causes must sum to the aggregate. The fields are read from
counters that nothing moves yet, so the test fails: every cause reads 0 against 2, 1 and 1.
The API signature table is blessed for the 14 fields. The runtime-sources pin does not move
(counters.rs is not among its inputs).
The golden table (bless job m3-max-84114, on the M3 Max) and the authored compile census
(m3-max-84121, census at c6a7995260: 2390 cases, 9 profiles, 0 failed, 161 differences, 0
regressions) at the pin's tip. Every moved cell is attributed to its commit.
Golden (blesses at each SEMANTICS step, cell by cell per profile):
- 180 cells, 12 rows x 15 profiles, from Unsupported{IdentityDomains; NotImplemented} to
hashes: rfs_kernel_lod's lod_2d, lod_2d_array, lod_3d, lod_cube and lod_vertex, and
sampling_completion's lod_query_kernel, in both fixture forms (.air.ll and .ll). All moved at
c04212227d (red) and 5b3bd800c0 (a runtime sampler's LOD query outside a fragment function
compiles under the identity domains).
- 60 cells in 4 new rows: coherent_texture_handoff and coherent_texture_handoff_seen in both
forms, from the fixture commits 3994ea73dc, 5410866d9a and 18e8600cbb; all hashes.
- The semantics line, 2347 to 2353. No other cell moves.
Census (cold blesses at each step; T's committed table equals a cold bless at T, 0 changes):
- 36 cells, 4 cases x 9 profiles, from not_supported{unsupported:not_implemented
IdentityDomains} to compiled at 5b3bd800c0, the same LOD query fix (m3-max-84197).
- 16 new cases from c5f979d985 and df54afeef2, the LOD clamp cases qualified on the M3 Max
(m3-max-84198); 1 new case from 8e912a905d, coherent_texture_handoff.
- No compiled artifact's digest moves in the steps read so far; the remaining steps read after
the push and are fixed forward.
States-only plays at T and at U are equal (m3-max-84116, 84117). Merge legs at c6a7995260:
m3-max-84110 (signatures, clippy plain, m2v_gpu and m2v_cpu_icd, rustdoc, translator suite 3459
passed 37 skipped, lavapipe rt 993 passed 4 skipped at its own width and at 128 bits,
validation 1349 passed 3 skipped, lavapipe validation 1477 passed 3 skipped, conformance build
and lavapipe conformance EXIT=0, all steps EXIT=0) and m3-max-84111 (copy form on the RTX 5080
Laptop, 41 passed).
The brief for this change asks for the bump at READY. A run of an unchanged artifact now adds to
six more Metrics fields (restoring_makes and the five after it) at each make of a texture in place
over host memory's import; its answers, refusals and submissions are unchanged. Main renumbers at
landing.
Over holds the import's host mapping, a NonNull that is not Sync, so the scoped thread could not
borrow the whole Over: the lib test did not compile (lavapipe build, job m3-max-84045). The thread
now borrows the buffer and the descriptor and sends back whether the texture is in place, as
restore_batch's does.
The consumer's walk on the Iris Xe reads one long restore span a walk (57.3 and 57.9 ms at pin S),
in a HEIC step whose VA-API decodes write rt's exported blocks, and nothing in the runtime splits
a restoring make's wait, so the walk cannot say what the span waited for. A fenced make waits
twice: for the GPU work already submitted, before the fence's before, then for the progress value
its flush gave, inside the span. That second wait holds the batch that carries the restore (every
upload of any thread not yet submitted, and a group's copies into its textures' images), the GPU
work submitted ahead of it on the one queue and, where an upload of the batch uses memory another
API shares (an exported block's zero fill, a copy from one), the group's first part, since such
uploads signal no value of their own.
Metrics counts, with nothing run beside the work:
- restoring_makes, once each make's wait returned;
- restoring_make_drain_nanos, the fenced make's first wait;
- restoring_make_wait_nanos, the wait for the restore, and restoring_make_wait_submissions, the
submissions the completion thread had not yet seen complete as it began (more than one: work
submitted ahead of the restore's batch);
- restoring_makes_shared and restoring_make_shared_wait_nanos, the makes whose restore went ahead
of a group's command buffers in uploads that use memory another API shares. Each restore's
upload carries its make's flag (Keep::Restore's, through Restoring), which submit() sets before
the vkQueueSubmit2 where it sends awaited uploads that share memory with no signal of their own;
the make reads it once its wait returned.
The runtime README's fence paragraph names the fields. The signature table gains them.
restore_waits.rs checks the six restore-wait fields the next commit counts, on every device of the
cfg's kind whose texture over host memory's import is in place:
- a make without a fence counts one restoring make, its restore wait and the submissions it
waited for, and no drain;
- a fenced make counts its drain (the wait for the GPU work already submitted, before the fence's
before) as well;
- neither counts among the shared makes;
- a make whose restore goes ahead of a group's command buffer with a new buffer's zero fill in an
exported block (an upload that uses memory another API shares, which signals no value of its
own) counts among the shared makes, its wait in theirs.
Metrics gains the six fields, read from atomics nothing adds to yet, so both tests fail here: the
red for the counting that follows.
Verified: red on the venues the next commit names (this commit's run is in its body).
Its one threadgroup's index is the thread's grid position, which Metal's run read; the grid
position takes a push field of its own, which the test's interpreter run does not fill.
The AIR reader refused every thread-local global (ModuleRecord{code: 7}). Metal runs one of the
thread address space as an object each thread holds, starting at the initializer in every dispatch
and reached through the functions the thread calls (M3 Max, Metal toolchain 32023.922, macOS 27:
128 of 128 threads read the initializer, then their own 3t+1 after a barrier, in each of two
dispatches of one pipeline). That is SPIR-V's Private storage class with an initializer.
- metal2vulkan-air: Global gains thread_local; the reader reads it on a thread-space global and still
refuses it on any other space (ModuleRecord{code: 7}), as it refuses comdats.
- metal2vulkan: the memory plan places a thread-local global as the typed Private form a closed
constant global takes (ConstGlobalForm::Private), its writes its thread's own; one the typed form
cannot hold is refused (GlobalVariable), as the constant blob is shared and read-only. Its
thread-space pointers take that form, and a typed store into it is allowed where a constant's is
ReadOnlyStore.
- SEMANTICS_VERSION 2352 -> 2353: modules with such a global now translate.
Verified: see the job lines in the lane's READY report (red at 364ad75207, green here).
Metal runs a module with `@g = internal thread_local unnamed_addr global i32 <init>` in the thread
address space: on an Apple M3 Max (Metal toolchain 32023.922, macOS 27) each of 128 threads read the
initializer first and, after storing 3t+1 and crossing a threadgroup barrier, read its own 3t+1 back
through a helper function, in each of two dispatches of one pipeline; the same global without
thread_local is refused at pipeline creation ("Undefined symbols: g"). The AIR reader refuses every
thread-local global (ModuleRecord{code: 7}).
Red: the reader test now expects a thread-space thread-local global to read and one of the
threadgroup space to stay refused; engine_thread_local expects the kernel to translate on every
committed profile and to leave Metal's words in the interpreter. Both fail at this commit.
Recorded on the M3 Max (macOS 27.0.1) by `conformance record
stage-in-region-clamps`, job m3-max-83929, RECORD EXIT=0: the three new
rows' sites (pipeline, buffers, region, dispatch, status, read-back) are
added, and the earlier rows' answers are unchanged (351 lines added, 1
changed). The recording's times half is carried as recorded.
The case compared an indexed step at rate 1 only. The runtime now
fetches an indexed step at any rate, as an M3 Max read it in job
m3-max-68668, so the case now holds three rows of it:
- xi_rate2_o1_r3_g8: x at rate 2, a region of 3 from origin 1, so the
last threads clamp
- xi_rate3_o2_r4_g12: x at rate 3, a region of 4 from origin 2, over
12 threads
- yi_rate2_o1_r2_g2x8: y at rate 2, a region of 2 from origin 1
Unrecorded here: the M3 Max record job that follows writes the
recording in its own commit.
What: the kernel stage-in fetch's specialization constant StageInReach,
its select over a thread-position step's reach check, its word estimate,
the runtime's arm that skipped it, and the codec's tag are deleted, with
tests/stage_in_element_bytes.rs, a doc-only module about the binder
that set the key and is gone. A thread-position step's reach check now
runs unconditionally, as an indexed step's already did.
Why: nothing set the key to false. The runtime kept it at its default
(true) for every dispatch (pipeline.rs, `SpecKey::StageInReach =>
continue`), so every module carried a constant and a select that always
chose the check. Consumer search: `git grep -n -w StageInReach
development -- '*.rs'` in the consumer's checkout at 40c2b1abeb has 0
hits.
Also: SEMANTICS_VERSION 2351 -> 2352 (a thread-position fetch's module
loses the constant and the select). ARTIFACT_FORMAT_VERSION unchanged:
the codec tags by name and the removed tag stays unused, which its doc
says needs no bump. The signature table blessed (one variant out);
docs/REFUSALS.md regenerates unchanged; runtime-sources.sha256
unchanged (pin-compute, a92fe0a8...).
Verified here: signatures.py --bless moved only that variant; no
StageInReach, reach_key or REACH_KEY_WORDS is left in crates/. Clippy,
rustdoc and the suites run in the jobs the lane's report names.
What: a kernel [[stage_in]] layout of an indexed step
(ThreadPositionInGridXIndexed or ...YIndexed) at a step rate past 1 is
now fetched: the thread's position on the axis divided by the rate,
clamped to the stage-in region's last element, looked up in the index
buffer, plus the region's origin. Step::Indexed carries its rate, and
the grid and indexed steps share stepped_position, the one division.
Why: an M3 Max read index[min(x / rate, size - 1)] plus the origin at
rates 2 and 3 (job m3-max-68668), so the refusal guarded a measured
answer. The runtime's Gap::StageIn of IndexedStepRate and the
translator's Feature::KernelStageIn refused it; both had no other site,
so both variants are deleted. Consumer search for the runtime variant:
`git grep -n -w IndexedStepRate development -- '*.rs'` in the consumer's
checkout at 40c2b1abeb has 6 hits, all in its refusal-label table and
the test that expects this refusal (rt_platform/diag.rs 8, 3079, 3088,
3094; rt_platform/compute.rs 1246, 1382), which change with this
answer; Feature::KernelStageIn has 0 hits there.
Also: SEMANTICS_VERSION 2350 -> 2351 (the modules of an indexed fetch
past rate 1, and a refusal gone). docs/REFUSALS.md regenerated
(refusal_surface.py) after reach.tsv lost the feature's row; the
signature table blessed (two variants out). The runtime README, the
encoder's and pipeline's docs and the gap's docs say the indexed
element at any rate. runtime-sources.sha256 unchanged (pin-compute,
a92fe0a8...).
Verified here: signatures.py --bless moved only the two variants; the
refusal surface regenerated with 0 variants unmarked. The red tests of
the commit before this one, and clippy, rustdoc and the suites, run in
the jobs the lane's report names.
The runtime refuses a kernel [[stage_in]] layout of an indexed step at a
step rate past 1 (Gap::StageIn of IndexedStepRate), and the translator
refuses it as not implemented, though Metal's answer is measured: an M3
Max read index[min(x / rate, size - 1)] plus the region's origin at
rates 2 and 3 (job m3-max-68668).
The runtime's fetch test gains two indexed rows, at rate 2 under a region
of 3 (so threads past it clamp) and at rate 3 under a region of 8, and
its element rule divides the position by the rate before the clamp. The
unbuilt-forms test keeps DynamicStride and IndirectRegion. The
translator's refusal test expects rates 2 and 3 to compile, and the
every-profile validation and region tests take indexed rows past rate 1.
Red here: both runtime and translator tests meet the refusal. The fix
follows.
usage_taken reads the bit as ShaderWrite, so reached, which decides
whether new_texture takes an index, holds for a texture of the bit alone
(0x10000): it takes an index, and one made without is
Refusal::TextureIndex. Metal's kernel write to such a texture lands
(block-writes-only-writes, recorded on an Apple M3 Max under macOS
27.0.1, job m3-max-83930). The conformance rt side gave the texture no
index, so the lavapipe replay refused it at creation (job m3-max-83976);
its texture_index now counts the bit as the runtime does. The docs of
reached, Refusal::TextureIndex and the runtime README say so;
docs/REFUSALS.md regenerates unchanged.
A consumer that decides a texture's index by its usage counts
TextureUsage::BLOCK_WRITES_ONLY as a shader write.
Rustdoc read the message's t[1] as an intra-doc link and failed under
-D warnings (job m3-max-83944: unresolved link to 1). The message is now
a code span. Nothing else changes.
The suite's test every_case_carries_its_timing needs every case's
recording to hold a timing leg. This one's Metal leg, eight rounds, was
measured on an Apple M3 Max under macOS 27.0.1 (job m3-max-83967, with
conformance times --runs 8 --write). The recorded answers are unchanged.
The coverage table regenerates unchanged.
The case's Metal answer, recorded on an Apple M3 Max under macOS 27.0.1
(job m3-max-83930): for both usages, ShaderRead | RenderTarget |
BlockWritesOnly (0x10005) and the bit alone (0x10000), the dispatch
completes and every texel holds its four codes (00 ff 00 ff, 10 ef 25
fe, ...), with no notice announced. The coverage table is regenerated
with scripts/conformance-coverage/coverage.py.
The case writes buffer 0's float4s, each a code over 255, through the owned fixture
fpv_srgb_storage's fpv_srgb_write (an access::write slot) into a 16 x 1 Shared RGBA8Unorm texture
of usage ShaderRead | RenderTarget | BlockWritesOnly (0x10005, the guest's) and of the bit alone
(0x10000). It records each dispatch's status and the stored bytes.
The public MTLTexture.h of macOS 27.0.1 does not define the bit. On the M3 Max under macOS
27.0.1 (job m3-max-83917), a write to 0x10005 lands and Metal's validation passes it. The
recording is taken by the next commit's job.
usage_taken, the one place a descriptor's usage is read as Metal takes it, now reads the private
bit BlockWritesOnly (0x10000) as also ShaderWrite. That feeds the slot check
(Refusal::TextureUsageAtSlot), the image plan (the storage element, its view formats and the 8-bit
sRGB write twin), texture buffers, and the storage-element gap's test of a written texture.
Why: the public MTLTexture.h of macOS 27.0.1 does not define the bit. Its writes were measured
on an Apple M3 Max under macOS 27.0.1, job m3-max-83917. A kernel's access::write to an
RGBA8Unorm texture of ShaderRead | RenderTarget | BlockWritesOnly (0x10005) lands, Shared and
Private, plain and under MTL_DEBUG_LAYER=1 with no assertion. A texture of 0x5 asserts there
("writes texture (t[1]) whose usage (0x05) doesn't specify MTLTextureUsageShaderWrite (0x02)"),
and 0x7 is silent. The runtime refused the dispatch, and planned no storage element for such a
texture, so the write would have been dropped. An arm64 guest walk met the refusal 8,662 times,
at one kernel's slot 1 for 8,624 of them. The translator's heap binder already takes the bit so
(bind/heap.rs), so both crates now read it one way.
RUNTIME_VERSION 2561: a run may answer differently (a dispatch that was refused now runs).
docs/REFUSALS.md regenerates unchanged (its table carries the refusal's first line alone). The runtime-sources fingerprint does not move
(pin-compute.py: a92fe0a8... before and after); the runtime crate's sources are not among its
inputs. The runtime README's texture slot paragraph says the same.
Verified by the red test of the commit before: on lavapipe (llvmpipe, LLVM 23.1.1), job
m3-max-83922 at that commit fails it with Some(TextureUsageAtSlot) for the new row; the green run
is named in the lane's report.
slot_usage's sample_down gains a destination of usage 0x10005: ShaderRead, RenderTarget and
Apple's private bit 0x10000, which the public MTLTexture.h of macOS 27.0.1 does not define. On an
Apple M3 Max under macOS 27.0.1 (job m3-max-83917), a kernel's access::write slot 1 bound to an
RGBA8Unorm texture of that usage takes the write, Shared and Private, plain and under
MTL_DEBUG_LAYER=1 with no assertion, where usage 0x5 asserts "writes texture (t[1]) whose usage
(0x05) doesn't specify MTLTextureUsageShaderWrite (0x02)" and 0x7 is silent.
The runtime refuses the dispatch today (Refusal::TextureUsageAtSlot): it reads only ShaderWrite as
granting a write, and plans no storage element without it. A guest walk on an arm64 guest met the
refusal 8,662 times, at one kernel's slot 1 for most of them.
Red: expected to fail on every device until the usage is read as granting the write.
Before a plan workload's rows, the harness now prints one line naming each of its buffers'
storage mode and length and each of its textures' storage mode, in its plan's order, for authored
and described workloads alike:
burst_160_shared storage: buffer 0 private 1024 bytes, buffer 1 shared 16 bytes
On a discrete card a kernel's reads of a Shared buffer cross the bus at every dispatch (the
runtime README's known gaps of memory blocks: 75 against 2.4 us a dispatch for 512 KiB on the
RX 7900 XTX), so a row's time cannot be read without knowing where its data lives.
No committed kernel workload gains a Private arm, because each one's bulk data is already
Private, as a real app would keep it: bandwidth, alu, long_4cb, threadgroup_scan, simd_reduce's
input and partials, image_filter, row_cells, dispatch_chain, wide_bindings, waves, vote_loop,
narrow_ints, zero_products, texture_read, the sampling rows, the texel buffer rows,
constant_private and the draws. The Shared buffers that remain are the ones an app keeps Shared,
or already have a Private twin:
- simd_reduce's buffer 2, the 16-byte total the CPU reads back;
- burst_160_shared's 16-byte increment, a constant argument the CPU writes, kept for the record
beside burst_160's Managed one, as the recordings bind such arguments from Shared memory;
- row_tail_224, row_tail_27730 and row_tail_49, whose outputs are Shared, each already beside
its _private twin.
The kernel behind the known gap was a described workload of the audit's own, never in the tree.
A test in the command's own tests checks the line for burst_160_shared, burst_160 and draw_2000.
On the RX 7900 XTX (RADV, Mesa 26.2.6) the Shared type, the first host-visible, host-cached
type a buffer can use, lies in the host's 14.58 GiB heap, so every dispatch's reads of a Shared
buffer cross the bus. A half-precision sum reduction reading 512 KiB of a Shared buffer took
7,475 us a run of 100 dispatches, 75 us a dispatch, against 236 us a run, 2.4 us a dispatch, with
the same buffer Private, alternated three times at the card's full shader clock (about 3.07 GHz
in both arms, sampled every 20 ms; job m3-max-84013).
Ruled a recorded known gap (rung 4) rather than a second Shared type: Shared is the memory the
program's CPU reads and writes directly, and the card's device-local, host-visible types are not
host-cached, so each CPU read of a Shared buffer there would be an uncached read, which costs
more and comes more often than a kernel's reads over the bus. Metal's Shared is one memory the
CPU and the device both use (MTLResource.h), on a discrete Mac too, where a program that wants
the card's read speed keeps its data Private or Managed.
Docs only. The memory types and heaps are the job's vulkaninfo on that card.
Each subcommand names the options it takes beside its required ones, and
options() refuses any other with "--NAME is not an option of
SUBCOMMAND" before anything runs: exit status 2, the usage printed, as
for any bad command line. Before, an unknown --name VALUE pair went into
the map and was never read, so a mistyped or retired option played as
if absent.
The sets are what each subcommand reads: play its four required options
and blobs, managed, until-frame, past-range, states-only, state-log,
state-threads, state-keys, state-digests, gpu-wait-timeout (the
wait module's flag), video-handle, check-presents, read-device-copies,
prepass-width, dump-command-buffers and dump-dir; dump and shapes
--stream and --blobs (their stream reader reads it; the usage and the
module doc now show it); compare-dumps --a and --b; compare-plays --a,
--b and --frame; snippet video-surfaces --out and --handle. The module
doc and docs/REPLAY-STREAM.md section 10 say so.
The audit in the red commit's message found no caller passing an option
outside these sets except --probe-dump in two lab probe scripts of one
carry, which no commit here ever read.
Verified by the job named in the lane's report: the red test at the
parent and green here, clippy x3, rustdoc, the validation suite.
command-replay's options() takes any --name VALUE pair into its map, and
each subcommand reads only the names it knows, so an option a subcommand
does not take is dropped in silence: `play --name run` plays as if no
--name were given. A mistyped or retired option should be a bad command
line instead.
replay_options::every_subcommand_refuses_an_option_it_does_not_take runs
play (--name), dump (--frame), shapes (--until-frame), snippet
video-surfaces (--stream) and compare-plays (--until-frame), each with
its required options plus one it does not take, and expects exit status
2, a standard error line "--X is not an option of SUBCOMMAND", no play
report and no snippet written.
Red here: play runs on (its report is written), and dump, shapes and the
snippet run to exit 0. The fix follows.
Callers audited before refusing (development 6a7b159d95): the in-tree
tests and docs, sched/round.py and every orchestration job script that
names command-replay (54 files), the scripts in every carry repository
(136, 35 that play), and the consumer's tree (development fdc1ecbbb5: no
caller). Every option they pass is one the subcommand takes, except
--probe-dump in two 11-27 probe scripts of one lab carry (probe-424.sh,
probe-reduce.sh), an option no commit of this repository ever had: it
was dropped in silence there, and would now stop those scripts with exit
status 2.
98435ae812 gave compute_case the checked entry's AirInterface as a
second argument but left two test callers on one, so the validation
crate's lib tests and integration tests did not compile (job
m3-max-83945: E0061 at case/tests/indirect_commands.rs:107 and
tests/integration/engine_linked_cases.rs:123; clippy in all three
configurations and the validation suite failed on it).
- indirect_commands' assert_engine_refuses: the refusal comes before
compute_case reads the interface, so a synthetic kernel interface of
no parameters stands in.
- engine_linked_cases: the admitted case's own interface,
checked.primary.interface.
Verified by the job that follows (clippy x3, rustdoc, the validation
suite). The same job's case runs on lavapipe at 98435ae812 (the bins
built) matched 7 of the 8 authored stage-input cases whose AIR is here;
the eighth is private.
What: a kernel case's stage inputs of a fixed stride, and its dispatch's
stage-in region, now run on the engine candidate as the Metal oracle runs
them (executor_contract::stage_inputs, the derivation both executors
share):
- compute_case takes the checked entry's AIR-layer interface and maps
each input's data to its own buffer at the slot its location takes;
- ComputeCase carries the stage-input descriptor, the region (the
dispatch's, or the grid's from the origin) and each slot's location;
- the run through the runtime makes its state with that descriptor, sets
the region before the dispatch, and guards a stage input's data as its
OutOfBoundsResource::AttributeBuffer target (guards::buffer_resource);
- the authored compile census compiles the kernel under it
(PipelineRequest::Kernel::stage_input, variants::compile_kernel).
ToolingRequirement::KernelStageInput ("kernel_stage_input") becomes
DynamicStageInStride ("dynamic_stage_in_stride"): it now fires only for
an input of a dynamic stride. The runtime refuses that layout (Gap::StageIn
of DynamicStride), since its compute encoder has no
setBuffer:offset:attributeStride:atIndex:. Docs say the same:
docs/VALIDATION.md, the requirement's, case_requirements' and
compute_case's. A neighbouring line now says the implicit imageblock is
the runtime's limit, where it said explicit; the code already said so.
Why: the runtime has fetched stage inputs at every step function since
a916e61185 and sets the region (set_stage_in_region), but the candidate
built its state without the descriptor and set no region. So twelve
authored cases stayed Metal-only, the twelve the authored compile census
holds as not_supported{tooling_requirement:kernel_stage_input}.
Also: AUTHORED_COMPILE_CENSUS_VERSION 9 -> 10. Its table is re-blessed
on development. ENGINE_EXECUTOR_ABI unchanged: every case this lets run
was refused before, which its doc says needs no bump.
Verified here: cargo fmt; signatures --check. Tests:
engine_case_families_follow_the_case_literals (red at the commit
before) and stage_inputs_map_onto_their_slots_descriptor_and_region.
Clippy, rustdoc, the validation suite and the cases' runs on a device go
in the jobs the lane's report names.
A kernel case with stage inputs, or a dispatch with a stage-in region,
carries ToolingRequirement::KernelStageInput, which stops the engine
candidate: its run through the runtime makes its pipeline state without
the case's stage-input descriptor and sets no region. The runtime fetches
stage inputs at every step function since a916e61185 and sets the region
(set_stage_in_region); it refuses only a layout of a dynamic stride
(Gap::StageIn of DynamicStride), as its compute encoder has no
setBuffer:offset:attributeStride:atIndex:.
engine_case_families_follow_the_case_literals now expects no requirement
for stage inputs of a fixed stride, with or without a region, and the
requirement for a dynamic one. Red here: both fixed-stride cases still
carry KernelStageInput. The candidate's run, the requirement's narrowing
and the doc follow.
Two measured changes to an extended-range sample's level, each from the M3 Max on macOS 27.0.1:
- A padded form's linear mip filter (R10Unorm_X6, RG10Unorm_X12 and their _sRGB twins) now
blends its two levels as BGR10_XR's and BGRA10_XR's do, through a constexpr sampler and through
a runtime one, and records PrecisionNote::BicubicFilterArithmetic. Before, a constexpr sampler's
was refused NotImplemented(Format), and a runtime sampler's read one level with no refusal. The
probe extended_linear_mip_blends (job m3-max-82967; 16,384 lanes per form and filter, 2D, five
levels, random codes) puts Metal's sample within 0.0157 of its own two levels' samples blended
by mix at the fraction truncated onto sixty-fourths. The note's doc and its docs/API.md
catalogue line gain that bound.
- A bfloat form's linear mip filter (R16Bfloat, RG16Bfloat, RGBA16Bfloat) is now its nearest mip
filter, which Metal's equals on every lane whose two levels differ (4,096, 8,192 and 16,384
lanes, nearest and linear filters). Before, a constexpr sampler's was refused. A runtime
sampler's already read that level.
What stays refused through a constexpr sampler:
- A two-plane form's linear mip filter (not measured). The probe only shows that a five-level
texture is made.
- RGB10A2Unorm_sRGB's linear mip filter (not measured). Jobs m3-max-83026 and m3-max-83029
explain why. A texture of five levels holds each level's own code, which a blit reads back per
level. Yet the M3 samples level 0's code at every explicit level, at gradients under a nearest
mip filter, at every level under a linear one, and in a 2D array's layer 1. RGB10A2Unorm, the
control, samples each level's code. Documented Metal samples the level asked for. So this is a
driver defect, which is not emulated (an Apple bug report is drafted), and the format's samples
keep reading the level the mip filter names. No conformance case samples that format's levels
today.
Docs: three comments named binder refusals that no code makes, and none of the three exists
(ResourcePlanner is gone):
- a runtime sampler word that states mixed filters;
- a runtime linear mip filter's clamp maximum below the last level;
- a runtime linear mip filter of an unmeasured form.
The comments sat in lower/sampler/extended.rs, select.rs and the extended-range tests'
module docs. They now state what happens: the word samples as nearest, the maximum is not read,
and a two-plane form's or RGB10A2Unorm_sRGB's runtime linear mip filter reads the nearest mip
filter's level. They also say this is an open gap that no consumer meets while the runtime makes
no texture of these formats (the runtime's Gap::TextureFormat).
The probe crates/metal2vulkan-conformance/probes/extended_linear_mip_blends.m gains the nearest
mip filter at the point's level, the two-plane question and each texture's level count.
SEMANTICS_VERSION moves to the next number, because refusals are removed and samples' answers
change. runtime-sources.sha256 is re-pinned because metal/format/mod.rs is a runtime input.
Tests (tests/engine_extended_range/levels.rs):
- unmeasured_linear_mip_filters_are_refused now builds a padded and a bfloat linear mip filter,
and still refuses a two-plane and an RGB10A2Unorm_sRGB one.
- measured_linear_mip_filters_blend_or_read_one_level: every padded and bfloat form's constexpr
sampler compiles, valid, under either mip filter, with the note on a padded linear one alone.
On the CPU interpreter, at 64 levels between two, through a constexpr and a runtime sampler, a
padded form's sample lies between its two levels' nearest-mip samples on every lane and
strictly between on some. A bfloat form's equals its nearest mip filter's, bit for bit.
Verified on the CPU with no device (job m3-max-83908): with metal/format/mod.rs,
lower/sampler/extended.rs and select.rs at 8e912a905d the two changed level tests fail, and here
the extended-range tests pass; the golden table differs from development's (semantics 2346) in 90
cells here and at 8e912a905d, so the change moves no existing cell by count; the refusal surface
check passes; cargo fmt, clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd), Rustdoc, the API
reference check and the doctests pass; the suites pass 3753 of 3754 (24 skipped), the one failure
golden_hashes_match_the_table, bless due as at 8e912a905d; the validation suite passes 1346 (3
skipped) and the conformance suite 1052. The states-only plays of this tree (m3-max-83910) make
what 8e912a905d's make (m3-max-83909): the gb-3090-r2 stream 10643 render and 15299 compute
states, the 780M windrag stream 8972 and 225, none refused.
Regenerate and verify all 3660 rows across 15 profiles on hosted macOS for semantics 2347. Source: 14536cadaa. Evidence: https://github.com/charlysound/metal2vulkan/actions/runs/47133887425. The full Linux software suite passes the identified software cases before this test-only table refresh; twelve CPU mesh cases, all Clippy configurations, device-gated compilation and Rustdoc pass.
The known gaps of render encoders said what a Mac's resolve writes into
the resolve texture past Metal's render area was unmeasured. The probe
resolve_band_past_render_area measured it on the M3 Max (job
m3-max-83924, with and without the debug layer, every command buffer
completed): a Load pass of a 300 by 300 render area that encodes no
draw, over a 600 by 600 4-sample attachment, resolved its area and the
band to 320 texels a side (90,000 and 12,400 texels changed) and left
the 257,600 texels past them untouched. The runtime's Vulkan render area
is Metal's rounded up to 32 texels a side, so it resolves the same band.
Under Clear the same pass resolved the clear value into the whole 600 by
600 texture, which the README's whole-level clear of a pass that draws
nothing already records as a known gap; the entry now says the resolve
follows it. The probe's header records the rows.
Doc and probe only: no Rust source changes.
The runtime's Vulkan render area is Metal's rounded up to 32 texels a
side, so a 300x300 pass resolves 320x320. What a Mac's
MultisampleResolve writes into the resolve texture past Metal's area is
not measured (the runtime README's known gaps say so). This probe
resolves a 600x600 4-sample attachment into a resolve texture first set
to 0xee bytes, with a render area of 300x300 under Load and under Clear,
and without one as the control, and counts the texels that changed in
the area, in the band to 320 and past it.
Not run yet: the M3 Max job that runs it follows, and its rows go in
the README with the run named.
cpu_icd_tests_128 ran the runtime's tests with LP_NATIVE_VECTOR_WIDTH=128 but never showed that
llvmpipe took the width, so a green run proved nothing about 128 bits. It now runs ci.yml's check
first, with the same greps: vulkaninfo at that width, its deviceName and subgroup-size lines printed,
and the step fails unless the device name says 128 bits and maxSubgroupSize is 4. It also takes
ci.yml's --no-fail-fast, keeping the function in step with ci.yml's run text as the file's header asks.
Verified: bash -n; and the step end to end on a host lavapipe, not in the gate's container: job
m3-max-83977 defined step() and cpu_icd_tests_128 from this file and called the step on Mesa 26.2.4
lavapipe (LLVM 23.1.1). The device line read 'llvmpipe (LLVM 23.1.1, 128 bits)' with
maxSubgroupSize 4; Summary 991 tests run: 991 passed, 4 skipped; step ok. The container run is
unverified, and METAL2VULKAN_TEST_REQUIRE_PINNED_LLVM, which the script exports at its top, was not
set (the host's LLVM is not the pin).
What: drops the known-gaps-rt.tsv row norm-storage-codes-rgb10a2unorm | Iris(R) Xe | divergent |
case/hsw_buffer/texels, and regenerates docs/CONFORMANCE-COVERAGE.md from it.
Why: pin S's real-card round replayed the ledger on the Iris Xe (RPL-P, Mesa 26.2.6) and reported
"now matches: 1": that case no longer diverges there, and the ledger must not outlive the gap it
stands for. Pin R's round passed the same leg (job m3-max-83399), so the change came between R and
S: there a read-write texture buffer whose format's own view reads none without a format became
words (1c68dd10f4), and a texture-buffer storage slot is declared without a format (1ae0e3c302), so
the Iris's RGB10A2Unorm texture buffer is written through the shader's own conversion, which gives
Metal's codes. The other Iris rows of the case (hsw_read_write, hsw_write, hsw_held) still diverge
there, and llvmpipe's and NVIDIA's rows are unchanged.
Verified: the conformance replay on the Iris Xe at 14c37cc76d (job m3-max-83990) listed this row as
its only surprise; coverage.py --check reads the document as derived. The replay after this commit
runs in the next pin's round.
The fetch known gap (UnorderedFetchWithinDraw: overlapping read-modify-writes of one draw may
leave one application) now says whether real work meets it. In every one of the 26 replay
streams counted, each colour input ([[color(n)]]) a fragment function declares is gated by a
function constant that the stream's pipeline states set off, so no state fetches.
Counted states-only on lavapipe, with a fresh shader cache per stream, every MODE line "mode
states-only". Probe on a never-landed branch:
- For each render state made, the runtime's own Draws::fetched (empty for all) and its notes (no
UnorderedFetchWithinDraw).
- The validation checker's evaluation of each colour input's predicate under the state's
constants (AirInterface::new): 0 live, 0 unevaluated, and 0 states whose input is live while
fetched is empty.
| Stream | Render states | Fetching | Declaring a colour input, all gated off | Job |
|---|---|---|---|---|
| windrag-780m-b2 | 8262 | 0 | 6313 | m3-max-83458 |
| windrag-780m-b4-um790 | 8972 | 0 | 6957 | m3-max-83458 |
| webdiv-780m-2 | 9014 | 0 | 6977 | m3-max-83458 |
| webdiv-780m-3 | 9645 | 0 | 7424 | m3-max-83458 |
| gb-3090-r2 | 10643 | 0 | 8177 | m3-max-83458 |
| glbench-3090-r4 | 9834 | 0 | 7492 | m3-max-83494 |
| bB-c1 | 494 | 0 | 392 | m3-max-83494 |
| boot-idle-780m-1 | 6817 | 0 | 5172 | m3-max-83494 |
| gb-3090-r3 | 10040 | 0 | 7752 | m3-max-83494 |
| gb-780m-u2 | 9038 | 0 | 6923 | m3-max-83494 |
| gb-780m-u3 | 8269 | 0 | 6339 | m3-max-83494 |
| gb-780m-u4 | 5850 | 0 | 4487 | m3-max-83494 |
| glbench-780m-r1 | 7435 | 0 | 5566 | m3-max-83494 |
| glbench-780m-r2 | 8538 | 0 | 6437 | m3-max-83494 |
| syncview-4k-780m | 1952 | 0 | 1585 | m3-max-83695 |
| windrag-780m-b4 | 8154 | 0 | 6252 | m3-max-83889 |
| windrag-780m-b3 | 8082 | 0 | 6256 | m3-max-83889 |
| web3d-780m-r1 | 8587 | 0 | 6593 | m3-max-83889 |
| web3d-780m-r2 | 8438 | 0 | 6478 | m3-max-83889 |
| web3d-780m-esc1 | 7253 | 0 | 5538 | m3-max-83889 |
| rtdesk-780m-rtrec1 | 7584 | 0 | 5850 | m3-max-83889 |
| rtdesk-780m-rtrec3 | 7636 | 0 | 5888 | m3-max-83889 |
| rtdesk-780m-rtrec4 | 10118 | 0 | 7784 | m3-max-83889 |
| vaapi-780m | 8604 | 0 | 6591 | m3-max-83889 |
| vaapi-780m-wd | 8403 | 0 | 6466 | m3-max-83889 |
| glbench-780m-r4-recnil | 3756 | 0 | 2669 | m3-max-83954 |
One windrag-780m-b2 function shows the gate (job m3-max-83522):
- It declares 3 used colour inputs and 60 function constants, and its state supplies all 60.
- Each input's predicate is a global computed from the constants.
- The gate opens only with constant index 4 set to 1 together with one of indices 0, 35, 55 or
56; the state gives index 4 the value 0.
The runtime translates under the identity domains, so a surviving fetch would be
PushField::FetchedColor, which fills Draws::fetched.
Values plays on one Radeon 780M (RADV) agree with this:
- glbench-780m-r2 (job m3-max-83322) and windrag-780m-b4-um790 (job m3-max-83381).
- In each, development twice (A, A2) and a build that splits every fetching draw per primitive
(B): 0 draws split, and every compared frame equal.
Docs only: the runtime README is not a runtime-sources input.
What: a Linux step after the CPU ICD step runs the runtime's device tests from that step's archive
with LP_NATIVE_VECTOR_WIDTH=128 (lavapipe's subgroups of 4, the width arm64 lavapipe runs at) and
MESA_SHADER_CACHE_DIR set to a directory of the leg's own in the workspace. It prints vulkaninfo's
device name and subgroup sizes first and fails unless they show 128 bits and subgroups of 4, so a
green step shows the width ran. scripts/lavapipe-image's nextest command takes --write and --env as
run does, so the leg's cache directory and variables reach the container. scripts/linux-gate-ci
gets the same step, as docs/VALIDATION.md asks of every Linux step. AGENTS.md's CI line and
VALIDATION.md's note on the width name the leg and the cache rule. Nothing in product code reads
either variable.
Why: the planner wants a stand-in for a device whose SIMD group is 4 wide (tile GPUs are a target).
The lab's 128-bit runs failed because of llvmpipe's disk cache, not our lowering. llvmpipe keys its
texture functions (lp_texture_handle.c) and its cache id (lp_screen.c) without
lp_native_vector_width (Mesa 26.2.4), so a cache that 256-bit runs filled gave a 128-bit shader an
8-wide texture function. A cache of the leg's own cannot collide with the 256-bit one.
Verified on lavapipe (Mesa 26.2.4, LLVM 23.1.1, 128 bits, subgroups 4), at aeb0ca9560, the
runtime's whole cpu_icd suite:
- shared default cache: 989 tests run: 887 passed, 102 failed, 4 skipped (job m3-max-83853);
- the cache off: 989 tests run: 989 passed (2 slow), 4 skipped (job m3-max-83888);
- gdb on two of the crashes stops at the same JIT store, vmovaps of a ymm register, the 4th of
four plus a byte at 0x80: an 8-wide texel struct written into a 4-wide caller (job m3-max-83878).
The step itself ran in the lab from ci.yml's step text, in the pinned lavapipe image (Mesa
26.2.4-arch1.1, LLVM 23.1.1): deviceName = llvmpipe (LLVM 23.1.1, 128 bits), subgroupSize 4 (min
and max 4); 764 runtime device tests listed; Summary 762 tests run: 762 passed, 231 skipped; job
exit 0 (job m3-max-83928, on the RTX 5080 Laptop machine's lavapipe). scripts/linux-gate-ci's
new step passed bash -n only; it has not run end to end. No Rust changed, so clippy, Rustdoc and
the suites have the inputs they had.
Regenerate and verify all 3652 rows across 15 profiles on hosted macOS for semantics 2343. Source: 2c297ad7bf. Evidence: https://github.com/charlysound/metal2vulkan/actions/runs/47127204415. The full Linux software suite passes 6141 cases before this test-only table refresh; twelve CPU mesh cases, all Clippy configurations, device-gated compilation and Rustdoc pass.
lower/raytracing/mod.rs and pipeline/facts.rs still named
StageTable::acceleration_structures, StageTable::threadgroup_lengths and
bind::BoundAccelerationStructure, which went with the binder's cut
(b5916b2f7b and the cut before it; the runtime binds through no stage table,
46a9a57522). The paragraphs now say what the binder writes without them.
Comments only. Neither file is a runtime input the validation guard hashes
(build.rs's list), so runtime-sources.sha256 stays a92fe0a8, recomputed with
no build; grep finds no other StageTable or BoundAccelerationStructure in
crates/ or docs/.
The header said the translation emits Vulkan's quad instructions where the
vertex stage takes them. It lowers every vertex function's quad broadcast and
shuffle-xor to a subgroup shuffle through the ballot of the live lanes on
every device, as the fixture README's row and the engine test
vertex_quad_permutes_shuffle_through_the_live_lanes say, since a vertex quad
may lack a lane past the draw's vertex count.
Comment only: the generated .ll and .air.ll carry no comment of the source and
are unchanged (regen-air-fixtures not needed), and the corpus cases key on the
AIR's hash, not the source's.
Covers::saw took a call as a texture's making only where its selector starts
with newTexture, so newTiledTextureWithDescriptor:offset:bytesPerRow: and
newLinearTextureWithDescriptor:offset:bytesPerRow:bytesPerImage: never
reached it: the rule held such a texture as no texture at all, neither over
its buffer nor written with it, and the linear selector's arm there was never
taken. The branch now also takes every selector makes_texture_over_buffer
names.
Found by the previous commits' test, which failed at the fix commit too (the
RTX 5080 laptop's node, job m3-max-83777: the tiled and linear textures read
uncovered).
The cover rule held a buffer's cover on the buffer alone, so a texture made
over a covered heap buffer read as uncovered: its check was compared and its
dump carried no cover, and compare-dumps could report as a difference the
bytes Metal leaves undefined once a heap texture's write aliased them.
Covers::covered now maps an object to the one whose bytes it holds (a view to
its texture, a texture over a buffer to that buffer), the same mapping the
rule already used to decide whether a texture's write is tracked. The rule
also takes the player's own list of the selectors that make a texture over a
buffer (makes_texture_over_buffer), which adds the tiled form
(newTiledTextureWithDescriptor:offset:bytesPerRow:) the rule had missed.
docs/REPLAY-STREAM.md and dumps.rs say a texture's cover follows its buffer's.
Verified by the test the previous commit added (red there, green here); the
jobs are in the lane's report.
The replay player's cover rule (covers.rs) covers a heap-placed buffer that a
heap texture's write meets, but a texture made over that buffer
(newTextureWithDescriptor:offset:bytesPerRow: and its tiled and linear forms)
holds the buffer's bytes and is not marked covered, so a check or a dump of it
carries no cover and compare-dumps can report the bytes the cover rule leaves
undefined as a difference.
This test makes one texture over a heap buffer by each of the three selectors,
covers the buffer by a dispatch that writes a heap texture placed over it, and
expects each to be checked as covered until the buffer is written whole. It
fails at this commit; the fix follows.
The coherent access beside a storage image no longer refuses (d0665778b7), so
lower/sync/memory_model.rs's not_implemented site of feature::Lowering is gone: 31 sites
become 30. Generated by scripts/refusal-surface/refusal_surface.py at 8e912a905d; the
runtime's error/basis.rs comes out unchanged. Found by lane lowrows's regeneration at that
tip.
One authored case over engine/coherent_texture_handoff's coherent_texture_handoff: 128 threads in
threadgroups of 64, a 64 x 1 r32_uint texture of zeros, a zero flag and an output of 64 words
filled with 0xAB. It is authored_bounded: the reader's one loop runs at most 4096 loads, a constant
of the kernel. Installed with corpus-case-check and qualified on Metal on the Apple M3 Max, three
executions (m3-max-83673): every word is 1 (output sha256 08f4ad0b..., the hash of 64 words of 1),
so no read on Metal that saw all 64 writers' flag read the texel's earlier value.
scripts/qualify-public-cases with this case in its list exits 0 on lavapipe (job m3-max-83707), and
the case's Vulkan candidate on the Intel Iris Xe (RPL-P) under its venue intel-irisxe-rplp-anv
prints Match (m3-max-83680).
tests::coherent_texels gains each_device_hands_a_device_coherent_texture_between_threadgroups,
under a device cfg on every device: engine/coherent_texture_handoff's coherent_texture_handoff_seen
from the fixture's .ll, through the runtime's identity route, dispatched as two threadgroups of 64
threads over a 64 x 1 R32Uint Shared texture of zeros, its flag and output in one Shared block
(new_buffer zeroes the flag). Of threadgroup 1's 64 reads it counts those that saw all 64
writers' flag and, of those, the ones that read the written texel, prints both, and fails where a
read that saw the flag read anything else. A device that ends the bounded wait before
threadgroup 0 runs shows no flag; its line says so, and its run then proves only the barrier
test's ordering within a threadgroup.
Counts:
- Intel Iris Xe (RPL-P): of 64 reads, 64 saw every writer's flag, and of those 64 read the written
texel (m3-max-83672); the barrier test beside it: 1024 of 1024 threads read their neighbour's
write;
- lavapipe (llvmpipe, LLVM 23.1.1): of 64 reads, 64 saw every writer's flag, and of those 64 read
the written texel (m3-max-83707); the barrier test beside it: 1024 of 1024.
bless_engine_goldens under the pinned LLVM 21 (Homebrew 21.1.8) on the M3 (m3-max-83664) writes the
fixture's printout: its four texture calls decoded with device_coherent: true.
bless_engine_inventory in the same job, with every assembler, leaves the table as the previous
commit wrote it: the four coherent_texture_handoff rows stand, and no other row moved. Both bless
tests passed.
The typed .air.ll and the opaque .ll from scripts/regen-air-fixtures on the M3 (m3-max-83664:
Metal 32023.922, SDK 27.2 26B118), and the fixture's TOOLCHAIN line. Apple's compiler names the
texture's read and write air.read_texture_2d.device_coherent.u.v4i32 and
air.write_texture_2d.device_coherent.u.v4i32, the writer's fence air.atomic.fence(i32 4, i32 3,
i32 2) and the reader's air.atomic.fence(i32 4, i32 2, i32 2) (texture memory, release or acquire,
device scope), and the flag's add and load air.atomic.global.add.u.i32 and
air.atomic.global.load.i32 at relaxed order and device scope.
The engine inventory gets four rows, the two kernels from each text. Each reads and writes a uint
texture2d declared read_write, as format_scout's scout_read_write_u does, and takes its row: ok on
every profile but the three Intel profiles and the runtime floor, which have no storage-image read
without a format and need the texture's format (NeedsInput StorageTextureFormat at texture 0).
Our own MSL (metal4.1, macOS 27.0): two kernels over a texture2d<uint, access::read_write,
memory_coherence_device>, a device atomic_uint flag and an output buffer, dispatched as two
threadgroups of 64 threads. Each thread of threadgroup 0 writes its texel (1000 + i), fences
texture memory at device scope with release order and adds 1 to the flag (relaxed); each thread
of threadgroup 1 loads the flag until it reads 64 or for at most 4096 loads, fences texture memory
at device scope with acquire order and reads the texel of its index.
coherent_texture_handoff stores 2 where a reader saw all 64 writers' flag and read anything but
the written texel, else 1: its words are 1 whatever the scheduling, so the case stays
deterministic for Metal qualification. coherent_texture_handoff_seen stores each reader's flag
value and texel, for the runtime's device test to count the reads that saw the flag.
The fences are MSL 4.1's release and acquire, not seq_cst: the runtime refuses a seq_cst fence
beyond the thread under the identity domains (IdentityDomains, "a sequentially consistent fence",
a known gap in its README), which a first form of this fixture met on the Iris Xe (m3-max-83655).
MSL 3.2's memory_coherence_device texture is read and written through members of the read and
write families named device_coherent, first after the stem and before .i16: Apple's compiler
(macOS 27.0.1, metal 32023.922) names a 2D uint texture's read and write
air.read_texture_2d.device_coherent.u.v4i32 and air.write_texture_2d.device_coherent.u.v4i32
(job m3-max-83533), a 2D half texture's at 16-bit coordinates
air.{read,write}_texture_2d.device_coherent.i16.v4f16, a texture buffer's
air.{read,write}_texture_buffer_1d.device_coherent.u.v4i32 and a 3D float texture's
air.{read,write}_texture_3d.device_coherent.v4f32 (job m3-max-83599), each with the operands of
the same access to a texture of the default threadgroup coherence and the same argument metadata.
The SDK's metal_texture headers pass the coherence to every read, sparse read, block read and
write; atomics take none. The translator refused each as UnknownIntrinsic.
Now:
- metal2vulkan-air: Texture::device_coherent holds the token, which Texture::parse reads first after
the stem for a read, block read or write and refuses for any other operation (a name the
grammar does not know stays unknown). Block-read canonicalization keeps it on the reads it
makes. The module doc gives the token's place.
- metal2vulkan: such a read or write takes its coherence as a buffer's *_coherent access does
(sync::memory_model::coherent_access, texture::device_coherent): under the Vulkan memory model,
where the profile has vulkanMemoryModel and its device scope, a read carries NonPrivateTexel
with MakeTexelVisible and a write with MakeTexelAvailable, at Device (Read::coherent,
Write::coherent, emit::texel_memory); elsewhere the function keeps GLSL450 and every storage
image is Coherent. A texture buffer held as words reads and writes through routines of their
own made at Device scope (words::Routine's coherent), under the Vulkan model only.
Public surface: metal2vulkan-air's intrinsics::Texture gains the public field device_coherent
(api_signatures.tsv blessed). A consumer that builds a Texture with a struct literal must set it;
the Debug form of a Texture prints it, so the engine fixtures' AIR input snapshots
(crates/metal2vulkan/tests/air_input/*.txt) print device_coherent: false on every texture call.
SEMANTICS_VERSION moves above development's: a refusal becomes a module.
Verified (job m3-max-83707): the command line on that kernel gives, for lavapipe and moltenvk-m3,
OpImageRead with MakeTexelVisible|NonPrivateTexel|VolatileTexel and OpImageWrite with
MakeTexelAvailable|NonPrivateTexel|VolatileTexel at scope Device (%uint_1), each module valid under
spirv-val at vulkan1.2, 1.3 and 1.4; the engine_atomics, engine_handles and air_input tests pass
(84); cargo fmt, clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd), Rustdoc, the API reference check
and the doctests pass; the suites pass 3742 of 3743 (24 skipped), the one failure
golden_hashes_match_the_table, bless due as at 011540217d; the validation suite passes 1343 (3
skipped) and the conformance suite 1052. The states-only plays of the branch's tree
(m3-max-83739) make what 011540217d's make (m3-max-83738): the gb-3090-r2 stream 10643 render and
15299 compute states, the 780M windrag stream 8972 and 225, none refused.
Landed with SEMANTICS_VERSION 2349 (renumbered above development's 2348: written 2347 on its base).
A texture declared with MSL 3.2's memory_coherence_device (texture2d<uint, access::read_write,
memory_coherence_device>) compiles, under macOS 27.0.1's metal 32023.922 at the default -std and at
-std=metal3.2, to the same argument metadata and type as a texture of the default threadgroup
coherence; only its reads and writes change, to members of the read and write families named
device_coherent: air.read_texture_2d.device_coherent.u.v4i32 and
air.write_texture_2d.device_coherent.u.v4i32 (job m3-max-83533). The SDK's metal_texture headers pass
the coherence to every read, sparse read, block read and write of every texture type, the texture
buffer's included; atomics take none. The translator parses no such member: Texture::parse finds
three tokens after the stem and answers None, so the function is refused as UnknownIntrinsic.
This adds a no-device test: engine_atomics
a_device_coherent_textures_texels_are_made_available_and_visible_at_device_scope compiles the
coherent_image kernel with its read and write renamed to the device_coherent members on every
profile of the file and on lavapipe without the memory model, and passes L3. Under the Vulkan model
each read must carry NonPrivateTexel with MakeTexelVisible and each write with MakeTexelAvailable,
at Device; under GLSL450 the storage image must be Coherent.
At this commit the test fails: the function is refused as UnknownIntrinsic.
Verified on the CPU (job m3-max-83707, red leg 2): with the crates at this commit the test fails at
its compile, and the command line on the kernel prints FALLBACK, UnknownIntrinsic
(air.read_texture_2d.device_coherent.u.v4i32), for moltenvk-m3 and lavapipe.
lower/sync/memory_model.rs's finish refused a function with a coherent access, or anything else
that selects the Vulkan memory model, beside a storage image outside an interlocked body
(NotImplemented{Lowering(MemoryModel)}), its module doc saying the image's NonPrivateTexel
accesses were not measured. The accesses were already right: a storage image's read and write
take the function's coherence (texture::emit::texel_memory), NonPrivateTexel under the Vulkan
model, so a barrier orders them with other invocations' accesses as GLSL450 does; under GLSL450
the module decorates every storage image Coherent beside the coherent accesses. Under the identity
domains, the runtime's route, the refusal never fired for a texture slot.
Now the refusal is gone, and with it texture::TexturePlan::heap_storage_images, which only it
called. The module doc says what a storage-image access takes and names the runtime test that
measures it.
SEMANTICS_VERSION moves above development's: a refusal becomes a module.
Verified on the CPU (job m3-max-83707): the two translator tests pass; the golden table differs from
development's (semantics 2342) in 72 cells here, as at 011540217d and at the tip, so the change
moves no existing cell by count; the refusal surface check passes.
Landed with SEMANTICS_VERSION 2348 (renumbered above development's 2347: written 2346 on its base 011540217d).
lower/sync/memory_model.rs refuses a function with a coherent access and a storage image
(NotImplemented{Lowering(MemoryModel)}) outside an interlock, its module doc saying the image's
NonPrivateTexel accesses "are not measured". The translator does emit them: a storage image's read
and write take memory_model::coherence(plan).texel(), NonPrivateTexel under the Vulkan model, as
every word access of shared memory takes NonPrivatePointer, so a barrier orders them with other
invocations' accesses as GLSL450 does. Under the identity domains the refusal does not fire for a
texture slot (finish counts cx.descriptors.storage_images, which a slot adds to only off identity),
and the command line on engine_atomics' coherent_image kernel for moltenvk-m3 and lavapipe (no
lowering inputs, the runtime's route) gives OpMemoryModel PhysicalStorageBuffer64 Vulkan,
OpImageRead and OpImageWrite with NonPrivateTexel|VolatileTexel, and the coherent OpStore with
MakePointerAvailable|NonPrivatePointer at Device; a variant with a threadgroup barrier over device
and texture memory between the write and a neighbour's read gives OpControlBarrier Workgroup
Workgroup with AcquireRelease|UniformMemory|ImageMemory|MakeAvailable|MakeVisible. Each module
passes spirv-val at vulkan1.2, 1.3 and 1.4 (job m3-max-83520).
This ports the refusal's two tests to the answer and adds a device test:
- engine_atomics a_coherent_access_beside_a_storage_image_orders_its_texels: the kernel with the
coherent store compiles on every committed profile of the file and on lavapipe without the
memory model, and passes L3. Under the Vulkan model its texture's every read and write carries
NonPrivateTexel and no MakeTexel* (the texture has Metal's default threadgroup coherence); under
GLSL450 its storage image is Coherent (pipeline::testing::interlocked_coherence). The kernel with
a plain store keeps plain texel operands.
- engine_handles a_coherent_access_beside_a_heap_storage_image_compiles: a heap storage class read
and written beside a coherent store compiles and passes L3, with and without image robustness.
- metal2vulkan-runtime tests::coherent_texels, under a device cfg on every device: a kernel reads
its texel of a read_write texture2d<uint>, writes it plus one, crosses a threadgroup barrier over
device and texture memory, reads its neighbour's texel and stores it with
air.store.device_coherent, over 64x16 threads in threadgroups of 8x8; every thread must read
its neighbour's write, never the texel's earlier value. It prints the counts before it checks
them.
At this commit the two translator tests fail: the function is refused. The device test runs
through the runtime's identity route, which the refusal does not reach, so it passes here.
Verified on the CPU (job m3-max-83707, red leg 1): with the crates at this commit the two translator
tests fail, each at its compile.
Six authored cases over the owned fixture rfs_kernel_lod: five of the kernel lod_2d and one of
the vertex function lod_vertex, each through a runtime sampler bound with
set*SamplerState:lodMinClamp:lodMaxClamp:atIndex: with a pair that differs from its
descriptor's, so the answer says which pair the query reads. The M3 Max (macOS 27.0.1, job
m3-max-83804) answers the bind's pair in every one:
- nearest mip, default clamps, bound (2.7, 4): 3 (the descriptor's pair reads 0);
- nearest mip, clamps (3, 4), bound (1.2, 4): 1 (3);
- linear mip, default clamps, bound (2, 3): 2 (0);
- nearest mip, clamps (2.7, 4), bound (0, FLT_MAX): 0 (3);
- nearest mip, default clamps, bound inverted (3, 1): 1, as under (1, 1);
- the vertex function, default clamps, bound (2.7, 4): 3 (0).
Each unclamped level is 0. The ids join scripts/qualify-public-cases, CI's lavapipe step.
Why: under the identity domains the query reads the minimum level from the word of the
resource ID the slot pushes, and a bind with clamps pushes the ID of the state's variant of
the pair; these cases check that variant's word against Metal.
A case's sampler gains bind_lod_clamps, the [lodMinClamp, lodMaxClamp] pair it is bound with.
The Metal oracle binds it through the stage's set*SamplerState:lodMinClamp:lodMaxClamp:atIndex:
(compute, vertex, fragment, tile, object and mesh); the Vulkan candidate through the runtime's
set_sampler_state_with_lod_clamps and its vertex and fragment forms, which bind the state's
variant of the pair. Absent, the field is left out of the case's JSON, so every existing case
keeps its identity; a NaN bound is refused, as Metal documents no answer for one, and an
inverted pair is allowed.
Why: the runtime's bind-time variant carries its own resource ID word, which a kernel's LOD
query reads under the identity domains; only an authored case of that bind checks its answer
against Metal.
Verified: the identity tests cover the field's absence, its presence and its NaN refusal; the
cases and their runs are in the next commit.
Ten authored cases over the owned fixture engine/rfs_kernel_lod. Each comes from the committed
runtime-sampler case of its entry with the sampler's mip filter and LOD clamps set (no new AIR):
- lod_2d: nearest (2.7, 4) reads 3; nearest (1.5, 3) reads 1; no mip filter (2.5, 4) reads 0;
linear (2, 3) reads 2; linear (10, 20) reads 4 (the last level); nearest (6, 9) reads 4;
- lod_2d_array: nearest (0.6, 4) reads 1;
- lod_3d: linear (1, 2) reads 1;
- lod_cube: nearest (2.2, 3) reads 2;
- lod_vertex: nearest (2.7, 4) reads 3, 64 points with no rasterization.
Every unclamped level is 0. These are exact rows only: a linear mip filter with an lodMinClamp
between whole levels, which the identity domains answer by the word's nearest level, has no case
(the planner's ruling; docs/API.md's accepted differences).
Installed with corpus-case-check and qualified with corpus-metal on the Apple M3 Max (macOS
27.0.1, environment apple-m3-max-macos27.0.1), job m3-max-83473. Each observation decodes to the
levels above, which metal::sampler::query_min_level gives. scripts/qualify-public-cases (CI's
lavapipe step) now runs these ten and the four existing runtime-sampler cases of the fixture.
Before this branch's translator fix those four were not_supported under the identity domains
(lavapipe, m3-max-83452: refusal=4); at the fix they match=4.
A case's sampler (SamplerResource) gains lodMinClamp and lodMaxClamp, each optional and left out
of the case's JSON when absent, so every case written before them keeps its identity. The Metal
oracle sets them on its MTLSamplerDescriptor (metal::platform::samplers), and the Vulkan candidate
on the descriptor its runtime sampler state is made of (candidate::engine::resources::
sampler_descriptor, the one source of the kernel, render and argument-buffer paths); an absent
clamp is Metal's default, 0 and FLT_MAX. The checker refuses a NaN or inverted pair. A clamp is
part of the identity where authored. No executor answer changes for a case without one, so no
executor version moves.
Tests: sampler_descriptor takes the clamps; absent clamps leave the JSON and the identity alone and
authored ones change it; an inverted or NaN pair is refused; every committed case (corpus/cases,
read by name) still computes to its stored case_id under the new schema. The last test is the
evidence that no existing identity moved; it runs in the lane's validation suite job.
A clamped calculate_clamped_lod in a kernel or a vertex function through a runtime sampler
argument was refused on every profile under the identity domains ("a sampler argument whose
minimum level or emulated filter the function specializes"): the query read the slot's
SamplerMinLevel specialization, which no binder chooses there.
The query now reads the word of the resource ID the sampler slot already pushes (SlotGuestBase):
0 where the word states no mip filter, else SamplerWord::LEVEL_MIN, the level a nearest mip
filter reads at lodMinClamp, bounded by the texture's last level as before. A bind-time clamp
(setSamplerState:lodMinClamp:lodMaxClamp:) binds a variant whose word is made of the clamped
descriptor, so it is read too. That is the M3 Max's and M4's measured answer
(metal::sampler::query_min_level) for no mip filter and a nearest one, and for a linear one where
lodMinClamp is a whole level or past the texture's last level. Under a linear mip filter with a
clamp between whole levels Metal answers the clamp on its sixty-fourths grid, which the word does
not hold. MSL 4.1 section 6.13 leaves both queries undefined outside a fragment function ("Only
call the calculate_unclamped_lod and calculate_clamped_lod functions from a fragment function or
a function you call with a fragment function; otherwise, the behavior is undefined."). So, per
the planner's ruling, there is no precision note; docs/API.md's accepted differences states the
answer. The resident-table path keeps its specialization.
SEMANTICS_VERSION 2347. The runtime-sources pin does not move: pin-compute.py gives a92fe0a8...
for this tree, the same as before. docs/REFUSALS.md does not move either: the refusal text
remains for an extended-range sample's linear-mip blend. The runtime README's known-gap entry
names the lowered query. Verified by the lane's red/green job, named in the lane's report.
Landed with SEMANTICS_VERSION 2347 (renumbered above development's 2346: written 2343 on its base,
then 2346 at the lane's rebase onto 0f4114c882, which development's HandleUse also took).
Under the identity domains (the runtime's policy) a clamped calculate_clamped_lod in a kernel or a
vertex function through a runtime sampler argument is refused on every profile, "a sampler
argument whose minimum level or emulated filter the function specializes": the query wants the
slot's SamplerMinLevel specialization, which no binder chooses there.
The two tests compile rfs_kernel_lod's runtime-sampler entries (lod_2d, lod_2d_array, lod_3d,
lod_cube, lod_vertex) and sampling_completion's lod_query_kernel under the identity policy on the
lavapipe and moltenvk-m3 profiles, and require L3 to pass, no SamplerMinLevel or SamplerState
specialization, the sampler slot's resource ID pushed, one OpImageQueryLevels and no
OpImageQueryLod. Red at this commit: each compile is the IdentityDomains refusal. The red run is
the lane's next potluck job.
Preserve the native object/mesh path alongside upstream texture-buffer and restore-batch changes. Advance semantics, artifact and runtime versions beyond both parents (2343/607/2560) and refresh the runtime source guard. Workspace all-target all-feature Clippy passes. The complete golden table is retained from upstream pending its genuine Apple-assembler refresh in hosted CI.
The golden hash table moves 18 rows, 133 cells, every one a hash before and after, and gains 8
rows: kernel_handle_word_joins's four entries in both fixture forms, which compile on all 15
profiles. Its semantics line goes from 2342 to 2346. The golden bless at each translator commit
since pin S (job m3-max-83753) puts every moved cell on one of two commits:
- 423fbce843 (ZeroAddress placed where a read may be checked on a device-address slot): 29 cells,
fragment_discard_hoist:hoisted_written_read in both forms on 12 profiles and
kernel_dynamic_cursor_across_a_call on 5 (lavapipe x3, moltenvk-m3, runtime-floor);
- aa2355716b (a half-float or RG11B10Float texel held as words converts only values in range):
104 cells, the texture-buffer subjects of a8r_buffers, hsw_storage_writes, tb_word_formats,
texture_ops and tob_renders on the 7 profiles that hold a texture buffer as words, and
kernel_texture_variant_leftovers on 6 of them.
The mode-2 rounding commit (011540217d) and HandleUse move no existing cell. The engine inventory
and the air_input printouts bless unchanged, and the metallib half of
committed_air_fixtures_parse_and_link passes on the M3's SDK (bless job m3-max-83730, at
f27b62c05a).
The authored compile census recompiled every cell: 2373 cases, 9 profiles, 21,357 cells, 0
cached; 19,142 compiled, 2,215 refused, 0 failed, 0 regressions (census job m3-max-83810, wall
65.7 s, slowest compile 450 ms). Its four differences are kernel_handle_word_joins's four new
cases, all compiled on every profile; 9 rows move only their artifact digests (30 digests), and
the artifacts_at line moves to this build.
corpus-metal ran the four authored cases on the M3 Max (apple-m3-max-macos27.0.1, the primary
reference environment), from the Metal twin kernel_handle_word_joins.air.ll, and qualified all four
(job m3-max-83499, at 1d88e9bd64).
The three sampler cases record one output (they spell the same choice three ways): even threads
read the texel clamp to edge names, odd threads the texel repeat names, and the two differ at
every shared out-of-range coordinate, so a thread that took the other branch's sampler would read
another texel. The texture case records each odd thread reading element slot[g] & 3 of the
texture array and each even thread the other texture.
The public case step now runs the four authored cases of the owned fixture kernel_handle_word_joins
(a sampler or a texture taken from a branch merged at a join, as integer words in a phi and in a
select, and as pointers in a phi) against their Metal observations.
Verified: syntax only (bash -n); the cases' Metal observations and the step's run come next.
Four cases, one for each entry of the owned fixture kernel_handle_word_joins: sixteen threads
take a sampler or a texture from a branch merged at a join (as integer words in a phi, as words in
a select, and as pointers in a phi) and write what it samples or reads.
The sampler entries read element slot[gid] & 3 of an array<sampler, 1> through a run-time GEP
index; slot holds 4g, so the index is always the array's one element. The case checker binds only
the first slot of a sampler array (the case schema has no sampler-array resource), which is why
the array has one element; engine_handle_words compiles the same entries over an
array<sampler, 8>. The texture entry reads element slot[gid] & 3 of an array<texture2d, 4>.
Installed by corpus-case-check --install at c5bbdb25b7 (job m3-max-83477, msi), which also
translated the fixture's Metal twin (kernel_handle_word_joins.air.ll through metal-as) for all four
entries (spirv-val PASS) and ran engine_handle_words, 7 of 7 passed.
The sampler entries read samplers[slot[gid] & 3] again, the structure under test: a word loaded
from a sampler-array element at a run-time index (a GEP whose index is a value, not element 0)
meets the constexpr sampler's bits at a join. The array stays an array<sampler, 1>: the authored
case checker binds only the first slot of a sampler array (the case schema has no sampler-array
resource), so the cases' slot values make the index 0 and Metal reads the one element.
engine_handle_words compiles the same three sampler entries over an array<sampler, 8>, a text edit
of the fixture's byval, GEP and argument metadata types, on every committed profile under both
policies, and checks the element's load is the clamped load over its run-time index range.
Verified: nothing yet at this commit; the next job runs the tests and llvm-dis of the twin.
The authored cases bind a sampler array's parameter at its first slot
only (the case schema has no sampler-array resource; the checker
refuses samplers 1-3 of an array<sampler, 4> as bound to nothing), so
the sampler entries now read the one element of an array<sampler, 1>
at a constant index, and their unused slot parameter is gone. The
texture entry keeps its four-element array read at a run-time index,
the same element lowering for either class. The typed twin follows
(reassembled with metal-as and linked with metallib on the M3), and
merged_handle_words_are_handle_indices expects the sampler entries'
static element load.
Handle words merged at a join now compile where they were refused
(Lowering(Access) HandleUse), and a handle phi of a constant with one
candidate of its class where it was ConstantOperand: the output for an
unchanged key changes, so the version moves above development's 2342 (2343, which the audit lane's item also targets; renumbered at landing).
lower::access::handle's module doc says what the word webs are and
when they lower; AccessCause::ConstantOperand's doc says a handle phi's
constant is refused only without one candidate of its class.
The runtime guard's inputs are untouched (the build's hash over them,
recomputed the way build.rs does, is the committed
runtime-sources.sha256), and docs/REFUSALS.md regenerates unchanged.
Landed with SEMANTICS_VERSION 2346 (renumbered above development's 2345: ZeroAddress 2343, finding 1 2344 and 2345). runtime-sources.sha256 recomputed on development, unchanged (a92fe0a8).
The fixture kernel_handle_word_joins.ll states in its header that it is
written from our own source and today's compiler's output for it;
kernel_handle_word_joins.air.ll is its typed-pointer twin, which xcrun
metal-as assembles for the Metal oracle (assembled and linked with
metal-as and metallib on the M3).
engine_handle_words adds:
- merged_handle_words_are_handle_indices: each entry's element load is
the clamped element, the select merge a handle select, and each
inttoptr (and the texture parameter's ptrtoint) a handle copy;
- an_observed_handle_word_is_refused: a merged integer with an
arithmetic use, or stored, keeps Lowering(Access) HandleUse;
- a_handle_word_of_another_class_is_refused: a web merging a sampler's
bits with a texture's, and one whose inttoptr makes a texture of a
sampler's bits, are HandleAsPointer;
- a_handle_phi_of_a_constant_that_is_no_handle_of_its_class_is_refused:
a sampler phi of a constant GEP of the sampler state is
HandleAsPointer (provenance's class conflict refuses it before
lowering's ConstantOperand);
- a_handle_phi_of_null_is_the_null_handle.
The fixture inventory gains the pair's eight rows, ok on every profile
(the .ll rows as the red test's run at e32daf9d9b compiled them; the
.air.ll rows expected, taken from the expectations off macOS).
An older Metal frontend spells `cond ? samplers[i] : constexpr_sampler`
by copying each branch's handle as a 64-bit integer (an element of a
handle array as a plain integer load through its address, a constexpr
sampler or a handle parameter as the ptrtoint of its pointer), merging
the integers in a phi or select, and turning the merged integer back
into a handle with inttoptr. Lowering refused the integer load
(Lowering(Access), HandleUse), and the same merge of the pointers
themselves, today's form, was refused for its constant incoming value
(ConstantOperand).
Provenance now finds these word webs by structure alone
(memory::provenance::words): integers merged by phi, select, or freeze,
each a plain integer load, a ptrtoint of a pointer, a ptrtoint
constant expression, or another merge, all as wide as the pointer, and
every use another merge or an inttoptr as wide (a sink). Any other use
of an integer (arithmetic, a compare, a store, a call) or any other
operand of a merge leaves the web out, and its inttoptrs stay pointers
made from an integer. A sink of a merge joins its sources' facts while
each is a handle (a load through a handle-array element, the bits of a
handle parameter, a constexpr sampler, or null), so its candidates are
the same merge's of the handles; its class is seeded from the arrays
and merged with the converted pointers, so a web mixing classes is a
class conflict. The bits of a handle such a web carries are not an
escape.
Lowering plans each web whose sinks, loads, ptrtoints and constants all
hold one class's handles (each constant with exactly one candidate):
its integers are handle indices (HandleWord::Joined), its selects and
freezes routed to the access family, and each constant its handle
index. A handle phi takes a constant incoming value in only when the
constant has exactly one candidate of the phi's class (the null handle
or a constexpr sampler's; under the identity domains an argument
buffer's sampler takes only null, as its nil ID); any other keeps the
ConstantOperand refusal.
The merge check passes over golden_hashes_match_the_table and the public fixtures' inventory
tests, which are often due for a bless, so the one sweep that compiles every public fixture's
subjects on every committed profile under the runtime's policy, and refuses a translator bug (an
internal error, such as a strategy's read of an unplaced push field), ran at no landing. This
test builds the same table with the golden check's own builder and compares no hash: it fails
only on a translator bug, and its name is outside the bless-due filter.
A texture buffer of a format a device holds as words is written by lower/texture/words.rs's
write_texel, which rounded a half-float or RG11B10Float channel toward zero at either
textureWriteRoundingMode. Metal's texture buffer rounds those to nearest even at mode 2, as its
storage texture does (the probe below). So a fragment function in a mode-2 pipeline that wrote a
half-float or RG11B10Float texture buffer on a device holding that format as words stored a code
one below Metal's on 36% to 44% of the probe's channels, and 65504 where Metal stores the infinity.
Now, where Write::half_up marks the write (a fragment function's, in a pipeline of mode 2):
- a half-float channel (R16Float and RG16Float, the half-float formats a device may hold as
words) takes ChannelWrite::FloatNearestEven, a finite value past the largest to the infinity, as
Metal's RGBA16Float texture buffer stores it;
- an RG11B10Float channel takes nearest even too, and a lane that rounds to the infinity from a
finite value is held at its format's largest finite value (65024 for the 11-bit channels, 64512
for the 10-bit one), as Metal's stores it; an infinity stays, and a NaN is the quiet NaN still.
The RGB9E5Float word's half-up rounding is unchanged; the probe shows Metal's texture buffer
storing the same bytes as its storage texture there. A write at mode 0 or 1, and every kernel's
write, still rounds toward zero.
The probe is committed as crates/metal2vulkan-conformance/probes/texture_buffer_write_rounding.m:
texture_write_rounding_storage.m with texture_buffer<T, access::write> targets, made from a Shared
buffer with MTLTextureTypeTextureBuffer and written at texel y * 256 + x, over the same 65,536
texels. On an Apple M3 Max under macOS 27.0.1 (job m3-max-83395), mode 0 matched toward zero on
every channel, and mode 2 matched nearest even on every channel that is not a NaN: RGBA16Float
float texels 262,112 of 262,112 (to the infinity past the largest), RG11B10Float float and half
texels 196,583 of 196,583 each (held at the largest), and RGB9E5Float 65,536 of 65,536 at both
texel types (half up, its hashes equal to the storage texture's).
Docs: words.rs's module doc, Write::half_up and write_texel; API.md's words line names mode 2.
SEMANTICS_VERSION moves above development's: a texture buffer write's answer changes.
Verified on the CPU with no device (job m3-max-83575): the color_write and words tests pass (79), the
golden table differs from development's (semantics 2334) in 109 cells, as at a535f1dc17, and the
refusal surface is unchanged; cargo fmt, clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd),
Rustdoc, the API reference check and the doctests pass; the suites pass 3740 of 3741 (24 skipped),
the one failure golden_hashes_match_the_table, bless due; the validation suite passes 1340 (3
skipped) and the conformance suite 1052. The states-only plays of this tree (m3-max-83669) make
what 126ee4fdf5's make (m3-max-83443): the gb-3090-r2 stream 10643 render and 15299 compute
states, the 780M windrag stream 8972 and 225, none refused.
A texture buffer of a format a device holds as words (an R32_UINT view whose texels shaders convert)
is written by lower/texture/words.rs's write_texel. Write::half_up marks a fragment function's write
in a pipeline of textureWriteRoundingMode 2, but write_texel applies it to the RGB9E5Float word
alone: a half-float or RG11B10Float channel is rounded toward zero at either mode. Metal's texture
buffer rounds those to nearest even at mode 2, as its storage texture does: the conformance probe
texture_write_rounding_storage with texture buffers for targets, on an Apple M3 Max under macOS
27.0.1 (job m3-max-83395), matched toward zero on every channel at mode 0, and at mode 2 nearest
even on every channel that is not a NaN: an RGBA16Float channel past the largest finite value to the
infinity (262,112 of 262,112), an RG11B10Float one held at the largest finite value (196,583 of
196,583, for float texels and for texels rounded to half).
This adds a no-device test of the words against the probe's hashes, the way
rgb9e5_words_are_metals_at_either_mode holds the RGB9E5Float word, through the test hook
texture::written_words: lower/arith/tests/color_write.rs
half_and_small_float_words_are_metals_at_either_mode runs the words on the interpreter over the
probe's 65,536 texels and compares the FNV-1a hash of the words with Metal's at each mode:
RGBA16Float's texel (float texels) as RG16Float's words of red and green and of blue and alpha,
since RG16Float and R16Float are the half-float formats a device may hold as words and RGBA16Float
is not one, and RG11B10Float's (float texels and texels rounded to half).
At this commit the test fails at mode 2; mode 0 matches Metal.
Verified on the CPU with no device (job m3-max-83575): with words.rs at this commit the test fails
at mode 2, and half_and_small_float_words_convert_only_values_in_range passes.
lower/texture/words.rs's small_float_bits, which gives the codes of a half-float or RG11B10Float
texel a texture buffer held as words stores, computed every lane's denormal code (the lane's
value times 2^(14 + m), converted by OpConvertFToU) before a select kept it only for a denormal
lane. A normal lane of 2^(18 - m) or more (256 for a half float, 4096 for an 11-bit float, 8192
for a 10-bit one), and every infinity or NaN, reached the conversion past u32, which SPIR-V leaves
undefined; the select dropped what it gave, so no device was seen to store a wrong code, but the
module relied on an undefined operation for every such write.
Now a normal lane (an infinity and a NaN included) converts zero: the lane's magnitude bits are
selected to zero before the multiply, so every conversion takes a value below 2^m. A denormal
lane's code is unchanged, and the select still takes a normal lane's code from its exponent and
fraction. One select more per texel write.
SEMANTICS_VERSION moves above development's: the module of a write to a texture buffer held as
words changes.
Verified on the CPU with no device (job m3-max-83575): with words.rs at 16777dc811 the test
half_and_small_float_words_convert_only_values_in_range fails, the interpreter trapping
ConversionOutOfRange, and with this commit's words.rs it passes. The golden table differs from
development's (semantics 2334) in 109 cells at this commit and in 80 at 126ee4fdf5.
A texture buffer of a format a device holds as words (an R32_UINT view whose texels shaders
convert) is written by lower/texture/words.rs's write_texel, whose half-float and RG11B10Float
codes come from small_float_bits. That function computes every lane's denormal code, the lane's
value times 2^(14 + m) converted by OpConvertFToU, before a select keeps it only for a denormal
lane. A normal lane of 2^(18 - m) or more (256 for a half float, 4096 for an 11-bit float, 8192
for a 10-bit one), and every infinity or NaN, reaches that conversion past u32, and SPIR-V leaves
OpConvertFToU of a value its result type cannot hold undefined, whatever a device returns for it.
This adds a no-device test and the hook it needs (texture::written_words, a write_texel of a
format held as words, under cfg(test) alone): lower/arith/tests/color_write.rs
half_and_small_float_words_convert_only_values_in_range writes RG16Float and RG11B10Float texels
of normal, past-largest, infinite and denormal lanes on the interpreter, which traps an
out-of-range conversion, and checks each texel's words against the format's codes.
At this commit the test fails: the interpreter traps ConversionOutOfRange on RG16Float's first
texel (256, -65504).
A read at an offset the memory plan proves one value is checked at emission only where its
emitted offset is not a constant, which placement cannot know, so the field follows every read
of a checked device-address slot and is placed unread where each such read's emitted offset is a
constant: 17 golden cells on Linux's profiles move for that (fragment_discard_hoist's
hoisted_written_read on 12, kernel_dynamic_cursor_across_a_call on 5; job m3-max-83594).
Moving the check decision into the plan (an access the memory plan proves fixed is not checked)
places the field exactly, but drops the in-shader check from every such access whose emitted
offset is not a constant: 90 golden cells moved (job m3-max-83613). That widens containment's
behaviour beyond this fix and is not taken here.
The plan lists the fields it places; its strategies read theirs at emission, which refuses a read
of any field the plan did not place, so a compile that succeeds read none: the sweep checks every
field for its kernel, not ZeroAddress alone.
A device's description without pipelineRobustness makes its translator reach a kernel's buffers
at their device addresses, the form the unplaced ZeroAddress broke; the test asserts the form
and names it beside the device, so a run on a card that binds its kernels' buffers shows both.
moltenvk-m3 and runtime-floor lack shaderBufferInt64Atomics and refuse the kernel's typed
atomic, a typed refusal and not a placement failure (job m3-max-83546).
The translator's ADDRESSED_AND_VIEWED kernel in one threadgroup of 64 through the runtime: the
atomics are exact, each load reads its slot's memory (1 to 64 for words[0], at most the sum for
wide's low word), and nothing past the last thread's word changes.
Under the identity domains a kernel whose load reaches a typed atomic's device-address slot or
another slot through one pointer select ended in the invariant 'a strategy reads the unplaced
push field ZeroAddress' on every committed profile in the address form (lavapipe, RADV, ANV,
NVIDIA's address form): the select's load is at an offset the memory plan proves constant, so it
noted no variable read and placed no ZeroAddress, but a store at a variable offset made its slot
checked, and the emitted load, whose offset is not a constant there, took the check and read
the zero range outside.
Placement now follows use. note_variable records every read's slot at any offset
(AccessPlan::read) and no longer places the field; place_zero_address decides it once the slots'
forms are final: placed where a slot of variable that a read reaches is in the device-address
form (a memory-plan slot or a pulled fetch's own source), and removed elsewhere, which subsumes
the bound form's removal where no checked slot was left.
SEMANTICS_VERSION 2342 -> 2343: the push layout of a kernel with such a read moves.
Under the identity domains a kernel whose load may reach a typed atomic's device-address slot
or another slot ends in the invariant 'a strategy reads the unplaced push field ZeroAddress'
on some profiles. The test compiles and links ADDRESSED_AND_VIEWED on every committed profile
in the address form and the bound form and lists each that fails.
Core::fails_private stood in the product build as a method that always
returned false, called on every allocation; only its field was gated to the
device tests. The method now carries the field's cfg
(all(test, any(m2v_gpu, m2v_cpu_icd))), and allocate_spilling calls it only
in that cfg: the product build's first allocation is the plain allocate
call.
Verified in job m3-max-83684 (lavapipe): clippy of metal2vulkan-runtime with
all features (lib, bins, examples) and, under --cfg m2v_cpu_icd and
--cfg m2v_gpu, all targets, each EXIT=0; the product build's expanded source
(cargo rustc --lib -Zunpretty=expanded, 70,849 lines) holds neither
fails_private nor fail_private; the device tests that set the field,
tests::spill::on_device::every_device_spills_private_memory_out_of_device_memory
and tests::sites::on_device::every_device_counts_each_allocation_site_apart,
2 passed.
The view-storage known gap lists the cards whose own linear query makes the extended image of a
2 by 2 RGBA8Unorm_sRGB texture written through its RGBA8Unorm view. The RX 7900 XTX (RADV NAVI31)
now answers too, from job m3-max-83587 at 13c13835b0, run through the device tests in
storage_element and copy_cause, all 5 passed:
- over a Shared block of the runtime's, None for both the viewed and the written texture, so it is
made in place;
- over host memory's import, HostMemory, the copy every discrete card makes there;
- over a dma-buf's import, DmaBuf, as the RX 550 and the 780M answer;
- under the stand-in that refuses the extended image, ViewStorage, with the copy pair moving
(2, 32), and in place refused for ViewStorage.
Docs only. The README is no runtime-sources input.
The known gap for OverCause::ViewStorage now names what the lab's cards answered, read from
every_device_lands_a_write_through_a_view_of_a_texture_over_a_buffer's own-query arm at 13c13835b0
for a 2 by 2 RGBA8Unorm_sRGB texture written through its RGBA8Unorm view, with PixelFormatView
usage and without:
- RTX 3090 (NVIDIA 620.70.06, job m3-max-83540) and RTX 2080 (job m3-max-83541): in place over a
Shared block; HostMemory over host memory's import (discrete, so the external query is never
asked); no memory type taken for a udmabuf.
- RX 550 (RADV, Mesa 26.2.6, job m3-max-83542): in place over a Shared block; HostMemory over host
memory; DmaBuf over a dma-buf, with the stand-in and without, so not a refusal of the extended
plan.
- Radeon 780M Phoenix (job m3-max-83545) and Hawk Point (job m3-max-83560): in place over a Shared
block and over host memory's import; DmaBuf over a dma-buf as on the RX 550.
- Iris Xe (ANV, Mesa 26.2.6, job m3-max-83544) and lavapipe (job m3-max-83537): in place over all
three.
So no lab card reached makes the plain linear image and refuses the extended one. The RX 7900 XTX
waited behind the consumer's GPU job, the RTX 5080 Laptop was held for a pin's round legs, and the
UHD 630 (Windows) was not reached; the README already records that the UHD 630's optimal query
makes no extended image, so its plan is never extended and this copy cannot arise there.
Clippy's type_complexity under --cfg m2v_gpu and --cfg m2v_cpu_icd (job m3-max-83521) refused the
memories' inline tuple type; it is the alias Memory now.
every_device_lands_a_write_through_a_view_of_a_texture_over_a_buffer now also makes both textures
over a dma-buf's one import (Linux, through /dev/udmabuf, where the device imports dma-bufs and takes
a type for it), whose linear image the device's external query answers for the dma-buf's handle: the
answer it prints for each card is whether that query makes the image extended for the views'
storage. Under the stand-in the expected cause now follows the device's own answer over the same
memory: ViewStorage where its own was in place or ViewStorage, its own elsewhere (HostMemory over
host memory on a discrete device, a dma-buf's on a device without the foreign queue family).
every_device_refuses_in_place_alone_a_texture_whose_linear_image_stores_no_view failed on the RTX
2080 (job m3-max-83526): it compared the textures gauge across the refusals while the texture it had
just made to read the optimal image's usage was being freed by the reaper, which lowers the gauge
when it frees it. It now keeps each such texture until every make is refused, as copy_cause's test
keeps its textures. The same test passed on the RTX 3090 (job m3-max-83525) and lavapipe (job
m3-max-83492), where the free had landed first.
A run of an unchanged artifact may now do something else: where a texture over a buffer, planned
extended for its views' storage, had a linear image the device makes plain alone, the write through
the view that was Gap::StorageElement (Unextended) at dispatch now runs and lands through the counted
copy (OverCause::ViewStorage), and new_texture_in_place refuses that texture
(TextureNotInPlace { cause: ViewStorage }) where it made it plain in place. Main renumbers at
landing.
Where a texture over a buffer was planned extended for its views' storage (Plan::extended: shader
writes, an own format the device does not store, and a listed view format it does, which the
optimal image format query took), and the linear image query (for the buffer's import handle where
it has one) refused the extended linear image or a listed format's linear tiling lacked the storage
features while the plain linear image held, check_over made the texture plain in place. A write
through the stored view then had no storage element: Gap::StorageElement,
StorageElementCase::Unextended at dispatch, and the guest's write did not land. Metal keeps it.
check_over now answers OverCause::ViewStorage there (Spilled where the block spilled), whatever made
the plan extended (PixelFormatView with ShaderWrite, or an 8-bit sRGB texture's unorm sibling with
ShaderWrite alone), and the plain-in-place fallback is gone. One decision serves all three calls:
Buffer::new_texture makes the counted copy (rule 3's existing clause for a format query that offers
no linear image for the format and usage), whose optimal image keeps the extended plan, so the write
lands and its copies count in over_copies_view_storage; new_texture_in_place and its fenced form
refuse with TextureNotInPlace { cause: ViewStorage }; texture_copy_cause answers ViewStorage. No new
form and no rule 2 clause. Over a buffer, Unextended is now reachable only where the optimal query
itself refuses the extended image (the copy's image takes that plan too), as for Device::new_texture.
Docs: the runtime README's extended-usage entry, the over-copy cause list, texture_copy_cause's
descriptor-only causes and a known gap naming ViewStorage's copies and their two counters; the
public docs of new_texture, new_texture_in_place and texture_copy_cause; View's unextended.
docs/REFUSALS.md and api_signatures.tsv regenerated, no change here; runtime-sources fingerprint
unchanged (pin-compute).
A texture over a buffer that shaders write through a view of another format (PixelFormatView with
ShaderWrite, or an 8-bit sRGB texture's unorm sibling with ShaderWrite alone), whose own format the
device does not store, needs its image extended for that view's storage. Where the device's linear
image query refuses the extended image but makes the plain one, check_over makes the texture plain
in place, its view has no storage element, and the guest's write is Gap::StorageElement
(StorageElementCase::Unextended) at dispatch and does not land. Metal keeps it.
This commit adds what the fix needs to name and the tests that fail without it:
- OverCause::ViewStorage, with Metrics::over_copies_view_storage and
over_copy_bytes_view_storage, counted like every other cause (the device-free over_causes test
covers its pair; the replay player's metric list, its over-frames own-image part and the
stream test's decline list name it). No code answers it yet.
- A device-test stand-in, Core's extended_linear_refused, which makes linear_extent answer no
image for an extended plan, as a device whose linear tiling or external image query makes the
plain image alone does. The field and its read exist only under
cfg(all(test, any(m2v_gpu, m2v_cpu_icd))), as fail_private's field does.
- storage_element.rs: every_device_lands_a_write_through_a_view_of_a_texture_over_a_buffer (both
textures, over a Shared block and host memory's import, with the device's own query, which it
prints, and with the stand-in: the cause answered, the form made equal to it, the view-storage
pair counted, the write through the RGBA8Unorm view landing in the buffer's bytes);
every_device_refuses_in_place_alone_a_texture_whose_linear_image_stores_no_view
(new_texture_in_place, without an index, and fenced: TextureNotInPlace naming the cause, no
texture, no copy, no fence call); every_device_keeps_in_place_a_texture_over_a_buffer_that_
shaders_do_not_write (PixelFormatView without ShaderWrite stays in place).
api_signatures.tsv blessed for the new variant and fields; docs/REFUSALS.md regenerated (no
change); the runtime-sources fingerprint is unchanged (pin-compute).
The golden hash table moves 50 rows, 154 cells, and its semantics line goes from 2334 to 2342.
150 of the cells are in the three ANV profiles that hold a texture buffer as words
(intel-irisxe-anv, intel-irisxe-rplp-anv and intel-uhd770-rpls-anv, 50 each), and 4 in
runtime-floor (a8r_buffers and tb_word_formats). Every moved subject reaches a texture buffer, as the
usage-keyed words (1c68dd10f4) do; ARL and every other profile are unchanged. The engine inventory
and the air_input printouts bless unchanged, and the metallib half of
committed_air_fixtures_parse_and_link passes on the M3's SDK (bless job m3-max-83447, at
126ee4fdf5; the commits after it touch only the validation crate's word scan).
The authored compile census recompiled every cell: 2369 cases, 9 profiles, 21,321 cells, 0 cached;
19,106 compiled, 2,215 refused, 0 failed, 0 regressions (census job m3-max-83675, on a Linux lab node
that holds a copy of the private corpus; its run at pin R, m3-max-83628, gave the M3's table at R
exactly, every artifact digest included). Its two differences are the helper-thread case's
new identity, f03c5415 replaced by aa05a38c3b41 (31b2964425); 111 rows move only their artifact
digests, and the artifacts_at line moves to this build.
The census's first run at 126ee4fdf5 (m3-max-83448) stopped 432 cells, the 48 linked
quantized-matrix-multiply cases on every profile, at the case worker's deadline: the output-word
scan hung at admission, which the three commits before this one fix.
What: the phi of a_pointer_a_loop_carries_on_two_paths_is_answered_once lists the pointers its
two steps carry before the buffer argument.
Why: the old recursion stopped reading a phi's arms at the first whose object differs from its
first arm's. With the buffer first, the first step's answer (the cut, through the cycle) differed
at once and the second step was never read, so the test passed on the old scan (red-green job
m3-max-83650, Linux: 2 of the 3 bounded tests failed red). With the steps first, the first two
arms both answer the cut, each read in full, and the old walk answers about 2^32 values.
Verified: nothing run at this commit yet; its red run puts output_words.rs at 6a2870813f.
What: the scan's three recursive analyses (the object a pointer points into, a store's offset
from its buffer argument, and an integer affine in a grid component) each keep one answer per
instruction of the entry, filled by one iterative walk (solve) that reads each operand's answer
once. A value is answered from the module once a scan instead of once for every path to it.
Why: each analysis recursed into every operand with no memo, bounded only by depth 64. A select
or phi reads both arms and an add both operands, so a shared chain cost 2^depth answers, and a
pointer a loop carries on two paths through one phi cost about 2^32 per call. The 48 quantized
matrix-multiply cases of pin S's authored-compile census (432 cells) stopped at their 380 s
ceiling in the scan's admission, before any compile: a model of base() over the bisected case's
AIR counts about 1.8e11 answers in writes() alone, from eight calls through its loop-carried
pointer phis.
How the answers stay the same: the old cut (depth > 64 answers Base::Other or None) is absorbing
in every combination (a GEP or cast passes its operand's answer on, a select or phi of differing
objects is Other, and every affine and address step is None where an operand is), so the old
answer at depth 0 is the cut exactly where a chain of more than 64 links lies below the value,
and otherwise the uncut combination. The memo keeps each value's longest chain below it (capped
at 65) and answers the cut past 64. A value read again while it is being answered lies on a
cycle, whose chain has no end: it answers the cut, as the old recursion did where it ended. An
affine operator other than +, -, *, << and | is None without reading its operands, as before. No
version moves: the scan's answers are unchanged.
The visit counter (cfg(test)) counts one visit for each value an analysis answers from the
module; the three tests of the previous commit bound it at 1,000.
What: a cfg(test) counter of the values the scan's three recursive analyses (base, address,
affine) answer, which panics past the bound a test sets, and three tests over synthetic kernels
of our own: a GEP index built from 40 adds of the last link to itself, a store pointer through
40 and through 70 selects of one pointer, and a pointer a loop carries on two paths through one
phi. Each asserts the scan's answer (the placed store at 2^42 * tid bytes, the store into the
buffer, the unrooted pointer past 64 links and on the cycle) within 1,000 answered values.
Why: pin S's authored-compile census stopped 432 cells (the 48 quantized matrix-multiply cases
on all 9 profiles) at their 380 s ceiling with no compile, first bad commit e31bc61172 (main's
bisect). The scan's recursions answer a shared operand again for every path to it, bounded only
by depth 64: a model of base() over the bisected case's loop-carried pointer phis counts about
1.8e11 answers in writes() alone. These tests are red at this commit (the old walk passes the
bound) and turn green with the memo that follows.
Verified: nothing run yet at this commit; the red and green run is one Linux potluck job.
The m2v_gpu clippy configuration exposed two test-only two-stage arrays. Match the encoder dirty mask and content-key sRGB mask to RENDER_STAGES; the library code and shader outputs are unchanged.
Regenerate the complete owned-fixture table on GitHub hosted macOS 26 with Apple metal-as (run 47105329017, artifact 15720563051). The translator sources match ae1ea9f19 exactly. SEMANTICS_VERSION 2335 and RUNTIME_VERSION 2558 cover the queried mesh features and stage changes. The Linux suite passed 6118 of 6119 tests; its sole failure was this expected table refresh. Update the opened Vulkan feature-chain records and runtime source fingerprint for the same source.
A texture made in place over host memory's import on a unified device restores the bytes under
its image inside the make, and waits for the progress value Work::flush gives: the submit thread's
next submission's. Where a group goes at that turn, the flushed uploads went ahead of the group's
command buffers in the same batch, with one signal at the batch's end, so the make waited for the
guest's command buffers too. The consumer's walk on the Iris Xe saw restoring makes take up to
63.9 ms (9 spans of one photo-decode step, 67.4 ms in all) where the runtime's own makes take
about 3.5 ms.
Now a flush the host waits for (Work::flush, the staging waits, the surface and block ready
waits) marks its uploads awaited. Where a group's submission takes them, WorkState::close gives
them the progress value below the group's first, the value the flush returned, and submit has the
last of them signal it: their batch ends there, ahead of the group's, in the same vkQueueSubmit2.
The make waits for that batch alone. The pre-wait for the work already submitted is unchanged, so
a group submitted between that wait and the flush still lands ahead of the restore on the queue,
and the make still waits for it.
Two cases keep the group's signal:
- uploads that use memory another API shares (a surface plane or an exported block, held or read
by the uploads' copies) signal no value of their own: that memory is the other API's again only
at the first part's release, after the part's command buffers, so the wait is for the part's
value, as before;
- a batch signals a timeline semaphore once (Vulkan 1.4, section 7.2), so where nothing follows
the uploads in their part, parts gives the part's value in place of theirs.
A flush nobody waits for (the half-region staging flush, the release of held bytes) adds no batch:
its uploads go with the group's command buffers as before.
Docs: submit.rs's module doc and the flush docs; texture.rs's restore comment, RestoreFence and
Buffer::new_texture; Block::wait_until_ready and Surface::wait_until_ready; the runtime README's
restore paragraph, the fence's span, the known gap's span sentence and the two ready waits.
RUNTIME_VERSION moves to the next number above development's: a restoring make, a getBytes read
and the ready waits now end at the uploads' own batch.
Tests:
- restore_batch.rs each_device_returns_from_a_restoring_make_ahead_of_a_groups_command_buffers
(the commit before this one) passes;
- plane_parts.rs uploads_with_a_value_of_their_own_end_a_batch_that_signals_it_once: uploads that
signal their own value end a batch of their own ahead of the group's segment, and alone in their
part they signal the part's value once.
runtime-sources.sha256 is unchanged (a92fe0a8): it covers none of the files this edits.
Verified:
- red, submit.rs at the commit before this one: restore_batch hangs and fails after 10 s, and
plane_parts' new test fails (the uploads' value and the part's in one batch), on lavapipe
(llvmpipe, LLVM 23.1.1, job m3-max-83370) and on the Iris Xe (RPL-P, ANV, job m3-max-83373);
- green: restore_batch passes, the make returning with the fill's command buffer Scheduled, and
plane_parts 4 of 4, on both; the runtime's suite on lavapipe 985 passed (4 skipped), job
m3-max-83370, and on the Iris Xe 987 passed (4 skipped), job m3-max-83383;
- job m3-max-83370: fmt, the signatures, clippy plain, with --cfg m2v_gpu and with
--cfg m2v_cpu_icd, rustdoc, the private rustdoc and the API reference check passed; the suites
3738 of 3739 passed (24 skipped), the one failure the golden table, a bless due on development;
validation 1337 passed (3 skipped); conformance 1052 passed; the doctests passed.
A texture made in place over host memory's import on a unified device restores the bytes under
its image inside the make: the make flushes the upload that saves them, moves the image home and
writes them back, and waits for the progress value the flush gives (texture.rs). That value is the
submit thread's next submission's. Where a group goes at that turn, its command buffers ride in the
same batch behind the upload, with one signal at their end, so the make waits for them too. The
consumer's walk on the Iris Xe saw restoring makes take up to 63.9 ms where the runtime's own
makes take about 3.5 ms.
This adds a device test that puts the restore and a group's command buffer in one submission and
holds the group's batch back on the GPU, and the test hooks it needs, under the device cfgs alone:
- Work::pause and Work::resume hold the submit thread between passes;
- Work::flushing says whether a flush waits for the thread to send the uploads;
- Work::hold_next has the first segment of the next submission of a group's command buffers wait
on the GPU for a timeline semaphore the test signals.
restore_batch.rs each_device_returns_from_a_restoring_make_ahead_of_a_groups_command_buffers: on
a unified device whose texture over the import is in place, the test pauses the submit thread,
commits a fill of a buffer of its own, makes the texture on a thread of its own until its restore
is flushed, holds the fill's segment behind the test's semaphore and lets the thread pass. The make
must return while the fill's command buffer has not completed. Ten seconds after the thread passes
again, the test signals the semaphore and fails.
At this commit the test fails: the make waits for the fill's command buffer. Verified with
submit.rs at this commit under the next commit's tests:
- on lavapipe (llvmpipe, LLVM 23.1.1), job m3-max-83370: "the make did not return within 10s
while the fill's command buffer, in the same submission as its restore, waited for the test's
semaphore";
- on the Iris Xe (RPL-P, ANV), job m3-max-83373: the same.
What: the word scan (check::output_words) now follows a fragment case's render target to the
colour its entry returns for that attachment, as it already followed a kernel's output buffer to
its stores. Before, every render-target word was fed by Family::Unknown, so every recorded note
reached every word of every fragment case by fall-back.
How:
- The scan records a fragment entry's returned value by field (Stores::returned): the
families of each lane of each field, joined over its returns. Where a return or a
air.discard_fragment sits in a block that does not post-dominate the entry, every lane is also
fed by every branch condition, as a conditional store is.
- A render target's words (render_target_words): each channel of a texel takes the families of
the lane of the returned colour it holds (every lane where the colour has fewer lanes than the
format has channels), with those of the entry's other live outputs that decide whether or how
the write lands: a depth, a sample mask, a stencil reference, the second blend source. The
facts repeat every texel (every word for a texel under four bytes); the word's lanes still come
from the target's format. A target with no live colour from the entry (an imageblock writes
it), an attachment index that is not a constant, a vertex case's observed render target, and a
returned value the scan does not follow keep the fall-back.
- air.quad_is_helper_thread and air.simd_is_helper_thread feed Family::Group: whether a thread is
a helper is its place in its quad, which FragmentSimdgroupGrouping and QuadsSplitByClipping
concern. They fed Family::Unknown before.
Tests (check::output_words::tests): a_render_targets_words_take_the_returned_colours_operations
(the public case unclamped-and-clamped-lod-of-a-texture-selected-per-quad: red and green fed by
the texture queries and the position, blue and alpha by nothing, so a texture note reaches the
first two words of a texel and NativeDot none) and
a_helper_query_and_a_discard_feed_a_render_targets_words (helper queries and quad ballots feed
Group alone; a discard the position decides adds the position and its arithmetic). Both read
every word as Unknown without the change.
ENGINE_EXECUTOR_ABI is v216: rows record different word facts for fragment render targets, and
how their differing words are judged changed.
Verified (at 33873ab651, this commit's tree):
- Gate: fmt, clippy with --workspace --all-targets --all-features -D warnings plain, under
--cfg m2v_gpu and under --cfg m2v_cpu_icd, and rustdoc -D warnings, all exit 0 (job
m3-max-83339). Validation suite: 1339 passed, 3 skipped (job m3-max-83340); in the same job the
two new tests pass, and both fail with output_words.rs and words.rs put back to the parent.
- The public cases (1,168), noted / matched only within bounds / mismatch cases (batch-words),
before at 31b2964425 and after:
- lavapipe (x86): 156 / 27 / 10 before (job m3-max-83318) and after (job m3-max-83341); every
row keeps its outcome and gap; 15 rows lose their fall-back words. Cases with a word on the
fall-back: 571 to 488; with a differing one: 37 to 22.
- AMD Radeon 780M (RADV PHOENIX, Mesa 26.2.6): 171 / 24 / 16 before (job m3-max-83332), 170 /
24 / 17 after (job m3-max-83385). Every mismatch is held by a gap, before (21) and after (22):
no new mismatch. One row moves: three-color-inputs-tag-attachment (c261f487), from a noted
difference to a mismatch held as ordered_fetch_within_draw. Its target is the r32_uint tag,
tag * 5 + as_type<uint>(color.x) of the attachments it fetches: no half conversion feeds it,
so NativeHalfConversion, which reached its 16 differing words only by fall-back, no longer
excuses them; UnorderedFetchWithinDraw reaches them. Cases with a word on the fall-back: 605
to 515; with a differing one: 58 to 33.
Landed with ENGINE_EXECUTOR_ABI vulkan-engine-v217 (renumbered above development's v216, the half-arithmetic family); docs/VALIDATION.md merged by hand with that change's half family wording. runtime-sources.sha256 unchanged (a92fe0a8).
The planner's wording ruling of 12-03. Rule 3 named the linear-image exception for "a texture
over a Shared buffer", but the runtime takes the device's linear image in place over a buffer of
every storage mode (texture.rs check_over and over_descriptor; the runtime README's
Buffer::new_texture entry): Private, Managed (its device copy), Shared and the imports. Metal's
newTextureWithDescriptor:offset:bytesPerRow: aliases the buffer's bytes in every mode, and an
optimal image there would need a copy per use, which rule 3 forbids. So the code is right and
the sentence was narrower than meant. This is a wording correction, not a growth: still two
exceptions, no new form, no new copy. Rule 2's unified-memory clause is unchanged.
Found by the audit lane's read of rule 3 against the code at 6e83de343d; the planner read the
same sites at 9211eb3c10.
Resolve the upstream texture-buffer, render-offset and typed-refusal interfaces. Keep mesh metadata when pass attachments or stage bindings change; independent object and mesh masks cover all four render stages. The added CPU Vulkan regression exercises attachment removal and unaligned object/mesh buffers with direct and indirect draws. Twelve CPU mesh tests pass with private Lavapipe 26.2.6. Full merged-tree gates follow on the isolated fork development branch.
Under the 16-bit float controls, a half +, -, * or / and a half fused multiply-add run on the
device's 16-bit instructions, between exact conversions. By the Vulkan spec their results are
Metal's. A driver's compiler may still compute them in float and leave them unrounded. Intel's
Windows driver 101.2145 on a UHD Graphics 630 does:
- A standalone tree of three 16-bit OpFAdds, or Fmas of a product, each decorated NoContraction
under all three 16-bit controls, ran on 4,096 invocations. 2,284 sums and 4,080 products
matched neither the half tree nor the float tree rounded once (job m3-max-83092).
- The Iris Xe under Mesa ANV 26.2.6 gave the half tree on every invocation (job m3-max-83093).
- In the runtime's quad test on the UHD, 112 of the 1,536 compared halves are the float chain
rounded once at the store (job m3-max-82918).
Per the planner's ruling, the operation carries the static note on every device, with no device
check. narrow::computes_half_arithmetic looks in the emitted module for a 16-bit OpFAdd, OpFSub,
OpFMul, OpVectorTimesScalar or OpFDiv, or a GLSL.std.450 Fma. Where it finds one, the pipeline
records NativeHalfConversion, beside the conversion pair's existing cases. A Sqrt alone records
nothing, and neither does the simdgroup half tree's ClusteredReduce.
The note's reach in validation narrows to half arithmetic. Until now it reached every word fed by
any float family. The AIR word scan now feeds a new family, HalfArithmetic, beside the
operation's own family, from these operations:
- an fadd, fsub, fmul, fdiv, frem or fneg with a half result;
- a float cast whose result or operand is a half;
- a call of a modelled family whose result or an argument is a half.
NativeHalfConversion reaches only that family. A half word that only float arithmetic fed,
through a move, is no longer reached. The note stays unbounded at the word, now on the
comparison's stay-unbounded list with its reason. A driver may leave the chain unrounded and
round it once at the store, and with cancellation the two answers differ by more than the stored
value's ulps (40 codes measured on the UHD). How far rests on the operands, which a word does
not carry.
Docs:
- The note's API.md catalogue entry and its PrecisionNote doc said those operations "take no such
rounding". They now say the operations record the note, and give the UHD 630 measurement beside
NVIDIA's fold and RADV's fusion.
- The DeviceHalfDenormals entry points to it.
- VALIDATION.md names the half family among those the word scan reads.
Tests:
- engine_native_half: the controlled-conversion test's sum kernel now records the note, as every
kernel there does.
- engine_float_call_notes sets the module-level note aside for 16-bit arithmetic, as it does for
the conversion pair.
- half_simd_reductions accepts, where the quad pipeline records the note, a quad word whose
every half is Metal's or the float operations rounded once. The model is the new devtools
quads_once.
- In validation:
- the scan's packed-halves test expects HalfArithmetic on the half word alone;
- a words test shows the note reaching a half word only when half arithmetic feeds it;
- the reach row is pinned.
SEMANTICS_VERSION 2340 -> 2341 (precision notes added).
ENGINE_EXECUTOR_ABI vulkan-engine-v215 -> v216 (the word scan feeds HalfArithmetic, and the
note's reach narrows to it).
Golden hashes: no cell moves. The cells hash the final SPIR-V, which the note does not touch.
Job m3-max-83293 (Linux) ran golden_hashes_match_the_table twice: at this change, and with
compile.rs and cache/mod.rs at f42e61aa84. Both failed with the same 2 changed-cell lines, 0
lines differing between them: development's table is due its own bless. The fixtures that need
metal-as were skipped on Linux.
runtime-sources.sha256 is unchanged: no edited file is a fingerprint input.
Note-bounds figures (noted / matched within bounds / mismatches over the 1,168 public cases),
each arm built in one job, at 702916d9d3 and at this change on it (6edabebff2):
- lavapipe (Mesa 26.2.4, LLVM 23.1.1; job m3-max-83272): 151 / 27 / 15 before and after;
- Radeon 780M (RADV PHOENIX; job m3-max-83273): 166 / 24 / 21 before and after.
Every case's outcome and bounded line is the same in both arms, so no row is new. Only the per-note
word attribution moves: NativeHalfConversion's noted words fall from 3,267 to 1,168 on lavapipe and
from 3,558 to 1,276 on the 780M, as other notes reaching those words now take them.
Verified, at the probe db2bceb3f6, whose tree is this commit's (gate job m3-max-83293):
- the four red tests pass here and three fail with compile.rs at f42e61aa84 (EXIT=100);
- STEP clippy_plain EXIT=0, clippy_gpu EXIT=0, clippy_cpu EXIT=0;
- doc EXIT=0, privdoc EXIT=0;
- the translator's and AIR's suites minus the bless-due tables: EXIT=0;
- on lavapipe (host Mesa 26.2.6):
- runtime: 983 passed, 4 skipped; half_simd_reductions 0 differ in all three pipelines;
- validation: 1338 passed, 3 skipped, the runtime-sources guard among them.
- The conformance replay in the pinned lavapipe image (CI's venue, LLVM 23.1.1), at f42e61aa84
and at this change (job m3-max-83337): 0 ledger drift in both arms, 4661 rows as expected.
On the gate job's host lavapipe (Mesa 26.2.6, LLVM 23.1.4) its replay printed 12 drift lines,
the bicubic-texel-classes rows among them. That run has no base arm.
The device legs of the half test:
- UHD Graphics 630, Intel's Windows driver 101.2145, at 6edabebff2 (this change on 702916d9d3;
job m3-max-83288): every_device_sums_and_multiplies_half_simdgroups_as_metal passed.
- The quad pipeline records NativeHalfConversion. 0 of 768 words differ from Metal's, and 96
more are the float result rounded once.
- The simd and masked pipelines: 0 differ.
- Apple M3 Max, KosmicKrisp (Mesa 26.3.1), at db2bceb3f6 (archive m3-max-83294, run
m3-max-83297): passed. 0 words differ in each pipeline and none takes the rounded-once
admission.
Landed with SEMANTICS_VERSION 2342 (renumbered above development's 2341); runtime-sources.sha256 recomputed on development, unchanged (a92fe0a8). States-only plays at the change (job 83345): gb-3090-r2 render 10643 and compute 15299 made, 0 refused; windrag-780m-b4 render 8972 and compute 225 made, 0 refused, equal to pin R.
Under the 16-bit float controls a half sum, product or chain is the device's 16-bit OpFAdd or
OpFMul between exact conversions. Intel's Windows driver 101.2145 on a UHD Graphics 630 computes
such operations in float and leaves them unrounded: a standalone tree of three of them came back
at float precision (jobs m3-max-83092 on the UHD 630 and m3-max-83093, the Iris Xe under Mesa ANV
26.2.6, as the control). The planner ruled that the operation carries the static note,
NativeHalfConversion, on every device.
The tests now expect that note:
- native_half_rounding_records_its_kind: on the half sum, on lavapipe and on RADV;
- nvidia_computes_half_on_16_bit_floats_under_the_float_controls: on each of the 16-bit
kernels.
Red until the product records it.
StageModule::own_pixel_textures lists the fragment function's texture slots whose every texel
read is at the fragment's own pixel. The runtime reads it for the copy form of attachment reads:
on a device without the attachment feedback loop, a draw that reads its own pass's target
through such a slot copies the rectangle of its scissor, a pixel wider each way, into the
target's shadow, and through any other slot the whole level and layer (crate::shadow).
The analysis seeded the slots from their descriptor variables. Under the identity domains, which
the runtime ships, no variable holds one slot's image: the image is the element of its class's
set-1 array at the low word of the resource ID that PushField::SlotGuestBase pushes. So the list
was empty for every function, and every such draw copied the whole level and layer, beyond what
Metal copies (rule 3).
Now the analysis also seeds a slot from each access chain into a set-1 image array whose first
index is the slot's ID's low word: OpAccessChain(array, CompositeExtract(OpLoad(OpAccessChain(push
block, member)), 0)), the member being the slot's SlotGuestBase. The ID's parts may go nowhere
else: the member's pointer only to its load, the ID only to an extract of its low or high word,
and the low word only to such an access chain's first index or to an equality test (the nil
test). Any other use leaves the slot out (a store, arithmetic, a phi, a select, a call, an access
chain into the member's words). So does a slot whose ID the stage reads from its parameter block,
or whose levels a run of the array holds (TextureLevelBase), since those reads reach the array
through no binding the analysis follows. The analysis takes the stage's push placement for this.
SEMANTICS_VERSION moves to the next number above development's: a stage's interface answers
differently.
Tests:
- pipeline/compile/tests.rs the_interface_states_the_textures_read_at_the_fragments_own_pixel
now runs every profile under the identity domains too, the clamped form included: tob_read
states slot 0, and tob_sample, tob_read_buffer and tob_solid state none. At the base, under
identity, tob_read stated none.
- spirv/requirements/own_pixel/tests.rs under_the_identity_domains_a_slots_element_is_its_binding,
on hand-built modules: an own-pixel fetch through a slot's element qualifies; an element only
size-queried reads no texel; the ID stored, its low word plus one indexing another element, its
low word loaded through an access chain into its member, a TextureLevelBase field and an ID in
the parameter block each leave the slot out.
Verified on the CPU with no device and on lavapipe (llvmpipe, LLVM 23.1.4), job m3-max-83281 at
this commit:
- red, own_pixel.rs, its tests and compile.rs at the base: the compile test fails at its
identity rows;
- green: the compile test, the own_pixel, compile and link tests, 142 of 142; the runtime's
attachment-read, over-read, held-loop, shadow and translator-field tests on lavapipe, 18 of 18
(lavapipe reads through the feedback loop, so its copy form is not exercised there);
- the refusal surface check, fmt, the signatures, clippy plain, with --cfg m2v_gpu and with
--cfg m2v_cpu_icd, rustdoc, the private rustdoc and the API reference check passed; the suites
3737 of 3738 passed (24 skipped), the one failure the golden table, which fails at the base on
the same 80 cells (a bless due on development); validation 1337 passed (3 skipped);
conformance 1052 passed; the doctests passed.
The change in copied bytes on a device without the feedback loop is not measured: no runtime
test draws under a scissor smaller than the target there.
StageInterface::level_reads and StageModule::level_reads stated, per texture slot, the levels of
its bound view the stage's reads reach (LevelReads, SampledLevels, SamplerLevels and the
structural analysis spirv::requirements::level_reads). Nothing reads them:
- the runtime: git grep -nw -e level_reads -e LevelReads -e SampledLevels -e SamplerLevels
-e finite_texels -e highest_lod -e lowest_lod at 401d9d5949 over every crate but the translator
finds one hit, the runtime's translator_fields test, which lists the field as a fact the runtime
does not apply;
- the consumer: the same search at a20576e1fd finds 0 hits.
Under the identity domains, which the runtime ships, the analysis also seeded nothing, since no
variable holds one slot's image there. Rule 4: deleted rather than seeded.
Removed: the two fields, the three public types with their methods, the analysis and its tests,
their codec entries and footprint, their rows in tests/api_signatures.tsv and the api_surface
table, the API guide's "Levels a slot reads" section and HOWTO's mention of it, and the runtime
test's listing. own_pixel's helpers that the analysis shared are private again.
ARTIFACT_FORMAT_VERSION moves to the next number above development's: StageInterface's and
StageModule's encodings lose a field. No translation answer changes, so SEMANTICS_VERSION stays.
Verified on the CPU with no device and on lavapipe (llvmpipe, LLVM 23.1.4), job m3-max-83281 at
the next commit, which holds this one: fmt, the signatures, clippy plain, with --cfg m2v_gpu and
with --cfg m2v_cpu_icd, rustdoc, the private rustdoc, the refusal surface check and the API
reference check passed; the suites 3737 of 3738 passed (24 skipped), the one failure the golden
table, which fails at the base on the same 80 cells (a bless due on development); validation 1337
passed (3 skipped); conformance 1052 passed; the doctests passed.
Qualified on the Apple M3 Max under macOS 27.0.1, three executions (job m3-max-83312):
aa05a38c3b41, output sha256 de1a61a9.
Every word is a real lane's: all 196 words (49 pixels, four fills each) equal what the packing
model reads from an active lane (8x4 blocks from (0, 0), quads row by row, a quad's lanes row by
row; a lane runs when its quad holds a covered pixel), and no fill reads an inactive lane. Each
value is one of those lanes' x + 64y or its filling data, 10000 more. Over the old 7x5 target, the
same model read lane 31 of the lower block, which ran no thread, for (0, 4)'s fill up by 1.
The case simdgroup-fills-in-a-fragment-function-over-cut-quads (engine/gsm2_quad_ops,
fragment_simd_fills) drew a 7x5 target. On the M3 Max a simdgroup holds an 8x4 pixel block,
its quads row by row; the lower block's rows 4 and 5 fill lanes 0 to 15, and lanes 16 to 31 run
no thread. simd_shuffle_and_fill_up by 1 at pixel (0, 4), lane 0, reads lane 31's filling data:
a read of an inactive lane, which MSL 4.1 section 6.10.2 leaves undefined ("A thread needs to
only read data from another active thread in the SIMD-group"). Metal answered 0.0 there, which no
lane holds; lavapipe and the Radeon 780M answered the pixel's own fill, 10256. It was the one
differing word of the ten helper-thread cases that none of the four mechanisms explains.
At 7x7 the last column and row are still quads the target cuts, and each 8x4 block holds a
covered pixel in every quad, so all 32 lanes of both blocks run. A model of the M3's packing
(8x4 blocks from (0, 0), quads row by row, a quad's lanes row by row), checked against the
committed Metal rows, reproduces every word of the 8x8 case (256 of 256) and every word but
(0, 4)'s first of the 7x5 one (139 of 140); over a 7x7 target it reads no inactive lane in any
of the four fills, where the 7x5 target read one. The case's rationale states the undefined read.
Installed with corpus-case-check (job m3-max-83299): the new identity is
aa05a38c3b411ed862539df3e52691addc8e8b612e1d80e4b8425284cb73045d, and the old identity's Metal
row is removed. Its Metal qualification follows in the next commit. The authored compile census
still lists the old identity, for the next bless.
The read of the ten cases held as helper_thread_words (lavapipe, job 83263; Radeon 780M, jobs
83264 and 83267) explained 454 of their 455 differing words by four mechanisms: Apple's partial
quads, lavapipe's clip seam, RADV's lane order and x86 lavapipe's 8-lane subgroup. The docs said
otherwise in two places:
- QuadsSplitByClipping said each run of a split quad combines fewer active lanes than Metal's.
Each piece's run keeps all four lanes; what differs is the helper query, which names the other
piece's covered pixels as helpers where Metal's quad, shaded once, names none. The note's doc
comment, its API.md catalogue entry and the validation gap's doc now say that.
- FragmentSimdgroupGrouping gains the fill past a subgroup under 32 lanes: it reads an inactive
lane, which MSL 4.1 section 6.10.2 leaves undefined, and the device reads the calling lane in its
place (lower::simd's PartialFragment read).
docs/VALIDATION.md's verdict section names the four mechanisms and what lavapipe and the 780M do
under each, where the next reader of a held case looks. The gap's doc in c3.rs no longer says the
cause is unread.
Docs and doc comments only. pin-compute.py over the tree gives the committed runtime-sources
fingerprint (artifact.rs is not one of its inputs), so no re-pin. cargo fmt --all is clean.
Under the identity domains, a fragment function reads a colour attachment through the
sampled-texture array's element pushed for it (PushField::FetchedColor). That element is the
texture's own view, the shadow's or the feedback loop's. On a device without an A8_UNORM image,
an A8Unorm texture is held in R8_UNORM, and its view has the components (ZERO, ZERO, ZERO, R)
(metal::format, the A8Unorm candidate). Vulkan's Component Swizzle applies them to every texel
input instruction, a fetch included. So the element already reads Metal's (0, 0, 0, a).
lower/fragment/color.rs still applied the input attachment's alpha-in-red conversion to that
read, (0, 0, 0, texel.r), and recorded the colour in StageIo::alpha_in_red_colors. A guest saw
two things on such a device (lavapipe, intel-arl-anv, intel-irisxe-anv, amd-rdna2-apu-radv,
nvidia-pascal-linux, nvidia-rtx50-linux and runtime-floor among the committed profiles; the device
check below prints how the device it runs on holds the format):
- A function that reads an A8Unorm colour and also writes it read (0, 0, 0, texel.r), and the
view's red is 0: alpha 0, a wrong value (on lavapipe at the base, the device check below read
(0, 0, 0, 0) at texel (0, 0)).
- A function that reads one and never writes it was refused at link with
NeedsInput(ColorWrites), which nothing answers. color_writes::wanted_alpha_in_red counts
written colours and input attachments, and an identity fetch is neither.
Now the identity read takes no conversion and records nothing (ColorInput::alpha_red is false
under the identity domains). The input-attachment read of the resident domains keeps its
conversion, since an input attachment's view takes no swizzle. Link's set and the function's then
agree, and link is unchanged.
The extended-range half of the same link check is a docs line: an identity fetch of an
extended-range attachment is refused by the lowering and by link, so no shader reaches
wanted_extended_range's omission of FetchedColor colours. color_writes' docs of both wanted_*
functions now say why a FetchedColor read is in neither set.
SEMANTICS_VERSION moves to the next number above development's: a refusal goes and a fetch's
answer changes.
Tests:
- pipeline/compile/tests.rs an_identity_fetch_of_an_alpha_held_in_red_reads_through_the_view: on
lavapipe's profile (no A8_UNORM image), without the pixel interlock, under the identity policy,
fetch_blend with an A8Unorm colour 2 that it reads and never writes links. Colour 2 is read
through FetchedColor, no input attachment is used, and every stage passes spirv-val. At the base
it is refused NeedsInput(ColorWrites).
- metal2vulkan-runtime tests/fetch.rs every_device_fetches_an_a8unorm_attachment_as_metals_alpha
(device check): a pass clears an A8Unorm target to alpha 51/255. a8r_fill writes 204/255 over
the lower left half. a8r_fetch reads the attachment at every texel and stores what it read, and
every texel must read (0, 0, 0, a) of its own alpha.
Verified on lavapipe (llvmpipe, LLVM 23.1.1), which holds A8Unorm in R8_UNORM (the check prints
"A8Unorm held as Ok(AlphaInRed)"), job m3-max-83219 at this commit:
- red, lower/fragment/color.rs at the base: the structural test refused
NeedsInput(ColorWrites); the device check read (0, 0, 0, 0) at texel (0, 0).
- green: the structural test, the compile tests and engine_fragment passed; the runtime's fetch
tests on lavapipe, 7 of 7, the device check reading Metal's (0, 0, 0, a) at every texel.
- the refusal surface check, fmt, the signatures, clippy plain, with --cfg m2v_gpu and with
--cfg m2v_cpu_icd, rustdoc and the private rustdoc passed; the suites 3738 of 3739 passed (24
skipped), the one failure the golden table below; validation 1323 passed (3 skipped);
conformance 1052 passed; the doctests and the API reference check passed.
- the golden table fails at this commit and at its base alike, on the same two cells
(a8r_buffer_read_write and tb_word_formats on runtime-floor): a bless due on development, none
of it this change's.
Landed with SEMANTICS_VERSION 2340 (renumbered above development's 2339); runtime-sources.sha256 recomputed on development, unchanged (a92fe0a8).
UnorderedFetchWithinDraw's words said a pixel that overlapping fragments of one draw fetch and
write "holds the result of some order of the draw's fragments", "not necessarily Metal's". The
Radeon 780M (RADV, Mesa 26.2.6) shows otherwise. Job m3-max-83259 ran the eight authored cases
the ordered_fetch_within_draw gap holds (n instances of the companion's fullscreen triangle in
one draw, so n identical fragments at every pixel or sample) five times at 702916d9d3. All five
outputs were identical. Every differing word is the fragment function applied once to the
texel as it stood before the draw. Each case's chain f^k(initial), computed from its own inputs,
gives Metal's stored output at k = n on every word, and the 780M's at k = 1 on every word that
differs, all four lanes of each texel alike. All n fragments are identical, so every order of
them gives Metal's value: the 780M's value is no order's result. Lavapipe matches Metal on the
seven cases it runs (job m3-max-83255).
The note now says what a fetch can observe there: it may read the texel from before its draw,
so overlapping read-modify-writes of one draw may leave one application. Changed in docs/API.md's
precision-note catalogue, PrecisionNote::UnorderedFetchWithinDraw's doc comment and the runtime
README's known gap. Docs only, no behaviour change. The runtime-sources pin is unchanged
(pin-compute.py gives a92fe0a8...).
Verified: cargo fmt --all; nothing built.
FragmentSimdgroupGrouping, QuadsSplitByClipping and
UnorderedFetchWithinDraw only record a device behaviour now: none of
them excuses a word. The cases whose differing words they reach turned
from noted differences into mismatches, and nothing held them open, so
a round's public leg would read them as new mismatches. Two answer
gaps now hold them open. Both are decided by structure (the note and
the words its operations reach), never by case id:
- HelperThreadWords (helper_thread_words): every unexcused word is
reached by FragmentSimdgroupGrouping, or every one by
QuadsSplitByClipping.
- OrderedFetchWithinDraw (ordered_fetch_within_draw): every unexcused
word is reached by UnorderedFetchWithinDraw.
How:
- For each only-recorded note, the word judge counts the unexcused
words that note reaches (Judgement::recorded).
- AnswerGap::held_by_words picks the gap one of whose notes reaches
every unexcused word of a mismatch, where both outputs have one
length. The engine's difference_status calls it for a mismatching
verdict, and the batch-run line names the gap (held_open_by=).
- Every device has both gaps, since why the device's words differ is
not read yet. The reviewed list refuses an entry under either gap.
- A row's content check accepts such a gap only on differing bytes from
a run that recorded one of its notes, and status_holds re-derives the
gap from the row's words.
- C3 names a word gap as a mismatch's reason after a deferral and after
a listed gap.
- docs/VALIDATION.md states both gaps.
ENGINE_EXECUTOR_ABI stays vulkan-engine-v215, above development's v214.
The three figures, public cases (1,168): noted cases / cases that
match only within bounds / mismatches, then how many mismatches an
answer gap holds and how many are new.
- lavapipe (Mesa 26.2.4 image):
- before, development 965e707277, job m3-max-83220: 188 / 0 / 5;
5 held, 0 new.
- after, job m3-max-83166: 151 / 27 / 15; 15 held (5
clipped_primitive_split, 10 helper_thread_words), 0 new.
- Radeon 780M (RADV PHOENIX, Mesa 26.2.6, the device pinned alone):
- before, development 22861fde72, jobs m3-max-82940 and
m3-max-82966: 206 / 0 / 5; 5 held, 0 new.
- after, job m3-max-83177: 166 / 24 / 21; 21 held (5
clipped_primitive_split, 8 helper_thread_words, 8
ordered_fetch_within_draw), 0 new.
The after runs ran this commit's library code. Only a C3 test changed
after them.
Verified (tests at this tree):
- gate A, m3-max-83232: fmt check, clippy plain, --cfg m2v_gpu and
--cfg m2v_cpu_icd, and rustdoc each exit 0.
- gate B, m3-max-83236: the validation suite exits 0, 1337 passed,
3 skipped. Each red check exits 100 with its fix reverted: the
engine's word-gap hold, the judge's recorded-note count, the
denormal boundary, the note reach, the recorded rule-5 notes and the
recorded review notes.
What: NativeNanEncoding's rustdoc and its docs/API.md catalogue entry say what validation now
reads it as covering: a NaN's payload moved through loads, stores and selects as well as one an
operation computes. Validation excuses a word in any float lane only where Metal's answer and
the device's are both NaNs of the lane's format.
Why: the planner accepted reading the note as reaching every float lane, bounded to two NaNs.
The public case nan-model-loads-stores-and-selects-of-nan-halves differs on lavapipe only in
half NaN payloads its entry moves without an operation (e.g. Metal 0x7e01 against 0x7e00,
m3-max-82836), which the note's own text already records at every read of a half from its bits.
Text only: no output and no recorded note changes, so SEMANTICS_VERSION stays; artifact.rs is
not a runtime source input.
What: the notes whose rustdoc says "a difference stays a mismatch for review" are Recorded in
the allowance table, as rule 5 made QuadsSplitByClipping and DeviceInterpolation:
ExtrapolatedInterpolation, FragmentSimdgroupGrouping, BlendedWriteRounding,
CoverageReadsRoundedAlpha, DeviceAlphaCoverage, RotatedBlendRounding, HalfOutputPrecision,
DevicePointSize, LoopedSampleOutputs, NativeLogicOperation and UnorderedFetchWithinDraw (whose
doc says it without "and no explanation"). ViewBaseTexelOffset, DeviceColorConversion,
LinkedSamplerNumbering and DeviceInterpolationOffset already were. A word they reach that
differs is a mismatch unless another note excuses it.
C3's deferral of a near-equivalent (FragmentSimdgroupGrouping, BlendedWriteRounding,
CoverageReadsRoundedAlpha, RotatedBlendRounding among them) reads the run's recorded notes
(ExecutedCensus::all_notes) rather than the unbounded class, which no longer names a recorded
note: a row that ran one stays open as before.
The review-sentence lines of the note docs drop their design citation ("deferred in C3", "which
C3 names"), and the table's rows say what each note records. The NativeNanEncoding row says it
covers a payload moved through loads, stores and selects (the reach the previous commits gave
it), and the DeviceDenormals row lists the operations measured to keep a denormal.
Why: the planner ruled that rule 5 applies to every note carrying the sentence; the code read
them as unbounded, so a difference they reached was a noted difference against their docs.
ClippedCoverageSplit says "no tolerance and no explanation" but not "a mismatch for review", and
its cases are held open through it; it is unchanged.
Verified on lavapipe (Mesa 26.2.4, the lavapipe image), the 1,168 public cases, job
m3-max-82941 (this tree with the next commit's doc text) against m3-max-82873 (rule 5 alone):
ten cases are mismatches, every differing word of each on the fall-back; eight of them were
noted differences that FragmentSimdgroupGrouping explained: 1daf00c7, 243237a9, 8926b0e1, aa65ed07, b1f22cbf, c8195f48 (helper threads),
8aac224c and f03c5415 (simdgroup fills); 524be944 and 60db147e are rule 5's. Two runs
of that job ended in a device wait timeout under the host's load (2e81b17c, 35d576e0) and are
rerun at the tip. Each note's row is tested (every_precision_note_has_its_table_row), and a red
check that turns NativeLogicOperation back to Unbounded fails it.
What: both notes' rows of the allowance table are Recorded, as their rustdoc states
("Validation derives no tolerance and no explanation from it: a difference stays a mismatch for
review"): a word they reach that differs is a mismatch unless another note excuses it. The
table's doc rows, its test rows, the C3 test of a DeviceInterpolation row (its class is the
census's, Exact) and a word test of both notes follow.
Why: the code read both as unbounded, so a difference they reached was a noted difference,
against the documented contract.
Verified on lavapipe (Mesa 26.2.4, the lavapipe image), the 1,168 public cases, job
m3-max-82873 (this tree) against m3-max-82854 (the tree before it): match 773 -> 773,
noted_difference 161 -> 159, mismatch 5 -> 7. Red, both render targets whose words every note
reaches (the fall-back), where only QuadsSplitByClipping explained them:
- 524be944 helper-threads-in-a-fragment-function-over-full-quads: 32 of 256 words, Metal 0
against the device's 0xe or 1 (25:00000000/0000000e, 29:00000000/00000001, ...);
- 60db147e helper-threads-in-a-fragment-function-over-cut-quads: 20 of 140 words
(17:00000000/00000008, 49:00000000/00000007, 113:0000000c/0000000e, ...).
The other seven cases these two notes excused first stay noted under another note that reaches
the same words: six helper-thread cases under FragmentSimdgroupGrouping, and
memory-write-per-sample-4x under NativeHalfConversion. Tests: m3-max-82874 (137 passed, the
touched modules).
What: NativeFma's rustdoc and its docs/API.md catalogue entry state the one case its recorded
bound does not cover: an unfused product can overflow where Metal's fused result is finite, and
the overflow stays the device's answer. A 16-bit product of magnitude 65520 or more rounds to
the infinity of its sign, so the result is that infinity where Metal's is finite, or a NaN
where the addend is the infinity of the other sign and Metal's result is that infinity.
Why: the bound (half an ulp of the product plus half an ulp of the result) read as covering
every input; the public cases fused-multiply-add-rounding-and-fmuladd-without-fast-math and
fused-multiply-add-rounding-and-contraction-under-fast-math show the other answer on lavapipe:
fma(256.0h, 256.0h, -65504.0h) is inf where Metal answers 32, and fma(65504.0h, 65504.0h,
-inf) a NaN where Metal answers -inf (job m3-max-82667's rows against the committed Metal rows
of the Apple M3 Max). No lowering changes; the note stays unbounded in validation.
Text only: no output and no recorded note changes, so SEMANTICS_VERSION stays. artifact.rs is
not a runtime source input, so runtime-sources.sha256 stays.
What: a candidate's output is judged against Metal's one 32-bit word at a time
(observation_contract::words). An equal word matches. A differing word is excused only by a
recorded note that reaches it: a note with a bound makes a word within it a match, a note with
no bound makes it a noted word, and a word no reaching note excuses is a mismatch.
- Reach is read from the case's AIR (check::output_words): for each output word, the float
lanes it holds and the operation families whose results feed it, followed byte by byte
through bitcasts, lane moves and the zext/shl/or that pack two halves. A store placed at
A * thread_position_in_grid + B bytes gives each thread's words their own facts. A note of the
module that writes the output reaches the words its operations feed; a note of another module
reaches every word, and so does every note of a word the scan cannot follow (a load of memory
the entry writes, a call outside the intrinsic families).
- Bounds a word can carry are checked there, and a word within one matches: DeviceDenormals
only where Metal's and the device's lanes both lie at or below the smallest normal (2^-126,
2^-14 for half), of one sign unless one is a zero; NativeNanEncoding only two NaNs of the
lane's format (it reaches every float lane: a half read from its bits is no operation);
HalfTexelConversion its recorded one half ulp, or +-65504 beside the infinity; the lane
tables and the reassociation bound as before.
- NativeFma, NativeDot, NativeMix and NativeDivision keep no value bound (each states its bound
over the operands, which a word does not carry) and reach only the words their operations
feed. The fixture knows its inputs, so a per-case bound from the operands is a later form.
- SimdgroupAccessOrder reaches only a word another thread of the kernel may write: one a store
the scan cannot place in its own thread's bytes writes.
- Rows record the output's word facts (census output_words). The batch report prints, per case
and in total, the words matched exactly, within each note's bound and only noted, by note,
the unexcused words, and the cases with a word on the fall-back.
- DeviceDenormals's rustdoc states Metal's measured answer per operation: it flushes before
rounding on some (a product, fma, dot and mix just below 2^-126 answer a zero) and keeps a
denormal on others (sin, tan, asin, sinh, asinh, atanh of a denormal), from the public cases
float-products-flushed-before-rounding and nan-model-float-denormals-per-operation. Its
recording rule already covers plain multiplies; no rule changed.
ENGINE_EXECUTOR_ABI is v215: how a match is decided changed and rows record word facts.
Why: a noted difference was excused whole by any recorded note, so a note that could not cause
a word's difference (a division's note beside a product, an access-order note on a kernel whose
threads write disjoint words) hid it, and a bounded note never matched.
Verified on lavapipe (Mesa 26.2.4, the lavapipe image), the 1,168 public cases, job
m3-max-82854 (this tree with the next commit's doc text) against m3-max-82667 at b3d7464945: match 746 -> 773, noted_difference
188 -> 161, mismatch 5 -> 5 (each held open by clipped_primitive_split, as before); words
2,859,015 exact, 30,212 within a bound, 352,820 noted, 0 unexcused. Of the 188 cases noted
before, 34 have an output word on the fall-back (26 every word) and 32 a differing one.
Tests: the validation suite at an earlier tree, m3-max-82839 (1,331 passed, 3 failed; the three
are fixed here), and the touched modules at the same tree as m3-max-82854, m3-max-82855 (136
passed).
A texture buffer's form (rule 2's texture buffer formats, metal::format::texel_buffer_form) asked
three accesses of a format's own view: a uniform texel buffer, a storage texel buffer, and a storage
texel buffer written without a format. A function that reads a texture buffer through
access::read_write reads its storage element without a format, which Vulkan asks of the view's
format (VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT, VUID-vkCmdDispatch-OpTypeImage-07030),
so on a device whose own view of a format lacks that bit the runtime refused the draw or dispatch
(Gap::StorageElement, ReadWithoutFormat). ANV on the Iris Xe (RPL-P) lacks it for BGRA8Unorm,
B5G6R5Unorm, BGR5A1Unorm and BGR10A2Unorm (jobs m3-max-81883, m3-max-82116); its committed profile
(intel-irisxe-rplp-anv) answers the same for RG11B10Float, RGB10A2Unorm and RGB10A2Uint, and so do
intel-irisxe-anv and intel-uhd770-rpls-anv for all seven (job m3-max-82025). Holding those formats
as words for every texture buffer would cost one made to be read 31.6% and 31.7% on that Iris
(texel_buffer_bgra8_read and texel_buffer_b5g6r5_read, job m3-max-82136).
The form now asks a fourth access, the storage read without a format, only of a texture buffer
whose usage, fixed at its making, holds both MTLTextureUsageShaderRead and
MTLTextureUsageShaderWrite, or is MTLTextureUsageUnknown (metal::format::texel_buffer_read_write):
Metal lets a function reach a texture buffer through access::read_write only where its usage holds
both. texel_buffer_form(pf, usage, profile) is one answer per format and usage per device; one made
to be read or written alone keeps the three-access answer. On the three ANV profiles the seven
formats move to words for such a texture buffer and nowhere else. AGENTS.md's rule 2 says so in
the same commit: the three accesses, plus the storage read without a format for a texture buffer
made with both usages, one answer per format and usage per device; it is still one query-chosen
form, and the count of fourteen is unchanged.
The word says the usage, as it says the format, so a shader that meets a texture buffer through a
handle, as one at a slot, tells which answer holds: bit 11 of a texture buffer word of a format
with a word layout, TextureWord::TEXEL_BUFFER_READ_WRITE, is set where it was made both to be read
and to be written. It lies within the 14 low bits an argument buffer's handle carries
(HANDLE_WORD), and the word stays the same on every device. The translator holds the codes a
profile holds as words per usage (WordCodes: alone, read_write); the words twin's held test tests
bit 11 beside the code only where some format is words for the one usage and not the other
(read_write & !alone), and where the two sets are equal the test and the module are what they
were. The runtime asks texel_form of the texture's usage at its making, and
Device::minimum_texture_buffer_alignment, Metal's query of a format alone, answers the larger of
the two forms' alignments: on the three ANV profiles (uniform offset alignment 1, storage 16, a
single texel enough for both) B5G6R5Unorm and BGR5A1Unorm go from 2 to 4 bytes (a word against a
2-byte texel), and BGRA8Unorm, BGR10A2Unorm, RG11B10Float, RGB10A2Unorm and RGB10A2Uint stay 4;
every other profile's two forms are equal, so its answer is unchanged (computed from the committed
profiles' limits, not measured apart).
Public contract, in this commit: TextureWord::of_texture_buffer(pixel_format, width, usage),
texel_buffer_form(pf, usage, profile), the new texel_buffer_read_write and
TextureWord::TEXEL_BUFFER_READ_WRITE (api_surface, api_signatures.tsv); docs/RESOURCE-ID.md's bit 11
row, its texture buffer word section and its test vectors: tests/resource_words.tsv gains a usage
column, each format with a word at read (1) and read-write (3) usage with its widths, and at write
(2) and unknown (0) at width 1. Consumer search: reims-vgpu at 4f46e27e3b (main's) and at its
current e447795571 (mine): no guest computation of words; of_texture_buffer, texel_buffer_form,
TEXEL_BUFFER_ and resource_words have no hit, and TextureWord's one hit is link-order.txt, a symbol
order list naming TextureWord::of. The runtime README's known gap now says the read is served for a
texture buffer made with both usages, and keeps the measured words' cost scoped to those; its form,
alignment and words-cost paragraphs, docs/API.md and docs/REPLAY-STREAM.md name the usage.
The zero for amd-rdna2-apu-radv, intel-arl-anv and nvidia-pascal-linux is unaudited: those
committed profiles report all 39 word formats as words, so no format can move there by this rule
(main opens a row to re-record them).
SEMANTICS_VERSION 2339 (development holds 2338): the words twin's module on the three ANV profiles
and the form's answers move. RUNTIME_VERSION 2558: a texture buffer's form, its word and the
alignment the runtime answers move. runtime-sources.sha256 re-pinned (metal/format/texel_words.rs
and metal/format/mod.rs are runtime inputs). docs/REFUSALS.md does not move (refusal_surface.py
--check passed).
Verified at 0cbe4dfc70, a commit of this same tree on a try branch (tree dd16b6a2f7):
- red: the test before this one (rebased here as 5900eb8642), at ed24bac82a, job m3-max-83041 on
the Iris Xe (RPL-P, Mesa 26.2.6): every_device_runs_texture_buffers_made_to_be_read_and_written_at_every_slot
failed with B5G6R5Unorm, BGR5A1Unorm and BGR10A2Unorm "not dispatched", the read-written slot's
ReadWithoutFormat refusal;
- the Iris Xe (RPL-P, Mesa 26.2.6), the runtime's texture buffer tests (--cfg m2v_gpu, filter
test(texture_buffer)), job m3-max-83121: 12 run, 12 passed; the new test alone, job m3-max-83127,
passed, every one of the 15 formats answering the CPU's at every slot. It asserts, per texture
buffer made, that the words gauge (Gauges::word_texture_buffers) moved exactly where the form
answers words for its usage, and that the words twin ran once per dispatch where one bound is
words; every_device_reads_and_writes_texture_buffers_of_formats_held_as_words printed
B5G6R5Unorm, BGR5A1Unorm and BGR10A2Unorm "own view; made to be read and written, words: every
answer the CPU's", where they were refused before;
- the Iris Xe, rt_replay's texture_buffers_play_with_their_recorded_ids_and_the_cpu_s_texels
(--cfg m2v_gpu), job m3-max-83115 (at 9eb68e9c2c, which differs from this tree by a test
helper's name in the runtime's texture_buffer_words.rs alone): BGRA8Unorm and B5G6R5Unorm play
as "own view, read_write words" with the recorded IDs (each word with bit 11 where made to be
read and written), the CPU's texels and values, where the play ended in the refusal before;
- the Intel UHD 630 (Windows driver 101.2145, validation layer 1.4.363.0), job m3-max-83145 (the
win-cross build m3-max-83134): the runtime's whole suite, 985 run: 984 passed, 1 failed, 4
skipped; every_device_runs_texture_buffers_made_to_be_read_and_written_at_every_slot and
every_device_reads_and_writes_texture_buffers_of_formats_held_as_words passed. The one failure,
half_simd_reductions' every_device_sums_and_multiplies_half_simdgroups_as_metal, fails the same
way at pin Q (m3-max-82853) and at 2e9f9866be (m3-max-83061) and is outside this change;
- job m3-max-83128 (Linux): the runtime's, devtools' and harness's suites 280 run, 280 passed, 2
skipped; validation 1323 run, 1323 passed, 3 skipped; conformance 1052 run, 1052 passed;
doctests; on lavapipe (--cfg m2v_cpu_icd) the runtime's texture buffer tests 12 run, 12 passed,
and rt_replay's texture buffer play passed, every format the same form for both usages there;
- the Linux gate, job m3-max-83122: cargo fmt --check, signatures --check, refusal_surface.py
--check, clippy -D warnings (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd) and rustdoc all clean;
the translator's and AIR suites 3459 run: 3458 passed, 1 failed, 22 skipped, the one failure
golden_hashes_match_the_table, a bless due of 80 cells under 2339 (the 78 below and
development's own 2); the runtime guard (the_runtime_sources_are_the_committed_ones) passed;
- golden cells (job m3-max-83165: the golden test's every changed cell at this tree and at
development's 401d9d5949, the same build, listed in full): 26 cells move on each of
intel-irisxe-anv, intel-irisxe-rplp-anv and intel-uhd770-rpls-anv (every fixture that reaches a
texture buffer: a8r_buffers, abt_descriptor_sets, hlf_half_buffer, hsw_storage_writes,
kernel_read_through, ob1_texel_buffer, rlm_runtime_limits, tb_word_formats, texture_ops'
texel_buffers, tob_renders, trh_forward, unk_size_queries,
kernel_texture_variant_leftovers, kernel_write_one_dimensional_textures), and 0 on each of the
other twelve committed profiles (amd-780m-hawkpoint-radv, amd-780m-radv, amd-rdna2-apu-radv,
gate-lavapipe, gate-lavapipe-x86_64, intel-arl-anv, lavapipe, moltenvk-m3, nvidia-pascal-linux,
nvidia-rtx50-linux, nvidia-rtx5080-laptop, runtime-floor): there the two code sets are equal and
the module is what it was. Development's own two due cells (runtime-floor's a8r_buffer_read_write
and tb_word_formats) are the same at both. The .air.ll rows need macOS's metal-as and were not
compared. The table is re-blessed on development;
- the authored compile census (jobs m3-max-83117 at 9eb68e9c2c and m3-max-83118 at
401d9d5949, checks; m3-max-83148, a bless in its own workspace at this tree, diffed): 0
differences and 0 failures at both, 21321 cells; 14 artifact digests move, every one on
intel-irisxe-rplp-anv (a C3 venue), 0 on gate-lavapipe and amd-780m-radv, against 0 at
401d9d5949;
- the bit test's cost where nothing moves, on the Iris Xe (exclusive, job m3-max-83168): the
release harness of 401d9d5949 (before, and a copy of it, before2) against this tree's (after),
built by job m3-max-83124, 8 rounds of 500 runs each, the arms' order rotating: the read-only
own views texel_buffer_bgra8_read and texel_buffer_b5g6r5_read take a GPU p50 (median of the 8
rounds) of 9009.0 us and 9215.8 us after against 9009.0 us and 9215.6 us before, +0.00% each,
before2 against before -0.01% and 0.00%; every run matched its CPU reference.
A texture buffer made with both ShaderRead and ShaderWrite usage, of each of the 15 formats a
device may hold as words, at each of tb_word_formats' slots (read, written, read and written),
must run on every device and answer the CPU's decode: where its format's own view reads none
without a format (the buffer features lack STORAGE_READ_WITHOUT_FORMAT), such a texture buffer
is to be held as words. Then texture buffers made to be read alone and written alone over the
same bytes must agree with it: the read-alone one reads what the read-written usage wrote, the
write-alone one writes the codes. The words twin must run exactly where a bound texture buffer
is held as words, read from Gauges::word_texture_buffers at each making.
Expected red on ANV's Iris Xe: B5G6R5Unorm, BGR5A1Unorm and BGR10A2Unorm are held as their own
views there, whose read through access::read_write is Gap::StorageElement (ReadWithoutFormat), so
the first dispatch is refused. Expected green on the UHD 630's Windows driver, which already
holds every one of them as words.
run() takes the thread values from the shared thread_values.
On the Apple M3 Max venue (KosmicKrisp, Mesa 26.3.1), 82 blend rows carried the other venues'
text: that metal2vulkan-runtime "leaves the blend to the device's fixed-function unit". These are
the 73 half-output-blends-* rows (1mdc-one, ba-1mba, bc-1mbc and the rest) and the 9 argb8-targets-*
rows.
KosmicKrisp has no fixed-function step there: it blends in the fragment shader itself.
kk_lower_fs_blend runs NIR's nir_lower_blend (kk_shader.c), and Metal compiles the result under
fast math. Each row now says so. Its answer, count and bound are unchanged, and so is its note,
device-color-conversion.
docs/CONFORMANCE-COVERAGE.md was regenerated with coverage.py and did not change.
The KosmicKrisp replay at this commit (Apple M3 Max, job 83202) reports 0 unexpected lines.
The Apple M3 Max venue (KosmicKrisp, Mesa 26.3.1) held 30 lines after its re-record, kept back
until their causes were read. Each now has a row whose text names that cause:
- a2c and a2one, 8 texel sites: KosmicKrisp computes alpha-to-coverage in the fragment shader with
NIR's nir_lower_alpha_to_coverage (kk_shader.c, msl_nir_lower_common.c). The mask is Mesa's
mapping, not Metal's. Note device-alpha-coverage.
- half-output-blends-r32f sa-1msa: KosmicKrisp blends in the fragment shader (kk_lower_fs_blend,
nir_lower_blend), compiled under Metal's fast math, so the products round in Mesa's order.
Note device-color-conversion.
- pixel-downscales frac/slot digests, 7 sites: ours, not the device's. The slot's pixel
coordinate goes to the normalized sampler as coordinate over size (pixel-sampler-scaling). The
norm control matches Metal on this venue.
- The venue's 11 downscale frac/slot head and tail rows, landed with the earlier re-record, now
carry the same "ours" text in place of "the device's own answer".
- pixel-samplers rgba8 and rgba16f linear-mirror, slot and arg, 4 sites: ours, the same scaling
under mirrored repeat. KosmicKrisp maps mirrored repeat to Metal's own mode, and norm and const
give Metal's digest.
- texture-buffer-fill-groups, -fill-streams and -long-fills: KosmicKrisp's
minTexelBufferOffsetAlignment of 16 (KK_MIN_TEXEL_BUFFER_ALIGNMENT) refuses the offset-4 texture
buffer typed (Refusal::TextureBufferAlignment), before the fillTexture step.
- texture-fills-41: A1BGR5Unorm is not made on this venue.
- texture-fills-236: KosmicKrisp offers ASTC HDR, so the case reaches fillTexture (Unavailable).
Those five cases' every-venue rows split into llvmpipe, NVIDIA, RADV and Intel rows, since
KosmicKrisp answers otherwise there. In the split texture-fills-236 rows, "on any venue" now
reads "on this venue". docs/CONFORMANCE-COVERAGE.md is regenerated (coverage.py).
Answers taken from the KosmicKrisp replay of job m3-max-82902. The KosmicKrisp replay at this commit
(Apple M3 Max, job 83133) reports 0 unexpected lines. docs/CONFORMANCE-COVERAGE.md re-run with
coverage.py on development: unchanged.
A BGR10_XR or BGRA10_XR form's (or _sRGB twin's) 3D sample under a linear mip filter now blends
its two levels' 3D filters as a 2D sample blends its levels: the device's FMix at the clamped
level's f32 fraction, through a constexpr sampler and through a runtime sampler whose word states
the filter. It records PrecisionNote::BicubicFilterArithmetic, as every level blend does
(the runtime sampler's under its linear-mip clause). Metal's blend of a 3D texture's two levels
fits no rule tried; the XR mip probe (an Apple M3 Max on macOS 27.0.1) put the closest 284 of
8,192 samples apart. The note's doc and its catalogue line in docs/API.md now state this, with a
new measure committed as crates/metal2vulkan-conformance/probes/extended_linear_mip_blends.m (the
M3 Max, macOS 27.0.1, job m3-max-82944). At 16,384 lanes per form, filter (nearest, linear) and
shape, Metal's own two levels' samples blended by mix at the fraction truncated onto
sixty-fourths lie within 0.033 of Metal's 3D linear-mip sample of BGR10_XR, BGRA10_XR and their
twins, and within 0.031 of its 2D sample, the blend the module has shipped. The module blends at
the f32 fraction instead, which moves its blend by under 1/64 of the two levels' difference from
that rule.
The select_extended doc no longer lists a 3D texture's linear mip filter among the refusals.
Before this change:
- A constexpr sampler's linear mip filter on such a 3D texture was refused
NotImplemented(Format).
- A runtime sampler's linear mip filter on one had no refusal at all. The emitted sample read the
nearest level, and its comment named "the binder's refusal", which no binder or runtime code
makes (ResourcePlanner::extended_sampler no longer exists).
The same gap holds for a 2D sample of a form whose levels' blend is not built (another XR form,
ExtendedRange::blends_levels false) through a runtime sampler that states a linear mip filter. That
case is left to the oracle measure that will build it.
Red test: tests/engine_extended_range/volumes.rs volume_linear_mip_filters_blend_two_levels
replaces volume_linear_mip_filters_and_padded_forms_are_refused. A constexpr linear mip filter
compiles, valid, with the note. On the CPU interpreter, a runtime sampler's linear-mip sample at
64 levels between two lies, on every lane, between the nearest mip filter's samples of those two
levels, and strictly between on some. A padded form's 3D sample stays refused. At the base, the
constexpr case is refused, and the runtime sampler's sample is one level's.
SEMANTICS_VERSION moves to the next number: a refusal is removed and a sample's words change.
Landed with SEMANTICS_VERSION 2338 (renumbered above development's) and runtime-sources.sha256 4361761c, recomputed on development.
Under TextureWriteRoundingMode::NearestEven (Apple's textureWriteRoundingMode 2) every fragment
storage write now runs; the refusal NotImplemented(PrivateRenderState(TextureWriteRounding)) and
the facts RuntimeFact::StorageTextureWriteRounding and HeapWriteRounding are deleted.
Measured first, by the probe committed here as
crates/metal2vulkan-conformance/probes/texture_write_rounding_storage.m (an Apple M3 Max under
macOS 27.0.1, jobs m3-max-82793 and m3-max-82824): a fragment function writes 65,536 texels of
float and of half texels into RGBA16Float, RG11B10Float and RGB9E5Float storage textures, once in
a pipeline of mode 0 and once of mode 2. Mode 0 rounds every channel toward zero. Mode 2 rounds
a half-float channel to nearest even, a value past the midpoint above 65504 to the infinity
(262,112 of 262,112 non-NaN channels); an RG11B10Float channel to nearest even, held at the largest
finite value (196,583 of 196,583, float and half texels alike); and an RGB9E5Float texel's
mantissas half up under the largest clamped channel's exponent, moved up where that mantissa
rounds to 512, which is Vulkan's own rule for the format (65,536 of 65,536 texels, float and half
alike). Every mode-2 code lies within one unit of mode 0's.
- RGB9E5Float: the word is the module's own arithmetic (texture::rgb9e5_word), so under mode 2 it
is now Metal's mode-2 word exactly: the product times 2^(25 - e) converted toward zero keeps the
half's bit, one added and a shift right round half up, and a largest mantissa of 512 moves the
exponent up before every mantissa is rounded again. Write::half_up carries it to a
SharedExponentBits slot's write (emit::to_image) and WordsPlan::half_up to the texture-buffer
words' write routine. A kernel, tile or other function, a word attachment and the default mode
keep the truncation.
- RG11B10Float, float and half texels: the device's conversion as at the default mode, recorded
as PrecisionNote::DeviceColorConversion (unconditionally for a declared format, under
small_float_storage's clauses for a formatless slot or a heap). A half-float channel's note for a
float texel stays half_storage_facts's. The note's storage clause and its catalogue line in
docs/API.md state the measured counts.
Red tests:
- lower/arith/tests/color_write.rs rgb9e5_words_are_metals_at_either_mode: the emitted word, run
in the SPIR-V interpreter over the probe's 65,536 texels (probe_texels rebuilds them from the
probe's SplitMix64; its input and half hashes are checked against the probe's), hashes (FNV-1a)
to the texture Metal wrote, bit for bit, for float and half texels at either mode. It is red with
the half-up arm disabled.
- tests/engine_link.rs mode_two_fragment_texture_writes_round_as_metal_or_the_device replaces
mode_two_refuses_fragment_texture_writes_it_would_round. It draws over an RGBA32Float attachment,
whose output records no note (the previous test's RGBA8Unorm attachment recorded
DeviceColorConversion itself, which made the earlier commit's note check vacuous). Every case
compiles and links valid at either mode. A declared R16G16B16A16 slot records
DeviceColorConversion at both modes, a B10G11R11 slot under mode 2 alone, and an RGB9E5 word
slot at neither. It is red with the product files at the base, which refuse.
Public surface: PrivateRenderField::TextureWriteRounding and the two RuntimeFact variants are
removed (api_signatures.tsv rows). The consumer's checkout at a20576e1fd has 0 hits for
PrivateRenderField, StorageTextureWriteRounding or HeapWriteRounding (git grep). The mechanism
test's variant indices move StencilBitDraws and RobustStorageBuffers into the two freed places.
docs/REFUSALS.md is regenerated.
Not in scope, a follow-up: a texture buffer of half-float or RG11B10Float held as words
(texel_buffer_form) converts by the module's own toward-zero routine, recorded under the same note.
SEMANTICS_VERSION (refusal removed, notes and words under mode 2) and ARTIFACT_FORMAT_VERSION (two
RuntimeFact variants removed from the codec) each move to the next number.
runtime-sources.sha256 re-pinned (4361761c): the edited translator sources are runtime inputs.
Landed with SEMANTICS_VERSION 2337 (renumbered above development's) and runtime-sources.sha256 4361761c, recomputed on development.
Under TextureWriteRoundingMode::NearestEven (Apple's textureWriteRoundingMode 2), a fragment
function's float texel written to a storage texture whose slot declares a half-float or
RG11B10Float format was refused NotImplemented(PrivateRenderState(TextureWriteRounding)). It now
runs with the device's conversion, as at the default mode, and records
PrecisionNote::DeviceColorConversion: Metal's mode 2 rounds such a channel to nearest even
(RG11B10Float held at the largest finite value), the device's store toward zero on every measured
driver. The half-float note comes from half_storage_facts, which every float write runs; the
RG11B10Float note from mode_rounded_write, under the clauses of small_float_storage (unconditional
for a declared format, by the bound format for a formatless slot, by the heap's small-float family
for a heap element). The note's storage clause in artifact.rs and its catalogue line in docs/API.md
state the mode-2 case.
The writes whose mode-2 rounding was not measured keep the refusal: a float texel into
RGB9E5Float, and a half texel into RG11B10Float or RGB9E5Float. RuntimeFact::
StorageTextureWriteRounding and HeapWriteRounding stay for a slot whose bound texture decides and a
heap handle, their docs narrowed to those cases; their field `halves` (a float texel, which also
refused half-float textures) is renamed `float`, since a half-float texture no longer refuses
(api_signatures.tsv's two variant rows follow). The consumer's checkout at a20576e1fd has 0 hits
for StorageTextureWriteRounding or HeapWriteRounding (git grep).
Fixed with it: a slot declaring RGB9E5Float through its word alias (R32_UINT,
StorageImageClass::SharedExponentBits, the choice every profile makes for the format) was not
seen as a mode-2 target at all, so under NearestEven it compiled with the default's word, no
refusal and no mode recorded. It now records the mode and is refused under NearestEven, as a
declared E5B9G9R9_UFLOAT_PACK32 was.
SEMANTICS_VERSION 2333 -> 2334: a refusal class changes (mode-2 storage writes), and a fragment
stage writing an RGB9E5Float word slot now records the mode in StageIo.
Red test: engine_link's mode_two_refuses_fragment_texture_writes_it_would_round gains a
SharedExponentBits case (refused under mode 2) and expects the declared R16G16B16A16_SFLOAT and
B10G11R11_UFLOAT_PACK32 cases to compile under mode 2 with DeviceColorConversion, no fact, and to
link valid.
runtime-sources.sha256 re-pinned (2ac17122): lower/texture/mod.rs and the other edited sources
are runtime inputs.
Landed with SEMANTICS_VERSION 2336 (renumbered above development's) and runtime-sources.sha256 2ac17122, recomputed on development.
Publish the locally validated source tree on a dedicated experimental branch.
Original validation source: d26b3cbe01669894959cdb96e8627a81d79d4b6a.
Base: 0b0ac58eb0.
Published with the account no-reply identity; local history is unchanged.
The M3's conformance replay on KosmicKrisp (Mesa 26.3.1) at 6989666062 (job m3-max-82902; the
product of development's 13c6ba8a91, which adds one rt test change) printed 269 lines the ledger
did not expect. The venue had 14 rows; every other row it held was another venue's or every
venue's. This commit records what is mechanical and leaves the rest as it is.
- 197 rows added at sites another venue already lists: 158 with that venue's answer, 39 with the
same answer but for its numbers. Each takes that venue's gap text, except 18 whose text named
another device:
- 6 indirect-range cases: KosmicKrisp does not list VK_EXT_device_generated_commands;
- 11 pixel-downscales frac sites: the device's sampler, within the 2/255 recorded on lavapipe;
- 1 half-tanh site: the other venue's first-element values are dropped.
- 14 every-venue rows (astc-*-hdr zero-blocks/texture) split into llvmpipe, NVIDIA, RADV and Intel
rows. KosmicKrisp makes ASTC HDR textures (textureCompressionASTC_HDR in kk_physical_device.c),
so the M3 now matches Metal there.
- 1 M3 row removed: discard-quad-sum-placement hoisted_known/pipeline, which the venue now reads as
lacking the feature.
- 15 rows added for refusals no venue listed, each from a device query:
- 10 surface-textures cases: KosmicKrisp exports no dma-buf, opaque fd or Win32 memory;
- 2 lines and facing draws: no fillModeNonSolid;
- 3 A1BGR5Unorm textures (fresh-pattern-41, extended-swizzles-a1bgr5unorm,
texture-round-trip-41): not made for the usage.
- 6 bicubic-texel-classes M3 rows: the answer is the one the 780M, RX 550, RTX 5080, RX 7900 XTX
and Iris Xe rows record. The M3 answers it since the Converted half pair is decorated
NoContraction (699f1167d6).
Left as they are, to be read first (30 lines):
- alpha-to-coverage texels: a2c-* and a2one-*, 8;
- pixel-downscales frac digests, 7;
- pixel-samplers linear-mirror sites, 4;
- texture-buffer fills refused off KosmicKrisp's 16-byte texture-buffer alignment, with
texture-fills-41 and -236 (5), plus the 5 every-venue rows they no longer hold;
- half-output-blends-r32f sa-1msa, 1.
docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py).
Verified: the edit is derived from that replay's lines; the conformance suite and a replay on the
M3 with this ledger are in the READY note.
Rebased onto development 13c6ba8a91, where 699f1167d6 (a Converted half rounding's conversion
pair decorated NoContraction) took 2334. The previous commit's own bump, 2333 to 2334, is
upstream's line now, so the rebase left it out; this change, a refusal that becomes a module
(Unsupported{IdentityDomains} for a texture buffer's slot without a format), takes 2335.
The previous commit's jobs ran at 1db43f3bd8, the same change on development 22861fde72 under
2334: red m3-max-82957, Iris Xe m3-max-82971, UHD 630 m3-max-82977, Linux gate m3-max-82968,
golden diff m3-max-83023. This tip's own gate and UHD 630 leg are named in the lane's report.
Under the identity domains no input names a storage slot's bound format. storage_format declared
a slot without a format only where shaderStorageImage{Read,Write}WithoutFormat grant its
accesses, or where the formats' own bits grant its read (reads_by_format_bits: the neutral
R32_SFLOAT and every read-write tier format's view carry STORAGE_READ_WITHOUT_FORMAT), and
refused anything else as Unsupported{IdentityDomains}, not implemented, with no symbol. Intel's
Windows driver 101.2145 on the UHD 630 lacks shaderStorageImageReadWithoutFormat and lists
neither WITHOUT_FORMAT bit in any format's buffer features (vulkaninfo there, jobs m3-max-82912
and m3-max-82917), so every function with an access::read_write texture buffer at a slot was
refused at the make: tb_word_formats for all 15 formats of
every_device_reads_and_writes_texture_buffers_of_formats_held_as_words (job m3-max-82853, pin Q
aed8b7eba3). The refusal is the own-view arm's declaration and took the words twin with it,
though that device holds every format with a word layout as words, which the twin reaches through
the R32ui words array and no formatless access.
A texture buffer's slot is now declared without a format wherever the profile reads and writes
storage so at all (texel_buffer_without_format: DeviceProfile::accesses_without_format, the
features, or Vulkan 1.3 or VK_KHR_format_feature_flags2, which enable the SPIR-V capabilities
StorageImageReadWithoutFormat and StorageImageWriteWithoutFormat). Vulkan asks the format's bits
of each view an access reaches (VUID-vkCmdDispatch-OpTypeImage-07029, -07030), and the runtime
already answers that per texture buffer at the draw or dispatch from the slot's interface
(declared_format false): an own view whose buffer features lack the access's bit is
Gap::StorageElement, a texture buffer held as words reads and writes true (texel_form). A nil
texture at the slot reads a null descriptor, which is no view: the floor's nullDescriptor
(runtime README, Floor, Features: `nullDescriptor`, VkPhysicalDeviceRobustness2FeaturesEXT; the
floor also requires Vulkan 1.3, its first line). Decided by the profile's Vulkan answers alone.
Images keep reads_by_format_bits; its texture buffer arm goes, as the new rule takes every
profile it took.
The refusal narrows from every state over such a function to the bindings the runtime README
already records: on a device whose buffer features lack STORAGE_READ_WITHOUT_FORMAT for a format
held as its own view, a read of that format's texture buffer through access::read_write at a
slot is refused at the draw or dispatch. The README's paragraph now says that the slot's
declaration is made on every device and the refusal is the dispatch's, per texture buffer, that
a nil texture there reads the floor's null descriptor, and that the UHD 630 reads and writes its
word formats through access::read_write; the refusal list's no-symbol item is now a storage
texture's alone, not a texture buffer's.
SEMANTICS_VERSION 2334 (development held 2333): a refusal becomes a module. No RUNTIME_VERSION
bump: a run of an unchanged artifact does nothing else. runtime-sources.sha256 is unchanged:
neither lower/texture/slot.rs nor cache/mod.rs is a runtime input (validation's build.rs list),
and the guard test passed at this tree (below). docs/REFUSALS.md does not move: storage_format
stays an IdentityDomains site (refusal_surface.py --check passed below).
Verified at 1db43f3bd8, a commit of this same tree (tree 569677eeac) on a try branch:
- red: the test before this one (849c883ab3), job m3-max-82957: refused as
"unsupported: IdentityDomains; needs NotImplemented", the UHD 630's text;
- Intel Iris Xe (RPL-P, Mesa 26.2.6), job m3-max-82971: the runtime's texture buffer tests
(--cfg m2v_gpu, filter test(texture_buffer)), 11 run, 11 passed; its word formats every answer
the CPU's, and B5G6R5Unorm, BGR5A1Unorm and BGR10A2Unorm (own views) refused read_write by name;
- Intel UHD 630 (Windows driver 101.2145, validation layer 1.4.363.0), job m3-max-82977 (the
win-cross build m3-max-82970): the runtime's whole suite, 984 run: 983 passed, 1 failed, 4 skipped;
every_device_reads_and_writes_texture_buffers_of_formats_held_as_words passed (it asserts the
words twin ran once per dispatch where the format is held as words, all 15 formats there), as
did one_path's the_scan_reads_the_translators_product_sources_alone and
the_product_sources_take_one_path_for_every_device. The one failure,
half_simd_reductions' every_device_sums_and_multiplies_half_simdgroups_as_metal, failed the
same way at pin Q (job m3-max-82853) and is outside this change;
- the Linux gate, job m3-max-82968: cargo fmt --check, signatures --check,
refusal_surface.py --check, clippy -D warnings (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd) and
rustdoc all clean; the translator's and AIR suites 3457 run: 3456 passed, 1 failed, 22 skipped; the
runtime guard (the_runtime_sources_are_the_committed_ones) passed. The one failure is
golden_hashes_match_the_table, a bless due under 2334 (job m3-max-83023): exactly two cells
changed, both refusals that became modules on the runtime-floor profile,
engine/a8r_buffers.ll a8r_buffer_read_write and engine/tb_word_formats.ll tb_word_formats,
Unsupported{IdentityDomains; NotImplemented} to modules; the .air.ll rows need macOS's metal-as
and were not compared. The table is re-blessed on development.
On the UHD 630 under Intel's Windows driver 101.2145 (job m3-max-82853, pin Q aed8b7eba3) the
runtime test every_device_reads_and_writes_texture_buffers_of_formats_held_as_words made no
pipeline of tb_word_formats for any of its 15 formats: Unsupported{IdentityDomains}, not
implemented, with no symbol. That device lacks shaderStorageImageReadWithoutFormat and lists
neither STORAGE_READ_WITHOUT_FORMAT nor STORAGE_WRITE_WITHOUT_FORMAT in any format's buffer
features (vulkaninfo there, jobs m3-max-82912 and m3-max-82917), so storage_format refuses the
kernel's access::read_write texture buffer slot under the identity domains: the slot's read is
granted neither by the feature nor by the neutral R32_SFLOAT's buffer read bit
(reads_by_format_bits). The refusal takes the whole make, the words twin with it, though every
format the test reads is held as words there and reached through the R32ui words array.
This test builds that device's answers device-free: the Iris Xe's profile
(intel-irisxe-rplp-anv, which lacks the feature too) with both bits cleared from every format's
buffer features. It asserts that tb_word_formats compiles under the identity domains and passes
L3, requires the StorageImageReadWithoutFormat capability and not the feature, plans the words'
routines, and states its written and read-written texture buffer slots as storage slots without
a declared format. Expected red until the fix: the compile is refused as IdentityDomains.
The golden hash table moves 399 rows and its semantics line goes to 2334:
the Converted half rounding's NoContraction pair (699f1167d6) changes the
module wherever that form is emitted. The engine inventory and the air_input
printouts bless unchanged, and the metallib half of
committed_air_fixtures_parse_and_link passes on the M3's SDK (bless job
m3-max-83055; the first bless job, 82992, gave the same 400-line change, but
its workspace was released before its patch was read).
The authored compile census recompiled every cell: 2369 cases, 9 profiles,
21,321 cells, 0 cached; 19,106 compiled, 2,215 refused, 0 failed,
0 differences, 0 regressions (census job m3-max-82993). Only its
artifacts_at product fingerprint line moves.
7d9aa2207f's partition left its element type to inference, which rustc could not settle
(E0282, job m3-max-82776). It is now the conversion triple's reference. Test only.
converted_half_rounding_is_the_exactly_rounded_half (red two commits back) asserted that every
OpFConvert in its kernel is decorated NoContraction in both forms. Its kernel also stores the half
result, and that store's narrowing to bits (narrow::to_bits) is no pair: it is decorated under the
float controls alone, which a_half_encode_is_the_devices_narrowing_in_every_form holds and the fix
keeps. So the assertion also failed at the fix, on the store's narrowing ("round Converted:
[Allowed, Allowed, Allowed]" before the fix, job m3-max-82752).
The test now finds the pair by structure (a narrowing of an f32 to 16 bits and a widening of its
result back to 32 bits), asserts both are NoContraction in both forms, and asserts every other
conversion takes its form's decoration: NoContraction under the float controls, none in
Converted. Test only; no translation output changes.
A `half` rounding in `QuantizeForm::Converted` (a profile with shaderFloat16 whose float
controls do not make the conversion Metal's) was an undecorated OpFConvert to 16 bits and
its widening. Vulkan assumes AllowTransform on every operation not decorated
NoContraction ("Precision and Operation of SPIR-V Instructions"), and Mesa's NIR folds
`~f2f32(f2f16(a))` into `a` wherever the instruction is not exact (nir_opt_algebraic.py;
vtn marks NoContraction exact), so the value went on unrounded. On KosmicKrisp (Mesa
26.3.1, Apple M3 Max) that broke half_simd_reductions: each round of the half tree kept
float precision, and 224 of 256 words differed from Metal's (job m3-max-82540, pin P's
leg). The MSL KosmicKrisp emits showed no half() between rounds; with the pair decorated,
0 words differ (job m3-max-82662).
`narrow::converted` now emits each conversion with `convert_no_contraction`, as
`narrow::controlled` does. The pair relies on Vulkan's environment rule, which reaches a
conversion, where the SPIR-V specification words NoContraction for an arithmetic
instruction only; the docs state that reliance at the Controlled pair's (narrow.rs), on
QuantizeForm::Converted, and in docs/API.md's native-half-conversion entry, and that a
driver which folds a decorated pair leaves the device's own answer, within
PrecisionNote::NativeHalfConversion, which a Converted module already records. NVIDIA's
measured fold of the decorated Controlled pair stays as recorded. SEMANTICS_VERSION 2333
-> 2334: every Converted module's words change (moltenvk-m3 is the committed profile on
that form; KosmicKrisp takes it at run time).
Evidence, all on the arms of this change before the ruling:
- KosmicKrisp conformance replay on the Apple M3 Max: 53 sites that differed from Metal
at the base now match, none added (job m3-max-82685).
- Cost: +0.46% host wall on half_mix on the M3 under KosmicKrisp, job 82685, three
alternated rounds of 200, spread 0.03%.
- Golden tables: 216 moltenvk-m3 cells change, no other profile's (job m3-max-82679).
They re-bless at the next named pin.
The red test (the commit before) asserts both forms' conversions are NoContraction;
it fails before this change and passes with it (the gate's jobs are in the READY note).
The Converted form (shaderFloat16 without the 16-bit float controls) rounds an f32 to half by an
OpFConvert to 16 bits and its widening, undecorated. Vulkan assumes AllowTransform on an
operation not decorated NoContraction, and Mesa's NIR folds the widening of a narrowing under it
(nir_opt_algebraic.py, Mesa 26.3.1, line 1271: ~f2f32(f2f(a)) -> f2f32(a), then x2xN(a@N) -> a).
So on every Mesa driver on a Converted profile the value is never rounded. On the Apple M3 Max
under KosmicKrisp (Mesa 26.3.1), the runtime's half_simd_reductions device test read the f32 sum
rounded once at the store in 224 of 256 words, not Metal's tree of rounded halves (0x3c10 for
Metal's 0x3c0f on the first sum; job m3-max-82540). The MSL KosmicKrisp emits for that kernel has
no half conversion between the tree's rounds (MESA_KK_DEBUG=msl, m3-max-82662).
converted_half_rounding_is_the_exactly_rounded_half now asserts that both forms' conversions are
NoContraction. It fails on the Converted form until the next commit decorates the pair.
Verified: cargo fmt only. The red run is the next commit's base arm.
The scan labelled each product source by Path::display, which joins its
components with `\` on Windows. The labels the tests name and the allowances
key on are written with `/`, so on the UHD 630 under Windows (job
m3-max-82853, at aed8b7eba3) the_scan_reads_the_translators_product_sources_alone
found no "metal2vulkan/src/device/description.rs". And
the_product_sources_take_one_path_for_every_device reported allowed lines,
such as "metal2vulkan/src/ash_interop\convert.rs:36 DriverId", as findings.
The label now joins the path's components with `/`. Test-only:
runtime-sources.sha256 is unchanged (recomputed: 3ec63863).
Rule 1 fixes a precision note per operation and never decides it at run
time. metal2vulkan-runtime follows that: each state carries its stages'
whole precision_notes from its creation (pipeline.rs, render.rs) and
reads no specialized note at a draw or dispatch (0 hits for
specialized_notes or precision_notes_bound in its sources). Its README
says the same ("fixed at creation and never decided at dispatch").
Several translator docs said otherwise:
- Ten said the runtime announces or reads a note at a draw or dispatch that binds
a texture, or only while a sampler state of pixel coordinates lives:
pipeline/artifact.rs (DeviceNanEncoding, ArgumentPixelSamplerScaling),
lower/sampler/select.rs (three), lower/texture/heap_raw.rs,
lower/texture/mod.rs (four, stored_where's "the runtime reads ... at
each draw or dispatch" among them). They now say the note holds under the
bound value and is among the stage's notes, which the runtime records
whole at the state's creation.
- Two named announcements with no runtime code: artifact.rs's
`non-strict-residency` and facts.rs's PlanDiagnostic::CrossClassHeapNeutral
("which the runtime announces"; the runtime reads no PlanDiagnostic).
Both claims go.
The same class beyond those eleven, so the docs agree with README.md
(the caller announces a note; the runtime records it): metal/state.rs
named an announcement `unorm-depth-bias`, which no code has (the render
encoder's note is PrecisionNote::DeviceDepthBias); artifact.rs's
SrgbTexelDecode said the runtime reads the bound format at a draw;
"the runtime announces" becomes "records" at artifact.rs (three),
compile/numbered.rs,
link/band.rs, the runtime README (DevicePackConversion) and validation's
c3.rs; three test docs drop the run-time claim (engine_spec_bits,
engine_sampler, engine_cross_class); validation's coverage.rs said an
executed module's notes are its bound ones (precision_notes_bound),
where every executor records the state's whole notes; and the runtime's
translator_fields row says "records".
Comments and docs only. metal/state.rs is a runtime input, so
runtime-sources.sha256 takes the inputs' new hash; no run changes.
Verified: rustfmt --check on every .rs file changed; the job named in
the handover.
A precision note's stable code, `metal2vulkan-degrade-` and the note's
name in kebab case, was written only in the conformance crate
(degradation.rs), which is unpublished. So no published item gave a
caller the code to announce a note by, and README.md said the runtime
announces each note once with a stable code, which it does not: the
runtime records each state's notes when the state is made, exposes them
through its getters, and prints and sends none (docs/API.md section 9
says so).
- PrecisionNote::code (pipeline/artifact.rs) returns the code, one arm a
note, as docs/API.md's catalogue names it.
- The conformance crate reads it from there: Degradation::code is its
note's code, through Degradation::note, the inverse of
from_precision_note. Each kind's doc names its note, not a second copy
of the string.
- README.md's "Recorded differences" says what is true: the runtime
records each state's notes at creation and exposes them with a stable
code; the caller announces them. docs/API.md's catalogue lead names
PrecisionNote::code.
- The signature table takes the method under both crates that export
PrecisionNote.
The 83 codes are unchanged: each equals the conformance crate's string
before this commit (checked by script against its code() table), and
every_kind_is_a_catalogued_precision_note still finds each in the
catalogue. New tests: every_precision_note_code_is_its_name_in_kebab_case
(translator, serde feature: every variant read from the enum's source,
its code the kebab rule, no code twice) and every_kind_is_its_notes_kind
(conformance: note() takes from_precision_note back for every kind).
No translation, runtime or refusal changes; no runtime input changes, so
runtime-sources.sha256 stays.
Verified: rustfmt --check on the four .rs files; the job named in the
handover.
The golden hash table moves 16 rows. The profile fingerprint moved at
a4491c1436 and the translator changed since pin P. The engine inventory and the
air_input printouts bless unchanged, and the metallib half of
committed_air_fixtures_parse_and_link passes on the M3's SDK (bless job
m3-max-82822).
The authored compile census recompiled every cell: 2369 cases, 9 profiles,
21,321 cells, 0 cached. 19,106 compiled, 2,215 refused, 0 failed, 0
regressions, and 6 new cases blessed (census job m3-max-82823, 97.6 s wall).
Its slowest compile was 1.67 s and its largest worker 232 MiB RSS, inside
the 20 s and 500 MiB ceilings.
The first bless and census jobs (82767, 82768) lost their compiles when the
build cache's daemon died: the daemon belongs to the job that starts it and
went with that job when it ended. Nothing in this tree changed between
those jobs and the reruns.
What: the known gap of memory blocks (a texture in place over host memory's import) states how long
a RestoreFence holds its span: from before returning to after being called. In microseconds, the
median of 16 fenced makes and then the largest, without the validation layer:
- 1920x1080 BGRA8Unorm: Apple M3 Max (KosmicKrisp 26.3.1) 455 and 645; Radeon 780M (RADV PHOENIX,
Mesa 26.2.6) 603 and 877; Iris Xe (ANV, Mesa 26.2.6) 3267 and 3504.
- 16x4 RGBA8Unorm: 328 and 396; 120 and 169; 507 and 934.
It also says the span holds the whole submission that carries the restore.
Why: the consumer picks its fence from these numbers.
Verified: printed by the new test (host_in_place's
each_device_fences_a_host_writer_around_the_restore_alone) at 7bc3d18e4e, with
METAL2VULKAN_TEST_UNVALIDATED=1, in jobs m3-max-82721 (M3 Max), m3-max-82720 (780M Phoenix) and
m3-max-82734 (Iris Xe). Under the validation layer, in the same jobs, the 1080p numbers were 478
and 591, 1240 and 1972, and 3731 and 3993; the 16x4 numbers were 350 and 444, 209 and 825, and
793 and 1411. Docs only.
What: Device::texture takes the fence that Buffer::new_texture_fenced and
Buffer::new_texture_in_place_fenced pass. On a restored make alone (in place over host memory's
import, Keep::Restore), after the refusals ahead of the restore, the make runs on its own thread:
it waits for the progress already submitted (Work::progress), calls the fence's before, adds the
image's move home to the upload (Work::home), flushes, waits for that value, and calls after.
before comes ahead of home and not just ahead of flush because a commit from another thread can
carry the upload out as soon as the move is in it (take_uploads). after is called from a drop
guard (Fenced), so it runs on every exit once before returned Ok: the make done, Quiesced from
home, a lost device in the wait, or a panic unwinding. A before that answers Err(reason) refuses
the make with Refusal::RestoreFenceRefused { reason }. Then nothing is recorded, saved, moved or
written back, the texture made so far is dropped, nothing counts, and after is not called: before
undoes its own work, and after always pairs with a before that returned Ok. Every other make, and
every make with no fence, takes the match's other arm, so an unused seam costs one branch. The
make itself is unchanged.
Public shape: a trait object (&mut dyn RestoreFence, before -> Result<(), &'static str> and after)
on two new twins, not an Option argument on new_texture and new_texture_in_place. This tree has
about 90 four-argument calls of those two, and the consumer's development has 6, of which 2 need
the fence; the twins leave every other call unchanged. A &mut trait object lets before keep a guard
or a token in the fence for after to release. The reason is &'static str so that the refusal stays
Copy, as Refusal is.
Docs: the runtime README (Imported blocks, "The caller's fence"; the known gap of memory blocks;
the API list) states the contract. Between before and after the runtime saves, moves and writes
back the block's bytes, so a host write to them in that span is lost; the span holds the whole
submission that carries the upload, a group's included. A caller with such a writer fences it
there; one without passes nothing. Vulkan documents no form that keeps the bytes without the
write-back (sections 12.10.1 and 7.7.6: an acquire keeps bytes only after the other owner's
release; section 11.2.6: host-pointer memory is shared with the host under host access
synchronization). The rustdoc of the trait, the twins, the refusal and Buffer::new_texture says
Metal has no such span. Refusal::InScheduledHandler's doc names the twins. docs/REFUSALS.md is
regenerated (RestoreFenceRefused, one site). Not touched: RUNTIME_VERSION and runtime-sources.sha256,
whose inputs are the translator's listed files (metal2vulkan/src, metal2vulkan-air/src); this change
edits none of them.
Verified, red: at 4e941d8015 (the fence passed nowhere) the new test failed on lavapipe (llvmpipe,
LLVM 23.1.1, Mesa 26.2.4), job m3-max-82710. With no fence, 632 of 86,252 stamped words were lost.
With the unwired fence, 7,507 of 98,879 were lost, 0 writes found the gate held, and before and
after ran 0 times. Green runs and the gate follow in the lane's report.
6b8b3af925 added Refusal::RestoreFenceRefused without regenerating error/basis.rs, so the runtime
did not compile (non-exhaustive match in Refusal::basis; job m3-max-82706, lavapipe). basis.rs is
regenerated by scripts/refusal-surface/refusal_surface.py from the variant's Basis line. The
signatures table takes the five new public items and the new variant
(scripts/api-signatures/signatures.py --bless). No behaviour changes: the fenced twins still drop
the fence, so the red test stays red.
What: the runtime's public seam on its one make that saves and writes back a buffer's bytes, a
texture in place over host memory's import on an integrated or CPU device. RestoreFence (before,
which may refuse with a reason, and after), Buffer::new_texture_fenced and
Buffer::new_texture_in_place_fenced, and Refusal::RestoreFenceRefused { reason }. In this commit
the twins take the fence and Device::texture drops it: neither method is called.
The test, host_in_place's each_device_fences_a_host_writer_around_the_restore_alone, puts a host
writer on a 1920x1080 BGRA8Unorm frame over its own import. The writer stamps one word every 64
bytes, one a microsecond, each through a mutex gate, starting before the make and stopping after
it returns. With no fence (new_texture, up to four makes) some stamped words hold their old bytes:
the write-back reverted writes that landed between the save and the write-back. With a fence whose
before takes the gate and whose after gives it back, the writer must find the gate held at least
once and lose no word. The fence runs once each way. The restore pair (OverCause::HostMemoryRestore)
is the same as the unfenced make's, and every word not stamped holds the bytes written before the
make. A before that refuses ("unsettled") must give RestoreFenceRefused with that reason, no after,
no copy and no texture counted. The in-place-alone twin runs the fence the same way. Sixteen fenced
makes each of 1080p BGRA8 and 16x4 RGBA8 print the span between before and after and the make's
time (median and largest). Off unified memory (a discrete or virtual device, or the two-copy view),
neither method runs, and the in-place-alone twin is refused as not in place.
At this commit the fenced arm fails: the writer loses words behind the fence, and before never
runs. Red runs are named in the next commit's message.
What: the runtime README (Imported blocks, and the known gap of memory blocks), the rustdoc of
Buffer::new_texture, Metrics::over_copies_host_memory_restore and the make's comment said that a
texture in place over host memory's import has its restore (save, move, write-back) go "alone, in
a submission of the runtime's own". They now say what the code does: the make seals the upload
and flushes it (Work::flush), and the submit thread's next submission carries it. Where no
queue's group goes at that turn, that is a submission of the runtime's own (submit.rs, the flush
branch after the group loop); otherwise a group's close takes it (WorkState::close calls
take_uploads, which takes every flushed upload), and submit() puts it ahead of the group's
command buffers, in the first part where the group goes member by member. The make waits for that
submission's value, so it waits for those command buffers too.
Why: the consumer reads these sections to decide how to fence its host writers around the make;
"alone" told it the span holds nothing of its own.
Verified: read against submit.rs (Work::flush, WorkState::flush, WorkState::close, take_uploads,
submit, parts). Docs and comments only; no code changes.
Two pieces of dead code go (rule 4).
LeafCaps::zero_initialize_workgroup_memory was set from the
shaderZeroInitializeWorkgroupMemory query in device::derive and read
nowhere. Lowering and the verifier read the enabled feature set instead
(lower/access/local.rs, spirv/verify/rules.rs), so no answer changes.
The field is not public: device::profile is pub(crate) and LeafCaps is
not re-exported. A git grep of the consumer's checkout at eadc8b4a0d
finds 0 hits for the field or LeafCaps.
The profile's fingerprint is a hash of the fields' Debug text, so every
profile's fingerprint moves with this commit. Cache keys miss once and
recompute; there is no false hit, so no SEMANTICS_VERSION bump. The
golden table goes stale by key alone and re-blesses at the next pin: at
this tree 28,860 cells (1,924 rows x 15 profiles) are "under a changed
profile", with 0 new, 0 gone, 0 under a changed fixture source and none
changed under an unchanged key. Stored observations name the field in
their environment/profile Debug text: 12 shard files, 55 lines (4 under
observations/refusals/vulkan, 8 under observations/vulkan). They are
left as stored; their text already differs from today's profile shape.
lower::sampler::anisotropic::select returns as soon as the profile has
samplerAnisotropy, so its later `if anisotropy && !reached` test could
never be true. It goes with its comment. Behaviour is unchanged on every
profile.
runtime-sources.sha256 takes the runtime inputs' new hash. derive.rs and
profile.rs are inputs, and this change alters no behaviour of a run.
The hash also covers two earlier comment-only edits to inputs that left
the guard red on development: b07b697aac (device/metal.rs) and
7be9f00a3f (device/policy.rs, device/profile.rs). Their .rs diffs change
comment lines alone. At 7be9f00a3f the guard test fails and names
5aa066e0..., against the pinned 36ba0695... (job m3-max-82683).
Verified on the CPU with no device:
- m3-max-82633, the gate at 2523fe20c6 (this change before the hash update):
signatures, clippy (plain, m2v_gpu, m2v_cpu_icd), rustdoc and private
rustdoc of metal2vulkan all exit 0; conformance 1051/1051; doctests 0.
Product suites: 3734 of 3735 passed, 24 skipped; the failure was
golden_hashes (stale, above). Validation: 1321 of 1322 passed, 3
skipped; the failure was the runtime guard, which this hash fixes.
- m3-max-82683 at 413a1db3f9 (this tree): the runtime guard passes; golden_hashes is
stale by profile key alone (above). With the four files at 7be9f00a3f:
the guard fails (development's red), and golden_hashes passes (1,924
rows x 15 profiles match).
- rustfmt --check on the three .rs files.
The known gap said the runtime's two device tests of it "fail there". The bug is a race (the
driver's indirect tessellation grids are thread counts dispatched as threadgroup counts, so one
instance's extra vertex work overwrites the next instance's), and the tests' results on
KosmicKrisp vary by run:
- every_device_reads_a_patch_draw_s_base_instance_after_tessellation and
every_device_reads_a_patch_s_position_as_its_primitive_id_under_a_patch_index_buffer failed in
m3-max-81082 and passed in m3-max-81774 and m3-max-82540, with no change to patch.rs between
those runs;
- every_device_reads_control_points_and_patch_indices_through_their_index_buffers (indirect,
no index type, no patch index buffer) passed in m3-max-81774 and failed in m3-max-82540: the
second instance's slots for positions 2 and 3 read 0, and slots for positions 5 and 6 read the
first instance's id, 3. That is the first instance's vertex threads past its 3 patches writing
positions 4 to 6 over the second instance's 3 vertex slots, with position 4 culled.
The bullet now says it is a race, that a draw can be right, what the failed draw showed, and the
runs of all three tests on the Apple M3 Max under KosmicKrisp (Mesa 26.3.1), plus the third
test's passes on RADV on the RX 7900 XTX (m3-max-82574) and the Radeon 780M (m3-max-82583) in
the same round.
Verified: docs only; the results are read from those jobs' logs. The driver's grids were read in
Mesa 26.3.1's kk_tessellation.cl (libkk_tess_setup_indirect) and kk_cmd_draw.c
(kk_dispatch_compute), not instrumented.
What: executor_contract::out_of_bounds::containment() reports a threadgroup target as the arena
unchecked (Check::Unchecked), on every profile and under either domains. out_of_bounds_run then
refuses the case before anything is made, as not_supported{uncontained:unchecked threadgroup},
as it refuses a loaded pointer under the identity domains. The read rule's in-shader arm no
longer names the arena. The module docs, the Unchecked variant, ContainmentForm::Threadgroup,
the coverage note on which accesses the encodings govern, and docs/VALIDATION.md say so.
ENGINE_EXECUTOR_ABI moves to vulkan-engine-v214: the executor records a refusal for a case it
ran before.
Why: since 990328afe1 no profile checks a threadgroup access (lower::access::local::contained;
docs/API.md, "Threadgroup memory": one past the memory is undefined, as in Metal; the runtime
README states it too). The contract still reported the arena as checked in the shader, so the
candidate ran the only authored case with a threadgroup target, tg-twice (7efae163,
loads-and-stores-past-a-threadgroup-allocation), and read what the device held past the
allocation. On the Radeon 780M (RADV, Mesa 26.2.6) job m3-max-82582 ran it 10 times at
f606e43b30 and got 10 different output hashes: word 6, a load of tg[40], which no thread
writes, held a different value each run. The kernel's SimdgroupAccessOrder note made the failed
zero rule a NotedDifference. Vulkan does not define an access past a Workgroup array either, so
no part of that run is evidence.
What else moves: no other authored case declares a threadgroup target (all case shards
searched for "form":"threadgroup": one hit), so only tg-twice moves from noted_difference to a
refusal. The case, its AIR and its Metal row are unchanged. No classifier input changes
(executor_contract/out_of_bounds.rs, coverage.rs and case/out_of_bounds.rs are not in
build.rs's classifier list), and the authored compile census compiles the case as before
(case_compile reads no containment), so neither census version moves.
Verified: see the green job named with this commit's READY.
What: the out-of-bounds contract's tests now state what the product does with threadgroup
memory. threadgroup_memory_is_checked_nowhere_and_its_case_is_refused asks containment() for a
threadgroup target on every committed profile, under either domains: the arena unchecked
(arena:unchecked), read rule Any, and out_of_bounds_run refuses the run as
not_supported{uncontained:unchecked threadgroup}. The coverage test of the ob1 fixtures expects
ob1_threadgroup's compiled target to be arena:unchecked.
Why: since 990328afe1 no profile checks a threadgroup access (lower::access::local::contained;
docs/API.md, "Threadgroup memory": one past the memory is undefined, as in Metal), but
containment() still reports the arena checked in the shader, so the candidate runs the
tg-twice case (7efae163, loads-and-stores-past-a-threadgroup-allocation) and judges its reads
past the allocation by the zero rule. On the Radeon 780M (RADV, Mesa 26.2.6) job m3-max-82582
ran it 10 times at f606e43b30: 10 different output hashes, all NotedDifference. Words 0 to 3
equal Metal's; words 4, 5 and 7 are the values threads 4, 5 and 7 stored past the allocation;
word 6, the load of tg[40], which no thread writes, differs in every run (9a2e1730, 982ec630,
9a2e4632, ...). The kernel's SimdgroupAccessOrder note made the failed zero rule a
NotedDifference.
Verified: red expected; the job that runs these tests at this commit is named in the fix's
commit.
The docs of DevicePolicy::RESIDENT_TABLES, PointerDomain::ResidentTable,
HandleDomain::Table, the lockstep module, docs/API.md and three test
comments said the resident form was the validation executor's alone and
that the executor builds the resident root and handle table itself, or
called it "the old runtime's, until the cutover deletes it". Neither is
true: the validation executor (engine.rs), the runtime, the command line
and the compile worker all build their device under
DevicePolicy::default(), and every RESIDENT_TABLES in the tree sits in a
test (the translator's src/tests and device tests, the validation
crate's #[cfg(test)] modules including coverage::tier_table, the
harness's tests and the validation integration tests).
The comments now say that: nothing outside tests builds the form, and
the runtime, the tools and the validation executor take the default.
Comments and docs only; no code changes.
Verified: git grep of RESIDENT_TABLES, PointerDomain::ResidentTable and
HandleDomain::Table at 8140229b9c, each hit outside the translator's own
tests read for its #[cfg(test)] scope; cargo fmt --all; the workspace
rustdoc check with -D warnings, doc 0 and private-items doc 0 on all seven crates (job
m3-max-82621).
The runtime README called the zero clear of a new texture the runtime's choice. It now gives the
reasons the answer stands on: Metal leaves a new texture's contents undefined, programs read
textures they never wrote, an Apple M3 Max answered zero for new Shared and Managed textures, and
zero is the one answer that cannot show a program bytes something else left in the device's
memory. The clear is counted by Metrics::texture_clears and texture_clear_bytes. No behaviour
changes.
Verified: the paragraph reads as one, and no other doc states the old reason.
capture::Changes holds two lists that wait for a commit, both of weak entries:
- the ranges that didModifyRange named, with their index by buffer;
- the bytes of each Managed buffer made since the last commit.
Each list drops the entries of buffers that are gone once it doubles, starting from SWEEP_FLOOR
(64) entries. Nothing tested that bound. A program that makes, names and drops Managed buffers
without committing would grow the lists without limit if the sweep broke.
every_device_bounds_what_managed_buffers_gone_left_for_a_commit makes, names and drops four times
SWEEP_FLOOR Managed buffers, each with its bytes, and commits nothing. With a device copy, each
list and the index fill to the floor and never hold more. With one copy, nothing is listed. The
test reaches the lists through two accessors that exist only for the device tests
(Changes::entries, Work::changes). SWEEP_FLOOR becomes pub(crate) so the test can name it.
Verified in job m3-max-82584, at a commit with the same tree (c3ea874a68):
- with both sweeps disabled in a probe copy of capture.rs, on lavapipe in its two-copy view:
"after 65 Managed buffers gone, [named, indexed, made] are [65, 65, 65], past 64", red;
- as committed, on lavapipe: one copy [0, 0, 0], two copies [64, 64, 64] at most, green;
- the RTX 5080 Laptop (two copies), under --cfg m2v_gpu: [64, 64, 64] at most, green;
- managed.rs's 37 tests on lavapipe, green;
- signatures, clippy plain, m2v_gpu and m2v_cpu_icd, doc and privdoc, all 0.
The translator's TEXTURE_SAMPLE_COUNTS comment and the conformance sample-position family's module
doc stated the Apple M3 Max's answer for 8 samples with no measurement behind it. Job 82550 asked
an Apple M3 Max under macOS 27.0.1: yes for 1, 2 and 4, no for 3, 5, 8, 16 and 32. Job 82204 asked
an AMD Radeon Pro 5300M under macOS 26.7.1: yes for 1, 2, 4 and 8, no for 16. Both comments now
cite them. Comments only; the recorded EIGHT_NEVER_RE_RECORD text, which the 8x recordings carry,
is unchanged.
Verified: both jobs' SAMPLES and P8 lines read from their logs; cargo fmt --all leaves the tree
unchanged.
the_product_sources_take_one_path_for_every_device (rt's tests::one_path) enforces rule 2: product
code names no vendor, device or driver identity, reads no environment variable and declares no
policy type. Until now it read only the runtime's sources and missed several spellings. It now
reads the translator's two crates too, and it catches:
- driver_version, conformance_version, the device, driver and pipeline-cache UUIDs and
PhysicalDeviceIDProperties;
- ash's device_name_as_c_str, driver_name_as_c_str and driver_info_as_c_str accessors, and
vk::VendorId;
- the vendor IDs written in decimal;
- getenv;
- the device type, which rule 2 lets decide unified memory alone.
The translator's tests are left out: its tests directories, its tests.rs and *_tests.rs files, the
modules it declares under #[cfg(test)], and its inline #[cfg(test)] modules. A test checks that
exclusion.
The lines the scan may find something on are listed in ALLOWED, by file and text, each with its
reason:
- the device type where unified memory is decided;
- the stage cache's key;
- the translator's DeviceDescription and its two readers;
- DevicePolicy;
- Vulkan's driver enum, mirrored;
- the environment variables' registry;
- the command line's device file;
- three table and grammar numbers that equal a vendor's ID.
A listed line that no longer holds a finding fails the test, so the list cannot go stale. The
module docs say what a scan cannot see: a policy switch spelled as a bool field, a constant or a
cfg(feature) gate, and code after a // inside a string literal.
from_queries_derives_one_profile_whatever_the_identity now also varies the device's name and the
driver's version, and the profile stays the same.
Verified on the CPU with no device, in job m3-max-82544. Probe files were put beside the product
sources; no module declares them, so they were never compiled. They hold one line of each new
form (nine in the runtime's src, one in the translator's):
- the scan at a0d2d2efdd passes over them, which is the gap;
- this change's scan fails, naming all ten lines;
- without the probes, the four one_path tests and the identity test pass;
- the runtime's and the translator's suites: 3091 passed, 22 skipped.
Gate A ran in job m3-max-82570 at a commit of this tree (0339453fe7): signatures, clippy plain,
m2v_gpu and m2v_cpu_icd, doc and privdoc, and the one_path tests again after the one clippy fix
(an explicit auto-deref).
Changes::take used to look up, at every commit, each buffer the command buffer keeps and the
buffer under each texture it keeps, in the hash map of the Managed ranges named. Only a Managed
buffer with a device copy can have a range named, so every other lookup was wasted. The command
buffer now lists those buffers as its encoders keep each object for the first time
(ByKind::managed): a buffer kept by a slot, a declaration, a blit or any other way, and the buffer
under a texture kept. The take visits only that list. The list is cleared with the recording's
other lists, keeps its room up to KEPT_BOUND, and holds at most one entry for each buffer and
texture kept. Lending a buffer for a slot learns whether the buffer is new from the same set
insert it already made (Kept::keep_first). The commit order and the rule for which commit takes a
range do not change.
Red: the previous commit's test fails at 52d871017b, its parent, on lavapipe (llvmpipe, LLVM
23.1.1; job m3-max-82510). In the one-copy form the commit looks up 7 buffers where none is
wanted. An earlier run, m3-max-82505, failed on the test's own setup, since fixed.
Verified, before the re-lay onto development, at the same change on 1a84985dd4:
- lavapipe (job m3-max-82510): the test passes in both forms (the two-copy view); the runtime's
whole suite reads 976 passed, 4 skipped; clippy plain, --cfg m2v_gpu and --cfg m2v_cpu_icd exit
0; Rustdoc and the runtime's private-items Rustdoc exit 0.
- RX 7900 XTX, RADV of Mesa 26.2.6 (job m3-max-82512): the runtime's 36 Managed tests pass under
--cfg m2v_gpu, among them the first-naming test that guards the frame-396 crash fix.
Counted, on the RX 7900 XTX (job m3-max-82512): one whole glbench-3090-r4 play per arm, 1,050
frames, release players, with a diagnostic (never landed) counting the user-space instructions of
the take at each of the 24,883 commits:
- before (development plus the diagnostic): 34,299 instructions a commit, 812,822 a frame;
- after: 5,301 a commit, 125,635 a frame. That is 687,188 fewer a frame, 84.5% of the take.
- The committing thread retired about 850 million user-space instructions a frame in both arms,
so the take was 0.096% of them before and 0.015% after.
- Runtime command buffers (20,195), upload barriers (35,025), barriers (522,991), submissions
(24,886), passes, bytes copied (432,472,763) and Managed bytes captured (7,215,718,372) are
equal in both arms.
Lavapipe keeps one copy of a Managed buffer, so no range is named there and the take does no
lookup; the count was read on the XTX alone.
At every commit, Changes::take looks up each buffer the command buffer keeps, and the buffer under
each texture it keeps, in the hash map of the Managed ranges named. That walk came with the
first-naming rule (51ac48c788). On a recorded play on an RTX 3090 it cost 35,453 user-space
instructions per commit, about 840,000 per frame, on the committing thread (job m3-max-82470, a
diagnostic build). It visits every Shared buffer and texture of the command buffer, though only a
Managed buffer with a device copy can have a range named.
The walk now sits in capture::Names::addresses, which the take uses, so a test can read what a
commit would look up (CommandBuffer::capture_lookups, test-only). The test's command buffer
dispatches over a Managed buffer and two Shared ones, and copies out of a texture over another
Managed buffer and out of one over a Shared buffer. The test expects the commit to look up the two
Managed buffers, once each, where the device keeps a copy, and nothing where it keeps one. Today
it also looks up the Shared buffers and the Shared texture's buffer, so it fails in both forms.
No behaviour changes.
Red runs follow in the next commit's message.
4a96499072 refuses a surviving call to an unmodeled body-less ___metal_* routine as
UnknownIntrinsic, and a __tensorops_impl_* function in air.externally_defined outside the
matmul2d ABI as Tensors, where both were refused as Linking. A refusal's class is part of the
semantics key, so a cached FALLBACK of such a kernel names the wrong class under an unchanged key.
The golden tables are re-blessed on development.
Verified: the one line changed; 4a96499072's own checks are in its body (m3-max-82525,
m3-max-82527).
AGENTS.md's name rule now also allows the body-less runtime-library routines Metal's compiler
links by symbol: the ___metal_* maths routines and the __tensorops_impl_* family. Their
declarations have no body, so the symbol is the only thing that says what the routine is. An
unknown member of such a family is a typed refusal.
Both families were already gated on that structure. The bitcode reader classifies a routine
name only on a declaration, and the matmul2d lowering takes a __tensorops_impl_matmul2d_op_*
function only when it has no body and is in air.externally_defined. Two tests now show that a
defined function of either name is the module's own:
- a_defined_function_named_as_a_runtime_routine_is_the_modules_own (bitcode, through llvm-as);
- a_defined_function_named_as_a_tensor_op_is_the_modules_own (canon).
Both tests pass at the base as well.
An unknown member used to be refused as Linking, the refusal for an undefined function that
linking could supply, which these never are. Now the post-check refuses a surviving call to a
body-less declaration as its family:
- an unmodeled ___metal_* routine as an unknown intrinsic, the same refusal an unknown air.* name
gets;
- a __tensorops_impl_* function in air.externally_defined, outside the matmul2d ABI, as Tensors,
which is how the matmul2d lowering already refuses its own unmodeled functions.
The same name outside that section is not a family member, and still needs linking.
intrinsics::is_routine_family and tensor_ops::in_family state the two families. docs/REFUSALS.md
lists the new Tensors site.
Verified on the CPU with no device, in job m3-max-82525 at a commit of the same tree
(4974c671a8):
- an_unknown_runtime_library_routine_is_refused_as_its_family is red with this change's product
files at a0d2d2efdd (___metal_ldexp_float: Linking, expected UnknownIntrinsic) and green with
them;
- the two look-alike tests and surviving_calls_are_refused_by_family_naming_the_callee pass in
both runs;
- the refusal surface regenerates to these files exactly, and its --check passes;
- the metal2vulkan-air and metal2vulkan suites: 3455 passed, 22 skipped.
vkSignalSemaphore fails only for want of memory or with VK_ERROR_UNKNOWN,
never with a loss. The wake ignored the failure and marked the thread woken,
under a comment that said a failure is a loss. The thread stayed in its GPU
wait with nothing to end it, and every later flight-only wake returned early,
because the thread already waited for the progress semaphore. With work in
flight, a listener or an end then waited for the front batch to complete.
That is a deadlock where that batch waits on a host signal the listener
would give.
The form (the planner's ruling, which withdrew its "next wait is bounded"
form, a record the wait in progress cannot read):
- A failed signal leaves the wake owed. The thread stays marked waiting on
the GPU, and the next wake from any thread signals again at a higher
value, flight-only wakes included. The thread clears the debt as it next
reads the state.
- There is no polling: tests/event_values.rs's thread-does-not-spin
assertion holds as before.
- The limit, stated in the code: a failed wake that no later wake follows
waits for the wait's other semaphores.
vkWaitSemaphores (the dma-bufs import's bind wait before vkDestroyBuffer)
and vkDeviceWaitIdle ignored every failure under a comment that named loss
alone. Both now go through complete::wait_through:
- success, a loss the call reports, or a loss the runtime has seen ends the
wait;
- an out-of-memory or unknown result, which says nothing of what is
pending, is called again 100 ms (LOSS_POLL) later.
So a lasting out-of-memory result on a live device waits, and no buffer
whose bind may still be pending is destroyed. On a lost device,
vkDeviceWaitIdle returns success or VK_ERROR_DEVICE_LOST in finite time
(Lost Device), so a teardown does not spin on a dead device.
The two tests of the previous commit, failed_waits.rs, turn green here
through the same seams (fail_wakes, fail_waits).
Two device tests through two test seams on Core, in fail_begins' style:
fail_wakes fails the completion thread's next wakes as vkSignalSemaphore out of
host memory, and fail_waits fails the device's next idle waits before the
driver is called. Each seam is wired into today's path unchanged: the wake
still ignores the failure and marks the thread woken, and the idle wait still
returns.
- a_failed_wake_is_owed_to_the_next_wake: a fill is in flight behind the Busy
gate, a listener is posted at a value the host already set, and its wake
fails. The test expects a second fill's commit, a flight-only wake, to
deliver the owed wake while the gate still holds both fills. Today that
wake returns early, so the listener waits for the gate.
- a_failed_idle_wait_is_made_again: a fill is in flight behind the gate and
the idle wait's first call fails. The test expects the idle wait not to
return while the gate holds the fill. Today it returns at once.
Both are expected to fail at this commit. The next commit is the fix.
The engine inventory, the golden hash table and the air_input printouts, re-blessed at
1a84985dd4 on the M3 (potluck job m3-max-82483: inventory=0, golden=0, printouts=0, and the
metallib half of committed_air_fixtures_parse_and_link un-skipped, linkhalf=0). The texture
buffer words, sRGB draw writes and mul24 work since the last bless added the tb_word_formats,
fpv_srgb_draw_storage and int24_products fixtures and moved SEMANTICS_VERSION to 2332, so the
bless-due tests (engine_fixtures_match_their_golden_printout, inventory_lists_every_fixture_in_order,
golden_hashes_match_the_table, llvm_as parts 4 and 8) read red until this commit.
Files: golden_hashes.tsv, public_fixture_expectations_engine.tsv, and the two new printouts
air_input/tb_word_formats.txt and air_input/fpv_srgb_draw_storage.txt. Nothing else.
The test a_bytes_form_no_copy_buffer_is_an_import_and_a_descriptor_form_one_a_pool_buffer
asserted one imported over copy: the copy at use of a texture over host memory's import held in
an image of its own. A texture over host memory's import is now in place on an integrated or CPU
device whose external image query takes a linear image for that handle, its bytes saved and
written back once around its move home, so it counts that restore pair: two imported copies and
none at use. On the 780M (Phoenix, RADV, job m3-max-82442) the test read 2 and failed; its line
was "textures over buffers 2: 2 in place, 0 in an image of their own", with 2048 bytes of
host-memory restore. The product's count is the documented one; the test's expectation was
stale.
The test now reads each texture's form from what the run reports and asserts the copies that
form makes:
- #6, the one texture over an import, is in place where the device counts one texture in place
over an import (textures_in_place_over_imports). Then it takes the restore pair: two imported
copies and two host-memory restores of equal bytes, each at least the 784 bytes under the
texture's rows, and none at use. Else it takes one imported copy of its 64 bytes at use, for
host memory's cause or a linear-image decline.
- #13, over pool buffer #4, is in place where the textures-over line's in-place count, less #6,
says so, with no copy. Else it takes one pool-side copy of 64 bytes at use.
- The at-use copies by cause sum to the textures in images of their own.
The test prints each texture's form and, where declined, its cause.
Verified on the fix's first form, the same assertions:
- 780M (Phoenix), m3-max-82451: both in place, #6 by its restore pair (2048 bytes), passed.
- Iris Xe, m3-max-82452: both declined for pitch (the linear image's row pitch or start is not
the texture's 256), one copy each at use, passed. That is why the Iris read 1 before.
- RTX 2080, m3-max-82453: #6 for host memory (a discrete device), #13 for pitch, passed.
Product code is unchanged.
The planner's ruling on resolve rounding: rule 1 counts a resolve among the device's own answers,
and two Macs round an average that lies exactly halfway between two codes differently, so Metal
fixes no answer there for a guest. An Apple M3 Max (macOS 27.0.1) rounds the tie up, as the
conformance recordings sample-positions-default-2x and -4x hold (red 1/255 over half the samples
resolves to 1); an AMD Radeon Pro 5300M (macOS 26.7.1) rounds it to the even code (red 0 at 1 of
2, 2 of 4 and 4 of 8 samples, an alpha of 127.5 to 128; m3-max-82284). The device's own rounding
stands; no behaviour changes and neither Mac's rounding is emulated.
- PrecisionNote::DeviceRoundedResolve's doc and docs/API.md's catalogue entry name both measured
answers with their sources.
- The seven known-gaps-rt.tsv rows of sample-positions-default-2x and -4x (Iris Xe, RADV, NVIDIA,
llvmpipe) say they differ only by how a tie rounds, and why that stands;
docs/CONFORMANCE-COVERAGE.md regenerated from them.
- PrecisionNote::DeviceAlphaCoverage's doc and its catalogue entry say exactly which devices are
measured at 8 samples: the 5300M (m3-max-82239); the M3 Max, which renders no 8 samples and so
has no answer there; no device the runtime runs on. They said before both that the 5300M was
measured at 8 and that 8 was unmeasured on every device.
12cd7bc987 lowers air.mul24 and air.mad24 (both signs, i32 and 2 to 4 of its lanes), which the
translator refused as UnknownIntrinsic, so a kernel that calls one translates under an unchanged
key where it refused before: a cached FALLBACK of it is stale. The golden tables are re-blessed on
development.
Metal's answer: the product of the operands' low 24 bits, zero-extended for u and sign-extended for
s, and for mad24 its 32-bit sum with z, in the specification's range and outside it, at every word
of int24-products-in-range and int24-products-outside-24-bits on the Apple M3 Max under macOS
27.0.1 (m3-max-82247); the AMD Radeon Pro 5300M under macOS 26.7.1 answers both cases with the same
output sha256 as the M3's, 5bf881c0 and f8cce5fb (the fixture compiled at run time, the cases'
buffers; m3-max-82284).
Verified: at this change on ee6911e100 (cab2e25131), clippy plain, --cfg m2v_gpu and
--cfg m2v_cpu_icd and Rustdoc clean; the core suites 3715 passed, 39 skipped; validation 1322
passed, 3 skipped; conformance 1050 passed; doctests 2 passed; both cases Match Metal's rows on
lavapipe (m3-max-82325) and on the AMD Radeon RX 7900 XTX (m3-max-82350); the guest's kernel that
was refused compiles, PASS on the RADV and lavapipe profiles (m3-max-82349). At this change on
86190052f5 (68e8a17200): fmt --check and clippy plain clean, the translator and AIR suites 3437 passed, 37
skipped, both cases Match Metal's rows on lavapipe (m3-max-82408).
Before that: the int24_products kernel PASS with spirv-val clean on all fifteen profiles (m3-max-82287); a states-only play of glbench-780m-r4-recnil on lavapipe, 3756 render and
484 compute states made, 0 refused (m3-max-82292).
Re-laid onto d12395fc12, whose new commits touch no file of this change but the version file's
RUNTIME_VERSION line.
every_math_entry_decodes_and_checks spells every table entry at every integer width, and read
air.mul24.s.i8 as unknown, which 12cd7bc987 means: mul24 and mad24 are of i32 lanes alone. The
sweep now skips their other widths, as it skips dot's scalars; the decode test of 12cd7bc987
holds those widths unknown.
api_signatures.tsv gets the two variants 12cd7bc987 adds to the published
metal2vulkan-air::intrinsics::MathFn, Mul24(Sign) and Mad24(Sign)
(scripts/api-signatures/signatures.py --bless): an addition, nothing removed or changed.
Both failed in the gate at 12cd7bc987 (m3-max-82287), whose other 3431 translator and AIR tests
passed, the arith sweep's mul24 and mad24 kernels and the new decode test among them.
bless_engine_goldens under the pinned LLVM 21 on the M3 (m3-max-82288) writes the fixture's
printout, its sixteen calls decoded as Mul24 and Mad24 of both signs at 1 to 4 lanes.
bless_engine_inventory in the same job leaves the two int24_products rows of 617853c57b as they
are: the kernel translates on all fifteen profiles from the opaque and the typed text.
The same bless also wrote rows and a printout for engine/tb_word_formats, another change's fixture
already on development; they are left to development's bless, as are the golden hashes.
A guest's screen-sharing encoder makes a compute pipeline whose kernel calls air.mul24.u.i32, and
the translator refused it as UnknownIntrinsic. The guest's module declares four of the family
(air.mul24 and air.mad24, s and u, of i32); Apple's compiler spells sixteen
(air.{mul24,mad24}.{s,u}.{i32,v2i32,v3i32,v4i32}, m3-max-82233). All sixteen decode now.
The Metal Shading Language specification (4.1, section 6.4, Table 6.2): mul24 "multiplies two
24-bit integer values x and y and returns the 32-bit integer result. x and y are 32-bit integers
but only the low 24 bits perform the multiplication"; mad24 "uses mul24 ... adds the 32-bit
integer result to the 32-bit integer z". Below the table the product is defined for x and y in
[-2^23, 2^23 - 1] signed and [0, 2^24 - 1] unsigned and implementation-defined outside them.
The Apple M3 Max (macOS 27.0.1) answers outside that range too with the product of the operands'
low 24 bits, zero-extended for u and sign-extended for s: 480 of 480 words of
int24-products-outside-24-bits, where the 32-bit product of the whole operands differs at 386
(m3-max-82247). That outside-range equality is measured on the M3 only.
Now:
- intrinsics::math decodes air.mul24.<s|u>.<T> and air.mad24.<s|u>.<T> as MathFn::Mul24 and
MathFn::Mad24, for T i32 or a vector of it; any other element width stays undecoded.
- canon::routine replaces each call, after SCCP as it does OpenCL C's mad, by plain AIR in T's
shape: each operand's low 24 bits (and 0xffffff for u; shl 8 then ashr 8 for s), their 32-bit
mul, and for mad24 the 32-bit add of c, all without nsw or nuw. One form on every device and no
precision note: it is the table's own wording, and it equals Metal at every word measured.
- Lowering takes them as it takes any such instructions; a Mul24 or Mad24 call that survived
canonicalization is an invariant failure, as a mad call is.
Tests: mul24_and_mad24_decode_on_32_bit_lanes_alone (the sixteen names; i16, i64, i8 lanes, a
float, no sign and a prefix stay unknown). The arith sweep's five mul24 and mad24 kernels
(cc5adc7e7c), the int24_products inventory rows (617853c57b) and its two validation cases
(7fcd661645) are the red tests this turns green.
Five kernels of the arith sweep, each validated and interpreted on every profile:
air.mul24.u.i32 of 0x01FFFFFF and 0x00FFFFFF (0xFE000001, where the 32-bit product of the whole
operands is 0xFD000001), air.mul24.s.i32 of 0x00800000 and 0x7F000003 (bit 23 sign-extends:
0xFE800000, not 0x01800000), air.mad24.u.i32 adding all 32 bits of -1, and per-lane
air.mad24.s.v4i32 and air.mul24.u.v3i32 of operands with bits above bit 23. The expected values
are the product of the operands' low 24 bits, zero-extended for u and sign-extended for s, then the
32-bit sum, as the M3 Max answers the int24_products cases in and outside the specification's
range (m3-max-82247).
Red: the translator refuses each as UnknownIntrinsic.
Two authored cases over engine/int24_products, 12 threads, out filled with 0xAB: operands in the
range the Metal Shading Language specification gives mul24 (section 6.4, after Table 6.2:
[0, 2^24 - 1] unsigned, [-2^23, 2^23 - 1] signed), and operands outside it, each beside small
in-range partners, where the specification calls the product implementation-defined. The addends
are full 32-bit words in both. Installed with corpus-case-check (m3-max-82243) and qualified on
Metal on the Apple M3 Max, three executions each (m3-max-82247).
Metal's outputs against the kernel computed on the CPU, word for word (480 words each):
- in range: equal to the 32-bit product of the operands, and equal to the product of their low
24 bits (zero-extended unsigned, sign-extended signed), which agree there;
- outside the range: equal to the product of the operands' low 24 bits at all 480 words; the
32-bit product of the whole operands differs at 386 of them.
scripts/qualify-public-cases runs both on lavapipe against those rows. They are red until the
family is lowered: today the translator refuses the kernel as UnknownIntrinsic.
The companions come from scripts/regen-air-fixtures on the M3 (job m3-max-82233: Metal 32023.922,
SDK 27.2). Apple's compiler spells the family as sixteen intrinsics, air.mul24.<s|u>.<T>(T, T)
and air.mad24.<s|u>.<T>(T, T, T) for T in i32, v2i32, v3i32 and v4i32, and the fixture's module
declares all sixteen. MSL on macOS spells no wider form: the header's 8- and 16-lane overloads sit
behind __HAVE_NATIVE_WIDE_VECTORS__, which is not defined there, and uint8 and int16 are reserved
names (the same job).
The engine inventory's two rows expect the kernel to translate on every profile. They are red
until the family is lowered: today each profile refuses it as UnknownIntrinsic. The golden
printout under tests/air_input follows the decoder's change.
Our own MSL for the air.mul24/air.mad24 family the translator refuses as UnknownIntrinsic (a
guest's screen-sharing encoder meets air.mul24.u.i32 in a compute pipeline). One kernel calls
mul24 and mad24, unsigned and signed, as a scalar and at 2, 3 and 4 lanes, over 12-value operand
rows of each sign rotated per thread, with full 32-bit addends, and stores every lane's bits:
40 words a thread. The companions come from scripts/regen-air-fixtures in the next commit.
RUNTIME_VERSION 2556 -> 2557: a device whose framebuffer colour, depth and stencil sample counts
hold 8 answers yes for 8 to supportsTextureSampleCount:, answers getDefaultSamplePositions:count:
at 8 with Vulkan's standard 8 locations instead of refusing it, and a pass at 8 samples takes
custom positions where its answer to programmableSamplePositionsSupported is yes.
runtime-sources.sha256 holds the inputs' new hash, computed as the build script computes it (the
same computation gives development e0fe34be0c's committed 70aa1707cd...).
The planner's ruling: raster_sample_counts, which supportsTextureSampleCount:,
getDefaultSamplePositions:count: and programmableSamplePositionsSupported read, is the device's
framebufferColorSampleCounts, framebufferDepthSampleCounts and framebufferStencilSampleCounts,
intersected with 1, 2, 4 and 8. A query answer, not a second form: a device that renders 8 into
all three attachments answers yes for 8, as a Mac's AMD GPU does (an AMD Radeon Pro 5300M under
macOS 26.7.1, job 82204) and Apple10 does, where the Apple9 table answered 1, 2 and 4 alone.
TEXTURE_SAMPLE_COUNTS leaves the apple_gpu table, whose other answers are Apple9's.
Nothing else capped at 4: a texture's samples are its format's own (Limit::TextureSamples), the
pipeline link maps 8, the sample mask takes a word, Vulkan's standard locations hold 8, and
interpolate_at_sample reads index & (n - 1).
Metal at 8, measured on the 5300M (job 82239), and where ours can differ:
- interpolate_at_sample: indices 0 to 9, 15, 16, 100, 2^31 - 1 and 2^32 - 1 read sample
index mod 8, the runtime's answer; InterpolantAt::Sample's doc says so.
- Alpha to coverage: the 5300M covers a pixel at one sample at an alpha of 1/2 or above, every
pixel alike, and at two, four and eight samples floor(alpha * n + 1 - t), t 1/8 and 3/8 at even
and odd x of an even row, 5/8 and 3/8 of an odd one; every pixel floor(alpha * n) or
ceil(alpha * n). The device's own mapping may differ: PrecisionNote::DeviceAlphaCoverage (and
docs/API.md's catalogue) now states the 5300M's rule beside the M3 Max's and that eight
samples are unmeasured on every device.
- Default positions at 8: the 5300M's answer is Vulkan's standard 8 locations.
Docs that said 1, 2 and 4: Device::supports_texture_sample_count and default_sample_positions,
the floor's standardSampleLocations line, RenderPassDescriptor::sample_positions, positions.rs,
the runtime README (default positions, the floor table) and metal_properties' field.
Verified: the stacked gate (m3-max-82337, this change on the (i)+(b) hand-over): fmt, clippy in
three configurations, rustdoc, doctests, the validation suite 1322 passed (3 skipped), the
product suite 3725 passed with the five reds development's next bless takes (none of this
change's), the runtime's lavapipe suite 974 passed (4 skipped); the red commit's tests green on
lavapipe (2 translator, 9 runtime). On an RTX 3090 (m3-max-82314), an RX 7900 XTX and a 780M
(m3-max-82315) and an Iris Xe (m3-max-82316), the same patch on 8a2acc84fb: the runtime's 9
sample-count and sample-position tests pass, each device answers yes for 8 with Vulkan's
standard 8 default positions and answers programmableSamplePositionsSupported yes.
The planner's ruling: a device answers each of Metal's sample counts, 1, 2, 4 and 8, that its
framebufferColorSampleCounts, framebufferDepthSampleCounts and framebufferStencilSampleCounts all
hold. A Mac with an AMD GPU renders 8 samples (an AMD Radeon Pro 5300M under macOS 26.7.1 answers
supportsTextureSampleCount: yes for 1, 2, 4 and 8 and no for 16, job 82204), as Apple10 does
("Maximum sample count in render passes with MSAA" 8); the runtime answers an Apple9 GPU's 1, 2
and 4 alone today.
- The translator's metal_properties tests hold raster_sample_counts to the three framebuffer
counts and {1, 2, 4, 8} on every committed profile: lavapipe 1, 4 and 8, moltenvk-m3 1, 2 and 4.
- The runtime's four-sample draw test holds the device's answer at every count from 0 to 64 to
the same rule from the device's own limits.
- Metal's default positions at 8 samples, the 5300M's getDefaultSamplePositions:count: answer
(job 82204, Vulkan's standard 8 locations), join the table the runtime's default-positions test
compares with, which now reaches 8 wherever the device answers yes.
Red until the answer changes: today every profile and device that renders 8 answers no for it.
Verified red at this commit on 8a2acc84fb (m3-max-82304): both translator tests fail (lavapipe's
answer 1 | 2 | 4 where the rule gives 1 | 2 | 4 | 8, and the like on every profile that renders 8),
and the runtime's draw test fails on llvmpipe at 8 samples (framebuffer counts 0xd).
The oracle, an Apple M3 Max, renders no 8 samples (supportsTextureSampleCount: answers no for 8),
and a Mac with an AMD GPU does. Three rows run the family's pass at 8 samples: the device's own
positions against an edge at 5/8 of the pixel (5 of 8 samples), eight positions at x 0.25 (8 of
8) and one at 0.25 with seven at 0.75 (1 of 8). Their Metal answer is carried from an AMD Radeon
Pro 5300M under macOS 26.7.1, plain and under Metal's API validation layer, which passed the
passes (job 82284, the usage-edges probe sample_positions_8.m): the resolved texels
01 00 00 9f, 01 00 00 ff and 00 00 00 20, record mode forbidden on the oracle.
Each row's coverage avoids a resolve halfway between two codes: there the 5300M rounds to the
even code (4 of 8: red 0, alpha 128; and 1 of 2 and 2 of 4: red 0) where the M3 Max rounds a half
up (red 1), which is the device's own rounding (PrecisionNote::DeviceRoundedResolve), not where
the samples are. The probe's sweep of the default positions, an edge at each even sixteenth,
covered 0 to 8 samples in order, as Vulkan's standard 8 locations do.
The rows are sample-positions-8x-default, -8x-custom-left and -8x-custom-mixed, one prefix that
tests::a_carried_answer_taken_on_another_chip_names_it lists beside managed-named-* as the 5300M's.
Their recordings were written on the oracle by record mode's carried path, which runs no Metal,
with the timing record `times --write` keeps for a case whose Metal leg is forbidden
(m3-max-82412).
Verified: the conformance suite and its clippy (m3-max-82421); the rows replayed through the
runtime on lavapipe (m3-max-82337, m3-max-82421), an RTX 3090 (m3-max-82314), an RX 7900 XTX
(m3-max-82315) and an Iris Xe (m3-max-82316): every byte equal to the 5300M's, each row announced
only by the device's own colour conversion or point size notes. The 2x and 4x default rows, whose
resolve halves a code, stay the known gaps the ledger holds on those cards.
alpha_coverage_sweep.m and pull_model_interpolation.m read their single-sample textures through
Shared storage, which a Mac with a discrete GPU does not take for a texture: there the read
texture was never made and every word read zero. On such a Mac (hasUnifiedMemory false) the
single-sample textures are Managed, and a blit synchronizes them before the CPU reads them.
Verified: both probes ran on an AMD Radeon Pro 5300M (macOS 26.7.1, job 82239) and read the
alpha-to-coverage pattern at 1, 2, 4 and 8 samples and interpolate_at_sample at every index of 8
samples, where the Shared form read zero (job 82204).
On a device that keeps a device copy of a Managed buffer, every commit that takes a copy-in
records its copies into a command buffer of the runtime's own, with one barrier after them (a pair
where textures over the ranges in images of their own take copies in). Since a commit takes only
the ranges of the buffers its own encoders name, plus the first bytes of buffers made since the
last commit, a program that names ranges of several buffers and spreads their uses over several
command buffers pays that command buffer and barrier at each such commit. The known gaps of memory
blocks now say so, with the counters that count them (Metrics::runtime_command_buffers and
Metrics::upload_barriers).
Docs only. The text follows the code at development's tip: capture::copy_in records one
vkCmdCopyBuffer per buffer and record::barrier counted as UploadBarriers, or over::record_side's
pair where textures over the ranges take copies in; Changes::take takes the named ranges of the
buffers the committing command buffer keeps and every buffer made since the last commit. It names
no figure.
SEMANTICS_VERSION 2330 -> 2331: a read through a sampler of a texture buffer held as words is
built by the words (the sampler's addressing, the words' width and the border texel by code), and
no texture buffer access records RuntimeFact::TexelBufferOwnView, which goes.
ARTIFACT_FORMAT_VERSION 603 -> 604: RuntimeFact loses the TexelBufferOwnView variant
(cache/codec.rs).
RUNTIME_VERSION 2555 -> 2556: the runtime no longer refuses a draw or dispatch that binds a
texture buffer held as words where an own-view access reaches it (Gap::TexelBufferOwnView and
its plumbing go).
runtime-sources.sha256 holds the inputs' new hash (device/mechanism.rs, an input, loses the
fact's mechanism row), computed as the build script computes it (the same computation gives
development 13d511cfe9's committed a929dd9581...).
The planner's ruling (b) after (i): with a read through a sampler built by the words, no access
MSL writes leaves a texture buffer on its own view on a device that holds some format as words,
so the runtime's Gap::TexelBufferOwnView and its plumbing (the kernel interface's own views, the
render content's, the encoders' checks before binds_words) go, and with them
RuntimeFact::TexelBufferOwnView, which nothing produces now.
Each access the words do not build now has an outcome that is not wrong output:
- A read that observes its residency is the words': its status word is 0, Metal's for a texture
that is not sparse, as a texture buffer never is (with_word's 0); words::wrap no longer sends it
to the own view.
- A read of an sRGB texture's codes is never a texture buffer's: srgb_texels answers false for a
buffer's shape, so Read::raw is false there. Were one met, the compile refuses it.
- A read or write in another numeric class (LoweringInputs::cross_class): the runtime never sets
it, and under the identity domains no variant is chosen; on a profile that holds some format
as words the compile refuses such an access (Feature::Format, not implemented).
- A write of fewer than four lanes: the AIR front end takes a colour texture's write of four lanes
alone (texture.rs, texel_ok), so such a call is an unknown intrinsic on every profile. The new
authored case a_texture_buffer_write_of_two_lanes_is_refused_on_every_profile (an inline .ll of
a8r_buffer_write narrowed to <2 x float>) checks Feature::UnknownIntrinsic on lavapipe and
moltenvk-m3 under the identity domains.
Docs: words.rs module docs and wrap's doc, the runtime README's known gap rewritten as the
refusals; REFUSALS.md and the error basis regenerated (Gap 32 -> 31); api_signatures drops the
fact's and the gap's variants. The mechanism test's variant count returns to 87.
The fixture census at (i)'s tip, the condition the ruling set before this deletion (scratch job
m3-max-81238, steelbrain/scratch-tb-census): 18 fixtures naming texture buffers, 1477
compilations, no own-view fact on any profile that holds a format as words.
Verified with (i) at 355c902082 (gate m3-max-82186): fmt, clippy in three configurations, rustdoc,
the validation suite 1322 passed (3 skipped), the conformance suite 1050 passed, doctests; the
product suite 3723 passed with four reds a bless clears (the golden printout, the golden hashes,
the inventory, and llvm_as part_3_of_8 for tb_word_formats.ll, which has no rows until then),
the new authored case among them passing; the card legs as (i) lists them.
A read through a sampler (MSL 4.1's read(sampler, coord)) of a texture buffer took the texture's
own view alone, and where the device held the bound format as words the runtime refused the
draw or dispatch (Gap::TexelBufferOwnView). The words now build it: the site reads the
sampler's state (through::state), addresses the index against the words' width the way the own
view's read addresses it against its size (through::buffer_index, which address() now calls for
a texture buffer: the first texel outside, the nearest where a runtime slot sampler's s mode is
clamp_to_edge, the border where the t mode is clamp_to_zero or clamp_to_border), calls the read
routine at the addressed index, and where it reads the border hands back the border texel of
the format the word's code names (words::border_texels), the alpha 1 of a format without alpha
included. Such a read no longer records RuntimeFact::TexelBufferOwnView; the remaining own-view
accesses are a read that observes residency, a read or write of another numeric class, a read of
an sRGB texture's codes and a write of fewer than four lanes.
The site's word estimate adds the sampler's addressing again and THROUGH_WORDS (the view's size,
the width, the border texels by code).
Tests: engine_identity's read-through test now asserts no own-view fact and a words routine
where the profile holds formats as words. The runtime test reads rt_buffer (mirrored_repeat),
rt_buffer_ow (clamp_to_border, opaque white) and rt_arg_buffer through three runtime sampler
states (clamp_to_edge; t clamp_to_zero; t clamp_to_border opaque black) over six formats in
either form, against Metal's texel in bounds and outside.
Docs: words.rs module docs, the fact's and the gap's docs and Display, the runtime README's known
gap, RESOURCE-ID.md; REFUSALS.md regenerated.
Verified at the hand-over tip 355c902082, with (b), on development 8a2acc84fb: clippy in the
three configurations and the translator's tests (gate m3-max-82186; the read-through and words
tests 120 passed, m3-max-82186's focused step); on lavapipe the runtime's texture buffer tests 13
passed and the stream test passed, and the runtime's whole suite 972 passed, 4 skipped; the
read-through test over the three sampler states and six formats on an Iris Xe (m3-max-82187), an
RTX 3090 (m3-max-82193) and an RX 7900 XTX and a 780M (RADV, m3-max-82282), each format in its
form there (B5G6R5Unorm as words on the 3090, the XTX and the 780M); the read-through-buffer
conformance replay on lavapipe, base 8a2acc84fb against the tip, 0 of 1 cases differ
(m3-max-82188).
The doc comment of lower/texture/words.rs's unorm_values linked `tests::unorm_mirror`, an item of a
cfg(test) module that no doc build has, so `cargo doc -p metal2vulkan --all-features --no-deps
--document-private-items` under -D warnings stopped on rustdoc::broken-intra-doc-links. The test is
named as code text instead. The public doc build, which the gate runs, did not see the link.
Verified: m3-max-82334, fmt --check and the private-items doc build of metal2vulkan EXIT=0.
The draw-side sRGB form keeps each render state's sRGB variant in the device's map of contents
beside its content, under the descriptor's key with its slots. The kernel's variant had a
fill-past-capacity test and the render variant had none, so this adds it: at a cap of 2, the float
fragment writer's content and its variant fill the map, a reuse onto the other twin or an
RGBA8Unorm texture makes nothing, the half writer's content and variant push both out, and the
float writer's next draw onto a twin makes its variant again (translations_at_encode 1, 1, 2, 3;
kernel_entries 2 throughout). each_device's settle then waits for every gauge, render_contents and
kernel_entries among them, to read zero once the device drops. The runtime README's paragraph on
makes at encode is re-wrapped, its words unchanged.
The gap named the float route alone, measured by forcing it on an RTX 2080 with the shuffle tree
since deleted. It now states the tree's four forms and their two choosers: the SIMD-group
operations query (a subgroup tier takes one clustered reduction per round, the emulated tier its
workgroup tree) and the 16-bit floats query (16 bits under the 16-bit float controls, float
rounded to half each round elsewhere). It also states what the tree costs against the device's
reduction of the float values rounded once, which was faster and not Metal's answer.
Rows: a kernel of two simd_sum of half4 on the subgroup tier at 16 bits, GPU time at the 50th
percentile over three alternated rounds with a same-arm pair (carry bin/hsum2: base 7fe0a001 =
development e1e6f52848's product, clus 8cb0caa5 = the clustered tree, eaf11e5c63 before this
series' rebase), exclusive, a device line in every run:
- Iris Xe (RPL-P, ANV), m3-max-81581: 1274.5-1317.9 us against 825.7-880.9 us, medians 1275.2
and 827.8, +54.0%.
- RTX 2080, m3-max-81598: 805.0-808.3 us against 660.1-665.0 us, medians 807.5 and 662.6,
+21.9%.
- RX 7900 XTX (RADV NAVI31), m3-max-81839: 7525.8-7538.0 us against 7474.9-7478.9 us, medians
7526.85 and 7475.55, +0.7%.
The Iris is the slowest GPU, and the clustered form is the fastest right form on it; the 16-bit
shuffle tree ran 2278 us there. The loss on the others is this gap, as ruled.
Verified: docs only; the rows are those jobs'.
The series lowers a half simd_sum and simd_product as Metal's tree of rounded half operations
(clustered reductions on the subgroup tiers, the workgroup tree on the emulated tier) and an
emulated or quad half step as the 16-bit instruction under the 16-bit float controls, so a module
with any of them translates to other words under an unchanged key. Its first commit's
"SEMANTICS_VERSION 2325 -> 2326" was taken at development by other changes; development reads
2329 at this rebase, so this series takes 2330. The golden tables are re-blessed on development.
The tree of xor shuffles (16-bit, two halves to a word, or in f32) ran a real kernel of two
simd_sum of half4 2.76 times as long as the device's reduction on an Iris Xe (ANV): Mesa's Intel
backend moves a shuffled lane by indirect addressing, about 150 us of that run per packed word a
round, where a clustered reduction's step is a register-region operation. Round d (1, 2, 4, 8,
16) is now one OpGroupNonUniformFAdd or FMul ClusteredReduce over clusters of 2d lanes in which
the first lane of each d-lane block that takes part brings its block's partial and every other
lane the identity (-0 for a sum, 1 for a product). Each cluster so combines exactly its two
blocks' partials in one rounded operation whatever order the device's reduction takes, and every
lane of it holds the result: Metal's tree. A lane that takes no part adds nothing, so a block
with none leaves the other's partial, as Metal counts such a lane as the identity. In a block
every lane executes a block's first lane is the lane whose index is a multiple of d; where the
group may be partly live it is the lowest set bit of the ballot of the active lanes in the
block. The shuffle code (pack, unpack, the xor and ballot rounds, HalfTree::step) is deleted,
and ops::f16_binary is whole again.
The partials are held as before: at 16 bits under the 16-bit float controls (half_controls, the
16-bit floats query), a 16-bit reduction whose rounding a driver that folds a conversion's round
trip keeps (shaderSubgroupExtendedTypes is in the runtime's floor); elsewhere in f32, each
round's result rounded to half, where the f32 product of two halves is exact and their f32 sum
rounds to the half their sum does (24 >= 2 x 11 + 2). The identity is an f32 constant there, so
a module without 16-bit floats declares none.
Forms of a half simdgroup sum or product in a kernel: 4, two choosers, both in the owner's rule
2 list. The subgroup tier (Direct or Cluster32, the SIMD-group operations query; the class is now
CLUSTERED where it was SHUFFLE) takes these clustered rounds, at 16 bits or in f32 by the 16-bit
floats query; the Emulated tier (the same query finds no subgroup tier, as on runtime-floor,
which offers BASIC alone, or ANV's widest-pin rule) takes its workgroup-memory tree, at 16 bits
or in f32 by the same query.
Verified: rows in the runtime README's known gap and the hand-over (Iris, RTX 2080, RX 7900
XTX, exclusive, three alternated rounds); the engine tests of Metal's half trees and the device
test of full, masked and quad words, named with their jobs in the hand-over.
A translator consumer that is not metal2vulkan-runtime read nowhere in docs/API.md that a
kernel stating RuntimeFact::LocalSizeConstraint runs only threadgroups whose size is a multiple
of it, and that a dispatch at any other size runs the kernel's EmulatedSimdgroups variant. A
half simdgroup sum or product on the Direct and Cluster32 tiers now reads its sibling lanes by
xor shuffles in a block every lane executes, which name an inactive lane in a partial subgroup.
Section 6 now says so, and that the emulated variant gives Metal's answers for the partial
simdgroup, as the runtime's variant choice does (pipeline.rs: a module with multiples gets
KernelVariant::EmulatedSimdgroups).
Verified: docs only; the contract read from device::subgroup::requirement and the runtime's
variant choice.
engine_simd_products ran the Direct variant (32 lanes) and the Cluster32 variant (64 lanes) at
a threadgroup of 40 threads, and Cluster32 at 96 as well. Neither variant is ever dispatched at
those sizes: subgroup::requirement gives both full subgroups and a local size that is a
multiple of the subgroup size (RuntimeFact::LocalSizeConstraint), and the runtime gives such a
kernel its emulated variant (KernelVariant::EmulatedSimdgroups), which runs every other size.
The group instructions the half product used before tolerated the partial subgroup on the
interpreter. The half tree's xor shuffles name lane L ^ d, and the interpreter traps on an
inactive lane (InactiveLane { lane: 8 } at Direct, { lane: 40 } at Cluster32), as SPIR-V makes
that read poison. The runtime's variant choice is the guarantee: Direct and Cluster32 need
full subgroups (LocalSizeConstraint), and any other threadgroup size takes EmulatedSimdgroups,
so a 40-thread dispatch keeps Metal's partial-simdgroup answer through the emulated tier. So the
fixture now runs each tier at the sizes its requirement admits, and the partial simdgroup (40
threads) keeps its run on the Emulated tier at 8, 16, 32 and 64 lanes.
Verified: the gate's suites (81303, at 501f2c0b16) failed these two tests with those
traps and nothing else but the golden table; this commit's run of engine_simd_products and
clippy is recorded in the hand-over.
Under --cfg m2v_gpu and --cfg m2v_cpu_icd, clippy's type_complexity rejected the cases' array
type in the runtime's half_simd_reductions device test (a tuple holding a function pointer).
The model's type is now the alias `Model`; the cases are unchanged.
Verified: the gate's clippy steps (plain, m2v_gpu, m2v_cpu_icd) rerun on this commit.
Clippy's type_complexity rejected the pair of function-pointer types in the quad model
(`quads`), so the gate's three clippy configurations failed in metal2vulkan-devtools. The
operation type is now the private alias `Operation`; the model is unchanged.
Verified: the gate's clippy steps (plain, m2v_gpu, m2v_cpu_icd) rerun on this commit.
A half simdgroup sum or product is Metal's tree of rounded half operations on every device.
Which form the tree takes is the 16-bit floats query (narrow::half_controls, read through
group::sixteen_bit_half by HalfTree and workgroup::combine): a module that computes half under
the 16-bit float controls holds the tree at 16 bits; every other module holds it in float and
rounds each step to half. Of the committed profiles, moltenvk-m3 (shaderFloat16 but controls the
module cannot declare), nvidia-pascal-linux (no shaderFloat16) and runtime-floor (no
shaderFloat16) take the float route (engine_native_half's
a_controlled_conversion_rounds_half_where_the_float_controls_allow asserts the split); the ANV,
RADV, RTX 50 series and lavapipe profiles take the 16-bit one. It is that query's existing second
form, not a new one: a module under the controls never reaches the float tree, since both
callers test the same predicate.
The float route's cost goes in the pipeline states' known gaps with its rows, the closest
measure: that form forced on an RTX 2080 (which itself takes the 16-bit route) for a real kernel
of two simd_sum of half4, GPU time at the 50th percentile over three alternated rounds,
m3-max-81173: 691.6-695.4 us against 659.1-660.7 us for the reduction it replaces (+5.1%), where
the 16-bit tree ran 613.3-614.1 us (-7.0%). The line says it applies to that route alone.
Verified: docs only; the rows are m3-max-81173's.
The emulated tier's tree (workgroup::tree_fold), its prefix sums and the quad tree (quad_tree, on
every tier) combine their half values by workgroup::combine, which ran the f32 operation and
rounded it to half by narrow::round. Where the module computes half under the 16-bit float
controls that rounding is the controlled conversion pair, which a driver's compiler may fold
into the f32 value it started from (NVIDIA's does, narrow.rs), leaving the step unrounded; and
the module records NativeHalfConversion for the pair.
combine now takes the device's 16-bit instruction, kept apart, for a half sum or product where
the module computes half on it (group::sixteen_bit_half, which HalfTree uses too): the choice
half + and * make there (ops::f16_binary), whose rounding a folding driver keeps. Elsewhere it
is the f32 operation rounded by narrow::round, as before. Each step rounds the same exact result
once, so where the pair rounds the values are unchanged. Quad prefix operations on the subgroup
tiers (group::lane_scan) keep their own step.
The engine test of the emulated tier asserts that lavapipe's profile computes half under the
controls and the runtime floor's does not, so the 16-bit step and the rounded f32 step are both
checked against Metal's 64 answers at every subgroup width on the CPU interpreter.
lavapipe (8-lane subgroups, the emulated tier) gives Metal's simdgroup sums and products both
without this commit and with it once T3 is underneath (m3-max-81129: 0 of 256 and 0 of 768 words
differ in each arm); what changes there is that the pipelines no longer round through the pair
and no longer record NativeHalfConversion (notes [NativeHalfConversion, NativeNanEncoding,
DeviceHalfDenormals] before, [DeviceHalfDenormals] after). The quad kernel of the previous commit
is the device check of the quad step on the RTX 2080 and the 780M.
Verified: m3-max-81129 (CPU only, at this series' f32-held arm and at this commit): the
engine tests 5 passed; lavapipe as above.
Metal's quad_sum and quad_product of half operands are (x0 op x1) op (x2 op x3) with each
operation rounded to half, and its quad prefix sums and products the lane-order chain over the
quad's lanes with each operation rounded, the empty exclusive sum -0 and product 1. Measured on
the M3 Max (macOS 27.0.1), fast math on and off alike, over the operands of
metal2vulkan_devtools::half_simd_reductions, all 256 threads (m3-max-81130, our own MSL): those
models match every thread; the float result rounded once misses 48 of the quad sums, 64 of the
products and 6 to 25 of each prefix operation.
half_simd_reductions gains a third kernel, QUADS: thread t takes entry t of SUM_OPERANDS and
PRODUCT_OPERANDS and writes five words, its quad reductions, its quad prefix sums and its quad
prefix products, then its simdgroup prefix sums and products. devtools::half_simd_reductions::quads
answers the first three words from those models (a small exact half rounding of an f64 sum or
product). Metal's simdgroup half prefix order matches none of the models (the lane-order chain,
Hillis and Steele, and the float result rounded once miss 60 to 137 threads each), so those two
words are written, not compared: they make the kernel a simdgroup user, which a device with
subgroups narrower than 32 lanes (lavapipe's 8) runs on the emulated tier, quad operations
included.
The runtime's device test runs the kernel on every device beside the two simdgroup kernels and
prints how many of the compared words differ. This is the test of the quad half step the next
commit moves to the 16-bit instruction under the 16-bit float controls.
Verified: cargo fmt only (this Mac runs no builds); the device runs are the timing job's
correctness leg on the RTX 2080, the 780M and lavapipe.
The half simdgroup sum and product tree (group::half_fold) held its partials in f32 on every
route: each of its five rounds shuffled the f32 lanes, narrowed the sibling's partial, ran the
16-bit instruction and widened the result. On the RTX 2080 that form costs 4.7% GPU time on a
real two-simd_sum(half4) kernel against the native f32 reduction it replaces (m3-max-81045,
three alternating rounds, p50 662.5/663.6/664.5 us old against 693.4/696.3/694.7 new),
above the 3% bar.
Where the module computes half under the 16-bit float controls the tree now holds its partials
at 16 bits: the operand narrowed once and the result widened once (both exact, they are half
values), each step the device's 16-bit instruction (ops::f16_instruction, split out of
ops::f16_binary, the same instruction and NoContraction / fma-with--0 form half + and * take
there), and each shuffle moving the partial's lanes two to a 32-bit word, an odd lane count
padded with a zero lane the tree drops. A half4 round is two 32-bit shuffles and the 16-bit
instruction, where the f32 tree took four shuffles and the conversions. The values are the same
bits: each step rounds the same exact result once. Without the controls the tree is the f32
operation rounded by the module's rounding, as before.
The engine test runs the full and masked kernels on NVIDIA's Linux profile too, which computes
half under the controls, so the 16-bit tree is checked against Metal's 64 answers on the CPU
interpreter beside the f32 tree on MoltenVK's and the wave64 profile.
Verified: cargo fmt only so far (this Mac runs no builds). The engine tests, the device test on
the 2080 and the 780M, and the old/f32-tree/16-bit-tree timing on the 2080 are the next job.
Metal's simd_sum and simd_product of half operands work as a tree. In round d (1, 2, 4, 8, 16),
each aligned block of 2d lanes holds its lower and upper halves' results, combined and rounded
to half. A lane that takes no part counts as the identity. Measured on an M3 Max, macOS 27.0.1,
our own MSL, fast math on and off alike:
- sums: m3-max-80839;
- products: m3-max-80879;
- three masks of active lanes: m3-max-80890.
The Direct and Cluster32 tiers folded the f32-held values with OpGroupNonUniformFAdd or FMul and
rounded once. Rounding once misses five of the eight measured sums (0x3c10 where Metal answers
0x3c0f), four of the eight products, and ten of the 48 masked results. The emulated tier's
exchange rounds already were the tree.
group::half_fold:
- New form. Five rounds; each combines the lane's partial with its sibling block's partial
through half_step.
- In a block every lane executes, the sibling partial comes from OpGroupNonUniformShuffleXor
by d. A mask below 32 stays inside a Cluster32 cluster.
- Where the group may be partly live, the sibling partial is the first active lane of the
sibling block, read with the live lanes' ballot. A block with none leaves the lane's own
partial: the identity, as the masked probe measured.
half_step:
- On a module that computes half under the 16-bit float controls, it is ops::f16_binary. That
is the device's 16-bit instruction, whose rounding survives a driver that folds a
conversion's round trip (NVIDIA's does).
- Elsewhere it is ops::float_binary.
- This is the same choice half + and * make.
There is no 16-bit route for group operations: half group ops run on f32-held values on every
profile, so this covers every route.
Other changes in this commit:
- reads_lanes is true for these operations, so partly_live tracks them.
- direct_ops and cluster_ops need the shuffle class; partly_live adds the ballot.
- words() bounds the five rounds.
- A half simdgroup sum or product no longer records PrecisionNote::ReductionOrder. float and
double sums and products, every float prefix sum or product, and the matrix and AGX
multiply-adds still record it.
- The note's doc and docs/API.md's catalogue entry say this per route. They also record that
Metal's half prefix-sum order is not measured: it matches none of f32 rounded once per lane,
a lane-order chain of half additions, or a Hillis-Steele scan of them (m3-max-80839).
- Validation's REDUCTIONS table drops simd.reduce.fadd.half and simd.reduce.fmul.half, so a
comparison holds them exactly. Its tests now name the half scan.
- bfloat has no group operations: decode refuses them.
SEMANTICS_VERSION 2325 -> 2326.
Tests:
- lower::simd::tests::half_sums_and_products_are_shuffle_trees covers the classes and the
lane reads.
- engine_simd's float_sums_record_their_precision now holds that a float sum records the note
and a half sum does not.
- The red tests of the previous commit carry Metal's bits.
Verified: cargo fmt only on this host. The red and green device jobs, and the timing on a real
half-reduction kernel, follow before landing.
Metal's simd_sum and simd_product of half operands combine the lanes as a tree. In round d
(1, 2, 4, 8, 16), each aligned block of 2d lanes holds its two halves' results combined and
rounded to half, and a lane that takes no part counts as the identity. Measured on an M3 Max
(macOS 27.0.1, our own MSL, fast math on and off alike):
- sums: potluck job m3-max-80839;
- products: m3-max-80879;
- sums and products over three masks of active lanes: m3-max-80890.
The tree matches every answer. The float result rounded once misses five of the eight sums,
four of the eight products and ten of the 48 masked results. The tree over the active lanes
packed together misses three masked sums.
metal2vulkan-devtools' half_simd_reductions holds two kernels of our own AIR, the operands and
Metal's answers:
- half_simd_reductions: eight simdgroups summing and multiplying their lanes in a uniform block;
- half_simd_reductions_masked: the same in blocks only a mask of lanes executes.
Three tests run them:
- engine_simd: the Direct tier at 32 lanes and the Cluster32 tier at 64, on the CPU
interpreter. Red: those tiers fold the f32-held values with OpGroupNonUniformFAdd or FMul
and round once.
- engine_simd_emulated: the emulated tier's pairwise tree at every width, on lavapipe's and
the floor's profiles. Its rounded combine is Metal's tree, so this test is expected green.
- the runtime's half_simd_reductions: under a device cfg, every device of the cfg's kind. It
prints the kernel subgroup sizes and each pipeline's precision notes.
Verified: none of these tests has run yet; their jobs follow. cargo fmt only on this host.
A vertex or fragment function that writes, at a slot it does not read, a texture whose storage
element is its UNORM twin's view was Gap::StorageElement at the draw. It now takes the form the
kernel took: the render encoder finds the texture slots each function the state lowers from its
AIR writes and does not read that hold a twin (TextureObject::encodes) beside the buffer slots it
holds to 4, and draws through the state's content for both (RenderPipelineState::for_draws, made
at the first such draw and kept in the device's map of contents under the descriptor's key with
the slots), which lowers those slots under LoweringInputs::srgb_storage, so each write there is
encoded by the MSL transfer through the device's conversion. KernelKey's srgb is a mask per stage
(the kernel's or the vertex function's, then the fragment function's). The facts skip a slot the
content encodes; read_write stays refused, and so does a twin at a slot of a function the
consumer compiled, which has no variant. A render state whose vertex or fragment function writes
a texture slot it does not read announces PrecisionNote::DevicePackConversion from its creation.
No new query and no second form: the twin's view and its query are the kernel's.
The runtime's README moves the draw out of the sRGB texture's known gap and names the content
among the makes at encode; docs/REFUSALS.md regenerated with no change (the StorageElement sites
are the same; refusal_surface.py --check exit 0). Proof jobs follow.
Metal's run on an Apple M3 Max with its validation layer (job m3-max-82183, record then times
--runs 8 --write): each fragment's write stores the same bytes the kernel case's writes store, all
four stored sites equal to srgb-storage-writes' recording. On the runtime at development's tip the
case's draw is Gap::StorageElement; the runtime's draw test is red on lavapipe (job m3-max-82181,
filtered, 3 tests: 2 passed, 1 failed, the new one, refused StorageElement Absent).
fpv_srgb_draw_storage's companions (regen-air-fixtures on the Mac, job m3-max-82169). The
conformance case srgb-storage-fragment-writes is the fragment twin of srgb-storage-writes: the same
values, formats, texture and layout, written by fpv_srgb_fragment_write and its half form behind
one triangle over a 256 by 2 RGBA8Unorm attachment. The runtime's test draws the fragment writers
and the vertex writer (rasterization off) onto RGBA8Unorm_sRGB and BGRA8Unorm_sRGB textures with
their twins' storage views, and expects the draw to run through the render state's sRGB variant:
the encode in the bytes, one make at encode, and the state's DevicePackConversion note. At
development's tip the draw is Gap::StorageElement, so the test is red; the Metal recording and the
lavapipe run follow.
Owned MSL for the draw-side sRGB storage lane: a cover vertex function, fragment writers of
float4 and half4 at their pixel, and a vertex writer at its vertex ID's place, each from buffer 0
in a row buffer 1 wide. The companions follow from regen-air-fixtures on the Mac.
The planner closed holding a format as words where its own view lacks the read without a
format (a whole-format move): on the Iris Xe it serves read_write but slows every other read of
those formats, and trades the refusal for another (a read through a sampler would be
Gap::TexelBufferOwnView). The read_write refusal stays the typed known gap
(Gap::StorageElement, ReadWithoutFormat).
The row now records, so nobody times it again:
- job m3-max-82136, Iris Xe (RPL-P), ANV (Mesa 26.2.6, read on the node by job
m3-max-82150): GPU p50 of texel_buffer_bgra8_read 11857.1 us as words against 9007.0 us as
its own view (+31.6%), texel_buffer_b5g6r5_read 12133.8 us against 9215.2 us (+31.7%); the
median of 8 rounds of 500 runs, the two builds alternating, the own view's build against
itself within 0.1%, every run's values checked against the CPU references;
- job m3-max-82025's listing: the committed ANV profiles (irisxe-rplp, irisxe, uhd770) answer
the same for seven formats (adding RG11B10Float, RGB10A2Unorm and RGB10A2Uint), and no other
committed profile does;
- the trigger: no further form is built; that changes on a guest's run or stream that meets the
refusal.
On the Iris Xe (RPL-P, ANV) the buffer features of BGRA8Unorm, B5G6R5Unorm,
BGR5A1Unorm and BGR10A2Unorm take a uniform texel buffer, a storage texel
buffer and the storage write without a format, so texel_buffer_form holds
them as their own views, but lack VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT.
A dispatch reading one through access::read_write is Gap::StorageElement
(ReadWithoutFormat): job m3-max-81883 failed the runtime test on B5G6R5Unorm,
BGR5A1Unorm and BGR10A2Unorm and the stream test on BGRA8Unorm there.
With that dispatch refused, the runtime test's reads and writes through handles now run on the
Iris for B5G6R5Unorm and BGR5A1Unorm as their own views, whose values are ANV's conversion: it
widens a 5- or 6-bit field by replicating its bits (job m3-max-82043: B5G6R5Unorm's texel 2 read
0.5176471 against the CPU's 16/31). The test takes a normalized format held as its own view within
PrecisionNote::DeviceTexelConversion's recorded bound (docs/API.md's catalogue: one f32 ulp, or
0.18 of a code of a 5- or 6-bit field and 0.015 of a code of a 10-bit one the device widens by
replicating its bits), as the stream test already did.
The ruled query stays. The runtime test and the replay stream test now expect
that refusal by name wherever the device's own view of the format lacks the
read without a format, and the runtime test still checks the format's reads
and writes through handles there. The runtime README records the refusal on
those four formats on the Iris as a known gap, naming the missing feature.
The predicate's docs name the three uses its checks cover (a read through the
uniform texel buffer, the storage texel buffer the view's usage takes, a write
through it without a format) instead of "every access".
runtime-sources.sha256 takes the runtime inputs' new hash: texel_words.rs, an input, changed in
its doc comments alone, which change no behaviour of a run.
Verified with this change on development ece306e521 (its tip then, ee46e48714):
- Iris Xe, job m3-max-82058: the stream test passed (BGRA8Unorm and B5G6R5Unorm play
their recorded IDs, then the read-written one is refused by name at the dispatch;
RGBA8Unorm, R8Unorm and RGBA16Unorm the CPU's texels and values); the runtime's
texture buffer tests 11 of 11 (B5G6R5Unorm, BGR5A1Unorm and BGR10A2Unorm answer
within the bound, their read_write refused by name);
- RTX 3090, job m3-max-82043 (976685a17e, before the bound, which its words do not
take): stream passed, runtime texture buffer tests 11 of 11;
- lavapipe and CPU, job m3-max-82057: clippy in the three configurations, rustdoc,
validation 1320 passed, conformance 1048 passed, the runtime's suite 964 passed
(4 skipped), texture buffer tests 13 of 13, the stream test passed.
The planner accepted the twin's read of a B5G6R5Unorm texture buffer held as words at 2.3% more
GPU time than the same words compiled with no stage constant (the per-format query's form) on
the RTX 3090, and let the known gap carry the row. The words-cost known gap now gives it, with
the RX 7900 XTX's 2.1%:
- RTX 3090, exclusive job m3-max-81336, 4 rounds rotating the arms, median of each round's GPU
p50: read 167.6 us (spread 1.01%) against 163.8 us (1.16%); write 312.0 us against 310.9 us.
- RX 7900 XTX (RADV), exclusive job m3-max-81364, the same: read 93.1 us (1.07%) against
91.2 us (0.88%); write 85.9 us against 86.0 us.
On both cards the device's profile holds B5G6R5Unorm as words; base refuses the format there.
Documentation only.
SEMANTICS_VERSION 2328 -> 2329: on a profile that holds a colour format's texture buffers as
words, a function reaching a texture buffer emits the words routines and declares
SpecKey::TexelBufferWords (its words twin), records RuntimeFact::TexelBufferWords and, for an
access the words do not build, RuntimeFact::TexelBufferOwnView, and records
DeviceTexelConversion, SrgbTexelDecode and DevicePackConversion where the words convert so; a
texture buffer's word keeps its border texels unless its format has a word layout.
ARTIFACT_FORMAT_VERSION 602 -> 603: RuntimeFact gains the TexelBufferWords and
TexelBufferOwnView variants (cache/codec.rs).
RUNTIME_VERSION 2554 -> 2555: the runtime holds a texture buffer of a format the device lacks for
one of its accesses as an R32_UINT view whose texels the shaders convert, runs a content's words
twin where a draw or dispatch binds one, sizes an indirect execution's shape per pipeline, and
refuses a texture buffer held as words at a slot an own-view access reaches (the runtime gap).
The validation crate's runtime inputs take metal/format/texel_words.rs (build.rs): the runtime
decides each texture buffer's form and word layout through it (texel_buffer_form), and the
runtime-sources guard found metal/format/mod.rs, an input, reaching it unlisted.
runtime-sources.sha256 holds the inputs' new hash, computed as the build script computes it (the
same computation gives development 3ecfe8f034's committed b5a8df0e75...).
The golden tables, the engine fixture inventory and its llvm_as part, are blessed on
development: the semantics bump and the new fixture tb_word_formats move them.
The pipeline-keyed shape (the previous fix) holds for every layout the execution draws with: a
content of patch draws (DRAW PATCHES' CommandDraw::Patches, a post-tessellation vertex function,
PATCH_LIST) has a words twin beside its patch pipeline where a stage reaches a texture buffer, and
an execution through the twin takes the preprocess requirements of the twin.
The shape test now sizes both pipelines of two contents, each with tb_word_fragment: plain
draws (TRIANGLE_LIST, CommandDraw::Plain) as before, and patch draws (icb_merged_patch_vertex,
PATCH_LIST, CommandDraw::Patches) on a device whose executions run tessellation stages, saying
so where they do not.
An execution shape holds the preprocess requirements vkGetGeneratedCommandsMemoryRequirementsEXT
answers for the pipeline the execution binds, and VUID-VkGeneratedCommandsInfoEXT-preprocessSize-
11071 asks an execution's preprocess size of the requirements of its matching inputs, that
pipeline among them. The shape cache keyed a shape on the content's id and the raster state, which
chose the content's pipeline until the words twin: under one raster state a content now has two,
the plain one and its twin, and an execution that ran the twin took the shape the plain pipeline
sized.
The key now holds the pipeline itself in place of the raster state: one per class and raster
state, the twin's apart from the plain one's. A content's pipelines live as long as it does and
its id is never another's, so no stale shape matches. Indirect::shape takes (content, pipeline);
the draw and the execution part pass the pipeline they bind. The runtime README's line on the
shapes the device keeps says so.
Red/green: the test of the previous commit asks for two shapes from the plain pipeline and the
twin of a content that reads a texture buffer; the device run is in the hand-over checks.
An indirect command buffer's execution shape (indirect::Shape) holds its command layout and the
preprocess requirements vkGetGeneratedCommandsMemoryRequirementsEXT answers for the pipeline the
execution binds, and VUID-VkGeneratedCommandsInfoEXT-preprocessSize-11071 asks the execution's
preprocess size of the requirements of the matching inputs, the pipeline's among them. The shape
cache keys a shape on the content's id and the raster state, so an execution that runs a
content's words twin reuses the shape the plain pipeline of the same raster state sized.
The test makes a content whose fragment function reads a texture buffer (tb_word_fragment), for
indirect command buffers, takes its plain pipeline and its words twin at the default raster
state, and sizes a shape for each: it asks for two. Red here on a device with indirect command
buffers that holds a format as words (one shape); it skips, saying so, on a device without them.
On the Iris Xe (ANV, Mesa 26.2.6; job m3-max-81344, and its diagnostic m3-max-81378),
texel_buffer_b5g6r5_read failed its check in every arm, base 2bfb9b5bd3 included, which holds
B5G6R5Unorm through its own view there: "buffer 1: 959978 values differ; the first, [0], is
41.34902, not 41.343575 +- 0.0009765625". The row sums 16 texels' four channels against the
CPU's c / (2^b - 1) within 1/1024, but ANV widens a 5- or 6-bit channel by replicating its bits,
which the translator records as PrecisionNote::DeviceTexelConversion with a recorded bound of 0.18
of a code (docs/API.md). The row's tolerance now adds that bound for each 5- or 6-bit channel of
the 16 texels a sum reads: 16 x 0.18 x (2/31 + 1/63), about 0.23. Other formats' rows keep 1/1024
(an 8- or 16-bit code's one ulp is inside it). On the RTX 3090 and the RX 7900 XTX the row runs
through the words (base refuses the format there), bit for bit, and passed.
Verification pending: the row on the Iris Xe with this harness.
The runtime's Draws gained own_views in 5f5a42681f; the indirect tests' literal lacked it (E0063,
job m3-max-81152's clippy). It names none, as the content reads nothing else.
Verified: not yet built; job of the next dispatch.
The planner's ruling on (A)'s read-through loss, option (ii). Under the identity domains on a
profile that holds some format's texture buffers as words, words::wrap refused the whole module
for a texture buffer access its routines do not build: a read through a sampler, one that
observes residency, one in another numeric class, an sRGB code read, a write of another class or
of fewer than four lanes. The ceilings run (job m3-max-81042) lost three fixture rows that compile
on the base, development 530fb4ea4c: kernel_read_through's rt_buffer, rt_buffer_ow and
rt_arg_buffer, on lavapipe and on the runtime floor.
Such an access now keeps its strategy, the texture's own view, as on a profile that holds no
format as words, and the stage records RuntimeFact::TexelBufferOwnView { stage, texture }: the
slot, or None for a texture buffer reached through a handle. The fact's mechanism is a plan-time
check. The runtime's kernel interface and a render content's draws read it, and a dispatch or
draw that binds a texture buffer held as words at such a slot is Gap::TexelBufferOwnView of the
slot and its format; through a handle, any such dispatch or draw while a texture buffer held as
words is live (the gauge the words twin's handles test reads). Binding no texture buffer held as
words there changes nothing.
Tests: engine_identity's a_read_through_a_sampler_of_a_texture_buffer_takes_its_own_view compiles
the three entries under the identity domains on lavapipe and moltenvk-m3, passes L3, and checks
the fact where the profile holds a format as words and nowhere else (red before this: lavapipe's
compile refused). The runtime's a_read_through_a_sampler_refuses_a_texture_buffer_held_as_words
runs rt_buffer_ow over six formats. Each held directly answers its texels and Metal's white
border: three without a word layout, and three with one, whose border comes from the code. Each
held as words is refused at its dispatch with the gap of slot 0 and its format, and the same
state's next dispatch runs.
docs/REFUSALS.md and the error basis are regenerated. The runtime README's known gaps state the
refusal. api_signatures gains the fact's and the gap's variants.
Verified: not yet built; the ceilings, the gate, lavapipe device tests and the read-through-buffer
conformance replay follow.
The words change cleared bits 0-11 of every texture buffer's word, on the premise that no texture
buffer is read through a sampler. Metal 4.1 reads one so (`read(sampler, x)`, the fixture
kernel_read_through's rt_buffer, rt_buffer_ow and rt_arg_buffer, the conformance case
read-through-buffer), and under the identity domains such a read takes the border texel from
those bits. So every texture buffer read through a bordered sampler read a zero border on every
device, and one of a format with a word layout read its fields as border texels. The base,
development 530fb4ea4c, kept the bits; found by reading, before any run.
Now TextureWord::of_texture_buffer is the texture word, border texels included, for a format
without a word layout, which is the base's word. A format with a word layout sets bit 13
(TextureWord::TEXEL_BUFFER_LAYOUT, 0 in every other word) and carries its fields in bits 0-10 on
every device. The words' held test requires bit 13, since a plain word's bits 2-7 are border
texels; a handle carries 14 bits of the word (HANDLE_WORD 0x3fff). A slot's read through a
sampler of a texture buffer takes the border texels from bits 0-11 where bit 13 is clear, else
from its format's code (words::border_texels, a choice among the values the word layouts'
formats have, grouped from WORD_FORMATS and metal::sampler::border_texels).
RESOURCE-ID.md and resource_words.tsv state the new word: the texture buffer lines of a word
layout gain bit 13, the others carry their border texels (the texture line's word at the default
swizzle).
Consumer search, the consumer's development 2221a41c20 (git grep -w over *.rs, *.c, *.h, *.m,
*.mm, *.cpp, *.py, *.tsv, *.md): TextureWord, of_texture_buffer, resource_word, resource_words,
BORDER_TEXELS, TEXEL_BUFFER, border_texels, OUT_OF_BOUNDS_ALPHA_ONE, PIXEL_FORMAT_SHIFT: 0 hits
each. The consumer takes each texture's ID from the runtime's gpu_resource_id.
Verified: not yet built. The unit test words::each_code_takes_its_format_s_border_texels holds
each code to its format's border texels; the runtime test and the lavapipe replay of
read-through-buffer come with the next commit.
The public function's doc linked VIEW_USES and NATIVE_USES, which are private: rustdoc with
-D warnings failed on the three links (the rebased branch's gate, job m3-max-81050, doc step
EXIT=101). The doc now states the uses in words: a uniform texel buffer, a storage texel buffer
and a storage texel buffer written without a format.
Verified: not yet built; the next gate's doc step checks it.
The planner's ruling for (A): the twin's per-state compile cost is the form's known gap for a
program that binds a texture buffer. On lavapipe (job m3-max-80997, the texture buffer stream
test's tb_word_formats state over five formats) the twin's make took 16.9 to 23.5 ms
(Metrics::word_pipeline_nanos) and the plain pipeline's create at least 2.9 to 5.3 ms
(pipeline_creation_nanos less the twin's), about 4 to 7 times. The five recorded guest streams
declare the constant in no state (job m3-max-80975): 0% of their boots' compile time.
The test took an own view's values within one ulp with nothing behind the number. The value
is the device's conversion of each code, which the translator records as
PrecisionNote::DeviceTexelConversion; the test now asserts the fixture's state records that
note, and takes an own view's values within the note's recorded bound (docs/API.md): an 8- or
16-bit code within one f32 ulp, a channel of 6 bits or fewer within one ulp or 0.18 of a code
where the device replicates its bits (ANV, NVIDIA). Words stay bit for bit.
Not yet rerun.
The handles dispatch passed the read-written values (a Vec<f32> by then) at slot 2, which the
kernel does not use, so the runtime's device tests did not build (job m3-max-80971 on
lavapipe, E0308); it binds the values buffer there. The texture buffer stream compared an own
view's values bit for bit with the CPU's c / (2^n - 1); lavapipe's conversion multiplies by
the reciprocal and lands one f32 ulp off for RGBA8Unorm, R8Unorm and BGRA8Unorm (80971). The
device's own conversion is the answer (the owner's rule 1), so an own view's values are taken
within one ulp; words, our own decode, stay bit for bit (B5G6R5Unorm matched exactly).
Not yet rerun.
Interface gained `words` (the kernel's reach of word-held texture buffers) with the words
twin; the device tests' hand-made Interface (tests/compute.rs, compiled only under m2v_gpu or
m2v_cpu_icd) still lacked it, so the runtime's device tests did not build (job m3-max-80900,
nextest exit 101). Its kernels declare no texture buffer: None.
Not yet built: the lavapipe check reruns as a potluck job.
The two B5G6R5Unorm rows grew the harness's list past its declared 45, which stopped the
harness from compiling (the XTX arms build, job m3-max-80896, E0308). The texture buffer
replay stream passed each descriptor inline, which the player refuses for
newTextureWithDescriptor:offset:bytesPerRow: (job m3-max-80900 on lavapipe: "argument 0 ...
not an object"); it now records each with m2v.textureDescriptor first, as the other
texture-over-buffer streams do.
Not yet built: both checks rerun as potluck jobs.
The owned fixture tb_word_formats gains tb_word_fragment, which colours the pixel at x with texel
x % 5 of its texture buffer (regenerated with the macOS Metal toolchain and LLVM 21). The
runtime's draw test reads an R8Unorm and a B5G6R5Unorm texture buffer through it, checks every
pixel against the CPU's decode within one code, and that the draw ran the twin exactly where the
device holds the format as words.
Not built yet.
Metrics::word_contents counts the compute and render contents whose module declares
SpecKey::TexelBufferWords; the replay player prints it. A count of the dispatches and draws that
ran a words twin, for the device tests alone, shows which pipeline ran.
The owned fixture tb_word_formats gains tb_word_formats_args, which reads and writes the texture
buffers through an argument buffer's handles (regenerated with the macOS Metal toolchain and
LLVM 21). The runtime's words test runs it after the slots' kernel and checks its values, and
that the slots' dispatch ran the twin exactly where the device holds the format as words, and the
handles' dispatch there too.
Not built yet.
AGENTS rule 2's texture buffer form and the runtime's README name the stage constant, the words
twin made in the same make as each plain pipeline, what picks it, and its second compile and
memory as the form's known gap; docs/API.md and RESOURCE-ID.md name the gate.
The replay player prints the word pipelines' and word-held texture buffers' gauges and the
twins' makes and time beside pipeline_creation_nanos.
The harness's texel_buffer_b5g6r5_write and texel_buffer_b5g6r5_read rows time a format the lab's
cards hold as words, a 2-byte texel written by two atomics and read through the words' routine,
checked against the CPU's exact conversion and decode.
Not built yet.
SpecKey::TexelBufferWords { stage, handles }, a bool, false by default, which a stage declares
under the identity domains on a profile that holds some format's texture buffer as words, where
it reads, writes or queries a texture buffer. It gates each site's word test, the word bits a
handle carries and the element mask that drops them: false, they are dead code at pipeline
creation and each access is its view's alone.
The runtime makes each kernel variant's and each render content's words twin in the same make
as its plain pipeline, and a dispatch or draw runs it where a texture buffer held as words is
bound at a texture buffer slot a function declares, or, for a stage that reaches one through a
handle, while one lives on the device. Twins and word-held texture buffers are gauged, the
twins' makes counted with their time.
This commit alone was not built; the series is checked at its tip.
Blessed by job m3-max-80671 (bless_resource_words, then the resource_word tests: 2 passed): a
texturebuffer line for every pixel format with a texture buffer word at width 1, and at widths 2
to 4 where its padding changes the word, 251 lines; no texture or sampler line moved.
The site test read the codes from the module's declarations, which do not hold them; it reads
the plan's. The player compared a texture buffer's recorded ID with TextureWord::of, whose border
texels a texture buffer's word does not carry; it takes TextureWord::of_texture_buffer of the
descriptor's format and width, as RESOURCE-ID.md and REPLAY-STREAM.md now say. rt_replay gains a
stream of texture buffers of five formats (RGBA8Unorm, R8Unorm, BGRA8Unorm, B5G6R5Unorm,
RGBA16Unorm) over a Shared buffer, read, written and read-written by tb_word_formats with the IDs
the program saw recorded, each played on the cfg's device: no id line, the CPU's texels and
values, and each format's form on that device printed. Unbuilt.
Additions only (50 signature records): metal::format's TexelWords, WordLayout, TexelField,
FieldKind, TexelBufferForm, WORD_FORMATS and its functions, and TextureWord's texture buffer
fields and of_texture_buffer. scripts/api-signatures/signatures.py --bless reports no record
removed or changed. The runtime's texture buffer words test reads each format's form from the
device's profile and names it on each line.
metal::format::texel_buffer_form is the one place that decides, per format and device: the
format's own view where the device holds it directly as a uniform texel buffer, a storage texel
buffer and a storage texel buffer written without a format; else words where it has a word
layout; else its own view of the first two (whose writes the runtime refuses). The resource ID
word is unchanged and the same on every device; a module takes the codes its profile holds as
words (texel_buffer_word_codes) and tests a word's code against them, emitting nothing of the
words where the profile holds none so. The routines' cases and the precision notes follow those
codes. The runtime's texel_form takes the same answer. AGENTS.md rule 2 gains the fourteenth
form; the runtime's README records the words' cost (7.3x the own view's GPU time for an R8Unorm
texture buffer written on an RTX 3090, job m3-max-80580).
This commit alone was not built; the series is checked at its tip.
RESOURCE-ID.md gains the texture buffer word (TextureWord::of_texture_buffer: bits 0-1 padding,
2-7 the code, 8-9 texels per word, 10 a texel of two words; the 39 codes in order) and drops its
stale line that a texture buffer has no index. The runtime's README says which formats a texture
buffer holds as words and which it still refuses; the KosmicKrisp BGRA8Unorm gap is gone. API.md
and PrecisionNote's docs say a texture buffer held as words records SrgbTexelDecode and
DevicePackConversion for its float reads and writes, and that its other conversions are exact.
tests/resource_words.rs writes texture buffer lines (format, width, word); the table is blessed
in a later commit. REFUSALS.md regenerated (one more TextureFormat site).
A texture buffer of one of 39 colour formats with a word layout (metal::format::texel_words)
is viewed as R32_UINT over its bytes, and shaders convert each texel themselves: the translator's
words routines (lower/texture/words.rs) read, write and ask the width of such a texture buffer,
and a write of a texel of one or two bytes is an atomic AND then an atomic OR on its word, which
keep its neighbours' bits. The texture word of a texture buffer (TextureWord::of_texture_buffer)
carries the format's code, its packing and padding; a handle carries those bits, and the element
mask drops them. The runtime makes the R32_UINT view, its last word ending inside the buffer's
block, and the required-formats test names the formats Vulkan requires as storage texel buffers.
This commit alone was not built; the series is checked at its tip.
The harness makes a texture buffer over a plan buffer (plan::TextureSource::Buffer,
ComputeDevice::new_texture_buffer): texel_buffer_r8_write writes 2^24 R8Unorm texels, one a
thread, and texel_buffer_{r8,r16,rgba16,bgra8}_read read 2^24 texels, 16 a thread, each checked
against the CPU's decode. The workloads time a texture buffer's accesses, as the translation of
the formats the runtime holds as words is weighed against their own views.
Metal makes texture buffers of A8Unorm, the four 8-bit sRGB formats, RGB9E5Float, the
four packed 16-bit formats, BGR10A2Unorm and the four extended-range formats, for reading,
writing and both (M3 Max, macOS 27.0.1, jobs m3-max-79872 and m3-max-79879). The runtime
refuses each as Gap::TextureFormat on some or all devices, because Vulkan offers no
texel-buffer format for them.
The owned fixture tb_word_formats reads, writes, and reads then writes texture buffers of
five texels with eight threads. The new device test checks each format's answers against
the CPU's decode of the bytes:
- reads in bounds, exact, or within 2^-12 through the sRGB transfer;
- writes of each texel's value store its code, with neighbouring texels in one word kept;
- past the width, the zero texel is read and nothing is written, the rest of the last
word included;
- the widths are 5.
This is the red half: every format is expected to fail at Buffer::new_texture
(Gap::TextureFormat). The run that shows it is in the handover.
The player moved every written word whose value lies in a buffer noted
escaped (AddressMap::move_noted), whatever the buffer it was written into.
In rec-m3-max-80463 it moved 3 RG8 mask words of no-copy buffer #1960,
which the program reads only as texels through texture #1962 over it. Each
play wrote its own host address there, so two plays read different texels
(audit lane, m3-max-81898 and m3-max-81914).
Now the move is decided by the stream's structure:
- read_ahead, which already walks the whole stream, notes each buffer's
life, keyed by the object and its making's position (as recorded_ids
is):
- whether a texture is made over it (it receives
newTextureWithDescriptor:offset:bytesPerRow:, the tiled form or the
linear form);
- whether any call names it as an argument, at any depth of lists and
maps, but a copy between a buffer and a texture (copyFromBuffer:...
toTexture:..., copyFromTexture:...toBuffer:...), whose bytes are texels.
A buffer with a texture over it and no such naming is reached only as
texels.
- At an object's making the play marks it live as such, or unmarks the id.
- place_words takes the write's target (none for set*Bytes data). Into a
buffer reached only as texels, the words move_noted would move play as
recorded and are counted as texel_only_words (AddressMap::count_noted,
which shares move_noted's pass). The census is unchanged.
- Unchanged: a buffer with no texture over it, including one the stream
never names (the existing noted-word test), set*Bytes data, and any
buffer bound, encoded, used, copied buffer to buffer or added to a
residency set.
texel_only_words is a new stream counter: in FIXED, frame and group lines,
and the report's addresses line. Docs: REPLAY-STREAM.md section 5's
noted-word paragraph and section 10's counts and addresses line. The
counter lists the replay tests spell out gain it.
Two lavapipe plays of rec-m3-max-80463 differ (audit lane, jobs
m3-max-81898 and m3-max-81914). In frame 3 the player moves 3 words of the
stream's write into no-copy buffer #1960, at offsets 24344, 73104 and
74240. They are RG8 mask bytes whose value falls inside an escaped
buffer's recorded range, and AddressMap::move_noted rewrites them to each
play's own address. #1960 is read only as texels, through texture #1962
over it, so the texture reads other bytes in each play. A shader loads an
address only from memory its command reaches as a buffer: bound, encoded
into an argument or indirect command buffer, or made resident by
useResource:, useHeap: or a residency set. Each of those calls names the
buffer.
New test in replay/tests.rs,
a_noted_word_in_a_buffer_reached_only_through_a_texture_over_it_plays_as_recorded:
- An authored stream makes a buffer, a texture over it
(newTextureWithDescriptor:offset:bytesPerRow:), notes the buffer escaped
(kind 0) and writes into it a word inside its own range.
- Reached only through the texture, the word is to play as recorded, and
be counted as texel_only_words, not noted_words.
- The same buffer also bound by setBuffer:offset:atIndex: still moves the
word.
Expected red: today the word moves in both arms.
The engine inventory, the golden hash table and the air_input printouts, re-blessed at
3ecfe8f034 on the M3 (potluck job m3-max-82095: inventory=0, golden=0, printouts=0, and the
metallib half of committed_air_fixtures_parse_and_link un-skipped, linkhalf=0). The draw
patches and indexed draw patches work since the last bless added the icb_merged_patches and
icb_merged_ipatches fixtures and moved SEMANTICS_VERSION to 2328, so the four bless-due tests
(engine_fixtures_match_their_golden_printout, inventory_lists_every_fixture_in_order,
golden_hashes_match_the_table, llvm_as part 8) read red until this commit.
Files: golden_hashes.tsv, public_fixture_expectations_engine.tsv, and the two new printouts
air_input/icb_merged_patches.txt and air_input/icb_merged_ipatches.txt. Nothing else.
a3fb852de3 (a heap makes texture buffers in place) sizes a heap's texture buffer through the
format's texel form, which takes a format whose buffer features hold both the uniform and the
storage texel buffer. On the Iris Xe, whose ANV holds A4R4G4B4_UNORM_PACK16 so, the heap's size
and alignment of the format-footprints-plain-stragglers BGRA4Unorm texture buffer now answers
(Metal's 128 at 16), and the case reaches its makes-texture site, which the runtime's side refuses
as Refusal::TextureBufferNotOverBuffer, the consumer's contract. The ledger's one row for every
venue refused the size-and-align site, so the Iris's conformance replay went red at pin M
(m3-max-82006: an unlisted makes-texture refusal) while the RTX 3090's held (m3-max-82034).
Now:
- the size-and-align row is one per venue whose device lacks the storage texel buffer of both of
the format's Vulkan formats (NVIDIA, RADV, llvmpipe, Apple M3 Max, UHD Graphics 630), naming
a3fb852de3;
- the Iris Xe has a makes-texture row with the consumer's-contract reason the other texture
buffers' rows carry, naming a3fb852de3;
- each says Metal's validation layer refuses this format for a texture buffer, so what such a
texture reads is outside documented Metal and no value comparison is owed for it;
- the runtime's README says a texture buffer's answer, the heap's size included, follows the
format's texel-buffer features: the devices differ by query, not by form.
docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py; --check
clean), as are the metal-coverage and refusal-surface checks.
On a device that keeps two copies of a Managed buffer, the runtime now takes a range named by
didModifyRange to the device copy at the first commit whose encoders name the buffer (a slot, a
declaration, an indirect, index or other draw buffer, a blit's buffer, a texture over it), not at
the next commit, and a buffer's first bytes at the next commit whatever it names. A run of an
unchanged artifact may therefore submit and record other copies under an unchanged key. None of
the validation crate's runtime inputs changed, so runtime-sources.sha256 holds. SEMANTICS_VERSION
does not move: nothing compiled changed. 2553 is taken by another row landing beside this one.
Verified: the value alone changes; the gate at this tip follows.
`conformance times --runs 8 --write` over the five cases, built --release at a2f2cad217, on the
Apple M3 Max, macOS 27.0.1 (26A434), job m3-max-81954 (the build: job m3-max-81941). Each
recording gained one time record (native Metal, 8 rounds), a recorded hole whose stopped reason
is the cases' own: the oracle keeps one copy of a Managed buffer, so its leg is forbidden. A
comparison of the JSON before and after shows `times` the one key added and every other key
equal. This is what times::every_case_is_timed::every_case_carries_its_timing asked of the new
cases (it failed in m3-max-81916 at c098a9848e). docs/CONFORMANCE-COVERAGE.md, regenerated,
does not change.
Each recording holds the case's carried answer as record mode writes a carried case's: the
transcript of the reader's content as an AMD Radeon Pro 5300M under macOS 26.7.1 read it, 8
rounds a reader (jobs 81602 and 81644), measured_on amd-radeon-pro-5300m, validated not run. The
compute slot, the declaration, the vertex slot and the blit source read the bytes as of the
reader's commit; the reach through the address alone reads the bytes the GPU's copy last took.
The oracle's own run is forbidden by the cases (one copy), so nothing here ran on Metal.
They were written by record::carried and record::write, the calls record mode makes for a
carried case, through a scratch test of a CPU-only job's own workspace (job m3-max-81916, at
c098a9848e), never committed. docs/CONFORMANCE-COVERAGE.md is regenerated with them
(scripts/conformance-coverage/coverage.py): 192 case modules, 1347 recordings, 85 carried.
Verified: in the same job the conformance suite ran 1050 tests, 1048 passed; the two failures are
the coverage document, regenerated here, and the cases' missing Metal time records, which the
oracle's times run adds next.
Clippy named the chunks_exact of a constant 4 (as_chunks reads each word as an array, with no
conversion that can fail) and the unused import of call.
Verified: clippy of the conformance crate in job m3-max-81909 (CPU-only build) failed on both;
the next job runs it again.
Clippy's drain_collect named the collect of the made entries into a vector of their own; the loop
now drains them directly, its other borrows being of the change list's other fields.
Verified: clippy of the conformance crate's dependencies in job m3-max-81865 (CPU-only build)
failed on it; the clippy job follows.
A commit takes its named ranges through Seconds::take, which answers none where its command
buffer named no buffer with a range, so nothing calls named. The release build of the player warned
of it as dead code.
Verified: the warning is in the player's release build of the frame-396 play job m3-max-81847
(lavapipe); no caller in the tree (grep of seconds' calls). The clippy job follows.
The reader's own helper took the name of the side's kernel stage helper, a duplicate definition
on RtSide. It is now compute_state, built on that helper, and the render reader takes its two
stages through it as well.
Verified: the recording job m3-max-81836 (a CPU-only build, at the commit before the rebase)
failed to compile the conformance crate on the duplicate; the next job compiles it.
Watching forwards every Side method, so a watched run of the managed-named cases answers what the
side it wraps answers rather than Unavailable. The suite's test that compares Side's methods with
Watching's forwards names the missing one without it.
Verified: expected from the forwarding test's name sets. The conformance suite run follows.
The test every_device_places_a_managed_buffer_s_device_copy_where_the_consumer_says named the
whole buffer, then read the block through a commit that kept only another buffer over the
Private block. Under the rule that a named range is taken at the first commit whose encoders
name the buffer, that commit takes nothing, so the two-copy form read the old bytes. The read's
commit now names the Managed buffer as well.
Verified: lavapipe rt suite job m3-max-81780 at f864a75d35 failed this test alone (958 of 959
passed, 4 skipped) at the copy-in assertion; the rerun follows.
Five cases, one a reader, each of the same sequence: a Managed buffer's red
contents written, named and taken by a blit; green written and named, then a
commit of a blit that fills another buffer; the reader encoded, blue written
with no second name, the reader's command buffer committed. The site holds
which of the three the reader read. Readers: a compute slot
(scale_and_offset), useResource: (ab_address), the address alone (ab_address,
no declaration), a vertex slot with a draw (colored_vertex), a blit copy's
source.
Metal's answer is carried from an AMD Radeon Pro 5300M table under macOS
26.7.1, 8 rounds a reader (jobs 81602 and 81644): the readers that name the
buffer read the bytes as of their commit (blue), the address-only reader the
bytes the GPU copy last took (red). The oracle keeps one copy, so record mode
may not replace the table (carried_only), and the case names the chip
(recording::AMD_RADEON_PRO_5300M; the known-families list in
a_carried_answer_taken_on_another_chip_names_it grows by managed-named-).
The runtime's side runs the sequence in the form the device's memory-type
query picks. On a device that keeps one copy the address-only row answers the
venue's gap (a device copy of each Managed buffer), as that row asks what a
second copy holds; the other rows read the bytes as of their commit in either
form, as the 5300M and the one-copy UHD Graphics 630 (jobs 81603, 81645) did.
Recordings follow from a record job on the oracle. Not yet compiled.
The first-naming-commit rule (baf1c8a8c9) also held a new Managed buffer's
first `copied` bytes until a commit named the buffer, so a reach before then
read the device copy's old bytes. Metal's device copy holds a buffer's bytes
from its making. Those bytes now go in at the next commit whatever its encoders
name (Changes::made, taken by every commit, merged with the buffer's named
ranges where the same commit takes both); ranges did_modify_range names still
wait for a commit that names the buffer. The made entries are swept as the
named ones are.
Texture::image_bytes, a test helper, now commits a compute encoder that
declares the texture by use_resource, so its commit takes the named ranges of
the buffer the texture lies over.
Lavapipe's full runtime suite at baf1c8a8c9 (m3-max-81741: 957 passed, 2
failed, 4 skipped) failed managed::every_device_places_a_managed_buffer_s_
device_copy_where_the_consumer_says and over::every_device_holds_a_texture_
over_a_buffer_in_place on these two; this fixes both. Not yet compiled.
The runtime now takes a Managed range at the first commit whose encoders name
its buffer, as Metal on an AMD Radeon Pro 5300M does (jobs 81602, 81644). The
player's own second copy, which a two-copy stream's Managed buffers take on a
device with unified memory, took every range named at the next commit of any
command buffer; it now follows the runtime's rule.
- second.rs: Seconds keeps, for each command buffer not yet committed, the
buffers with a second copy its encoders named, themselves or through a
texture over one (made over the buffer, a tiled one, or a view of one), and
a commit takes only those buffers' ranges. A released buffer with ranges
pending stays only while a command buffer not yet committed that named it,
or a texture over it, can take them; otherwise its place goes back at once.
A command buffer released uncommitted takes nothing.
- mod.rs: each encoder call's named objects, a render pass's attachments,
resolve textures and visibility result buffer at its encoder's making, and
the textures and views made over a second copy feed it. render.rs keeps the
pass's resolve textures and visibility result buffer by stream id.
- encoders.rs: copy_named takes the committing command buffer's ranges alone.
- stale.rs: a didModifyRange: is pending until a commit whose uses name the
object takes it, with the bytes written by then (an indirect command
buffer's command takes it where it is encoded); writes between the
announcement and that commit are not stale.
- docs/REPLAY-STREAM.md says so.
Tests: rt_replay a_two_copy_stream_s_announcement_is_taken_at_the_first_
commit_that_names_the_buffer (zeros announced, a commit of another buffer, 7s
written with no announcement, a copy of the buffer reads the 7s); tests
an_announcement_is_taken_at_the_first_commit_that_names_its_buffer (the
census counts one stale use where it counted two). Not yet compiled.
On a device that keeps a device copy, did_modify_range named a range and the
next commit of any command buffer took every range named since. A consumer
that names a range, commits a command buffer that does not use the buffer,
writes the range again with no second name, then commits the command buffer
that binds it had the GPU read the first bytes. Metal on an AMD Radeon Pro
5300M (macOS 26.7.1, 8 rounds each, jobs 81602 and 81644) takes a named range
at the first commit whose encoders bind the buffer (a compute slot, a vertex
slot with a draw), declare it by useResource: or read it in a blit copy, with
its bytes as of that commit; an unrelated commit takes nothing; a buffer named
to no encoder and reached by address keeps its last synced bytes. The Intel
UHD Graphics 630 keeps one copy (jobs 81603 and 81645).
A commit now takes only the ranges of the buffers its command buffer keeps,
which is every way an encoder names a buffer in the runtime:
- a slot of any stage: compute set_buffer, set_vertex_buffer,
set_fragment_buffer;
- use_resource on a compute or a render encoder (the runtime has no
use_resources);
- an index buffer; the indirect arguments of a draw, an indexed draw or a
dispatch; a patch draw's index and control-point buffers and an indirect
command buffer's range buffer, kept by the same line of the draw as the
index buffer and the arguments;
- the tessellation factor buffer and the pass's visibility result buffer;
- a blit: a copy's source or destination, a fill, a copy into or out of a
texture, a synchronize;
- a texture over the buffer, or a view of one, wherever the command buffer
keeps it (a slot, use_resource, an attachment, a resolve, a blit).
A heap use names none: Metal refuses a Managed heap (jobs 81602, 81603).
A pending range holds its buffer weakly. The pending list sweeps the entries
of buffers gone once it holds twice the entries its last sweep left (at least
64), so it stays bounded by the live buffers with ranges pending.
Tests (tests::managed): the consumer's six calls (red at e1fbce1486 on
lavapipe's two-copy view, m3-max-81614, and on an RTX 2080, m3-max-81606);
each way above, through compute, render and blit encoders and a texture over
the buffer, with a reach by address alone taking nothing; a buffer no encoder
names keeps the bytes taken last; a narrow named range takes its own bytes
alone (unaudited on Metal); a declaration alone takes, a commit with no
commands takes nothing. over_texture's capture commit now names its buffer.
The did_modify_range doc and the runtime README state the rule and its jobs.
Not yet compiled; the green runs follow.
A consumer writes zeros into a Managed buffer and names the range. It commits a command buffer that
does not name the buffer, and that command buffer completes. It encodes a kernel that reads the
buffer, writes a table over the zeros with no second didModifyRange:, and commits. The test expects
the kernel to read the table, in either form.
Metal on a discrete Mac GPU (an AMD Radeon Pro 5300M) takes a named range at the first commit whose
encoder binds its buffer (Buffer::did_modify_range's doc). The runtime takes it at the next commit of
any command buffer, so with a device copy the kernel reads the zeros. A guest's argument buffer
written this way held a null pointer in the device copy, and its vertex function read through that
pointer.
Red runs follow in the next commit's message.
Gap::MemorylessTexture's basis read "render passes are not built", which stopped being true
when render passes were built. It now names the reason the refusal stays: a memoryless
attachment keeps its contents for the whole render encoder, across the renderings the runtime
ends and restarts inside one encoder (barriers after writing draws, the feedback-loop barrier,
copies for textures over buffers and Managed copies, shadow copies), and the image that would
hold them is not built. docs/REFUSALS.md regenerated (scripts/refusal-surface).
Docs only: no behaviour changes. refusal_surface.py --check exits 0.
Buffer::texture_copy_cause (and new_texture_in_place's TextureNotInPlace cause) now says
which of its answers come from the device's queries of the descriptor and the buffer's kind of
memory alone: HostMemory, DmaBuf, DmaBufs, Dedicated, Surface, Linear and LinearFeatures, all
decided in check_over before any place is read (memory_cause, the external or linear image
query, the linear tiling's features). Spilled, Pitch, Alignment, RenderReach and ImageMemory
depend on the buffer and its place (the block's spill, then in_place_fit's laid image). A
consumer may keep a kind-only answer per descriptor and kind of memory instead of importing
another buffer to ask again; the consumer's census meets four such refusals a run on the M3,
each paying a map and an import first.
Docs only: no behaviour changes. Verified by reading check_over, memory_cause and over_cause at
this commit's parent.
every_device_places_each_vector_access_at_its_own_address gains a run binding vwp_vec16's a 4
bytes past a multiple of 16 and b at 0: one argument of alignment 16 at a multiple of 4 below its
alignment beside one at its alignment, the shape a guest kernel's refused bind had (index 0 at
offset 1871700, 4 past a multiple of 16, alignment 16). Each run now prints how many of its two
dispatches ran with their buffers bound (Metrics::bound_dispatches) and how many at their
addresses (Metrics::address_dispatches), so a card run shows which form served the bind.
Verified: the test passes on lavapipe (llvmpipe, LLVM 23.1.1), job m3-max-81994, with clippy
-D warnings under --cfg m2v_cpu_icd clean: every run's two dispatches at addresses (lavapipe has
no bound form), the a-at-4, b-at-0 run included. On the RTX 3090, job m3-max-81997, the same run's
two dispatches both ran bound (a in the variant that keeps its address, b through its binding),
the a-at-4, b-at-8 run one bound and one at addresses, and every other run two bound; every
buffer held Metal's words on both.
dc126ab306 lowers render_command's draw_indexed_patches (it wrote a refusal before) and grows every
command's record tail by 8 bytes: the stride is index() + 48 (was + 40), the sequence index lies at
index() + 24 (was + 16) and the draw's arguments at index() + 28 (DRAW_AT, was 20). So a kernel that
writes, resets or reads any command of an indirect command buffer translates to other words under
an unchanged key. The golden tables are re-blessed on development.
Verified: lavapipe m3-max-81663 (red, then green); 2080 m3-max-81688, XTX and 780M m3-max-81689, lavapipe m3-max-81691 (engine, rt indirect and the 6 range rows against Metal's recording m3-max-81637 on the Apple M3 Max); Iris Xe m3-max-81890 (no VK_EXT_device_generated_commands: refused by name); states-only play m3-max-81856 0 refused; suites and lint m3-max-81855.
Metal's answer for the indexed-patch-draws range row, recorded on the Apple M3 Max (macOS 27.0.1,
26A434) by job m3-max-81637 at 992794d8bd (the AIR commit, d244877fb2 after the rebase onto
685bde8009, the same patch), with its times (8 rounds, the same job). The execution completes, and
commands 1 to 5 draw rows 2 to 11 whole: each command's quad, whose four corners are stored out of
order and named in order by its 16-bit control-point indices, covers its two rows. Each texel
holds the command's mark, the patch index i, the instance and the base instance i, the patch-draws
row's texels exactly.
The ledger's Iris Xe row is the Extension refusal, as for the other range rows: the Iris Xe lists
no VK_EXT_device_generated_commands. CONFORMANCE-COVERAGE.md is regenerated.
The owner's 3406 order, the planner's next indirect command kind: MTLIndirectCommandTypeDrawIndexedPatches.
The records (pipeline::IndirectDrawLayout) grow by 8 bytes a command for every kind. The
control-point indices' address is a third u64 that an execution pushes, and VUID 11103 asks each
token's offset to be at or past the one before it, with the draw token last (VUID 11100). So the
address cannot go after the draw; it lies past the index token's 16 bytes, at index() + 16.
Every command's tail is now 16 + 8 + 4 + 20 = 48 bytes: the stride is index() + 48 (was + 40),
the sequence index's place index() + 24 (was + 16), and the draw's arguments index() + 28 (the
translator's DRAW_AT, was 20). The cost is 8 bytes a command in every buffer: 160 bytes for 7
vertex and 7 fragment slots (was 152, 5% more), 48 for none (was 40), 544 at most (was 536),
which the floor's stride and token-offset limits are checked against. One record shape for every
kind stays: a kernel cannot know a buffer's kind when it is translated, so it writes one shape
whatever buffer it reaches. The main lane accepted this on the condition that the
already-landed kinds' rows run again at the new layout.
Translator (lower/access/icb.rs): a render_command's draw_indexed_patches writes what
draw_patches writes (the draw's VkDrawIndirectCommand of patches, the factors' and the patch
indices' Metal addresses) and the control-point indices' Metal address at the new place
(CONTROL_POINTS_AT, IndirectDrawLayout::control_point_indices). Its operands are draw_patches's,
with the control-point indices at operand 6.
Runtime: Device::new_indirect_command_buffer takes DRAW_INDEXED_PATCHES alone
(CommandDraw::IndexedPatches), refused as patch draws are on a device whose executions run no
tessellation stage (TessellationStages). Its layout pushes the control-point indices' address
where the control stage reads it (FieldValue::ControlPointIndices), holds no index buffer token,
ends in TOKEN_DRAW and names the tessellation stages. An execution checks the state's
control-point index type against the buffer's kind, as a direct draw checks it against the call:
patch draws with a state of an index type are Refusal::PatchDrawWithIndexType, and indexed patch
draws with a state of none Refusal::IndexedPatchDrawWithoutIndexType. This replaces the patch
draws' check through an empty PatchReads.
Docs: the runtime README's ICB section (records, tokens, refusals, floor limits); the API guide's
section 1; METAL-COVERAGE (coverage.tsv); CONFORMANCE-COVERAGE and REFUSALS.md regenerated (the
two refusals gain the draw site); the API signature table blessed for control_point_indices.
Tests: the red commit's engine and runtime device tests; the layout's unit tests at the new
offsets, the reset command's control-point place among them; a unit test of the indexed patch
tokens.
The engine test of a kernel's patch draws compiles and validates icb_merged_ipatches too, whose
kernel encodes indexed patch draws with 16-bit control-point indices of its own, on every profile.
The runtime's patch-draws device test becomes one body for both kinds. Its new arm,
every_device_draws_encoded_indexed_patch_draws_as_their_draws_direct, uses a state of
icb_merged_ipatches's functions: a float2 corner at attribute 0 of vertex buffer 2, stepped per
patch control point, under the UInt16 control-point index type. Each patch's corners are stored
out of order, and its indices name them in order. The arm asserts that four indexed patch draws
the kernel encodes draw what the same draws direct draw, in the four executions of the patch
draws' arm, and that indexed patch and patch draws together are CommandTypes.
Red: the translator refuses a render_command's draw_indexed_patches
(GpuEncodedIndirectCommands), and the runtime refuses a buffer of DRAW_INDEXED_PATCHES
(CommandTypes).
Regenerated by scripts/regen-air-fixtures icb_merged_ipatches on the Apple M3 Max (macOS 27.0.1,
Apple metal version 32023.922, macOS SDK 27.2), job m3-max-81619: the .ll and .air.ll of the owned
source, and the fixture's line in TOOLCHAIN. The engine inventory, the golden tables and the
air_input printouts take the fixture when they are re-blessed on development.
The next indirect command kind after patch draws: MTLIndirectCommandTypeDrawIndexedPatches.
icb_merged_ipatches is an owned fixture. Its kernel encodes command i as one quad patch of four
control points from patch i, with no patch index buffer, 16-bit control-point indices and
level-1 half factors, one instance for an even command and two for an odd one, from base
instance i, with vertex buffers 0 to 2 of its own. The post-tessellation vertex function reads its
four corners through a PerPatchControlPoint layout at vertex buffer 2. The points are stored out
of order and the indices name each corner, so a patch that covers its rectangle read its
indices. Each texel then holds its command's mark, the patch index, the instance and the base
instance.
indirect_ranges.rs gains the row indirect-range-gpu-written-indexed-patch-draws: commands 1 to 5,
written by a blit's copy before the pass, as the patch-draws row is. EncodedRange carries the
commands' pipeline's vertex descriptor and tessellation state where a row states them; both
sides set them on that pipeline (the Metal side's tessellation fields through one helper, the
runtime side's through the fields module's descriptors). The fixture's AIR, the Metal recording
and the ledger row follow in their own commits.
Gauges::releases_waiting counted a release only while it waited for work
in flight. An object then handed to the reaper thread stopped counting
before the reaper freed it, and an imported or exported block or memory of
its own given back to the block-maker thread never counted. So a read of no
release waiting and no command buffer live could find objects still
counted, freed a moment later. The harness's churn rows, the replay
player's settled reads and the matrix take that read for every release
done. Round K's churn_all_day failed so on the RTX 2080 (m3-max-81680: an
iteration's plane stand-in, its export, 4 textures and 3 attachment views
still counted at the 200th read) and on the RTX 5080 (m3-max-81692: a
whole iteration's set counted at the 100th read).
Now a release counts until it is done:
- Reaper::give counts a free or a released image as it queues it, before
the reaper can take it; the reaper's run and its drain at the core's drop
count it done once its free ran. A teardown job is no release.
- Pool::give_back_own and give_back_loose count the block given back
before the block-maker thread can take it; the block-maker thread and
free_all count it done once it is freed and an import's release ran.
- A release that waited for work and goes on to the reaper rises at the
give and falls for its wait after, so it counts without a gap.
No sleep and no retry: the settled read waits on the same gauge, which now
covers every queue a release passes through.
Docs: Gauges::releases_waiting and the runtime README's gauge list say what
it counts and that a read of 0 with no command buffer live comes after every
release made before it is done.
Test: argument_tier's every_device_holds_a_release_until_the_work_committed_before_it_retires
holds the reaper across the releases; it now waits for the index to be
vacated, expects the texture's image handed to the held reaper to still
count, and expects the gauge at 0 once the reaper goes on.
Round K's 2080 leg (m3-max-81680) failed the harness's churn_all_day: from
the 100th iteration to the 200th, textures 0 -> 4, attachment_views 0 -> 3,
blocks 8 -> 9, exports 0 -> 1, plane_stand_ins 0 -> 1, and nothing live at
the device's drop. Round K's 5080 leg (m3-max-81692) failed it the other
way, a whole iteration's set read at the 100th and gone at the 200th. The
row's settled read waits for no release waiting, no command buffer live and
two reads 20 ms apart that agree. Gauges::releases_waiting stops counting an
object once the block-maker thread hands it to the reaper thread, before
the reaper frees it, and never counts an imported or exported block given
back, which the block-maker thread frees. A reaper busy with another job or
a look at the pipeline cache, or a block-maker thread busy with a free or a
make, leaves the read settled with the objects still counted.
New device tests, tests/releases_done.rs:
- every_device_counts_a_view_the_reaper_has_not_freed_as_a_release_waiting:
with the reaper held in its look at the pipeline cache (Caches::look_hold),
a texture view dropped with nothing in flight and nothing waiting is still
counted in textures, and is to count as one release waiting; let go, both
fall together.
- every_device_counts_an_import_the_block_maker_has_not_freed_as_a_release_waiting:
with the block-maker thread parked before its first work
(MakerTest::Park), a host import given back is still counted in imports
and its release has not run, and it is to count as one release waiting;
let go, the release runs and both fall together. A device that imports
no host memory says so.
Expected red: today each reads no release waiting while the object is
still counted.
b3ee209881 lowers render_command's draw_patches (it wrote a refusal before), and compiles a
post-tessellation vertex function of a state made for indirect command buffers under
LoweringInputs::indirect_range, so a kernel that encodes patch draws, and such a vertex function,
translate to other words under an unchanged key. The golden tables are re-blessed on development.
Main's ask for the new public field IndirectCommandLimits::tessellation_stages: the ICB section
now states what the floor reads before it enables the two extensions, and each limit it keeps,
with the field that holds it. docs/API.md describes no indirect command limit (the translator's
guide), so it is unchanged. REFUSALS.md regenerated with no change: it lists Gap variants and
their sites, and the new kind is a value of Gap::IndirectCommandBuffers's kind at a site it
already lists (new_indirect_command_buffer).
The 2080's replay of indirect-range-gpu-written-patch-draws (RTX 2080, NVIDIA 620.70.06, job
m3-max-81601 at 20105bb4bf) compared every texel with Metal's and diverged at case/notices alone:
the tessellating pipeline announced tessellation-winding, tessellation-factor-edge-cases and
tessellation-triangle-order, which every row that draws a patch declares. The row now declares
them through tessellation_sweeps::tessellation_notices. None moves a texel of a quad patch of
level 1, whose two triangles cover its rectangle in any order and winding.
The same job ran the runtime's indirect tests on the 2080, 27 passed, the patch draws' test
among them, and the four other range rows announced and justified as before.
CONFORMANCE-COVERAGE.md regenerated with no change.
The owner's 3406 order, the planner's next indirect command kind: MTLIndirectCommandTypeDrawPatches.
Translator (lower/access/icb.rs): a render_command's draw_patches writes VkDrawIndirectCommand (the
patch count, the instances, the patch start and the base instance) where a plain draw's goes, and
in the index token's 16 bytes, which a buffer of patch draws does not read as a token, the
tessellation factors' Metal address and the patch indices' (0 for the null pointer). The records
stay one shape for every kind (pipeline::IndirectDrawLayout::factors and ::patch_indices name the
two places). The control-point count is not read, as a direct patch draw does not read it; the
factors' instance stride and the factor scale are read only under a per-instance step function or
tessellationFactorScaleEnabled, which the runtime refuses at the pipeline state. A
post-tessellation vertex function of a state made for indirect command buffers is compiled under
LoweringInputs::indirect_range (pipeline/compile.rs), so each evaluation tests its command against
the execution range as a plain vertex function does.
Runtime: Device::new_indirect_command_buffer takes DRAW_PATCHES alone, the buffer's kind
CommandDraw::Patches. Its command layout pushes the factors' and patch indices' addresses where
the state's control stage reads them (FieldValue::TessellationFactors, FieldValue::PatchIndices),
holds no index buffer token and ends in TOKEN_DRAW; the layout and each execution name the
tessellation control and evaluation stages beside the vertex and fragment ones
(dgc::PATCH_STAGES). An execution of patch draws draws a patch list with a post-tessellation state
and reads no tessellation factor buffer of the encoder's; a state that is not post-tessellation
is Refusal::PatchDraw, as is a post-tessellation state with a buffer of other draws, and a state
of a control-point index type Refusal::PatchDrawWithIndexType, as for a direct patch draw.
VUID-vkCmdExecuteGeneratedCommandsEXT-supportedIndirectCommandsShaderStages-11060 requires the
bound stages in the device's supportedIndirectCommandsShaderStages, so the floor reads whether
they hold the tessellation stages (IndirectCommandLimits::tessellation_stages) and a buffer of
patch draws is refused without them, a new kind, IndirectCommandsKind::TessellationStages.
Mesa's source answers VK_SHADER_STAGE_ALL_GRAPHICS on RADV and VK_SHADER_STAGE_ALL on lavapipe.
Two draw kinds together, DRAW_INDEXED_PATCHES and the rest stay CommandTypes.
Docs: the runtime README's ICB section and refusal line; the API guide's section 1; METAL-COVERAGE
(coverage.tsv); CONFORMANCE-COVERAGE regenerated; the API signature table blessed for the new
field, methods and variant. REFUSALS.md regenerated with no change.
Tests: the red commit's engine test and runtime device test, with the device test's arm for the
TessellationStages refusal; a unit test of the patch tokens; the floor's limits test reads the
tessellation stages.
The owner's 3406 order, next kind after plain draws: MTLIndirectCommandTypeDrawPatches. Today
the translator refuses a kernel's draw_patches (Unsupported{GpuEncodedIndirectCommands,
NotImplemented}), and the runtime refuses a descriptor of DRAW_PATCHES (Gap::IndirectCommandBuffers,
CommandTypes).
- Engine: icb_merged_patches compiles and validates under the identity domains on every
profile. Red: refused today.
- Runtime, under a device cfg: four patch draws the kernel encodes draw what the same draws
direct draw. Each has three vertex buffers, one quad patch of one control point from patch i,
no patch index buffer, level-1 factors, one or two instances and its own base instance. The
arms are all four commands, commands 1 and 2, the range 2 and 3 a buffer holds, and
executions around a direct draw. A buffer of patch and plain draws together is refused,
CommandTypes. Red: the buffer of DRAW_PATCHES is refused today.
- Conformance: the row indirect-range-gpu-written-patch-draws and its Metal recording are in
a4dde5f4b0.
Jobs: the red runs are named in the hand-over.
Metal's answer for the patch-draws range row, recorded on the Apple M3 Max (macOS 27.0.1,
26A434) at 0616460f73 by job m3-max-81499, with its times (8 rounds, the same job). The
execution completes, and commands 1 to 5 draw rows 2 to 11. Each texel holds the command's
mark, the patch index i, the instance and the base instance i. The instance a post-tessellation
vertex function reads counts from the base instance: an odd command's second instance reads
i + 1, an even command's only instance reads i.
The ledger's Iris Xe row is the Extension refusal, as for the other range rows: the Iris Xe
lists no VK_EXT_device_generated_commands. CONFORMANCE-COVERAGE.md is regenerated.
Red: the runtime refuses an indirect command buffer of DrawPatches (CommandTypes), so the
row's replay meets a refusal that the ledger does not list.
scripts/regen-air-fixtures/regen-air-fixtures.sh icb_merged_patches on the Apple M3 Max (Apple
metal version 32023.922, macOS SDK 27.2 26B118), job m3-max-81495: icb_merged_patches.ll and
.air.ll, and the fixture's TOOLCHAIN line. The engine inventory and the air_input printouts take
the fixture when they are re-blessed on development.
The next indirect command kind after plain draws: MTLIndirectCommandTypeDrawPatches.
icb_merged_patches is an owned fixture. Its kernel encodes command i as one quad patch of one
control point from patch i, with no patch index buffer and level-1 half factors, one instance
for an even command and two for an odd one, from base instance i, with vertex buffers 0 to 2
of its own. The post-tessellation vertex function lays patch p over the rectangle from xy[2p]
to xy[2p + 1]. Each texel then holds its command's mark, the patch index, the instance and the
base instance.
indirect_ranges.rs gains the row indirect-range-gpu-written-patch-draws: commands 1 to 5,
written by a blit's copy before the pass, as the plain-draws row is. The fixture's AIR, the
expectations, the Metal recording and the ledger row follow in their own commits.
Owner 3406 follow-up to L212. A copy between two buffers whose ranges meet
in one block was refused (Refusal::BufferCopyOverlap, basis "ours"). Two
buffers placed over each other in a heap are aliases. Metal's validation
names copies between buffers among the defined copies between aliases in
a placement heap (job m3-max-81493), and plain Metal on an Apple M3 Max
gives memmove's bytes for them (probe overlapping_alias_copies.m, job
m3-max-81544).
Form (blit.rs):
- buffer_to_buffer takes whether the two are one buffer and answers
BufferChunks.
- Ranges apart are one chunk.
- Two buffers' ranges whose bytes meet are chunks no longer than the shift
|to - from|, the last chunk the rest. The chunk at the end the shift
points to goes first: the last first where the destination lies past the
source, else the first. So no command's source and destination share a
byte (VUID-vkCmdCopyBuffer-pRegions-00117, which each one-region command
meets on its own), and no chunk reads a byte an earlier one wrote.
- copy_from_buffer_to_buffer records one vkCmdCopyBuffer a chunk with the
slabs' execution barrier (between) between two, each counted as a blit
barrier. Every hazard between two chunks is a write after a read.
- Two ranges on the same bytes copy nothing.
- One buffer's overlapping ranges stay Refusal::BufferCopyOverlap. Its basis
is now metal-documented: Apple's page for the copy allows the same buffer
only "if size is less than the distance between sourceOffset and
destinationOffset". The conformance case buffer-blit-overlapping-copies
is one buffer, so its ledger row holds. Only its note's wording changed;
coverage.py regenerated with no change.
- A shift of n bytes takes size/n commands, rounded up. That is the fewest
any form without an intermediate takes.
Unit test a_copy_between_buffers_takes_ranges_inside_both_and_cuts_two_buffers_bytes_that_meet
(renamed) expects the chunk orders both ways, a partial last chunk, and
nothing for the same bytes. The rest of its cases are unchanged.
Docs: the copy's doc, BufferCopyOverlap (REFUSALS.md and basis.rs
regenerated), the runtime README's blit encoders, the tests' module doc.
Verified: refusal_surface.py --check exits 0. Green under the validation
layer, which fails a test on any message, so each one-region chunk met
VUID-vkCmdCopyBuffer-pRegions-00117 on these devices: the 27 blit tests pass
on lavapipe (llvmpipe, LLVM 23.1.4; job m3-max-81597), the AMD Radeon 780M
(RADV PHOENIX; m3-max-81592), the NVIDIA GeForce RTX 2080 (m3-max-81600) and
the AMD Radeon RX 7900 XTX (RADV NAVI31; m3-max-81671). The runs built the
series before its rebase onto development; the patches are the same.
Owner 3406 follow-up to L212. The runtime refuses a copy between two
buffers whose ranges meet in one block (two buffers placed over each other
in a heap) as Refusal::BufferCopyOverlap, basis "ours". Metal's validation
names copies between buffers among the defined copies between aliases in
a placement heap ("blitting between aliasing resources is defined on a
placement heap only when using a blit method copying entire texture
surfaces, or when copying between buffers"; job m3-max-81493). Plain Metal
on an Apple M3 Max gives memmove's bytes for such copies (probe
overlapping_alias_copies.m, job m3-max-81544): 64 KiB, the destination 4
or 4096 bytes past the source, and the reverse.
New device test every_device_copies_between_buffers_whose_bytes_meet_as_memmove:
- Three heap buffers over one Shared block: two at offset 0, one at 256.
- Copies 4 bytes on and back (1024 bytes), and 256 bytes on and back (1024
and 1000 bytes). Each expects the heap's bytes to be memmove's, every
other byte kept.
- Each expects a blit barrier a chunk more than a copy's one: 256 chunks
for the 4-byte shifts, 4 for the 256-byte ones. No byte is copied of the
runtime's own.
- Two ranges on the same bytes copy nothing and record no barrier.
- One buffer's overlapping ranges stay Refusal::BufferCopyOverlap.
Red as expected: every meeting case is refused today. The test fails on
lavapipe (llvmpipe, LLVM 23.1.4; job m3-max-81597), the AMD Radeon 780M
(RADV PHOENIX; m3-max-81592), the NVIDIA GeForce RTX 2080 (m3-max-81600) and
the AMD Radeon RX 7900 XTX (RADV NAVI31; m3-max-81671), with "4 bytes on: a
copy of 1024 bytes from 0 to 4 reads bytes it writes". The runs built the
series before its rebase onto development; the patches are the same.
Owner 3406 follow-up to L212: copies between buffers that alias in a
placement heap. Job m3-max-81544, an Apple M3 Max, macOS 27.0.1.
- With the API validation off, every buf-* case gave memmove's bytes in 8
of 8 rounds: two buffers at offset 0 of a Private placement heap, 64 KiB
with the destination 4 or 4096 bytes past the source, and the reverse.
One buffer into itself, 4 bytes on, gave the same.
- With MTL_DEBUG_LAYER=1, the one-buffer control runs with the same bytes.
Every two-buffer case ends the process inside the layer's own aliasing
check: "-[MTLDebugBuffer width]: unrecognized selector sent to instance",
from validateResourceAliasing under -[MTLDebugBlitCommandEncoder
copyFromBuffer:sourceOffset:toBuffer:destinationOffset:size:]. That is the
layer's fault, not a refusal. The layer's own assertion text, quoted
above it, names copies between buffers among the defined copies between
aliases.
Verified: the job's log, read whole.
Metal's API validation says a copy between aliasing resources in a placement
heap is defined "when copying between buffers". The runtime refuses two
buffers that overlap in one block as Refusal::BufferCopyOverlap.
The new buf-* cases measure Metal's answer:
- 64 KiB copied between two buffers at offset 0 of a Private placement
heap, the destination 4 or 4096 bytes past the source, and the source
past the destination;
- as a control, one buffer copied into itself 4 bytes on. Apple's page for
the copy allows that only where the size is less than the offsets'
distance.
A third buffer over the same bytes writes them first and reads them after.
Each round counts the bytes that hold memmove's answer.
Verified: xcrun clang -fsyntax-only -Wall -Wextra, no diagnostics.
Row L212. The test copies between Surface::buffer and its own plane, into
the plane and out of it from a row on. It ran only where the surface was in
place, so the copy form was not tested on any device.
The test now runs the copy form too, after the in-place form:
- A pitch multiple of 4096 asks every device for the copy form, as
tests/surface.rs's "copy-form" row does. In that form the plane is a
texture over the block's buffer in an image of its own, and crate::over
carries the bytes between them.
- Each form expects every byte of the surface to be the source's from before
the copy, every other byte kept.
- The copy form also expects no refusal and at least one counted over copy
(Metrics::over_copies, every cause), so the run shows the path ran. Not
Metrics::over_copies_surface: memory_cause gives that cause only where the
memory's kind keeps the image from lying in place, and a plane at a pitch
of a multiple of 4096 is in the copy form for its pitch
(Copy(Pitch { plane: 0 })). An assertion on over_copies_surface failed on
lavapipe (job m3-max-81576) after the bytes had matched.
- The line printed per device gives each case's submissions and copies.
- The in-place counts are unchanged.
The doc cites the M3 Max's answer from probe overlapping_alias_copies.m,
job m3-max-81486: the source's bytes from before the copy between an
IOSurface's no-copy buffer and its own plane, a row on each way and 8 texels
along, into and out of the plane, with the validation layer passing each.
No product change. Verified, device tests under the validation layer, each
printing OpaqueFd, Copy(Pitch { plane: 0 }), rows 4096 apart, (submissions,
copies) [(1, 2), (1, 1)], 27 of 27 blit tests passed:
- lavapipe (llvmpipe, LLVM 23.1.4): job m3-max-81597;
- AMD Radeon 780M (RADV PHOENIX): job m3-max-81592;
- NVIDIA GeForce RTX 2080: job m3-max-81600;
- AMD Radeon RX 7900 XTX (RADV NAVI31): job m3-max-81671.
The runs built the series before its rebase onto development, with this
assertion's fix as a commit of its own; the patches together are the same.
Row L212. Metal's API validation stops a copy between aliases in a placement
heap unless it copies between buffers, between linear textures of one row
stride, or entire texture surfaces. Source: probe overlapping_alias_copies.m
on an Apple M3 Max, macOS 27.0.1, jobs m3-max-81486 and m3-max-81493. The
runtime refused all of these as Gap::OverlappingCopy. It now refuses what
Metal stops as Refusal::AliasingCopy, and records nothing for it.
Form (blit.rs):
- buffer_copy: a region that meets a heap texture's memory, either way, is
Refusal::AliasingCopy (Metal: "blitting between aliasing resources is
defined on a placement heap only when using a blit method copying entire
texture surfaces, or when copying between buffers").
- texture_copy: two textures whose memory meets, one placed in a heap, that
are not both heap textures copying a whole level into a whole level
(whole_level: origin 0, size the level's extent, the view's first level
taken off) are Refusal::AliasingCopy. A texture in place over a heap
buffer against a heap texture is refused even for a whole level (Metal:
"... only when both textures are linear and have the same
bufferBytesPerRow value").
- The whole level between two heap textures stays Gap::OverlappingCopy,
counted, per the planner's ruling. That is how the consumer reaches
copyFromTexture:toTexture:, which Metal's validation takes and the M3
answers with the source's bytes at 0, 128 and 8320 bytes apart. No copy
command and no cut reads no byte it writes
(VUID-vkCmdCopyImage-pRegions-00124). The form through an image of the
runtime's, counted, is built once a guest's run counts the gap.
Docs: blit.rs's module and copy method docs; error.rs's Gap::OverlappingCopy
(REFUSALS.md regenerated); Metrics::overlapping_copies_refused; the runtime
README's blit encoders and their known gaps, which carry the M3's answer
and the VUID. The README also cites the M3's answer for a surface's buffer
and its own plane (job m3-max-81486). No conformance ledger row covers
these shapes.
Verified: refusal_surface.py --check exits 0. Green under the validation
layer, which fails a test on any message: the three tests pass, with the
rest of the 27 blit tests, at the series' tip on lavapipe (llvmpipe, LLVM
23.1.4; job m3-max-81597), the AMD Radeon 780M (RADV PHOENIX; m3-max-81592),
the NVIDIA GeForce RTX 2080 (m3-max-81600) and the AMD Radeon RX 7900 XTX
(RADV NAVI31; m3-max-81671). The runs built the series before its rebase
onto development; the patches are the same.
Row L212. These copies were all Gap::OverlappingCopy: a copy between a
texture placed in a heap and a resource whose memory meets it.
On an Apple M3 Max, macOS 27.0.1, the conformance probe
overlapping_alias_copies.m (jobs m3-max-81486 and m3-max-81493) shows that
Metal's API validation stops most of these shapes with
"blitting between aliasing resources is defined on a placement heap only
when using a blit method copying entire texture surfaces, or when copying
between buffers":
- a buffer and a texture over its bytes, either way;
- the region method between two heap textures that alias.
It stops a heap texture and a linear texture over a heap buffer at its
bytes with "... only when both textures are linear and have the same
bufferBytesPerRow value". It passes copyFromTexture:toTexture: between two
heap textures that alias. The consumer copies that as whole levels through
copy_from_texture.
The new Refusal::AliasingCopy (Basis: metal-measured) names the shapes
Metal stops. docs/REFUSALS.md, error/basis.rs and api_signatures.tsv are
regenerated. A whole level into a whole level between two heap textures
stays Gap::OverlappingCopy, per the planner's ruling. Nothing produces the
new variant yet.
Tests:
- textures_whose_memory_meets_where_one_is_laid_out_by_the_device_are_refused_or_copy_in_no_order
(unit, renamed) expects the two heap textures' whole-level copy still to
copy in no order. It expects part of a level, either way and at an offset,
and a texture in place over the heap texture's bytes, either way, to be
Refusal::AliasingCopy.
- a_buffer_copy_over_its_texture_s_own_bytes_copies_in_slabs_or_in_no_order
(unit) expects a region meeting a heap texture's memory, into it and out
of it, to be Refusal::AliasingCopy.
- every_device_refuses_a_copy_between_heap_resources_whose_memory_meets
(device) expects the whole level onto its alias to be the counted gap,
and part of a level onto its alias and the heap buffer either way to be
Refusal::AliasingCopy. Nothing is recorded, and one refusal is counted.
Verified: refusal_surface.py --check exits 0, and signatures.py --bless adds
the one variant row. Red as expected, under the validation layer, on
lavapipe (llvmpipe, LLVM 23.1.4; job m3-max-81597), the AMD Radeon 780M
(RADV PHOENIX; m3-max-81592), the NVIDIA GeForce RTX 2080 (m3-max-81600) and
the AMD Radeon RX 7900 XTX (RADV NAVI31; m3-max-81671): the three tests
fail. The device test says "part of a level onto its alias:
Err(Unsupported(OverlappingCopy { pixel_format: RGBA8Unorm }))", the unit
tests "not a refusal: it was checked". The runs built the series before its
rebase onto development; the patches are the same.
Row L212. The probe header now records the two oracle jobs on an Apple M3
Max, macOS 27.0.1: m3-max-81486 (heap-* and surface-*) and m3-max-81493
(tex-*).
- With the API validation off, every copy between aliases gives the
source's words from before the copy, in 8 of 8 rounds each.
- Metal's API validation ends the process at these copies:
- a buffer and a heap texture over its bytes;
- the region method between two heap textures that alias, over the whole
level or a part of it;
- copyFromTexture:toTexture: between a heap texture and a linear texture
over a heap buffer at its bytes.
The header quotes each assertion's text.
- Metal's API validation passes copyFromTexture:toTexture: between two heap
textures that alias, and every copy between an IOSurface's no-copy buffer
and its own plane.
Verified: the two jobs' logs, read whole.
Row L212. On an M3 Max, the first round (job m3-max-81486) found these
answers under Metal's API validation:
- A copy between a heap buffer and a heap texture over its bytes ends the
process: "blitting between aliasing resources is defined on a placement
heap only when using a blit method copying entire texture surfaces, or
when copying between buffers."
- copyFromTexture:toTexture: between two identical textures at one offset
passes the validation.
The new tex-* cases ask which texture-to-texture copies count as "entire
texture surfaces", and what the M3 gives for them:
- copyFromTexture:toTexture: with the second texture one alignment on, and
half its bytes on;
- the region method over the whole level, at offset 0 and half on;
- the region method over a quarter of the level;
- a heap texture and a linear texture over a heap buffer at the same bytes,
each way.
Verified: xcrun clang -fsyntax-only -Wall -Wextra, no diagnostics.
Row L212. Two copy shapes have no M3 answer on record:
- A texture placed in a placement heap and a buffer or texture of the heap
placed over its bytes. The runtime refuses this as Gap::OverlappingCopy.
- An IOSurface plane's texture and a no-copy buffer over the surface's own
bytes. The runtime copies this a row at a time from the source as it was
before the copy (Surface::buffer and its plane).
overlapping_alias_copies.m runs each shape as one blit command alone, one
case a process, 8 rounds each. Each round prints, word by word, whether the
destination holds the source's bytes from before the copy, and for the
surface, the word an in-place copy front to back or back to front would
leave. It also has controls with the heap's second resource placed apart.
Verified: xcrun clang -fsyntax-only -Wall -Wextra, no diagnostics. No
measurement yet.
85b8af89a4 lowers render_command's draw_primitives of triangles (it wrote a refusal before),
so a kernel that encodes plain draws translates to other words under an unchanged key. The golden
tables are re-blessed on development.
5781011f02 gave indirect-range-gpu-written-plain-draws its point-size notice allowance and left
docs/CONFORMANCE-COVERAGE.md one line behind it (coverage.py --check: not what the suite's
sources and recordings derive). Regenerated; --check now says as derived.
`conformance times --runs 8 --write indirect-range-gpu-written-plain-draws`, built --release
at 484725a4d4, on the Apple M3 Max, macOS 27.0.1 (26A434), job m3-max-81417. The recording
gained one time record (native Metal, 8 rounds) and nothing else: a comparison of the JSON
before and after shows `times` the one key added and every other key equal. This is what
times::every_case_is_timed::every_case_carries_its_timing asked of the new case (it failed in
m3-max-81226 at d14977bfcf).
The lavapipe proof (llvmpipe, job m3-max-81225) compared the new row divergent at
case/notices alone: icb_merged_vertex writes [[point_size]], so the render state carries
the static note device-point-size on a device whose largest point is below Metal's
(llvmpipe's 256), and the case declared no notice. The plain row now declares it, as
render_draw_forms does for the same fixture; no value is loosened. The indexed rows'
vertex function writes no point size and declares nothing.
Clippy (job m3-max-81227) refused the shapes cache's key tuple as too complex; it is
now the ShapeKey alias. No behaviour changes.
docs/API.md section 1 listed the render_command operations a function writes under the identity
domains; draw_primitives of triangles joined them in d14977bfcf. Its arguments go where an indexed
draw's do. Docs only.
The owner's 3406 order, the planner's first indirect command kind: MTLIndirectCommandTypeDraw.
Translator (lower/access/icb.rs): a render_command's draw_primitives of the constant triangle type
writes VkDrawIndirectCommand (vertex count, instances, vertex start, base instance) where an
indexed draw's VkDrawIndexedIndirectCommand goes, 20 bytes past the index token's place, and
writes nothing else. Both kinds share the records (pipeline::IndirectDrawLayout), so an encoding
writes one shape whatever buffer it reaches. A kernel cannot know a buffer's kind when it is
translated, because it reaches the buffer through an argument buffer. A reset's draw of nothing
reads as either kind's. Points and lines stay refused, as for indexed draws, because an execution
draws one topology.
Runtime: Device::new_indirect_command_buffer takes DRAW alone as well as DRAW_INDEXED alone, and
the buffer keeps its kind (indirect::CommandDraw). An execution's command layout follows the
kind. A layout of plain draws holds no index buffer token, which
VUID-VkIndirectCommandsLayoutCreateInfoEXT-pTokens-11095 forbids there, and ends in TOKEN_DRAW.
Its tokens are one fewer. The execution shapes' cache keys on the kind, and the reset templates
serve both kinds.
DRAW together with DRAW_INDEXED stays a typed refusal, CommandTypes, until the planner rules. A
layout takes one draw token (VUID-...-11100), and no form found draws both kinds in command order
at a bounded cost: two executions reorder the commands, an execution per command costs two a
command, and identity indices hold only as many vertices as a bound buffer of them. The
CommandTypes doc, the runtime README's ICB section and its refusal line say so.
Docs: the README ICB section; METAL-COVERAGE (coverage.tsv: "plain or indexed triangle draws");
CONFORMANCE-COVERAGE regenerated for the new row's recording and ledger row. REFUSALS.md
regenerated with no change.
Not run on an Intel card: the Iris Xe lacks VK_EXT_device_generated_commands, so its ledger row
is the Extension refusal; the four-card proof jobs are named in the hand-over.
Metal's answer for the plain-draws range row, recorded by job m3-max-81211 on the Apple M3 Max
(macOS 27.0.1, 26A434) at 873654c61e, plain and under Metal's validation layer: the execution
completes and commands 1 to 5 draw rows 2 to 11. Each texel holds the command's mark, the
provoking vertex's vid (6i or 6i + 3), the instance_id and the base instance i. The instance_id
counts from the base instance: an odd command's second instance reads i + 1, an even one's only
instance i.
Red at 873654c61e, job m3-max-81207 (msi, lavapipe): the engine test refuses
icb_merged_triangles (GpuEncodedIndirectCommands, NotImplemented), and the runtime's plain-draws
test meets 'indirect command buffers of CommandTypes are not built' on llvmpipe.
Job m3-max-81201 (msi, lavapipe) at 2ce4455b36 did not compile the runtime's tests: the match on
new_indirect_command_buffer's Result printed its other arm with {:?}, and IndirectCommandBuffer
is not Debug. The check now matches the Result's error, an Option. The engine leg of that job
was red as meant: a_kernels_plain_triangle_draws_into_commands_compile_under_the_identity_domains
failed and the four other engine tests passed.
The owner's 3406 order: every unbuilt indirect command kind Metal gives every Mac device is a
refusal to build, and the planner ranked MTLIndirectCommandTypeDraw first. Today the translator
refuses a kernel's draw_primitives (Unsupported{GpuEncodedIndirectCommands, NotImplemented}) and
the runtime refuses a descriptor of DRAW (Gap::IndirectCommandBuffers, CommandTypes).
- Engine: icb_merged_draws's icb_merged_triangles compiles and validates under the identity
domains on lavapipe and moltenvk-m3 (red: refused today). Its points and lines kernels stay
refused, since an execution draws one topology.
- Runtime, under a device cfg: four plain triangle draws the kernel encodes (three vertex buffers
each, their own vertex starts, one or two instances and base instances) draw what the same draws
direct draw: all four, commands 1 and 2, the range 2 and 3 a buffer holds, and executions around
a direct draw. A buffer of DRAW and DRAW_INDEXED together stays CommandTypes, until the planner
rules on that mix. Red: the buffer of DRAW is refused today.
- Conformance: a fourth GPU-written range row, indirect-range-gpu-written-plain-draws: eight
plain triangle draws the kernel encodes, commands 1 to 5 in a range a blit writes. The range
rows now state their command type (EncodedRange::command_types); the three indexed rows keep
their inputs byte for byte. The Iris Xe's ledger row is the same Extension refusal as the other
three range rows. Metal's recording follows in its own commit, taken on the M3. Red: the
runtime refuses the buffer, CommandTypes, a row the ledger does not hold.
Jobs: the red runs are named in the hand-over.
The known gap's make time now names three integrated devices: a 1920 by 1080 BGRA8Unorm
texture in place over host memory takes, median and largest of 16 makes in microseconds, 848 and
1149 on the Apple M3 Max, 720 and 1426 on the Radeon 780M and 3499 and 3927 on the Iris Xe; a
16 by 4 one 436, 278 and 420; a make that is the counted copy 25 to 60.
Verified: host_make's lines from the seam test at the commit before, whose tree differs from this
one by this paragraph alone: Radeon 780M (RADV, Mesa 26.2.6) job m3-max-81798, 18 of 18 passed;
Iris Xe (ANV, Mesa 26.2.6) job m3-max-81801, 18 of 18 passed. The M3's figures are from job
m3-max-81753 at the RUNTIME_VERSION commit, 12 of 12 passed.
The restore pair inside a make of a texture over host memory copies the texture's bytes out and
back, so the make's time grows with the texture's size. The known gap now gives the make's time on
the Apple M3 Max under KosmicKrisp 26.3.1: a 1920 by 1080 BGRA8Unorm texture in place, 848
microseconds (median of 16, largest 1149); 16 by 4 texels, 436; a make that is the counted copy,
25. The paragraph is reflowed to the README's width.
Verified: the figures are host_make's lines from the seam test at the commit before, job m3-max-81753
(12 tests run, 12 passed).
The runtime now makes a texture over host memory's import in place on an integrated or CPU
device, restores its bytes in a submission of its own inside the make, counts that pair under
OverCause::HostMemoryRestore, and offers Buffer::new_texture_in_place with its refusal
TextureNotInPlace. A run of an unchanged artifact may therefore submit and record something else,
and refuse something else, under an unchanged key. None of the validation crate's runtime inputs
changed, so runtime-sources.sha256 holds. SEMANTICS_VERSION does not move: nothing compiled
changed.
Verified: Gate job m3-max-81765 (clippy in three configurations, Rustdoc, the runtime's private
Rustdoc, and the runtime, translator, validation and conformance suites) passed with the series'
final code, the runtime guard among the validation suite's tests.
The restore pair inside a make copies the texture's bytes out and back, so a make's time grows
with the texture's size, and the 16x4 timing does not show it at a video frame's size. The test
now also makes a 1920x1080 BGRA8Unorm texture over an import of its own sixteen times, prints the
median and largest make, whether the frame was in place and the restore copies and bytes counted
across the sixteen, and asserts that an in-place frame's make counted its pair (32 copies) by its
return.
Verified: the 1080p make's median and largest, in microseconds: Apple M3 Max 848 and 1149 (job
m3-max-81753), Radeon 780M 720 and 1426 (m3-max-81798), Iris Xe 3499 and 3927 (m3-max-81801),
lavapipe 4249 and 14654 (m3-max-81750), each in place with 32 restore copies of 265,420,800 bytes in
all; the RTX 3090, the counted copy, 35 and 969 (m3-max-81792) with none.
The consumer makes a surface shape's image with no index of its own (Reach::Views), each guest
texture over it a view at the guest's index, and needs the in-place image made the same way. The
planner agreed that this rides N, one call: new_texture_in_place maps index None to Reach::Views
for any usage, as the crate-private Buffer::new_plane_texture does; Some(index) stays
Reach::Index, given exactly where shaders reach the texture, as new_texture takes it. The decision
whether the texture is in place is unchanged and still shared with new_texture.
Its doc says what None means against Metal: Metal gives every texture made from a buffer a
gpuResourceID of its own; one made with None has none (gpu_resource_id answers index 0, Metal's
nil texture to a shader, and a bind to a texture slot is Refusal::TextureWithoutIndex), and the
consumer answers the program through a view at the program's index. None is never
Refusal::TextureIndex. The runtime README says the same.
Verified on lavapipe, job m3-max-81750: tests/in_place_views.rs failed at the commit before (the
make in place alone with no index was refused) and passed two commits on, at the RUNTIME_VERSION
commit, with ShaderRead and with ShaderRead and PixelFormatView: views at an index in the image's
format, its sRGB sibling and R32Uint, retargets from it and onto it, and blits into and out of it.
With the series' final code (runs at its README commits, which change no code), the touched device
tests with in_place_views passed on the Apple M3 Max under KosmicKrisp 26.3.1 (job m3-max-81753, 12
of 12), the Radeon 780M (job m3-max-81798, 18 of 18), the Iris Xe (job m3-max-81801, 18 of 18) and
the RTX 3090 (job m3-max-81792, 18 of 18), each in both usages; gate job m3-max-81765 (clippy in
three configurations, Rustdoc, the runtime's private Rustdoc, and the runtime, translator,
validation and conformance suites) passed with the series' final code.
The consumer (video2) makes a surface shape's image with Device::new_texture_for_views
(Reach::Views): it takes no resource index of its own, and each guest texture over it is a view
at the guest's own index. To make that image in place it needs new_texture_in_place to take
index None the same way, as the crate-private Buffer::new_plane_texture maps None to
Reach::Views; today None is Refusal::TextureIndex for any usage shaders reach, and an index of the
consumer's own would take one outside the guest's numbering.
The test (tests/in_place_views.rs), on every device: an RGBA8Unorm texture of 8 by 8 at the
device's pitch over a Shared buffer, made by new_texture_in_place with index None, with ShaderRead
usage and, where the device makes it in place, with PixelFormatView too. It is in place with no
index of its own, and takes what a shape's image takes today:
- a view at the guest's index in its own format, which a draw samples texel for texel, and views
in its sRGB sibling and (PixelFormatView) R32Uint, whose blit copies out read the buffer's bytes;
- a retarget from it: a blit copies it into a Private image for views, whose view takes the
index, and a draw sampling the index reads the copy;
- a retarget onto it: its view takes another Private image's view's index, and a draw sampling
the index reads its texels;
- a blit copy into it writes the buffer's bytes at the pitch, read back by a copy out and a draw.
Expected red on every device: index None is refused with TextureIndex.
The planner ruled the seam (ii), for new_texture and new_texture_in_place alike, one form: the
restore pair of a texture in place over host memory's import runs in a submission of the
runtime's own inside the make, and the make returns after it completes. Metal touches no bytes at
a make, and a CPU write to a Shared buffer that no pending GPU command uses is fully defined.
Running the pair at the next submission on any queue let one thread's commit revert another
thread's write (reims: an app wrote its first frame into a fresh pool surface under a lock that
waits on nothing, and a later submission from another process ran the pair mid-write): a lost
write documented Metal never loses. The planner's earlier term (the pair in the texture's first
command buffer, held by an ordering test) is withdrawn. Discrete devices are untouched: they have
no pair.
Device::texture, for a texture whose image restores (Keep::Restore), has the upload that holds
its move home go at once, alone (WorkState::flush), and waits on the progress semaphore for it
(Done::wait), the pattern Texture::get_bytes and new_buffer's Private zeroing use. The upload's
barrier orders the save after the GPU work already submitted, so the make waits for that work
too. An encoded shared-event wait is held on the CPU and never submitted, so it never holds the
make's submission back. The make is refused in a scheduled handler (Refusal::InScheduledHandler),
which runs on the submit thread that the make waits for, as those calls are.
Docs: new_texture's and new_texture_in_place's, InScheduledHandler's list, the counters'
(HostMemoryRestore inside the make), check_over's and the homing comment; the runtime README's
Imported blocks paragraph and its known gap, which now says what remains (a host write from
another thread during the make) and carries the Radeon 780M row (Phoenix, RADV, job
m3-max-81673: 696 against 537 us a frame at one draw, 1025 against 793 at four);
docs/REPLAY-STREAM.md; AGENTS.md rule 2 ("after one counted copy pair at its making") and rule 3
("a counted copy pair at the texture's making restores the bytes"), in the planner's words.
Tests: host_in_place, over_causes and import count the pair at the make.
Verified on lavapipe, job m3-max-81704: the seam test failed at the commit before (exit 100) and
passed here (exit 0), with clippy under --cfg m2v_cpu_icd clean. With the series' final code (runs
at its README commits, which change no code), the touched device tests with in_place_views passed on
the Apple M3 Max under KosmicKrisp 26.3.1 (job m3-max-81753, 12 of 12), the Radeon 780M (job
m3-max-81798, 18 of 18), the Iris Xe (job m3-max-81801, 18 of 18) and the RTX 3090 (job
m3-max-81792, 18 of 18), the integrated three restoring in place inside the make (32 restore copies
over sixteen 1080p makes); gate job m3-max-81765 (clippy in three configurations, Rustdoc, the
runtime's private Rustdoc, and the runtime, translator, validation and conformance suites) passed
with the series' final code.
reims's case: an app makes a texture over a fresh pool surface and writes its first frame under a
lock that waits on nothing; a later submission from another process runs the save and write-back
of the in-place texture's bytes mid-write, and the bytes revert. The planner ruled the seam (ii),
for both calls, one form: the restore pair runs in a submission of the runtime's own inside the
make, which returns once it completed. Metal touches no bytes at a make, and a CPU write to a
Shared buffer that no pending GPU command uses is fully defined; running the pair at the next
submission on any queue lets one thread's commit revert another thread's write, a lost write
documented Metal never loses. The planner's earlier term (the pair in the texture's first
command buffer, held by an ordering test) is withdrawn.
The test, for new_texture and new_texture_in_place over host memory's import, each device in
both forms: the restore pair is counted by the make's return (in place: two copies; copied:
none), and no restore runs after it; bytes the CPU wrote before the make and after it returns
hold through a commit on another queue and a read; then, with another queue committing
throughout, bytes the CPU writes for 20 ms after the make returns hold. Off unified memory the
in-place-only make is refused for HostMemory. Sixteen timed makes print their median and
largest time.
Expected red on lavapipe and every integrated device: the pair is counted only at the next
submission, so none is counted by the make's return.
The planner accepted main's reading of reims's census B on the Apple M3 Max at this form (job
m3-max-81507, against the base at job m3-max-81498): 29 textures over host memory lay in place;
host memory's 2,327 counted copies, 982.3 MB with the in-place textures' restore pairs among
them, are at least 906 MB (92%) of textures with render-target usage, which KosmicKrisp makes no
linear colour attachment for, and six kinds read by shaders alone, of at most 32 KB each, carry
the rest, at most 76 MB. The entry states that bound beside the KosmicKrisp render-target
sentence and claims no more than the census's kind lines show.
Docs only.
A texture in place over host memory's import on an integrated or CPU device costs one save and
write-back of the bytes under its image around its move out of the undefined layout, once, at
its first use. Those two copies counted under OverCause::HostMemory, beside a copied texture's
copies at its uses, so a census could not tell an in-place texture's kind line from a copy's.
The planner ruled (row 1, pin N) that the pair stays counted, in count and bytes and in the
totals, under a cause that says what it is.
The upload's restore now counts under OverCause::HostMemoryRestore, in
Metrics::over_copies_host_memory_restore and over_copy_bytes_host_memory_restore, and still in
over_copies, over_copies_imported and bytes_copied; its OverCopyKind carries that cause.
over_copies_host_memory counts the per-use copies alone. Docs: new_texture's, the runtime
README's Imported blocks and over-copy paragraphs, docs/REPLAY-STREAM.md's over-copy causes (now
twelve beside host memory's) and the frame line's host_memory part, which carries the restore
pairs.
Verified on lavapipe before the rebase onto 9ce9960452, job m3-max-81616: the tests failed at the
commit before (3 of 12 failed) and passed here (12 of 12). Then gate job m3-max-81765 (clippy in
three configurations, Rustdoc, the runtime's private Rustdoc, and the runtime, translator,
validation and conformance suites) passed with the series' final code.
The first-use save and write-back of a texture in place over host memory's import counts today
under OverCause::HostMemory, the cause of a copied texture's copies at its uses. A census then
reads an in-place texture's kind line as a host-memory copy: reims's census B on the M3 showed
six ShaderRead-only kinds under HostMemory that the code says are the in-place textures' pairs.
The planner ruled that the pair keeps being counted, in count and bytes, under a cause that says
what it is, so that HostMemory means the per-use copies alone again.
This commit adds OverCause::HostMemoryRestore and its Metrics pair
(over_copies_host_memory_restore, over_copy_bytes_host_memory_restore), with docs, the
api_signatures table blessed, and the replay's metrics list and its over-copies-by-frame
host_memory part carrying the pair. The tests now expect the pair there: host_in_place's first
test (the first use's restore pair alone, and no host-memory copy), its device-type test (in
place: the restore pair at the first read, nothing after; copied: one host-memory copy a read,
no restore), and over_causes's move home (two restore copies, no other cause).
Expected red on lavapipe and every integrated device: the pair is still counted under
HostMemory.
The consumer keeps a texture of its own where the runtime would make the counted copy of a
texture over a buffer, and needs the runtime's in-place texture everywhere else. Buffer::
new_texture_in_place makes what Buffer::new_texture makes where that texture is in place, and
refuses with Refusal::TextureNotInPlace { cause } where new_texture would make the copy, naming
the OverCause its copies would count under. A refusal makes no texture and counts no copy.
One decision in one place: Source::Over carries what the making does with a texture it would not
make in place (Unplaced::Copy for new_texture and a surface plane's texture, Unplaced::Refuse for
the new call). Device::texture refuses at the same two points where it chooses the copy: where
check_over names a cause, and where the linear image made does not lie as the texture's bytes do
(Unmade::Unfit). No new form and no new query: over host memory's import the choice is still
row 1's unified-memory query alone. A texture buffer is a view, never copied, and is made as
new_texture makes it.
The doc comment names newTextureWithDescriptor:offset:bytesPerRow: and lists what is refused;
texture_copy_cause's doc and the runtime README name the new call. docs/REFUSALS.md regenerated
(the refusal's two sites in texture); api_signatures blessed at the red commit.
Verified on lavapipe before the rebase onto 9ce9960452, job m3-max-81616: copy_cause's test failed
at the commit before (1 of 12 failed) and passed two commits on (12 of 12). With the series' final
code (runs at its README commits, which change no code), the touched device tests with
in_place_views passed on the Apple M3 Max under KosmicKrisp 26.3.1 (job m3-max-81753, 12 of 12), the
Radeon 780M (job m3-max-81798, 18 of 18), the Iris Xe (job m3-max-81801, 18 of 18) and the RTX 3090
(job m3-max-81792, 18 of 18); gate job m3-max-81765 (clippy in three configurations, Rustdoc, the
runtime's private Rustdoc, and the runtime, translator, validation and conformance suites) passed
with the series' final code.
The consumer asked for an in-place-only make of a texture over a buffer: the linear image in
place wherever Buffer::new_texture takes it, and a typed refusal naming the cause wherever
new_texture would take the counted copy, so that the consumer keeps those bytes in a texture of
its own and counts them.
This commit adds Refusal::TextureNotInPlace { cause: OverCause } (Basis: ours), its Display arm,
docs/REFUSALS.md and basis.rs regenerated, the api_signatures table blessed, and a stub
Buffer::new_texture_in_place that makes the ordinary texture. copy_cause's test now runs each
device in both forms (an integrated or CPU device through its two-copy view too), makes each
case in place alone beside the ordinary texture, and adds a render target over its texels alone,
an R8Unorm texture of 13 x 3 at the device's pitch, and RGBA8Unorm and R8Unorm textures over host
memory's import. It asserts that the in-place-only make is in place where texture_copy_cause
answers in place, and elsewhere refused for that cause with no texture made and no copy counted.
Expected red on every device: the stub makes the counted copy where the answer is a cause (the
pitch case at least, on every device).
The planner's ruling on row 1 (a). The in-place form over a host-pointer import is chosen by rule 2's
unified-memory query, Vulkan's physical device type (Core::unified_memory, the query that keeps one
copy of a Managed buffer): in place on an integrated or CPU device, after one counted copy pair at its
first use; on a discrete or virtual device the per-use counted copy stays. The planner's earlier term
that deleted the per-use path is withdrawn by name: that path stays, for discrete devices alone. It
is the same query and the same form, widened, not a new one.
Grounds. On an integrated device a texture over Shared memory is already a linear image in place by
rule 3, on the ordinary Shared-buffer route and on the dma-buf import route, and pays the same linear
read; the host-pointer import was the one case still copying at each use. The speed pair (a scratch
timed test, never landed: a 1920x1080 RGBA8Unorm texture over host memory the CPU writes whole each
frame, read at every texel by a 1080p pass of 1 or 4 draws; base d69a0bda18, in place 99125586fb;
six alternating runs of 300 frames each, frame time in microseconds, per-use copy against in place):
- Apple M3 Max, KosmicKrisp 26.3.1, job m3-max-81356: 1016 against 843 (1 draw), 1043 against 888
(4 draws).
- Intel Iris Xe (RPL-P), ANV Mesa 26.2.6, job m3-max-81425: 3069 against 2630 (1), 4810 against 5381
(4): a full linear read costs about 360 more than an optimal one and the copy about 480 to 500,
so in place costs more from about two full reads a frame. The planner: that loss is against the
copy being removed, in a kernel built to be its worst case, a recorded cost of the linear form,
not a guest-shown regression; reims's census B on the M3 is the real-workload row.
- AMD RX 7900 XTX on OCuLink, RADV Mesa 26.2.6, job m3-max-81416: 1602 against 1561 (1), 1743
against 1579 (4), within the spread: in-place reads at the copy's own rate, about 6.7 GB/s.
- NVIDIA RTX 3090 behind Thunderbolt, 620.70.06, job m3-max-81379: 5219 against 12522 (1), 5291
against 12564 (4): the copy at about 1.98 GB/s, in-place reads at about 0.72 GB/s.
check_over lays a texture over host memory's import in place only where core.unified_memory();
elsewhere memory_cause names OverCause::HostMemory, the counted copy at each use. AGENTS.md: rule 2's
unified-memory clause gains the planner's words verbatim ("and a texture over a host-pointer import
in place on an integrated or CPU device, after one counted copy pair at its first use, and through
its per-use counted copy elsewhere"), and rule 3's host-pointer-import clause is limited to an
integrated or CPU device. The runtime README's Imported blocks paragraph names the device type, and
its known gap of memory blocks is one entry with the four rows. Buffer::new_texture's doc, the
counters' docs (OverCause::HostMemory, over_copies_host_memory, textures_in_place_over_imports),
REPLAY-STREAM.md and the device tests' docs say the same.
Verified before its rebases, on adba2693a1: on lavapipe, job m3-max-81460, the device-type test
failed at the commit before (1 of 2 failed) and passed here (2 of 2); the touched device tests
passed 15 of 15 on the Apple M3 Max under KosmicKrisp (job m3-max-81454), the Iris Xe
(m3-max-81456), the RX 7900 XTX (m3-max-81503), the RTX 3090 (m3-max-81555, the per-use copy) and
the Radeon 780M (m3-max-81556, in place); gate m3-max-81446 passed. Then gate job m3-max-81765
(clippy in three configurations, Rustdoc, the runtime's private Rustdoc, and the runtime,
translator, validation and conformance suites) passed with the series' final code.
The planner's ruling on row 1 (a): the in-place form over a host-pointer import is chosen by rule 2's
unified-memory query, Vulkan's physical device type, as one copy of a Managed buffer is: in place on
an integrated or CPU device, after one counted copy pair at its first use; through its per-use
counted copy on a discrete or virtual device. Grounds: on the RTX 3090 (job 81379) a 1080p texture
read in place across the card's link took 12522 us a frame against 5219 us for the per-use copy,
while on the M3 (job 81356) in place took 0.829 and 0.852 of the copy's frame time.
each_device_takes_a_texture_over_host_memory_in_place_by_its_device_type runs in both forms
(each_device_in_both_forms): on an integrated or CPU device it asks in place, counted once in
textures_in_place_over_imports, the pair at the first read and nothing at the second; through the
two-copy view, and on a discrete device, the counted copy, one copy in of the texels' bytes at each
read and nothing back, and no count of a texture in place. It prints both counters per card.
Expected red at this commit: the two-copy view on lavapipe takes the texture in place.
A texture over a buffer in host memory's import (Device::import_host_memory) used to be the counted
copy at every use. Its bytes were copied into an image of its own before each submission that used
it, and back after each write. Now it is in place: the device's linear image, made for host
memory's handle, bound in the import's own memory. The condition is that the external image query
for VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT answers the linear image importable,
compatible and not dedicated-only, and that the image passes the tests of any texture over a
buffer in place.
This is not a new copy. It is the existing last form made smaller: one copy pair in the texture's
life, in place after it, on documented behaviour only.
- Created UNDEFINED: an image bound in imported memory names the import's handle type
(VUID-vkBindImageMemory-memory-02989), so it starts undefined
(VUID-VkImageCreateInfo-pNext-01443).
- Saved and written back around the one transition: a move out of the undefined layout may
discard the bytes (Vulkan 1.4, section 7.1.1).
- Host access by memory-domain operations: host memory has no other side whose release an acquire
could match (section 11.2.6).
The image's one move home is in the upload ahead of the first command buffer submitted after the
making, from any queue, in this order:
1. a barrier from every earlier command's writes, including earlier submissions on the one
queue, to the save;
2. a copy of the bytes bound under the image into a Private block taken at the making;
3. the move, in a barrier that waits for the save's reads;
4. the write-back, with a barrier between write-backs, since two imports of the same pages may
meet;
5. a barrier from the write-backs to every later command and the host.
The block goes back once the upload retires. A later use copies nothing. Where the query offers no
linear image of the format and usage, the texture stays the counted copy at each use. On the Mac
driver that is every render target, since it makes no linear colour attachment.
Counts:
- the two copies count in Metrics::over_copies_host_memory (and over_copies, over_copies_imported,
bytes_copied), each of the bytes bound under the image;
- new: Metrics::textures_in_place_over_imports counts each texture in place over an import, host
memory's or a dma-buf's, at its making;
- the replay's frame metrics carry it.
Docs, in this commit:
- AGENTS.md rule 3's first exception gains the planner's clause verbatim;
- the runtime README's Imported blocks gives the form, and states the two VUIDs' rule in plain
words;
- its known gap gives the pair, the window while the upload runs (a host write may be lost, and a
host read may see the bytes undefined), and which formats and usages keep the per-use form on
which driver, by query;
- REPLAY-STREAM.md and Buffer::new_texture's doc follow.
Tests:
- host_in_place gains two checks: a fill submitted before the making and not waited for is in the
first read, and the texture counts once at its making;
- over_causes, import's texture test and imported_aliases now take either form, asserting in
place on lavapipe and the copy where the query refuses.
Verified on the system lavapipe (llvmpipe, LLVM 23.1.4), job m3-max-81271, filter host_in_place,
over_causes, import's texture test, imported_aliases, import_overs and layouts: 17 tests.
- Red at the commit before: host_in_place fails at its in-place assertion; the other 16 pass.
- Green, at a tree whose code equals this commit's: 17 of 17 pass. The restore pair is 2 copies,
512 bytes. In imported_aliases, the Half textures are in place, two pairs for two textures over
one import. Clippy -D warnings under --cfg m2v_cpu_icd is clean for the runtime and validation.
A device test for row 1's form. Under a device cfg, on every device that imports host memory, it
makes an RGBA8Unorm texture of 16 by 4 texels over a buffer spanning the import, at the device's
linear pitch. Where the external image query offers the linear image for host memory's handle
(lavapipe: Mesa's lvp_formats.c answers that handle importable), the texture is to be in place,
and three command buffers are each read exact:
- the CPU wrote the pages before the making and after it, before the commit; a blit reads both
writes through the texture, and one save and write-back pair (over_copies_host_memory 2, its
bytes between the texels' span and the import, each) are the command buffer's only copies;
- the CPU writes again; a blit reads the new bytes with no copy;
- a blit writes the texture; the pages hold its texels at the pitch, every other byte as the CPU
wrote it, with no copy back.
No command names the image preinitialized, and the moves keep their order. Where the query offers
no such image, the texture is the counted copy, printed, and the same reads hold.
Red at this commit: every texture over host memory's import is the counted copy, so on lavapipe
the in-place assertion fails.
CI run 47018745061 (at 9186e2fe46) passes macOS's validation suite. Its next
step, "Test the conformance suite", fails 2 of 1054 on the macos-26 runner
(macOS 26.7.2, 25G332):
- record_mode_counts_the_outcomes_it_saw_with_their_runs unwraps
Err(HostMoved { found: "macOS 26.7.2 (25G332)", named: "apple-m3-max on
macOS 27.0.1 (26A434)" });
- record_mode_refuses_a_case_whose_metal_run_stopped gets the same
HostMoved where it expects Refused.
These tests check record mode's logic through a stub side, but record mode
read the host's sw_vers directly. So on any Mac but the oracle, the host
check stopped them first.
Form:
- The Side trait gains macos_release (macOS only). Its default answers this
host's sw_vers -productVersion and -buildVersion (record::sw_vers, the
same reads check_host made). Metal's side and the runtime's side keep the
default.
- check_host takes the side and holds its release against ORACLE_OS_VERSION
and ORACLE_OS_BUILD as before. HostMoved and its text are unchanged. Off
macOS it is NoMetal, as before.
- watch::Watching forwards macos_release to the side it wraps, as it
forwards every Side call (the_announcing_side_forwards_every_call reads
the trait). docs/CONFORMANCE-COVERAGE.md is regenerated: the Side method
count is 135.
- The test StubSide states the oracle's release, so the record-mode tests
check record mode's logic on any Mac. on_release moves it.
- New test record_mode_refuses_a_host_that_is_not_the_oracle (macOS):
- a stub on macOS 26.7.2 (25G332) is HostMoved, naming both hosts;
- the oracle's release on another build is HostMoved too.
The rest of the macOS job after this step: only "Doc tests" (cargo test
--workspace --all-features --doc). Every later step is Linux-only. No
running doctest touches the host: the only doc code fence in macOS-gated
code is a text block in the conformance binary. Packaging and the
documentation steps run before this one, and passed in run 47018745061.
Verified: see the hand-over. The M3 runs no tests, so the macOS proof is
the next CI run.
87693a368c left surface.rs's one Gap use, Gap::D3d11SurfaceBuffer, in a #[cfg(windows)] arm,
so every other build warned of an unused import and clippy with -D warnings failed on it
(m3-max-81412: workspace clippy plain, m2v_gpu and m2v_cpu_icd all EXIT=101 at 417d86ac90). The
import is now cfg(windows), and the make's doc links Gap::TextureView by path.
Since c850655216, new_exported_surface answers a plane whose image in place lacks storage with
the copy form (SurfaceCopy::Usage) rather than Gap::SurfaceUsage. So the harness's churn probe
and the replay player's video surfaces can no longer reach their fallback to planes of shader
read alone, and this commit deletes it:
- churn.rs: the probe's retry and Video's usage field, replaced by one const usage;
- videos.rs: the retry, its read_only counter, and the report's "with planes of shader read
alone" count;
- REPLAY-STREAM.md and videos.rs's module doc now say the copy form takes such a device.
A device that lacks storage now shows in the report's copy-form count under its reason.
Checked by the hand-over job: clippy of the harness and validation crates, and the validation
suite.
new_exported_surface refused a plane whose texture asks a usage that its image in place does
not hold or export, ShaderWrite's storage for one, with Gap::SurfaceUsage. As ruled for row 5,
that plane now takes the counted copy form with its own reason, SurfaceCopy::Usage { plane }.
The copy form's texture over the block's buffer is an optimal image of the usage the texture
asks. The submissions copy it into the image and back (Metrics::over_copies), so a kernel's
write through a view of the plane reaches the exported bytes by that copy before the host or
the other API reads them.
How:
- Query::plane answers usage_verdict's reason in place of the gap. With nothing else to fail,
its return type drops the outer Result and the pixel_format it carried only for the gap.
- The feedback-loop retry skips Usage, as it skips Tiling and NoModifier, since dropping the
loop does not change the usage asked.
- Gap::SurfaceUsage stays for the Direct3D 11 import, and its doc now says that alone.
Docs, in this commit: the runtime README (the guide's storage paragraph, the copy form's list
of reasons, and a fifth case in the known gaps), REFUSALS.md regenerated (SurfaceUsage's row
and its sites) and the api_surface table (the new variant).
Tests:
- Verdict unit test a_plane_whose_tiling_lacks_an_asked_usage_takes_the_copy_form, with
synthetic features: a LINEAR tiling without STORAGE_IMAGE, where the optimal tiling has it,
takes Usage for a plane that asks storage, and lies in place for one that does not.
- The device test every_device_writes_a_surface_plane_through_a_shader_write_uint_view no
longer accepts Gap::SurfaceUsage at the make.
- The write-back through the copy form's own copy is the same copy_form path the device test
already ran at f997a251fc: on the RTX 3090 (NVIDIA 620.70.06, m3-max-81338) the dma-buf row
took Copy(Tiling) and the copy-form row Copy(Pitch); on the RX 7900 XTX (RADV, Mesa 26.2.6,
m3-max-81352) and lavapipe (Mesa 26.2.4, m3-max-81341) the copy-form row took Copy(Pitch).
Each had the kernel's 2,073,600 texels written through the ShaderWrite R8Uint view, read
back exactly from the surface's buffer.
- No device queried takes Usage for an R8 plane (the row 5 queries m3-max-81308, 81309,
81310, 81314, 81318, 81322 and 81353).
With a247e1ec2b the rt side answers newSharedTextureWithDescriptor:,
newSharedTextureHandle and newSharedTextureWithHandle:. Replaying the four cases on lavapipe
(Mesa 26.2.4, m3-max-81374) gave these results:
- the made, texture and handle sites compare against Metal's recording;
- a creator outside Private storage, and RGBA16Float_XR, answer nil as Metal does;
- 52 sites stayed refused, none divergent. This commit lists them:
- 40 sites read parentTexture, parentRelativeLevel, parentRelativeSlice and isShareable, on
the shared texture and its views. rt keeps no getter for them (TheConsumers), with the same
text as the views' existing rows.
- 8 resource and resource-after-handle sites read MTLResource's getters (TheConsumers), with
storageMode among them, so storageMode is not compared at those sites.
- 4 made sites for Private R10Unorm_X6, R10Unorm_X6_sRGB, RG10Unorm_X12 and
RG10Unorm_X12_sRGB, where rt makes no texture of the format (the same gap as
extended-swizzles-*'s rows; the 11-19 selector census found no stream that uses them).
All are venue *. CONFORMANCE-COVERAGE.md is regenerated (coverage.py --check: as derived).
The same job's full replay found no mismatch outside these four cases (52 in all, every one
listed here), and the conformance suite passed (1048 of 1048). The replay that shows these rows
holding is the hand-over's job.
957d59ecc1 kept the shareable textures in a set of u64, where a Handle is a u32; its build
failed (m3-max-81319, lavapipe, GREEN BUILD EXIT=101, E0308 at both uses). The set now holds
the handle's own type.
newSharedTextureWithDescriptor: is the texture newTextureWithDescriptor: makes, kept as
shareable; Metal's nil outside Private storage and for a format Metal makes no texture of
from a descriptor alone (texture_query::WITHOUT_TEXTURES, the list heap_metal_sizes already
asked, now shared) comes out nil, as measured on the M3 Max. newSharedTextureHandle and
newSharedTextureWithHandle: answer the handle of the one device and a clone of the same
Texture, shareable; a texture that is not shareable answers nil.
Not yet run: the replay of the four cases on lavapipe, and the ledger rows the getters of
the consumer's own (the resource getters, the parent facts and shareable) add at the new
sites, follow in their own commit.
The 31 rows of shared-creator-padded-format-storage, shared-creator-extended-range-samples,
texture-shared-handles and texture-view-descriptors at which the rt side answers
Unavailable(shared_texture) are dropped: the side is to answer newSharedTextureWithDescriptor:
and the handle calls as the runtime's consumer does on the runtime's one device, so each of
those sites compares against the M3 Max recordings (Metal's nil at Shared, Managed and
Memoryless, and for RGBA16Float_XR at Private; a texture at Private otherwise).
Red: the side still answers Unavailable, so a replay of the four cases fails on 31 refusals
the ledger does not list. CONFORMANCE-COVERAGE.md is regenerated (coverage.py --check: as
derived).
clippy's chunks_exact_to_as_chunks failed the test build under --cfg m2v_gpu and
--cfg m2v_cpu_icd (m3-max-81362, CLIPPY m2v_gpu EXIT=101, m2v_cpu_icd EXIT=101) at
f997a251fc's chunks_exact_mut(16); as_chunks_mut::<16>() takes the same texels.
view_list takes each format's features in the plane image's own tiling: LINEAR's for an
opaque handle's LINEAR image, the MOD_LINEAR modifier's for a dma-buf's modifier image, as
Vulkan 12.6.1 defines a view's format features. A format the modifier lists no features for
is no longer listed for a dma-buf's plane, so no view of it is made with empty format
features (VUID-VkImageViewCreateInfo-None-02273); a view in it is Gap::TextureView of
SurfacePixelFormat, as for a format the LINEAR tiling does not sample.
No device the tests run on routes a dma-buf export through NVIDIA, whose LINEAR tiling
samples the 8-bit UINT and SINT formats with no modifier listed for them (row 5's queries);
the AMD and Intel devices list MOD_LINEAR for every format they sample (780M m3-max-81314,
Iris Xe 81310). The verdicts test from the red commit passes.
surface.rs filtered an in-place plane's view formats by each format's LINEAR tiling
features whatever the plane's image is. A dma-buf's plane is a DRM_FORMAT_MOD_LINEAR
modifier image, whose view's format features are its format's drmFormatModifierTilingFeatures
for that modifier (Vulkan 12.6.1), and on a device whose LINEAR tiling samples a format the
modifier lists no features for, the list named a format no view of the image may take
(VUID-VkImageViewCreateInfo-None-02273). Row 5's queries found that on NVIDIA 620.70.06 and
615.71.09 (RTX 3090 m3-max-81318, RTX 2080 81309, RTX 5080 Laptop 81308): R8_UINT and
R8G8_UINT sample in LINEAR and list no modifier.
This commit is a refactor with no change in behaviour: the filter moves into view_list,
over TilingFeatures (a format's LINEAR features and its MOD_LINEAR modifier's) that
Query::tilings reads, and still reads the LINEAR features for both tillings (the same
SAMPLED_IMAGE bit as the legacy word it read). The new verdicts test,
a_plane_s_view_list_takes_the_formats_its_own_tiling_samples, gives synthetic features where
R8_UINT and the rest of the 8-bit list sample in LINEAR and list no modifier, and expects a
dma-buf's list empty: red.
A guard, not red. For each row the device exports (the VA-API dma-buf row, the NVIDIA
opaque-handle row and the copy-form row), on the 1080p picture, a surface whose luma has
ShaderRead, ShaderWrite, RenderTarget and PixelFormatView usage; an R8Uint view of the luma
that fpv_rgbx_write_uint writes from a buffer of values; then the surface's buffer, copied
whole to a Shared buffer, holds each written texel at the luma's offset and pitch as the
export states them. In place, a device whose linear image takes no storage usage may answer
Gap::SurfaceUsage at the make, or Gap::TextureView of SurfacePixelFormat at the view, each
printed.
This is the consumer's form for the exported planes a guest writes (row 5): the plane's own
image, viewed, with no storage shape and no copy. The row 5 format queries
(5080 m3-max-81308, 2080 81309, Iris Xe 81310, 780M 81314, 3090 81318, RX 550 81322) found
storage offered on the plane's linear and DRM_FORMAT_MOD_LINEAR images on every card, and
the layout unchanged by it; surface.rs already adds storage where the query offers it.
T1 (795edfb733) made every render pipeline without the attachment feedback loop's colour flag
and, at a state's first draw that reads its pass's attachment through a texture, made a flagged
one on the encoding thread. In a window-drag stream (windrag-780m-b4, to frame 500) that was 110
compiles at first use on each desktop card that the base (every pipeline flagged at its make)
did not have: 603.7 ms in all on the RX 7900 XTX with the driver's shader cache off
(m3-max-81076), 2.39 ms on the RTX 2080 (m3-max-80961). None of the 110 was a state whose
fragment function fetches its attachment ([[color(n)]]): T1 flagged those at their make. Each
was a draw handed its pass's attachment as a texture, which no state's make can know.
The ruled form decides the flag at the state's make from its functions' structure
(Draws::reads_textures): a state takes the flag on every pipeline where a function of any stage
can read a texture (a texture slot it reads, at any stage; a colour the fragment function
fetches; or a read beyond its slots, an argument buffer's texture or a resource ID, which the
structure cannot settle). A state whose functions read no texture never reads an attachment
other than as one, and takes no flag. No draw makes a pipeline for the loop: Raster's `loops`,
FirstUse::Loop and the content's per-raster flags go, and the content's later pipelines are
again at most 15.
Metrics::first_use_loop_waits, first_use_loop_wait_nanos and first_use_loop_wait_max_nanos go
with the site they counted (api_signatures.tsv), as do Raster's `loops` and FirstUse::Loop; the
replay's report drops their two keys. No consumer search was needed: T1 never reached a pushed
sha (origin is at 9186e2fe46, and T1 sits above it on development), so no consumer pin can hold
them.
Docs: the runtime README's attachment-read paragraph says which states take the flag; the first
use waits list drops the loop's; the known gap of render encoders for T1's first-use compile
gives way to one for the flag on the pipelines of every state that can read a texture, whether
or not a draw hands it an attachment, with what the flag costs a draw that reads none, and what
leaving it off saves, not measured on a tile-based phone GPU (no such device in the lab). The
floor table's VK_EXT_attachment_feedback_loop_layout row, Core::feedback_loop,
floor::Capabilities::feedback_loop and the render encoder's module doc say the same. No gain is
claimed for any device.
Verified at 00fe2f78be, this patch on development 795edfb733 (base = 59326c8dff, before T1),
then rebased onto d69a0bda18 with the same patch:
- Red/green: both tests of the red commit fail at it and pass here, on the RTX 2080 and on
lavapipe (llvmpipe, LLVM 23.1.4) in m3-max-81257, on the Iris Xe (RPL-P) in m3-max-81291 and
m3-max-81367, on the RX 7900 XTX (RADV NAVI31) in m3-max-81373 and on the RTX 3090 in
m3-max-81365. At the red commit the fragment test reads ((1, 0), (1, 0)) against
((1, 0), (0, 1)), and the vertex test (1, 0) against (0, 1).
- The stream's states, counted with a build of this tree that printed each content and each
render pipeline made (never committed; one play of windrag-780m-b4 to frame 500 on the 2080 in
m3-max-81257): 275 render contents, 218 of which can read a texture, every one through a
fragment texture slot, and 57 read none. 281 render pipelines: 220 with the flag, 61 without.
The play's Metrics::pipelines_created, 407, counts compute and the runtime's own pipelines too;
the 281 render pipelines are the ones the base flagged, and 61 of them lose the flag here.
- The A/B on the RTX 2080 (m3-max-81257): arms alternating a:cold, b:cold, a, b, a, b, cold with
the driver's disk cache off (__GL_SHADER_DISK_CACHE=0), each with a fresh rt shader cache.
Every play of both arms: pipelines_created 407, rendering interrupts 28857, barriers 136307,
attachment loop reads 33533, 0 refused; first-use waits a 17, 18, 15 and b 17, 16, 17 (the other
kinds; none for the loop, which the base never had and this tree no longer has). Median frame
GPU time: a 1.7290 (cold), 1.7267, 1.7542 ms; b 1.7188 (cold), 1.2215, 1.7233 ms. Every play's
clock samples mix P0, P5 and P8, and b's 1.2215 ms play is the one whose median moved alone; b's
other two sit at or below a's range. No gain is claimed.
- Merged-tree check (m3-max-81184, at 00fe2f78be): signatures, clippy plain, --cfg m2v_gpu and
--cfg m2v_cpu_icd, rustdoc, private intra-doc links, the translator's core (3420 passed, 37
skipped), the runtime on lavapipe (947 passed, 4 skipped), validation (1319 passed, 3 skipped),
validation on lavapipe (1441 passed, 3 skipped), and the conformance replay on lavapipe
(exactly the ledger's gaps, 0 drift), each exit 0. Clippy plain, --cfg m2v_gpu and --cfg
m2v_cpu_icd at the rebased tree (m3-max-81311), each exit 0.
- The A/B on the RX 7900 XTX (m3-max-81373, holding its node alone; cold with
MESA_SHADER_CACHE_DISABLE=true): every play's counts equal (pipelines_created 407, barriers
127909); the play's GPU time a 128.88 (cold), 129.16, 128.96 ms against b 129.12 (cold), 129.48,
129.20 ms (+0.21%, same-arm spreads 0.22% and 0.28%); median frame a 341.2, 340.0, 339.7 us
against b 339.8, 340.5, 339.9 us (-0.07%).
- The A/B on the Iris Xe (m3-max-81367, holding its node alone; a:cold, b:cold, then three pairs):
every play's pipelines_created 407, barriers 135343, loop reads 33533; median frame a 518.9
(cold), 524.8, 522.6, 525.2 us against b 507.8 (cold), 494.6, 522.0, 467.3 us, none of b's above
a's highest; the play's GPU time a 287.5, 292.6, 272.1, 280.9 ms against b 281.5, 281.3, 273.7,
277.4 ms, b's within a's range.
- The RTX 3090 (m3-max-81365): every play's pipelines_created 407 and other counts as the 2080's;
its clock samples mix P0, P5 and P8 within every play, so its timing is not read.
- Runtime command buffers per play vary between plays of one arm, the base's included (6258 to
6263 on the Iris Xe, 6320 and 6321 on the 3090): the play's own variance.
- Not measured on a tile-based phone GPU (no such device in the lab).
T1 (795edfb733) made a state's pipelines without the attachment feedback loop's colour flag
and, at the first draw that reads an attachment through a texture, made a flagged one on the
encoding thread: 110 such compiles at first use in a window-drag stream on each desktop card,
603.7 ms in all on the RX 7900 XTX with the driver's cache off (m3-max-81076). The ruled form
decides the flag at the state's make, from the structure of its functions: a state whose
functions can read a texture (a slot one reads, a colour the fragment function fetches, or a
read beyond the slots) takes it on every pipeline from its make, as every state did before T1;
one whose functions read none never takes it. No draw makes a pipeline for the loop.
Two tests, red at this commit on a device with the loop:
- every_device_flags_a_pipeline_for_the_loop_at_its_make_where_its_fragment_reads_a_texture
replaces T1's test: own_pixel_fragment's state makes its pipeline with the flag, and its
reading passes make no pipeline and wait for none (Metrics::pipelines_created,
Metrics::first_use_waits). T1 makes it without the flag, and its first reading draw makes a
second pipeline.
- every_device_flags_a_pipeline_for_the_loop_at_its_make_where_its_vertex_reads_a_texture:
icb_direct_arguments' texture_vertex with plain_fragment makes its pipeline with the flag. A
draw that hands the vertex function its pass's attachment is refused on every device
(Gap::Draw { AttachmentRead }), as before: only a fragment function reads an attachment of
its pass through a texture. T1 never flags this state.
The 31 rows of shared-creator-padded-format-storage, shared-creator-extended-range-samples,
texture-shared-handles and texture-view-descriptors that the rt side refuses with
Unavailable(shared_texture) gave "no stream uses it yet" (the 11-19 census) as their reason.
That is stale: on 12-02 a viewer's render process called newSharedTextureWithDescriptor:
about 2.5 s after its window opened, and its consumer answered nil. Their reason is now the
ledger's "refused: not built yet (fix-l155)", so every replay counts them as open work, and
the row says what is to be built: on rt's one device a shared texture is a Private texture
and the texture its handle opens a clone of the same Texture, the handle the consumer's.
Docs only: no row's case, venue, site or answer changes. CONFORMANCE-COVERAGE.md is
regenerated (coverage.py --check: as derived).
The Mac host leg of the runtime's device tests failed two patch tests with indirect true only:
every_device_reads_a_patch_draw_s_base_instance_after_tessellation and
every_device_reads_a_patch_s_position_as_its_primitive_id_under_a_patch_index_buffer (M3 Max
under KosmicKrisp, job m3-max-81082). Both draw 2 patches in 2 instances, and in both the second
instance's second patch is missing.
The cause is in the driver, not in the runtime. The runtime records an indirect patch draw as one
vkCmdDrawIndirect on Metal's argument buffer, the same on every device, with no compute pass in
front of it. KosmicKrisp (Mesa 26.3.1) emulates tessellation in compute. For an indirect draw,
libkk_tess_setup_indirect writes the vertex grid as {count, instances, 1} and the control grid as
{patches * output vertices, instances, 1}. kk_dispatch_compute then runs both through
dispatchThreadgroupsWithIndirectBuffer, so each word counts threadgroups (64 threads for the
vertex grid), where the direct draw passes the same words to dispatchThreads as thread counts.
Neither stage bounds the extra work, so it overwrites the next instance's vertices and control
points. This was read from the driver's source, not instrumented.
A bare Vulkan program (no runtime code) draws 2 patches of 3 control points in 1 and then 2
instances, direct and from the host-written VkDrawIndirectCommand, 8 rounds each. Under
KosmicKrisp the second instance's second patch was wrong in 3 of 8 indirect draws, and right in
all 8 direct draws and in every one-instance draw. Under MoltenVK on the same M3 Max, every draw
was right (job m3-max-81189). The tests' indirect arms pass on RADV on the RX 7900 XTX and the
Radeon 780M (m3-max-80750) and on lavapipe (m3-max-80990).
Docs only: one known-gap bullet under "Known gaps of render encoders". The README is not part of
any crate's Rustdoc, and its tests read only the floor tables.
Metal's copy of whole surfaces between textures has no runtime call of its
own; the player refused it as not played on a blit encoder, which ended a
viewer stream's play on the XTX in its first seconds (job m3-max-81089). It
now plays as the runtime's copy_from_texture, once for each slice and level
of the counts, each the source level's whole extent from the origin to the
origin, as a bind of a range plays as single-slot binds. The runtime's own
checks refuse a level or slice past either texture. REPLAY-STREAM.md says so.
A device test of the replay player copies slices 0 and 1 at levels 0 and 1 of
a 2D array texture into slices 1 and 2 of another with
copyFromTexture:sourceSlice:sourceLevel:toTexture:destinationSlice:
destinationLevel:sliceCount:levelCount:, each source surface written from its
own bytes first, and checks the four copied surfaces read back as those bytes.
Red until the player plays the selector: it refuses it as not played on a
blit encoder, which stops a viewer stream's play on the XTX (job
m3-max-81089) long before its patch draws.
The player refused both of Metal's indirect draws of primitives as not
played on a render encoder, so a stream whose program draws from an indirect
buffer lost each such draw. Each now plays as the runtime's call
(draw_primitives_indirect, draw_indexed_primitives_indirect), its arguments
and index buffer at their offsets. The patch draws' buffer helper becomes
draw_buffers, which both arms share: a draw naming a skipped index or
indirect buffer is a skipped draw, and one skipped by its state or a bound
object is counted as before; patch_draw keeps the patch draws' count of
draws through a state whose record lacks tessellation. REPLAY-STREAM.md says
the draws play direct or from an indirect buffer.
Three device tests of the replay player draw the render fixture's triangle
from an indirect buffer into a pass cleared red:
drawPrimitives:indirectBuffer:indirectBufferOffset: with its arguments at byte
16, and drawIndexedPrimitives:...:indirectBuffer:indirectBufferOffset: of 16-bit
and of 32-bit indices, its arguments at byte 20 and its index buffer at an
offset of one index. Vertex 0 is a blue one at the target's centre and the
arguments start at vertex (or index) 1, so only a draw that reads its
arguments and indices at their offsets covers the target green, which the
stream checks.
Red until the player plays those selectors: it refuses each as not played on
a render encoder.
Every render pipeline was made with VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT on a
device with the attachment feedback loop (22ca6271eb). Vulkan asks for the flag only of a draw
that reads, other than as an attachment, an attachment in the feedback layout (vkspec
"Non-Overlapping Access Between Resources"). Tile-based GPUs are a target; the flag stays off
the pipelines of draws that read no attachment. Not measured on a tile-based phone GPU; no such
device in the lab.
Now:
- Raster gains `loops`: the draw reads an attachment of its pass through the loop. The content's
main pipelines are made without the flag; the first draw that reads an attachment through a
texture makes the content's pipeline under `loops` in the content's bounded map of later
pipelines (at most 31 now, from 15), and later reading draws take it. One form on every device
with the loop; a device without it keeps its counted copy into the shadow, unchanged.
- A content whose fragment function fetches a colour ([[color(n)]]) reads through the loop at
every draw, so all its pipelines take the flag from creation, as before.
- An execution of an indirect command buffer takes the flagged pipeline wherever the device has
the loop, as before, since its commands bind their own slots; execution_part asks the same
pipeline, so the part and the draw's shape agree.
- A draw that may read beyond its slots while a read declaration covers an attachment the pass
holds out of its home layout (Metrics::unslotted_attachment_reads) takes it too.
- The extra make is a first-use wait of its own: Metrics::first_use_loop_waits, with its
nanoseconds and longest (three new public fields of the non-exhaustive Metrics, additive;
api_signatures.tsv blessed). The replay's metrics report the count and the nanoseconds.
No dynamic-state form: the loop's dynamic state stays gone.
Docs: the runtime README's attachment-read paragraph, the first-use waits list, a known gap of
render encoders for the extra compile at a state's first reading draw (with where the form has not
run), the floor table's VK_EXT_attachment_feedback_loop_layout row, the AMDVLK measurement's
wording, Core::feedback_loop, floor::Capabilities::feedback_loop and the render encoder's module
doc.
Not run on an Intel card: the lab's Iris Xe node is down; that leg is owed.
Not run on the M3: KosmicKrisp ignores the pipeline flag. Read in Mesa 26.3.1's source: KK lists
VK_EXT_attachment_feedback_loop_layout and attachmentFeedbackLoopLayout
(kk_physical_device.c:171, :431); Mesa's common runtime turns the flag into vk_graphics_state's
feedback_loops, which no kk_* file reads; KK reads only the image's feedback usage
(kk_image_layout.c:111). A run there could show no change.
Verified (the tree of this commit, 87e8f0241a, on development 15898e612e):
- Red/green: every_device_flags_a_render_pipeline_for_the_loop_only_where_a_draw_reads_its_attachment
fails before and passes after, at the pre-rebase shas 5e1e88e94b and d2e563c826, on lavapipe
(m3-max-80585), the RX 7900 XTX (m3-max-80586) and the RTX 3090 (m3-max-80589); at this tree it
passes on lavapipe in the merged-tree check.
- Merged-tree check (m3-max-80973, then m3-max-81099 for its last step): signatures, clippy plain,
--cfg m2v_gpu and --cfg m2v_cpu_icd, rustdoc, private intra-doc links, the translator's core
(3413 passed, 37 skipped), the runtime on lavapipe (945 passed, 4 skipped), validation (1319
passed, 3 skipped), validation on lavapipe (1438 passed, 3 skipped), and the conformance replay
on lavapipe (exactly the ledger's gaps, 0 drift), each exit 0.
- A window-drag replay stream recorded on a 780M (windrag-780m-b4) to frame 500 (501 frames),
arm a = 15898e612e and arm b = this tree, alternating in one job per card, a fresh rt shader
cache each play. On the RX 7900 XTX (m3-max-80880) and the RTX 2080 (m3-max-80926), every
play: rendering interrupts 28857, passes 41477, barriers 127909 (XTX) and 136307 (2080),
attachment loop reads 33533, 0 refused, equal in
both arms; pipelines made 407 in a and 515 in b, first-use loop waits 0 and 110.
- GPU time, the driver's shader cache warm: XTX, the play's command buffers, a 128.86, 129.29,
128.88 ms against b 129.02, 129.43, 129.27 ms (+0.18%, spread 0.33%); 2080, the median frame
over four plays each (its play totals follow the card's clock state), a 1.7255 ms against b
1.7320 ms (+0.38%, spreads 0.71% and 1.01%).
- The 110 loop compiles with the driver's disk cache off for the play (a measurement setting of
the job), alternated with warm plays in one job: XTX (MESA_SHADER_CACHE_DISABLE=true,
m3-max-81076, on a node running other jobs' CPU work then) 603.7 ms in all on the encoding
thread, against a play GPU time of 129.35 ms and 32.5 s of wall; 2.24 ms warm. 2080
(__GL_SHADER_DISK_CACHE=0, m3-max-80947) 2.39 ms cold and 1.88 ms warm; its cold plays' first-use
waits were no longer than its warm plays', so that setting's effect is not shown.
- Not run on an Intel card; not on the M3 (above); not measured on a tile-based phone GPU.
Every render pipeline is made with VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT on a
device with the attachment feedback loop, whether or not a draw reads an attachment through it.
Vulkan asks for the flag only where a draw reads, as a non-attachment, an attachment that is in
the feedback layout (vkspec 8.10.2).
The test replaces the one that held every pipeline to the flag:
- an ordinary pass draws a state whose fragment function reads no texture and one whose function
reads a texture no attachment renders; each state's pipelines carry no flag;
- two passes draw blue, then, after a memory barrier, each pixel read plus green; the reading draw
makes its state's flagged pipeline once, at the first pass, and every pixel reads blue plus
green each time, each reading draw one attachment_loop_reads;
- a device without the loop makes every pipeline with no flag and reads through a copy.
RenderCompiled::made_flags, for the device tests, lists the create flags of each pipeline a
content made.
Red here on a device with the loop: the ordinary pass's pipelines carry the flag.
oracle_fuel::tests::public_fixtures_with_loops_round_trip_instrumented failed on macOS CI (run
47003321413, macos-26, MetalToolchain 17.6), the first macOS run to reach it, in three ways:
- Ten .metal fixtures that name metal4.1, newer than that toolchain's metal4.0: "invalid value
'metal4.1' in '-std=metal4.1'".
- tns_mm_fp8, tns_mm_left and tns_mm_v2 .air.ll: metal-opt "unrecognized architecture
'air64_v29' provided." for the fixtures' own target triple.
- parked_heap_handles (.metal and .air.ll, four entries each): "buffer argument m2v_oracle_status
has invalid location (<29,1>)". The fixture binds buffers 28 and 29, and the test put every
status buffer at a fixed slot 29. The oracle itself puts it at the highest slot the entry's
interface leaves free (NativeBufferSlots::from_interface(..).allocate(), via producer_slots);
that is slot 30 here. This one is a test defect on any SDK.
The air writer's round trips already skip, list and count an input above the toolchain's AIR
version or Metal standard (Tally::refused). That rule moves into
air_writer::tests::above_the_toolchain and gains a third case, arch_ceiling: metal-opt's
refusal of an `air64_v<N>` architecture that the input's own target triple names. Each is the
toolchain's own refusal of something the input states; any other error stays a failure.
The oracle-fuel round trip now applies above_the_toolchain to a failure of a step on the fixture's
own AIR (compiling or assembling it, and finding the strictest level metal-opt passes). It prints
each skip and their count, "SKIP N of M inputs above the toolchain's newest version", as the air
writer's round trips do. A failure of the instrumented module's own round trip is never skipped.
Each entry is instrumented with its status buffer at the slot the oracle gives it, from the
entry's interface (status_slot).
Verified: red job m3-max-81148 (msi CPU) failed
an_input_of_an_architecture_the_toolchain_does_not_know_is_skipped_and_counted, and
every_other_toolchain_error_fails passed, at bec8a8dea1. The green and the macOS runs are named
in the hand-over.
translation_l3_stage::spirv_val_runs_in_the_l3_stage_that_replaced_the_translation failed on
macOS CI (run 47003321413, macos-26), the first macOS run to reach it: 'spirv-val ran under
"96367: not the L3 stage", not the worker's L3 stage'. The worker is right; the test's stand-in
is wrong. The stand-in spirv-val asks pgrep for the processes whose arguments hold
"--l3-stage engine" and looks for its parent there. macOS's pgrep leaves out its own ancestors
unless given -a (pgrep(1): "By default, the current pgrep or pkill process and all of its
ancestors are excluded"), and the L3 stage is pgrep's grandparent, so it never matched. procps's
pgrep on Linux excludes only itself, which is why the Linux job passes.
The stand-in now passes -a on Darwin alone: procps reads -a as --list-full, which would print each
command line beside its pid and break the exact pid match.
Verified: a local probe of the same script under `bash -c "sh standin.sh; :" --l3-stage engine`
on macOS 27 printed "not found" with plain pgrep and "found" with the fixed line. The test itself
runs on the next macOS CI run; it is not run on the M3 (no tests there).
macOS CI (run 47003321413, macos-26, MetalToolchain 17.6) failed
oracle_fuel::tests::public_fixtures_with_loops_round_trip_instrumented on tns_mm_fp8, tns_mm_left
and tns_mm_v2 .air.ll: that toolchain's metal-opt answers "unrecognized architecture 'air64_v29'
provided." for the fixtures' own target triple, which is newer than it knows. The air writer's
Tally already skips, lists and counts an input above the toolchain's AIR version or Metal
standard; it has no rule for this third refusal, so the fixture counts as a failure.
The new test hands Tally::refused that refusal for tns_mm_v2.air.ll and expects a skip. Two more
cases join every_other_toolchain_error_fails: an architecture the input's triple does not name,
and one refused for an input with no triple, both still failures.
Red: string-only, so it runs on Linux; expected to fail until the classifier lands (next
commits).
The bless for mad (2324) and the half form on devices lacking only 16-bit
DenormPreserve (2325). 1413 cells move, 471 in each of lavapipe,
gate-lavapipe and gate-lavapipe-x86_64, over 320 fixtures; no other profile's
cell moves, as T3's comparison predicted (the 3090 column is still owed). No
row is added or removed; mad's fixtures are not in the public set.
Blessed on the M3 (job m3-max-81107): inventory, golden hashes and printouts
exit 0; the metallib half of committed_air_fixtures_parse_and_link exit 0.
The planner's ruling (T3). On a device with shaderFloat16, 16-bit RoundingModeRTE and 16-bit
SignedZeroInfNanPreserve whose only missing 16-bit control is DenormPreserve, the half operations
narrow::half_controls gates take the 16-bit route: a half + - * / sqrt and fused multiply-add on
the device's 16-bit instructions, half values held at 16 bits, the controlled pair for a float
rounded to half, and a half widened from and narrowed to its bits by the device's conversion.
It is the 16-bit floats query's existing form, read from one more of its properties.
narrow::controlled_modes declares RoundingModeRTE and SignedZeroInfNanPreserve for 16 bits there
and no denormal mode: not DenormPreserve for 16 bits (VUID 06296), nor the 64-bit one the
independence for 32 bits only ties to it (VUID 06289 asks for the same denormal mode at 16 and
64 bits). The independence rules decide which devices take it as before, and a device missing any
other 16-bit control keeps half in float.
MoltenVK on the M3 stays off the route: its denormal modes are not independent at all
(denormBehaviorIndependence NONE), where the form would tie float's denormal mode to half's and
change how the module's float arithmetic reads denormals, which Metal flushes; and its rounding
modes are not independent while it offers no 64-bit RoundingModeRTE, so the 16-bit
RoundingModeRTE the form declares cannot be declared at every width as VUID 06292 asks.
Every module that declares those controls on such a device (narrow::flushes_half_denormals)
records the new static note PrecisionNote::DeviceHalfDenormals, "half denormals may flush to
zero where Metal preserves them": the Vulkan spec leaves a 16-bit denormal to the device in an
entry declaring no 16-bit denormal mode. No other module records it. The conformance suite holds
its code, metal2vulkan-degrade-device-half-denormals, among the native notes beside
device-denormals (the device's own denormals, the one form built there); validation allows it
unbounded, as it does NativeHalfConversion.
Run on lavapipe, whose committed profile has this shape: its half arithmetic moves from float to
16 bits. Turnip on an Adreno GPU before the 8xx series reports the same controls (Mesa 26.3.1,
tu_device.cc lines 534, 1038-1048: shaderFloat16, RTE and SignedZeroInfNanPreserve for 16 bits,
DenormPreserve for 16 bits false below A8XX, independence ALL): not measured on a tile-based
phone GPU; no such device in the lab. No performance claim is made.
Tests: engine_native_half's new test (the red commit before this) now also asks for the note on
each such module and for none under all three controls or without another one. The tests that
held lavapipe as the conversion form now hold it under the controls (engine_native_half's
rounding kinds, memory and decode widenings and controlled modes; engine_half_hold's held values
and division; engine_arith's 16-bit fma profiles), and the conversion form on lavapipe's
description without 16-bit RoundingModeRTE.
SEMANTICS_VERSION 2325 (development holds 2323; 2324 is mad's), and ARTIFACT_FORMAT_VERSION
601 -> 602 (the new note's codec member). Golden rows are blessed at the pin.
Docs: the precision-note catalogue (docs/API.md, the new entry and the conversion entry's
controls), docs/HOWTO.md, the runtime README's shaderFloat16 row and its half fma line, the
NativeHalfConversion note's device list, api_signatures.
The conformance ledger. The form moves lavapipe, whose float controls lack only 16-bit
DenormPreserve, onto the 16-bit route. The conformance replay in the pinned lavapipe image (Mesa
26.2.4, LLVM 23.1.1) then answers 79 of the runtime ledger's llvmpipe rows otherwise:
- 47 now match Metal and are dropped: vertex-format-half4 28 and integer-vertex-attributes 16
(the rows said lavapipe folds the unrounded OpFConvert pair, with no 16-bit DenormPreserve to
make it Metal's; the pair now rounds under the 16-bit controls), and half-texel-nans-rg11b10f's
3 (nearest-sample, read, widened).
- 32 now answer otherwise and are replaced, each with the answer and a reason written from this
run's printout (first differing element):
- vertex-format-half4, 8 rows (Float..Float4, Half..Half4): only the NaN differs now, Metal
0x7fc00000, the device 0xffc00000; one element per component, where the rows recorded the
unrounded values (Float, the largest difference inf) or the kept payload (Half).
- half-texel-nans, 18 rows (nearest-sample, read and widened of r16f, rg16f, rgba16f, r32f,
rg32f, rgba32f): a 16-bit float texel's NaN now narrows to 0x7e00 (the payload dropped, as
read-through-sample already answered; Metal hands back the texel's code); a 32-bit one to
0xfe00 (Metal 0x7e00); the widening answers 0xffc00000 (Metal 0x7fc00000). Six rows count more
elements than before (the 16f nearest-sample and read rows: 215 -> 472, 428 -> 940,
852 -> 1874), twelve fewer.
- bicubic-texel-classes, 6 rows: fewer elements at every site, each count and largest
difference the one the 780M and RTX 5080 rows record; within the bicubic note's bound.
None of the 79 is a half denormal.
docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py): ledger rows
7932 -> 7885. The image is the pinned one, so the ledger's llvmpipe line does not move.
Not replayed, a follow-up: the six bicubic-texel-classes rows of venue "llvmpipe (LLVM 23.1.4,
256 bits)", a lavapipe outside the pinned image; this commit leaves them as they were.
Verified: the replay of this tree without the ledger edit, job m3-max-80972 (pinned lavapipe
image): exit 1 with row differs 32, now answers otherwise 32, now matches 47; the rows are written
from its printout. The same counts in job m3-max-80871 (the pre-rebase fix, against its base,
which exits 0). coverage.py --check: as derived.
No lab card's translation moves. The golden blesses at development (15898e612e) and at this
change, over the committed profiles plus the RX 7900 XTX's vulkaninfo --json capture (job
m3-max-80916), compared cell for cell, job m3-max-81006 (macOS, every fixture, 3624 rows): every
column but lavapipe, gate-lavapipe and gate-lavapipe-x86_64 (471 cells each) is equal, among them
the XTX capture, amd-780m-radv, amd-780m-hawkpoint-radv, intel-irisxe-rplp-anv,
intel-irisxe-anv and moltenvk-m3; no profile fingerprint moves (job m3-max-80958, the
same over the 1910 rows a Linux host assembles, agrees). Not run on an RTX 3090: its column is
owed until the card is back.
Gate at this tree, job m3-max-80990: clippy -D warnings plain, under m2v_cpu_icd and under m2v_gpu
0; rustdoc -D warnings 0, and with private items for metal2vulkan 0; the runtime's suite on
lavapipe 945 passed, 4 skipped (whole suite); translator and AIR 3415 passed, 37 skipped (the
golden hash table, the fixture inventory and the engine printouts excluded: their bless is due at
the pin); validation 1319 passed, 3 skipped; conformance 1048 passed. CI's lavapipe steps in the
pinned image, job m3-max-81012: device tests 841 passed (843 listed), the conformance replay exit 0
(the 4640 gaps the ledger expects, exactly), public case qualification exit 0.
The planner's ruling (T3): on a device with shaderFloat16, 16-bit RoundingModeRTE and 16-bit
SignedZeroInfNanPreserve whose only missing 16-bit control is DenormPreserve, the half
operations narrow::half_controls gates take the 16-bit route, and any other missing control
keeps today's 32-bit form, under today's independence rules.
engine_native_half's new test asks, on the committed lavapipe profile and on the RTX 5080
Laptop GPU's and the Radeon 780M's descriptions without shaderDenormPreserveFloat16, for the
16-bit instructions the full controls give (a sum, a product and a chain of two on 16-bit
floats, the controlled pair for a half narrowed alone), an entry declaring RoundingModeRTE and
SignedZeroInfNanPreserve for 16 bits and no DenormPreserve at any width (the 780M's
independence for 32 bits only would tie a 64-bit one to a 16-bit one, VUID 06289), no
DenormPreserve property required, L3, and each operation rounded on the interpreter. And it
asks that the RTX 5080 Laptop GPU without 16-bit SignedZeroInfNanPreserve too, MoltenVK on the
M3 (denormal and rounding modes not independent), and the 780M without 64-bit DenormPreserve
stay in float.
Red: half_controls asks for 16-bit DenormPreserve, so lavapipe computes half in float.
opencl_mode_mad_rounds_its_product_and_its_sum failed on lavapipe (llvmpipe, LLVM 23.1.1):
the half mad(a, a, c) at a = 1 + 2^-6, c = -(1 + 2^-5) answered 0x0c00, the fused 2^-12,
where the M3 Max answers 0. The float and float4 rows answered 0 there too, as on every
device.
lavapipe has no 16-bit denormal-preserve control, so the module computes the half product
in float and rounds it through the conversion pair, records NativeHalfConversion, and
lavapipe's compiler folds the pair: the product stays exact and the sum is the fused
answer. That is the note's documented bound (docs/API.md), so the test now accepts 0x0c00
only where the module records NativeHalfConversion, as the vstore_half test beside it
does; every other row, and the half row on a module without the note, stays exact. The
test prints the half it read and the notes, so a run shows which case it took.
When the 16-bit route for lavapipe lands, the half mad there is the device's 16-bit
multiply and add, the module records no NativeHalfConversion, and this test is exact on
lavapipe too.
Verified: m3-max-80986 (msi, 8dbd521441) failed the test on lavapipe; m3-max-81037 read its
assertion, half 0x0c00 with the float rows 0. The run of this commit on lavapipe is the
hand-over's job.
clippy's indexing_slicing lint refused `&any[..r.kind.arity()]` in routine_len, in all three
configurations (job m3-max-80905, STEP clippy_plain, clippy_gpu and clippy_cpu EXIT=101: "slicing
may panic"). The operands are now `any.get(..arity)`; an arity past three is an invariant error,
which no kind has.
Verified: cargo fmt only on this host; the check job reruns clippy.
Apple's OpenCL compiler spells OpenCL C's mad(a, b, c) as air.mad.<T>. No
family decoded it, so a kernel that calls it (a real OpenCL workload's
image-scaling kernel, air.mad.f32 in AIR 2.8) was refused as
UnknownIntrinsic. OpenCL C leaves how mad rounds its product to the
implementation. The M3 Max's GPU rounds the product and then the sum.
- Decode: MathFn::Mad, which Math::parse reads from air.mad.<T> for the
three types the compiler was measured to spell (MAD_TYPES: f32, v4f32,
f16), each T (T, T, T), always Precision::Precise. Every other type
(v2f32, v3f32, v8f32, v4f16, bf16, i32) and spelling (fast_mad,
native_mad, a sign token) stays undecoded, as the planner ruled. mad is
not a TABLE stem, so Math::float_stems (Metal's own functions) is
unchanged.
- Lowering, the planner's option (2): canon::routine, which already
rewrites the frexp and ilogb routine calls into plain AIR after SCCP,
now replaces each mad call with an fmul of a and b followed by an fadd
of that product and c. Both carry no fast-math flags, whatever the
call's own flags are. Lowering then gives them exactly what an
unflagged fmul and fadd get: NoContraction on each, the profile's half
form, and no new note. air_math's invariant arm (Frexp, Ilogb) now
takes Mad too.
- Which form is smaller: the canonicalization. The families rows need a
DeclClass::Air, so MathFn::Mad cannot be avoided, but the rewrite
reuses the routine pass's expander, about 40 lines. A lowering of its
own would need a new FloatFn and its half forms.
Evidence, with its caveat as it is:
- Spellings come from Metal's OpenCL mode (newLibraryWithSource with
sourceLanguage 1, macOS 27.0.1, AIR 2.9), over our own kernels on the
M3 (job m3-max-80752).
- Answers come through the OpenCL framework on the M3 Max's GPU (job
m3-max-80759), not through a Metal pipeline of OpenCL mode:
- float, at a = b = 1 + 2^-12 and c = -(1 + 2^-11): mad answers 0,
fma 2^-24, and a*b+c 2^-24;
- float4: each lane of mad answers 0;
- half, at a = b = 1 + 2^-6 and c = -(1 + 2^-5): mad answers 0 and
fma 2^-12.
Tests:
- families_tests OBSERVED rows (previous commit, red).
- intrinsics::tests::opencl_mad_decodes_in_its_measured_types_alone.
- engine_arith::opencl_mad_is_its_multiply_and_its_addition, over our
own .ll on the three profiles:
- each mad kernel's linked SPIR-V has the same opcodes as its twin
written as an unflagged fmul and fadd, with the same notes;
- the float and float4 kernels have OpFMul and OpFAdd, each
NoContraction, and no Fma;
- the interpreter answers 0 on the probe's inputs.
- runtime opencl_data::opencl_mode_mad_rounds_its_product_and_its_sum, a
kernel of OpenCL mode: +0 on the float, on each float4 lane and on the
half, under a device cfg.
Public surface: MathFn gains Mad (api_signatures.tsv blessed), so an
exhaustive match over MathFn in a consumer breaks. docs/REFUSALS.md was
regenerated and is unchanged. docs/API.md lists mad beside the OpenCL C
native_ and half_ functions.
SEMANTICS_VERSION 2323 -> 2324: a module that calls air.mad translated to
a refusal before and translates now. The authoring classification follows
on its own, since its key fingerprints the product's sources
(ANALYZER_ABI), so no census version needs a bump.
Apple's OpenCL compiler, through Metal's OpenCL mode (newLibraryWithSource
with sourceLanguage 1, macOS 27.0.1, AIR 2.9), spells OpenCL C's mad(a, b,
c) of float, float4 and half as air.mad.f32, air.mad.v4f32 and
air.mad.f16, each T (T, T, T). No family decodes them, so a kernel that
calls one is refused as UnknownIntrinsic (air.mad.f32).
The three declarations go into OBSERVED, which observed_declarations_decode
requires to decode. Red until the next commit decodes them.
Spellings from our own OpenCL C kernels on the M3 (potluck job
m3-max-80752), carved from each entry's bitcode and disassembled with
metal-opt. The probe produced no other vector width, so no other is added.
The link test of IndexedPatchFactors read the identity domains off the
committed profiles, whose policy is the resident tables', so it tried none
and failed only on its own count (job m3-max-80982 on the msi CPU:
'a committed profile takes the identity domains'). It now builds each
committed profile with bufferDeviceAddress and shaderInt64 under the
identity domains' policy, as the engine test of the address form does,
and asserts the policy took. The engine test's doc names the cause.
The last cause-less Feature::Tessellation refusal of the translator, the
address form's in pipeline/link/tessellation control_plan
("addressed && !fits"), now names TessellationCause::IndexedPatchFactors:
a control-point index type beside a per-instance factor step or a factor
scale where pointers are device addresses used directly, where the
control-point indices' address takes the control stage's push words that
hold the factors' instance stride and scale (control::address_fits).
Every Feature::Tessellation NotImplemented refusal now carries a cause:
the translator's through Unsupported::tessellation, the AIR front end's
through its conversion.
Tests: the link test of the commit before this one (each such pair on
every committed profile of the identity domains); the engine test of the
address form's stepped and scaled descriptors asserts the cause too.
api_signatures blessed (the variant), REFUSALS.md regenerated (the
control_plan site moves under error/mod.rs's Unsupported::tessellation).
runtime-sources.sha256 unchanged: neither file is a runtime input.
TessellationCause gains IndexedPatchFactors: a control-point index type
beside a per-instance factor step or a factor scale where pointers are
device addresses used directly. The link test asserts it for each such
pair on every committed profile of the identity domains, and that each
pair without the index type is planned. The address form's refusal
(pipeline/link/tessellation control_plan) still names no cause, so the
test fails.
The engine candidate's runtime route required a patch draw to name no patch
or control-point index buffer, and refused one that did as
executor_not_implemented. No case reaches that refusal: the case mapping
(graphics::patch_draw) names neither buffer for every patch draw, the case
schema has no field for them, and the AIR states nothing about a draw's
index buffers. The conformance suite's tessellation-patch-indices case
compares drawIndexedPatches and patch index buffers against Metal.
The route now takes every patch draw, its refusal message and
VALIDATION.md's sentence drop the clause, and the routing test drops its
patch draw through a patch index buffer. The runtime platform's draw keeps
its own check of the translator's DrawCall fields, which fails a draw that
names an index buffer visibly.
A watchdog's SIGTERM killed a play inside a frame; on a 3090, plays killed mid-frame were
followed by a wedged card (11-23), which is why a play on an NVIDIA card ends at an
--until-frame. The player now takes a stop flag (Player::stopping_on): once it is set, the
play stops after the frame then playing ends, as at --until-frame, and command-replay tears
the device down as at any end. The SIGTERM handler writes its progress line and sets the
flag instead of re-raising; after the stop the play writes `progress stopped after SIGTERM:
frame N of M ended last at T s`, no judged metric, the report verdict `stopped SIGTERM after
frame N, short of its range` and exit status 1. A frame that never ends (a call that never
returns) is left to the caller's kill (timeout -k).
Not yet built: a lavapipe job plays one stream under a forced 150 s watchdog with the player
before this commit (red: killed inside a frame) and with it (green: ends at a frame).
A play killed by a caller's watchdog left no line saying how far it got: the 5080 stream
arm of job m3-max-80863 ended at its 840 s watchdog with the frame unknown. play now writes
`progress frame N of M ended at T s` to the standard error at the end of every tenth frame
and of the last frame it plays to, counted at the one flush the player makes as each frame
ends (Player::with_frame_lines), and on SIGTERM (Unix) `progress SIGTERM at T s: frame N of M
ended last` (or `no frame ended`), formatted without allocating, before SIGTERM ends the
process as it would have. Test-side only: the validation crate's binary.
Not yet built: the players' rebuild job and the 3090 rehearsal with a forced watchdog check it.
Clippy's type_complexity refused the helper's return type in every
configuration (job m3-max-80857). AtOffset names a buffer a draw names, at its
offset, or none.
The player refused three of Metal's four patch draws as not played on a
render encoder, so a stream whose program draws patches through an indirect
buffer or a control-point index buffer lost those draws. Each now plays as
the runtime's call (draw_patches_indirect, draw_indexed_patches,
draw_indexed_patches_indirect), beside drawPatches, through one helper the
four share: a nil patch index buffer is none, a draw naming a skipped buffer
(patch index, control-point index or indirect) is a skipped draw, a draw
skipped by its state or a bound object is counted as before, and a draw
through a state whose record lacks the tessellation key is counted.
REPLAY-STREAM.md names the patch draws among what render encoders play.
Three device tests of the replay player: a stream of the owned fixture
tess_indexed_patches draws twice into one pass, once with a nil patch index
buffer and once through one at offset 4, by
drawPatches:...indirectBuffer:indirectBufferOffset: (no control-point index
type), drawIndexedPatches:patchStart:...:baseInstance: (UInt16) and
drawIndexedPatches:...indirectBuffer:indirectBufferOffset: (UInt32). Each
checks both output buffers against the values Metal writes (the runtime's
patch test holds the M3 Max's runs) and asserts nothing skipped.
Red until the player plays those selectors: it refuses each as not played on
a render encoder.
The runtime README's DontCare store gap now says an Unknown store action
stores too, and states the form on file: each rendering recorded into a
secondary command buffer of its own, its begin recorded as it ends, when
its store operations are known, which would also take the late store
action RenderPassKind::LateStore refuses. It is not built while no
tile-based phone GPU is in the lab, no measurement on one shows the
write-back as a cost, and no guest program is known to meet that refusal.
The pass counts are those of the store census, jobs m3-max-80663,
m3-max-80681 and m3-max-80720 (the README quotes the last). The paragraph
is rewrapped at 100 columns.
Docs only.
Refusal::BufferCopyOverlap's Basis line kept "ours" with no reading of
Metal behind it. It now cites the two: on an Apple M3 Max, macOS 27.0.1,
arm64 and x86_64 under Rosetta (job m3-max-80419), and on a Radeon Pro
5300M, macOS 26.7.1 (job m3-max-80501), every overlapping copy equals
memmove's, forward and backward, Shared and Private, 64 bytes to 16 MiB,
five runs each; on that Mac's UHD Graphics 630 a forward overlap of 64 KiB
and up differs from memmove's in each of five runs, at the same first byte
and the same count of bytes. Metal's validation layer was on in both and
stopped none. The kind stays "ours": the readings show plain Metal takes
the copy, which the refusal-surface script calls metal-takes, and the
runtime's RefusalBasis has no variant for it, so naming it is a public type
change, not this docs commit. REFUSALS.md regenerated.
The runtime README's render encoder gaps gain the DontCare store: it
stores, because Vulkan fixes a rendering's store operation as it begins
and a pass may become several renderings for commands met after it
begins, so a tile-based GPU writes back attachments Metal lets a program
discard; not measured on a tile-based phone GPU, no such device in the
lab. The counts are from the store census over two replay streams (jobs
m3-max-80663, m3-max-80681 and m3-max-80720, the last the one the README
quotes, after the census also followed descriptors made by
renderPassDescriptor): 6,401 of 80,906 passes over 1,115 frames (5.74 a
frame, 7.9%) and 4,886 of 73,212 over 1,036 frames (4.72 a frame, 6.7%),
each such pass storing one colour attachment and not caring about a second
or its stencil attachment.
Docs only: a doc comment, the generated REFUSALS.md and the README.
refusal_surface.py --check passes.
Feature::Tessellation with Needs::NotImplemented covered fourteen refusal
sites behind one name, so a walk's log line ("the translator refused the
feature Tessellation, needing NotImplemented", cause None) could not say
which without the AIR. A tessellation refusal now carries
Cause::Tessellation(TessellationCause), one variant per structure the
sites refuse, the way an access refusal names its AccessCause; sites that
refuse the same structure share a variant, none is named by a file, a line
or a string of its own:
- PatchStep: a layout stepping per patch or per patch control point read
by a vertex function that is not post-tessellation (metal/vertex.rs
fetch_as, fixed-function input; lower/stage_io/fetch.rs, the pulled
fetch).
- PatchInterface: a patch input or a patch builtin in a function that is
not post-tessellation (lower/stage_io/plan.rs, two arms).
- UncountedPatch: [[patch(kind)]] with no count, or a count of 0 whose
control points are read (lower/tessellation plan_entry and select).
- InstanceStepRate, AttributeStep: a patch attribute per instance at a
rate above 1; a step the attribute's input has no element for.
- Builtin, VertexInput, SimdGroup: another builtin, a vertex input, or
SIMD-group semantics in a post-tessellation vertex function.
- ControlPointInput: the AIR front end's Tessellation, which is that one
structure (its two arms in canon post_check); the conversion from the
front end's refusal names it, so the front end's types are unchanged.
lower/tessellation's not_implemented() helper takes the cause, so the
compiler makes each of its sites name one; thirteen of the fourteen arms
name a cause. The fourteenth, the control-point index type
on the address form (pipeline/link/tessellation control_plan) is left as
it is: the drawIndexedPatches change removes that arm.
Feature stays Tessellation, so validation's outcome key (feature_key, the
Debug of the feature) and the census are unchanged; nothing stores the
cause (as for the access cause). No version bump.
Tests: the error module's Display test of a tessellation refusal and of
the front end's conversion; the cause asserted at the fixed-function and
pulled patch-step refusals (metal/vertex.rs, engine_vertex_fetch), the
uncounted patch (reflection), post-tessellation SIMD-group functions, and
a new test of a control-point layout stepping per patch, a patch layout
stepping per vertex (AttributeStep) and per instance at 2
(InstanceStepRate). The commit before this one adds those tests against
the cause-less sites.
runtime-sources.sha256 rewritten: metal/vertex.rs's refusal names its
cause, and no run behaves otherwise. api_signatures blessed
(TessellationCause, Cause::Tessellation), api_surface lists the enum,
REFUSALS.md regenerated (the sites are built through error/mod.rs's
Unsupported::tessellation), docs/API.md's error table names the cause.
Consumer uses (consumer-uses.sh, read-only, over the consumer's
development 33784022f1 and its lane tips of the last day):
Feature::Tessellation and TessellationCause, 0 hits.
The error module gains Cause::Tessellation(TessellationCause), one variant
per structure a Feature::Tessellation NotImplemented refusal meets, and
Unsupported::tessellation; the front end's Tessellation refusal maps to
ControlPointInput. The tests assert the cause at the sites: the patch-step
fetch (metal/vertex.rs, engine_vertex_fetch), the uncounted patch
(reflection), SIMD-group functions after tessellation, and a new test of
an attribute step a patch input has no element for and a patch instance
rate above 1. The sites still build cause-less refusals, so these fail.
Re-blessed on the M3 at 466d447c6a (bless job m3-max-80813: inventory, golden, printouts and the metallib link half all EXIT=0). The golden table moves 94 rows for split-store (semantics 2322) and drawIndexedPatches (2323), and adds tess_indexed_patches's rows; the engine inventory gains the fixture's .ll and .air.ll rows; tests/air_input/tess_indexed_patches.txt is its printout. These are the four bless items lavapipe named in m3-max-80734 (golden cells, the inventory's 1338 against 1340, llvm_as part 1's row, the missing printout).
The runtime refused a patch draw through a patch index buffer
(Gap::Draw of DrawKind::PatchIndexBuffer) and had no indexed patch draw.
The viewer draws every patch with drawIndexedPatches, indirectly, through
a nil patch index buffer and a UInt32 control-point index buffer (reims's
walk at development 8a2f155883, job m3-max-80637 on the XTX: 4202
draw_indexed_patches calls left unbuilt).
The encoder now:
- takes a patch index buffer in draw_patches and draw_patches_indirect;
- has draw_indexed_patches and draw_indexed_patches_indirect, whose two
index buffers come as one PatchIndexBuffers (the patch index buffer or
none, and the control-point index buffer, each with its offset), as the
indexed primitive draws take an IndexBuffer;
- pushes each index buffer's address plus its offset beside the factors'
(FieldValue::PatchIndices, FieldValue::ControlPointIndices, 0 for none),
and fills the push bytes again when they change. The control stage reads
the indices through those addresses, unchecked, as it reads the factors;
- counts each index buffer among the draw's reads, as an index buffer
(a Managed one's device copy brought up to date first), and keeps it until
the command buffer retires.
Metal's validation refuses four things (an Apple M3 Max, job
m3-max-80366), and the runtime refuses them typed, direct and indirect:
- drawIndexedPatches through a state of index type None,
Refusal::IndexedPatchDrawWithoutIndexType;
- drawPatches through a state with an index type,
Refusal::PatchDrawWithIndexType;
- a patch index buffer offset that is not a multiple of 4,
Refusal::PatchIndexBufferOffset;
- a control-point index buffer offset that is not a multiple of the index
size, Refusal::ControlPointIndexBufferOffset.
Indices at a byte of the buffer's allocation off that multiple (a no-copy
buffer over such a pointer) are Refusal::ArgumentPlace, as an indexed
draw's are.
DrawKind::PatchIndexBuffer is deleted: nothing returns it. consumer-uses
at the consumer's development db87b77b07 (104 refs) finds PatchIndexBuffer
at 0 code hits; the consumer's DrawKind uses construct AttachmentRead and
LineWidth, and its one match on DrawKind has a wildcard arm
(render.rs:283-287), so the deletion breaks nothing there.
The conformance suite's runtime side draws RenderStep::DrawIndexedPatches.
Its tessellation-patch-indices case now compares on lavapipe (announced:
only the declared winding notice), so its four refused rows leave
known-gaps-rt.tsv; indirect-render-commands-patch-draws now makes its
indexed patch pipeline and reaches its command buffer, whose
indirect_command_buffer call the side answers Unavailable as the case's
siblings do, so its row moves there. docs/CONFORMANCE-COVERAGE.md is
regenerated. The runtime README, docs/REFUSALS.md, the refusal bases, the
API signature table and the Metal coverage map say the same.
Under the identity domains (the runtime's), a post-tessellation function's
control stage reads its factors through their pushed address and binds no
buffer. It had no way to read a patch index buffer or a control-point
index buffer, so it took each patch's index from its position and refused
a control-point index type (NotImplemented(Tessellation)). The viewer's
two pipelines are UInt32 control-point indices drawn by
drawIndexedPatches, and both were refused.
The control stage's push range now holds, at its offset:
- 0: the factors' address (u64), as before;
- 8: under a control-point index type, the control-point index buffer's
address plus its offset (PushField::ControlPointIndexAddress, u64);
otherwise the per-instance step's stride at 8 and the scale at 12, as
before;
- 16: the patch index buffer's address plus its offset
(PushField::PatchIndexAddress, u64), 0 for a draw without one.
24 bytes in all, below the post-tessellation function's window
(push::TESSELLATION_BASE). A control-point index type beside a
per-instance factor step or an enabled factor scale has no room for both,
and stays NotImplemented(Tessellation) (control::address_fits); the
runtime refuses those two at state creation anyway.
What the stage reads, from the Apple M3 Max's tables (jobs m3-max-80366
and m3-max-80398):
- the patch at position p (patchStart plus its place in the draw) reads its
factors at p, whatever its patch index;
- its [[patch_id]] is the uint at index p of the patch index buffer where
the pushed address is not 0, else p;
- control point j of patch pid is the vertex the index at pid * N + j of
the control-point index buffer names (a ushort read out of its aligned
word for UInt16, a uint for UInt32), else pid * N + j.
Each read goes through the address unchecked, as the factor reads do. No
check form is added.
A fragment function's [[primitive_id]] behind the stage is the patch's
position, with a patch index buffer or without (the same tables): the
control stage writes p to a flat varying at PATCH_POSITION_LOCATION (3),
which the evaluation stage hands on, and the control point varying moves
to location 4. Before, the varying carried the patch index, which equals
the position only without a patch index buffer.
The cache codec carries the two new push fields: ARTIFACT_FORMAT_VERSION
601. Translation output changes for every post-tessellation pipeline
under the identity domains: SEMANTICS_VERSION 2323 (2322 is split-store's).
Tests: control/tests.rs runs the address form's patch index and control
points on the SPIR-V interpreter (both index types, a nonzero and a zero
patch index address) and checks the pushed fields of each form;
engine_tessellation compiles the stream's state under UInt16 and UInt32
on every committed profile with the identity domains, with the fields at
0, 8 and 16, and refuses UInt32 beside a per-instance step or a scale;
lower::push checks the range fits below the window for every step, scale
and index type the form takes.
What Metal reads under a patch index buffer and a control-point index
buffer, from the Apple M3 Max's tables (jobs m3-max-80366 and
m3-max-80398, every form: drawPatches and drawIndexedPatches, direct and
indirect, with and without a patch index buffer):
- patch p of a draw (patchStart plus its index) is patch
pid = patchIndexBuffer[patchIndexBufferOffset / 4 + p], or p without one;
- control point j is element
controlPointIndexBuffer[controlPointIndexBufferOffset / size + pid * 3 + j]
under drawIndexedPatches (u16 and u32 alike), and pid * 3 + j under
drawPatches;
- the factors are entry p of the factor buffer, and [[primitive_id]] is p,
whatever pid is;
- [[instance_id]] includes the base instance, and both instances agree.
Metal's validation refuses four things: drawIndexedPatches through a state
of index type None; drawPatches through one with an index type; a
controlPointIndexBufferOffset that is not a multiple of the index size; and
a patchIndexBufferOffset that is not a multiple of 4.
The tests, in tests/patch.rs:
- every_device_reads_control_points_and_patch_indices_through_their_index_buffers
uses the new fixture tess_indexed_patches. It draws three patches of two
instances from patch 1 and base instance 3, under each index type (None
through drawPatches; UInt16 and UInt32 through drawIndexedPatches, their
indices one index into the buffer), with and without a patch index buffer
(position p is patch 6 - p), direct and indirect. Factor entries 1 and 4
cull, so a build that read factors at the patch index would draw position
1's patch 5 and cull position 2's patch 4.
- every_device_reads_a_patch_s_position_as_its_primitive_id_under_a_patch_index_buffer
draws tess_primitive_ids with a patch index buffer that maps positions 1
and 2 to patches 3 and 0. Each tile sits at its patch index and reads its
position as [[primitive_id]].
- every_device_refuses_the_patch_draws_it_does_not_build now expects the four
refusals, direct and indirect, as typed Refusal variants. The indexed state
is made, where the translator refused it. The indirect test no longer
expects a patch index buffer's Gap::Draw.
The indexed calls take their two index buffers as one PatchIndexBuffers
(the patch index buffer, or none, and the control-point index buffer, each
with its offset), as the indexed primitive draws take an IndexBuffer.
Red: the runtime has no draw_indexed_patches, draw_indexed_patches_indirect,
PatchIndexBuffers or new refusal variants yet, so the tests do not build
(lavapipe, job named in the next commit).
An owned engine fixture for drawIndexedPatches and patch index buffers. It
is a rasterization-disabled post-tessellation function: triangle patches of
three control points, each with one float attribute through a
PerPatchControlPoint layout. Patch pid of instance iid writes its three
control points' values and iid to slot (iid % 2) * 8 + pid % 8. So a
patch's slot names its patch index, and the slot's values name the elements
its control points read.
Regenerated by scripts/regen-air-fixtures on the Apple M3 Max (job
m3-max-80491; one fixture of 585, Apple metal 32023.922, macOS SDK 27.2).
The fixture README gives its row. Its inventory rows and air_input
printout are for the landing bless.
The command built its render descriptor from separate options and set no
tessellation state, so a post-tessellation vertex function always compiled
under Metal's default state: no control-point index type, factor 16,
clockwise. A pipeline of another state, such as one whose control points
come through a UInt32 control-point index buffer, could not be compiled
from the command line.
--tessellation FILE reads the JSON form of TessellationDescriptor (it
derives serde already) into the descriptor's tessellation field. Without
it the descriptor has no tessellation state of its own, as before. A repro
bundle carries the file as tessellation.json, as it carries the stage-input
and vertex descriptors. The README's command-line section and --help name
it. The option lives in the command's binary, which the cli feature
builds.
Metal's heap makes a texture buffer (MTLTextureTypeTextureBuffer): heapTextureSizeAndAlign
answers its texels' bytes at an alignment of 16, and newTextureWithDescriptor:offset: lays the
texels linearly in place at the offset (m3-max-80369, m3-max-80398). rt refused both with
Refusal::TextureBufferNotOverBuffer.
Now:
- Device::heap_texture_size_and_align of a texture buffer answers width x texel bytes, unrounded,
at 16, or at the device's texel-buffer offset alignment for the format where that is larger
(minimum_texture_buffer_alignment). No Vulkan call.
- Device::new_heap_texture and new_heap_texture_for_views of a texture buffer place a buffer of
those bytes at the offset as new_heap_buffer places one, and make the texture buffer over it as
Buffer::new_texture makes one, through the same texel_texture: one buffer view, one form on
every device, no query. It takes the heap buffer's heap id and placement, so its uses are the
heap's in the hazard sets and its writes mark the heap's aliasing textures stale.
- Its backing is TextureBacking::Texture, as Metal answers its buffer with nil.
- A placement past the heap or off the alignment is Refusal::HeapTexturePlace. A heap in an
exported block makes one too: a buffer view needs no image.
- texel_texture's descriptor checks move to texel_shape and texel_width, shared with the size
answer.
TextureBufferNotOverBuffer stays for new_texture, new_texture_for_views, new_managed_texture and
new_drawable_texture. The test also checks HeapTexturePlace at offset 8 and past the heap's end.
Docs: the runtime's README (textures, heaps, exported blocks), docs/API.md's heap-size accepted
difference, the refusals' docs; docs/REFUSALS.md regenerated.
Conformance ledger (docs/CONFORMANCE-COVERAGE.md regenerated):
- 22 rows of a one-level RGBA8Unorm, R8Unorm or RGBA16Float texture buffer's heap size in the
texture-pairs cases are dropped: the replay now matches them;
- 6 rows of a texture buffer of 2 or 7 levels now record Refusal::TextureLevelCount, as
Buffer::new_texture refuses it, where Metal's heap answers one level's footprint;
- 11 rows of RGBA16Float_XR, YCBCR8_420_2P, Unspecialized and BGRA4Unorm texture buffers' heap
sizes now record Gap::TextureFormat;
- the device's newTextureWithDescriptor: rows keep TextureBufferNotOverBuffer, their reason
naming the heap as the other way to make one.
Verified (the change at 6d5f748347 on 787fbbb061, then this commit rebased onto development
8a2f155883, the same change):
- red: the test fails at heap_texture_size_and_align on llvmpipe (job m3-max-80460) and on the
RX 7900 XTX and the 780M (m3-max-80461);
- green: it passes on llvmpipe, whose 6 dispatches reach the buffers at their addresses
(m3-max-80460), and on the RX 7900 XTX and the 780M, bound (m3-max-80461). Each device's
texel-buffer alignment for R32Uint is 4, so all three answer 16 at 16;
- the conformance replay matches known-gaps-rt.tsv: llvmpipe, every case (m3-max-80487, and on
this tree m3-max-80503); the RX 7900 XTX, the 8 cases the ledger edit touches (m3-max-80488);
the conformance suite, 1047 passed (m3-max-80493);
- on this tree (m3-max-80502): signatures, refusals, both coverage checks, fmt, clippy plain,
--cfg m2v_gpu and --cfg m2v_cpu_icd, rustdoc and private rustdoc, all 0; the runtime suite on
llvmpipe 942 passed, 1 failed, 4 skipped. The failure,
private_sinks::every_device_keeps_a_store_past_a_private_array_off_its_words, fails the same
at development 8a2f155883 without this change (m3-max-80535) and passed at 787fbbb061 with it
(m3-max-80462, 940 passed).
A guest's viewer asks heapTextureSizeAndAlignWithDescriptor: of a texture-buffer descriptor and
makes the texture in a heap. rt refuses both with Refusal::TextureBufferNotOverBuffer.
The test asks for what Metal does on an Apple M3 Max (m3-max-80369 and m3-max-80398):
- a 4-texel R32Uint texture buffer is sized 16 bytes at an alignment of 16;
- a Shared and a Private heap make it at offsets 0, 16 and 4096;
- it reads the bytes a buffer placed at the same offset wrote, because placement keeps a reused
region's bytes;
- tb_atomic adds 3 to each texel, and the sums land in place, linear, in the heap's bytes, with
the sentinels past them unchanged.
Red here: heap_texture_size_and_align refuses the descriptor.
The sink (lower::access::quad::sink) ran on the specialized entry, before lockstep's order, on
every profile. Lockstep pairs only accesses that reach each other on one path, so a store moved
into each way of a branch whose lanes diverge lost its pairs with the other way's accesses:
under a key that orders lanes (the resident-table domains), a pair the program has, which
lockstep would have ordered, went unordered. The sink now runs on the ordered entry, and only
under a key that orders nothing (OrderKey::orders_nothing, the identity domains, which order no
pair and so lose none); under a key that orders, the store stays in its block. Under the
identity domains the same stores move; the order, which inserts nothing there, now finds the
pairs behind its SimdgroupAccessOrder note in the program as written.
engine_store_quad's descriptor-profile test now asks for sst_split's seven word stores there.
Verified: the test fails before this change, on moltenvk-m3 with seven stores where six are
expected (filtered, 3 tests), and passes after (filtered, 47 tests), with clippy clean
(m3-max-80575). Under the identity domains the change moves the same stores: the row_tail module
is byte-identical before and after it on the committed rtx50, lavapipe, 780M and Iris Xe profiles
(m3-max-80635). At the branch's last commit: clippy in all three configurations, rustdoc, the
runtime's suite on lavapipe (942 passed, 4 skipped), the translator's (3412 passed, 37 skipped,
the tables a bless is due for left out), validation's (1319 passed, 3 skipped) and
conformance's (1047 passed) (m3-max-80665).
memory::views said every bound range is a whole number of 16-byte units, and lower::access::quad
leaned on it for the 16-byte store through a robust view. A range is its bind offset plus the
buffer's length, rounded up only to robustStorageBufferAccessSizeAlignment (at most 4), so a
16-byte unit can straddle its end, and Vulkan lets a device drop the whole unit there. Such a unit
holds bytes past the end of the Metal buffer, which only a program that accesses past its
buffer's end reaches, and Metal does not define that; for every other unit the old reasoning
holds. Both docs now say so. No code changes.
sst_lanes, written by hand: thread g stores g + 1 at word 4g of out, then branches on its index
in its simdgroup. The lanes below 16 store zero at the next three words, so the store before the
branch begins four at consecutive words in that way, and read word 4g + 64, which lane t + 16
stored before the branch. Under a key that orders lanes, lockstep pairs the store with that read
and orders the two; moved into each way of the branch, the copy in the other way reaches the read
on no path and the pair is lost. The test asks, on the descriptor profiles, for the AIR's six
stores in the ordered entry beside an inserted barrier, and under the identity domains, which
order nothing, for the store moved into both ways (seven) and no barrier.
Red: the sink runs before lockstep's order on every profile, so the descriptor profiles' entries
hold seven stores.
Four authored cases over engine/split_store_tail, 16 threads at two a row over 8 rows, out
filled with 0xCD: sst_split at rows of 7, 6 and 5 floats (each row's second thread writes
three, two or one float after its first) and sst_block at rows of 7 (the four in one block,
nothing where the row does not hold them). A row starts at 4w bytes times its index, so the
first word of a run of four sits at every residue of 16 across the rows. Installed with
corpus-case-check (m3-max-80423) and qualified on Metal on the Apple M3 Max, three executions
each (m3-max-80428). Each Metal output equals the MSL's stores computed on the CPU, byte for
byte (output sha256 d875b981, 2f994d06, 1a84d360, 21ceb16b).
scripts/qualify-public-cases now runs the four on lavapipe against those rows. At the branch's
last commit their Vulkan runs match Metal on lavapipe (m3-max-80560), the AMD Radeon RX 7900 XTX
(m3-max-80568) and the AMD Radeon 780M (m3-max-80570). Not run on an Intel card.
A row of floats written four at a time from a float4, with its tail guarded, stores the first
float in one block and the other three in the block its branch takes when the row holds them.
Each store was its own word store. Now the specialized entry moves such a block's last store
into both successors of its branch, where one of them opens with the three stores after it
(`lower::access::quad::sink`). Selection then finds, in one block, four plain word stores at
byte offsets k, k+4, k+8 and k+12 from one base with nothing between them that touches memory,
all reaching one slot (`quad::plan`). The last of them emits the four; the others emit nothing.
At emit each invocation tests the first word's offset: where it is a multiple of 16 and the 16
bytes pass the slot's containment check, the four words are one uvec4 store (through the slot's
uvec4 view where the kernel binds its buffers, at the device address with Aligned 16
elsewhere); otherwise the four word stores run as selected, each checked by itself. At a device
address the 16 bytes are checked in the shader, so a store that straddles the buffer's end keeps
every in-range byte. One form on every device: the memory decides only where the store goes, as
for every other access. Under the descriptor profiles, where lockstep orders lanes, a barrier it
puts between the stores keeps them words.
engine_word_phases's alignment test now allows the two tested 16-byte stores of vwp_words's
two runs of four word stores. SEMANTICS_VERSION 2322 (development holds 2321): the SPIR-V of
such kernels changed.
Verified: engine_store_quad, engine_word_phases and the access tests pass on the interpreter
in both forms at bind offsets 0, 4, 8 and 12 (m3-max-80331, m3-max-80352); clippy in all three
configurations, rustdoc, the runtime's suite on lavapipe (937 passed, 3 skipped) and the
translator's (3404 passed, 37 skipped, the tables a bless is due for left out) at the change
(m3-max-80386).
Timed with the harness's row_tail workloads, the harness commit against this change, the arms
alternated in one job per card; GPU time, the median of the rounds' medians:
- NVIDIA GeForce RTX 3090 (m3-max-80449, 4 rounds): the Shared rows fell from 46.3 to 2.12 ms
(224 floats a row), from 52.4 to 3.29 ms (49) and from 24.8 to 19.4 ms (27,730, bimodal in
both arms); the Private rows took 0.2 to 0.4% longer.
- AMD Radeon RX 7900 XTX (m3-max-80450, 4 rounds): every row within 1.1% of the base.
- AMD Radeon 780M (m3-max-80482, 8 rounds): the times fall in two clock states, the change's
runs in the slower one in 5 of 8 rounds and the base's in 2 to 4; within a state the change
takes 0.973 to 1.014 of the base's time.
Not run on an Intel card. Those jobs ran an earlier build of this change on an older
development; its row_tail module equals the one at this branch's last commit byte for byte on
the committed rtx50, lavapipe, 780M and Iris Xe profiles (m3-max-80707, m3-max-80705).
engine_store_quad compiles split_store_tail's two kernels on every committed profile under the
identity domains, each with its kernel buffers at their device addresses and, where the profile
binds them, bound. It asks for one 4-lane store into buffer memory beside the word stores of the
other arm and the kernel's other ways, the uvec4 view of `out` where the buffers are bound, and,
on the interpreter at bind offsets 0, 4, 8 and 12 with rows of 5 to 8 floats, every word of
`out` as the MSL stores it. A second test holds the descriptor profiles: where lockstep puts a
barrier between the stores none joins.
Red before the change: `out` has one view, not two, and no 4-lane store (m3-max-80271).
row_tail writes a row of `shape.x` floats four at a time from a float4: the first float, then
the next three where the row holds them, else the next two, else the next one. Six workloads
run it: rows of 224 floats (every row 16-byte aligned), 27,730 (every other row) and 49 (one
row in four), each into a Shared buffer over about 381,000 threads and into a Private one over
16 times as many. Each checks the whole output against its CPU reference. They time the store
shape the translator's next change merges.
Companions regenerated by scripts/regen-air-fixtures --dir harness on the M3 (m3-max-80294).
Our own MSL of the shape a guest kernel writes its output in: thread gid reads in[gid] (a float4)
and writes its lanes to a float buffer at element row * w + col, col = (gid % d) * 4. sst_split
stores the first lane in one block and the other three in the block its branch takes where
col | 3 is inside the row (else the next two, else the next one); sst_block stores the four in
one block. Apple's compiler keeps the four scalar stores, at add i32 %i, 1 / 2 / 3, zext to i64.
The element's byte offset is a multiple of 16 only where w is.
Companions from scripts/regen-air-fixtures (job m3-max-80214 on the M3: Metal 32023.922, SDK
27.2). The engine inventory gets its four rows, written as ok on every profile, and the golden
printout under tests/air_input comes from bless_engine_goldens on the M3 (m3-max-80509); the
golden hashes are left to the bless on development.
At da37e9e5df's macOS leg (run 46984549568) the validation suite stopped at its first failure,
with 831 of its 1326 tests not run; the failure before it had hidden that one for a whole cycle in
the same way. Every nextest step of both legs now passes --no-fail-fast: the three suites
(metal2vulkan and its sibling crates, validation, conformance) and, on Linux, the device tests
lavapipe-image runs in the image (its nextest command takes nextest's arguments after the
filters). A red step stays red; only how much runs after the first red changes. The CI replica
reads ci.yml, so it runs the same way.
Verified: the replica job named on the ready line runs these steps.
The CI's macOS leg at da37e9e5df (run 46984549568) failed
check::admission::tests::a_metal_row_from_an_earlier_oracle_needs_metal_qualification: on macOS
engine::execute returned Failed("Vulkan candidate execution is not available on macOS") where the
test expects NeedsMetal(OracleAbi). execute_prepared called validate_host before it read the
case's Metal observation, so on macOS the host's refusal hid the admission's device-free answer.
Whether a case needs Metal qualification does not depend on the host.
Now execute_prepared reads the Metal observation (MetalObservation::current, from the case's Metal
shard alone, no device) first and refuses the host after it, before the device half. A run on
Linux is unchanged: the gate passes there. The order of every other refusal is unchanged.
The same order decides the_engine_candidate_is_admitted_whatever_its_loops (the same file; it
expects NeedsMetal(Missing) on both devices), which never ran on macOS: nextest stopped at the
first failure. No other test reaches validate_host: engine::execute's callers are those two tests
and corpus-vulkan's candidate_common; the device worker's tests start the worker directly.
Verified: on Linux in the jobs named on the ready line. On macOS expected from the code reading,
not run; the remote macOS leg is the run.
The CI's ubuntu leg at da37e9e5df (run 46984549568) failed its conformance replay: on an x86-64
AVX-512 runner, llvmpipe of Mesa 26.2.4 and LLVM 23.1.1 gave five sites the counts the ledger keyed
to AVX2 hosts, where the AVX-512 runners of runs 46969176610 and 46974578786, in the same image,
gave the AVX-512 rows' counts. The count follows a property of the host finer than its widest
vector set, which the venue does not state, so no venue key separates the two.
Ruled by the planner: for those five sites only, the llvmpipe row accepts the set of counts
recorded there, each named with the run it came from; any other count on those sites, and any
difference on any other site, still fails. The venue string carries no new property.
Now:
- known_gaps: a row's answer field may list more than one answer, with ` | ` between them
(ANSWER_SEPARATOR). KnownGap::answers lists them; the row covers each and no other, in both
directions: a run holding any of them holds the row, a third answer is a new gap and reads the
row as no longer held, and a site that no longer diverges reads it as fixed. A row of one answer
is compared as before.
- known-gaps-rt.tsv: the AVX2 and AVX-512 rows of each site become one llvmpipe row:
- fetch-ordered-bgra8unorm-srgb and fetch-ordered-rgba8unorm-srgb at case/x3 and case/x3-depth:
6304 or 6496 elements (U8), the largest difference 2;
- blend-interaction-format-srgb8 at case/blended/one-one-subtract: 81 or 78 elements (U8), the
largest difference 3.
Each row's gap names the runs of each count, from the commits that wrote the rows and CI's runs:
6304 by the lavapipe legs of m3-max-55331 to 55337 (x3) and m3-max-55569 to 55574 (x3-depth),
m3-max-56427 (LLVM 23.1.1) and CI run 46984549568; 6496 by m3-max-56238 and m3-max-56342
(LLVM 23.1.4) and CI runs 46969176610 and 46974578786 (LLVM 23.1.1); 81 by m3-max-50686 and
m3-max-56427 (LLVM 23.1.1), m3-max-63645 (LLVM 23.1.4) and CI run 46984549568; 78 by
m3-max-56238 and m3-max-56342 (LLVM 23.1.4) and CI runs 46969176610 and 46974578786. The venue
is llvmpipe, as the same cases' x1 and x2 rows are, so the lab's LLVM 23.1.4 hosts, which gave
the same counts, stay covered.
- Docs: the ledger's header, the conformance README and known_gaps's module doc describe the form;
Venue::host's doc and the README no longer say a CPU venue's answers follow its vector set.
CONFORMANCE-COVERAGE.md regenerated (5 ledger rows fewer).
Verified: coverage.py --check, refusal_surface.py --check and metal-coverage --check pass here;
the red test, the CI replica and the lint are in the jobs named on the ready line.
The CI's ubuntu leg at da37e9e5df (run 46984549568) failed its conformance replay on an x86-64
AVX-512 runner, llvmpipe of Mesa 26.2.4 and LLVM 23.1.1: five sites gave the counts
known-gaps-rt.tsv records under the AVX2 venue (6304 elements at the x3 and x3-depth sites of
fetch-ordered-bgra8unorm-srgb and fetch-ordered-rgba8unorm-srgb, 81 at blend-interaction-format-
srgb8's one-one-subtract), where runs 46969176610 and 46974578786, on AVX-512 runners of the same
image, gave the AVX-512 rows' 6496 and 78. The property that decides the count is finer than the
host's widest vector set the venue states, and a row holds one answer.
The test: a row of the ledger's own format listing two answers with ` | ` between them covers a
run that answers either; a third answer is a new gap and reads the row as no longer held; a run
that no longer diverges reads it as fixed; a row of one answer covers that answer alone, as
before.
Red here: the ledger compares the whole answer field, so neither answer of the two-answer row
matches it.
The bless for pin I at 5e0d5fb6ea, run on the M3 Max (job m3-max-80645): bless_engine_inventory,
bless_golden_hashes and bless_engine_goldens each exited 0, and the metallib half of
committed_air_fixtures_parse_and_link ran unskipped (linkhalf=0). Only golden_hashes.tsv moves:
40 rows, the run-time indexes into array fields that now go to the private sink rather than the
last element (511f31b0ba). Generated by the bless tests; no hand edits.
The two doc lines 511f31b0ba missed: memory::provenance's array_bound and
engine_parked_handles' compile test still said each run-time index into the
array field is clamped. Lowering sends such an access to the private sink
where an index is past its array. Doc text only; cargo fmt.
a992aa6929 bounded a GEP into an array field of a thread variable to its
array, so a struct holding handles beside a run-time-indexed array closes
as a forwarding cell. In the private arena it held every run to that bound
by clamping each run-time index to the array's last element. A store past
the array then landed on the array's own last word. The runtime's
private_sinks contract wants such a store kept off every word a thread
reads, as a store past a private array is. On lavapipe at development
8a2f155883 (job m3-max-80535),
every_device_keeps_a_store_past_a_private_array_off_its_words failed: the
fold over the arrays moved by about 193,700, which is b[k]'s store of
t + 200000 over b[N - 1]. The same test at 8a2f155883 with a992aa6929
reverted (scratch tree, job m3-max-80554) is the cause check.
The bound only promises that no run reaches outside the variable; where an
out-of-range index lands is undefined in MSL. So the GEP's offset is now
the sink's, 2^32 - 1, where any run-time index is above its array's last
element: ULessThanEqual per index, LogicalAnd across them, and one select.
No arena holds that offset, so the access's existing containment check
makes it a zero load or no store, as an access past a private array is,
off the array's words and every other's. The forwarding analysis keeps
relying on the in-field assumption alone (memory::provenance, unchanged).
parked_heap_handles' run-time-indexed array fields stay bounded and the
struct still closes (access.private.gep.array, 3 uses).
docs/API.md's accepted difference says it: a read past the end of an array
field reads zero and a write is dropped, in the private arena as in a
variable of its own. The local, provenance and parked-handles docs say the
same. The device-arena budget test's run-time-index shapes cost one
instruction more than the clamp (a compare and a select in place of a
UMin): bounds 14, 13 and 25. SEMANTICS_VERSION 2321 (development holds
2320).
The bless for pin I at 8a2f155883, run on the M3 Max (job m3-max-80469): bless_engine_inventory,
bless_golden_hashes and bless_engine_goldens (llvm-as 21) each exited 0, and the metallib half of
committed_air_fixtures_parse_and_link ran unskipped on the fixtures' SDK (linkhalf=0).
- golden_hashes.tsv moves from semantics 2318 to 2320: the dead-type removal, the evaluation
stage's output limit and the post-tessellation series.
- public_fixture_expectations_engine.tsv gains the seven new rows: parked_heap_handles,
parked_heap_handles_read, _copied and _stepped, tess_primitive_ids,
tess_primitive_ids_fragment and tess_draw_bases.
- air_input printouts for parked_heap_handles, tess_primitive_ids and tess_draw_bases.
Generated by the bless tests; no hand edits.
engine/rvc_draw_bases.ll is the public source of four committed cases,
which check its hash. Regenerating it to add draw_bases_after_tessellation
(and under a newer metal) failed all four in
committed_public_cases_check (lavapipe's host, job m3-max-80338). The
fixture goes back to the AIR its cases check, and the function moves,
unchanged, to engine/tess_draw_bases, regenerated by
scripts/regen-air-fixtures on the Apple M3 Max (job m3-max-80403; one
fixture of 584 regenerated, Apple metal 32023.922, macOS SDK 27.2). The
fixture README gains its row and rvc_draw_bases's row is as before.
The translator test the_base_instance_after_tessellation_is_the_patch_input_or_the_push_lane
reads base_instance_after_tessellation from rvc_draw_bases and
draw_bases_after_tessellation from tess_draw_bases, and the runtime's
every_device_reads_a_patch_draw_s_base_instance_after_tessellation draws it
from there. The engine inventory's new row is tess_draw_bases's, in place
of rvc_draw_bases's draw_bases_after_tessellation, for the landing bless.
The evaluation stage's varying carries Metal's patch index, which is the
patch's position in its draw only where no patch index buffer is bound. With
one, Metal's [[primitive_id]] stays the patch's position while its patch
index is the buffer's entry (an Apple M3 Max, job m3-max-80366), so the
docs now say which draws the varying's value is Metal's for, and that the
runtime records no patch draw through a patch index buffer
(DrawKind::PatchIndexBuffer stays refused). The translator module docs,
lower_inputs, the tessellation link module, docs/API.md and the runtime
README say so; no code changes.
Doc lines past 100 columns in stage_io/plan.rs, lower_inputs.rs, the
tessellation link module and the engine_device_arena and engine_draw_bases
tests are rewrapped, and the patch test's println is shortened under the
limit.
Behind an evaluation stage, Metal's [[primitive_id]] is the patch's position
in its draw, patch start included, the same in every instance and for every
triangle the tessellator makes of the patch (an Apple M3 Max, job
m3-max-80266: draws of two patches from patch 0 over two instances read 0
and 1 in both instances; two patches from patch 2 read 2 and 3). Vulkan's
PrimitiveId there counts the draw's patches from 0 and restarts in each
instance (the specification's PrimitiveId: "The index of the first primitive
generated by a drawing command is zero ... reset to zero between each
instance drawn ... In a fragment shader, it will contain ... the value that
would have been presented as input to the geometry shader had it been
present"), so it differs once patchStart is not 0. The translator refused
such a pipeline at link, NotImplemented(Tessellation), which a walk's
pipeline met behind its post-tessellation [[base_instance]].
The fragment function now reads it through the primitive ID's flat varying
(IoRole::PrimitiveId), on every device, one form: a post-tessellation
vertex function compiled under LoweringInputs::primitive_id_varying writes
Metal's patch index, its patch input at PATCH_INDEX_LOCATION, to that
varying at each return (stage_io::PrimitiveIdStore::Patch). Without a patch
index buffer the patch index is the patch's position; the runtime draws no
patches through one (DrawKind::PatchIndexBuffer stays refused), and the docs
state the value for draws without one. The same value
reaches every vertex of the patch, so the provoking vertex does not matter.
Device::compile_render_pipeline and the render keys decide the varying for a
post-tessellation vertex stage as they do on a device without a fragment
PrimitiveId; the library answers that without decoding the function (a
metallib function's TESS tag, a module entry's air.patch), and a compiled
stage from its interface. Link refuses a fragment function compiled to read
Vulkan's PrimitiveId behind an evaluation stage as NeedsInput(PrimitiveId),
where it refused every such fragment as NotImplemented(Tessellation);
docs/REFUSALS.md is regenerated.
The varying takes a location as any other: the evaluation stage's outputs
are held to maxTessellationEvaluationOutputComponents when it is planned,
and link numbers the fragment's inputs below maxFragmentInputComponents / 4,
each a typed InterfaceComponents limit refusal past it.
Tests: a_fragment_primitive_id_behind_tessellation_is_the_patch_index_varying
(MoltenVK's and RADV's profiles: the evaluation stage reads the patch-index
input, the fragment stage one flat input and no PrimitiveId, L3), the link
test of a fragment that reads Vulkan's PrimitiveId, and the runtime test
every_device_reads_a_patch_s_position_as_its_fragments_primitive_id, green on
lavapipe (llvmpipe), job m3-max-80338.
The owned fixture tess_primitive_ids (MSL we wrote, its companions
regenerated on the Mac, job m3-max-80275) is a post-tessellation vertex
function (triangle patches of three control points, no stage-in) that places
patch pid of instance iid in its own tile of an 8x8 target and passes pid and
iid flat, and a fragment function that writes [[primitive_id]], pid, iid and 1.
Metal's answer, read on an Apple M3 Max (job m3-max-80266, the same shape at
64x32, every factor 4 with the integer partition): every fragment of every
triangle of a patch reads one value, the patch's position in its draw,
patch start included, the same in each instance. A draw of two patches from
patch 0 over two instances reads 0 and 1 in both; a draw of two patches from
patch 2 reads 2 and 3. Vulkan's PrimitiveId behind an evaluation stage counts
the draw's patches from 0 and restarts in each instance, so it reads 0 and 1
for the second draw.
every_device_reads_a_patch_s_position_as_its_fragments_primitive_id draws
both in one pass and checks every covered texel of each drawn tile, and that
the tiles no patch draws stay clear. Today the translator refuses the
pipeline: Tessellation, NotImplemented, at link (a fragment function that
reads [[primitive_id]] behind an evaluation stage).
Red on lavapipe (llvmpipe), job m3-max-80279: "Tessellation; needs
NotImplemented" for the state; the control draw passes.
Metal gives [[base_instance]] to a post-tessellation vertex function on every
Mac device. An evaluation shader has no BaseInstance builtin, so the
translator read it from the second lane of PushField::BaseVertexInstance, an
encoder value the identity domains do not admit: the runtime refused every
such state.
On a profile with shaderDrawParameters (the runtime's floor), the base
instance now travels the way the instance index already does: the
synthesized vertex stage reads BaseInstance and writes it to the new fixed
location TessellationStage::BASE_INSTANCE_LOCATION (2), the control stage
hands it on as a patch output, and the evaluation stage reads that patch
input. CONTROL_POINT_LOCATION moves from 2 to 3. The runtime records a patch
draw as vkCmdDraw(patchCount, instanceCount, patchStart, baseInstance), and
reads MTLDrawPatchIndirectArguments as VkDrawIndirectCommand, so the builtin
is Metal's baseInstance in both forms. A profile without shaderDrawParameters
keeps the push lane, as a plain vertex function's [[base_instance]] does
there; the identity domains and the push window do not change.
TessellationStage is crate-private (pipeline::interface is pub(crate) and
does not re-export it), so neither constant is on the published surface.
The consumer's checkout names none of CONTROL_POINT_LOCATION,
INSTANCE_LOCATION, BASE_INSTANCE_LOCATION or TessellationStage
(consumer-uses.sh, development cba3a88875: 0 hits each).
Tests: the translator test
the_base_instance_after_tessellation_is_the_patch_input_or_the_push_lane
compiles both post-tessellation entries of rvc_draw_bases on every committed
profile with tessellationShader and on runtime-floor without
shaderDrawParameters: the patch input at BASE_INSTANCE_LOCATION with the
feature, the push lane and its fact without it, L3 either way. The
synthesized vertex stage passes L3 with and without the carry. The runtime
test every_device_reads_a_patch_draw_s_base_instance_after_tessellation is
green on lavapipe (llvmpipe), job m3-max-80249 (52 passed: the
runtime's patch tests, engine_draw_bases, engine_tessellation and the
link's tessellation tests). The walk's vertex function now compiles
(m3-max-80250, the XTX node).
The owned fixture rvc_draw_bases gains draw_bases_after_tessellation: a
rasterization-disabled post-tessellation vertex function (triangle patches of
three control points) whose patch pid of instance iid writes pid, iid,
[[base_instance]] and 1 to slot (iid % 4) * 8 + pid % 8. The companions are
regenerated from the MSL on the Mac (job m3-max-80217).
Metal's answer, read on an Apple M3 Max (job m3-max-80206): the pipeline is
made, and a drawPatches of two patches, instanceCount 2, baseInstance 3 runs
each patch of instances 3 and 4 with [[base_instance]] 3.
The runtime test every_device_reads_a_patch_draw_s_base_instance_after_tessellation
draws that function directly and from MTLDrawPatchIndirectArguments with the
same counts and checks every slot. Today the translator refuses the state on
every runtime device: under the identity domains the evaluation stage's
[[base_instance]] is a pushed encoder value they do not admit.
Red on lavapipe (llvmpipe), job m3-max-80232: "IdentityDomains (an encoder
value the function reads as BaseVertexInstance); needs NotImplemented"; the
control draw passes.
pulled_read takes (ControlPoint, Constant) as it takes (Patch, Constant):
Element::None, the attribute's offset alone, with no stride pushed or
depended on. A control-point call fetches such a member with no element.
It computes the control point's element only when some member steps per
control point, so a struct of Constant members alone needs no elements
input. The module doc states the rule and Metal's measured answer (every
control point reads element 0, Mac job m3-max-80062).
Verified: lavapipe (llvmpipe), job m3-max-80143 at the same tree on a
scratch branch: both tests pass, with the patch draws beside them.
A post-tessellation vertex function may read a control-point attribute
whose vertex buffer layout has the Constant step function (step rate 0).
Metal makes such a pipeline, and on an Apple M3 Max every control point of
every patch reads the layout's element 0 at the attribute's offset (an
Objective-C probe, Mac job m3-max-80062; the other elements held other
values and none was read). That matches Apple's documentation of
MTLVertexStepFunctionConstant ("fetches attribute data once and uses that
data for every vertex"). The translator refuses the pair,
NotImplemented(Tessellation), and a walk met that refusal behind the
array-field one.
- a_control_point_attribute_on_a_constant_layout_reads_its_one_element
(engine_tessellation): tess_triangle_points with its control points'
half2 from buffer 2 at offset 4, on a Constant layout, compiles. It
pushes no stride of buffer 2 and passes L3.
- every_device_reads_a_constant_layout_s_one_element_at_each_control_point
(rt, patch): the same draw as
every_device_draws_patches_from_their_factors, with that half2 shifting
the third control point's x. Element 0's half2 at offset 4 is 0;
element e's is e, with 5 at offset 0. So a control point that reads
another element, or the element's first bytes, moves the patch and
changes the texels.
Red: lavapipe (llvmpipe), job m3-max-80108: both refused, "Tessellation;
needs NotImplemented at function tess_triangle_points"; the control draw
passes.
A thread struct that holds pointers or heap handles beside an array field
indexed at run time was open to pointer forwarding: provenance made the
offset of any run-time index unknown, so the data access could overlap a
pointer slot. A heap handle stored into such a struct then fell to the
handle family's catch-all, Lowering(Access). That is the refusal of a
post-tessellation vertex function a walk met (two render pipeline states
refused).
The Metal Shading Language leaves an index past an array undefined. So a
thread-space getelementptr whose first index is a constant, each of whose
run-time indices steps over an array its own type path names, and whose
every use is a load or store address, is a GEP into an array field
(provenance::array_geps). Over a base whose roots are stack allocations at
constant offsets, its offsets are its displacement plus at most
(len - 1) * stride per run-time index. These keep unknown offsets: a
flattened offset (a run-time pointer index), a run-time vector lane, an
address another GEP offsets or that is merged or stored, a base that may
be null, and memory outside the thread space. A run-time index at a struct
level has no IR form.
Lowering holds every run to the bound. In the private arena, where
objects lie side by side, such a GEP takes each run-time index as
min(index, len - 1) (access.private.gep.array). A typed object's access
already never leaves its levels. docs/API.md records the accepted
difference: an index past the end of an array field of a local struct
does not reach its neighbouring fields; it is undefined in MSL. The
struct then closes as a forwarding cell, and its heap-handle stores that
no load reads take the cell's unread store (the previous commit).
Verified:
- red: m3-max-80079, b9d9dfc9ba (parked_heap_handles refused at its
handle store, block 0 instruction 11).
- green: gate m3-max-80143 at the same tree on a scratch branch
(lavapipe tests 47 passed; validation 1315 passed, 3 skipped;
conformance 1047 passed; the translator suite's only failures are the
tables development re-blesses: the engine inventory with four new
parked_heap_handles rows, the golden printout, and 315 golden hash
cells under SEMANTICS_VERSION 2319).
- L0: a_gep_into_an_array_field_is_bounded_to_the_array (the bound, and
each disqualifying shape staying unknown).
- read-back, whole-struct copy (a memcpy) and a stepped address stay
Lowering(Access).
- the walk's two metallibs on the XTX node (m3-max-80156): the handle
store's refusal is gone; the vertex function next met the two
refusals the following commits remove.
Cost: one UMin per run-time index into a private-arena array, the bound
itself. The device-arena budget test's word bounds move by one each (13
for a word load, 12 for a word store, 24 for a float4 load).
SEMANTICS_VERSION 2320 (development holds 2319).
The owned fixture engine/parked_heap_handles now matches the shape a
post-tessellation vertex function was refused for: a thread struct holds
heap handles (a sampler and a texture loaded from argument buffers, also
sampled directly) beside two array fields a loop writes at a run-time
index, and the out-of-line callee reads one array at a run-time index.
Every run-time index sits at an array level of its GEP's own type path.
Such a data access at an unknown offset opens the struct today, so the
handle stores fall to the handle family's catch-all, Lowering(Access).
heap_handles_parked_where_nothing_reads_them_compile expects the kernel
to compile with both handle stores unread and the three run-time array
indices clamped in the private arena. The read-back, copied and stepped
kernels (an address offset by a second GEP after the array GEP) must
stay Lowering(Access).
Companions regenerated with Apple metal 32023.922, macOS SDK 27.2
(Mac job m3-max-80076).
A heap texture or sampler handle (a handle loaded from an argument
buffer, whose root is Dynamic) stored into a field of a thread struct
that is a forwarding cell was refused at the store, Lowering(Access)
NotImplemented, because no cell encoding carries a heap handle. A
post-tessellation vertex function seen in a guest's render pipeline
parks three samplers and three textures from its argument buffers in a
struct that nothing ever reads them back from, so the whole pipeline
was refused at the first of those stores.
cell::select's store arm now asks the store's slot group for its
loads before it needs an encoding: where the group holds no load
(cell_reads has no entry for it), a pointer no cell encodes writes
nothing (CellStrategy::Unread, census name access.cell.unread). A
store whose value has an encoding still writes it, as before, so pools
(which data loads may read) are untouched: a pool holds arena pointers
alone, each of which a cell encodes.
Why "no load in the group" means nothing observes the slot: the
group is formed over every access of a closed forwarding cell, and a
cell is closed only while nothing else reaches it
(memory/provenance/cells.rs, Round::walk):
- a store of the cell's address into memory that does not forward it
opens it (line 1218);
- any other operand use, a call the translator does not inline, a
ptrtoint, an atomic or an aggregate, opens it (line 1241);
- a memcpy or memmove whose bytes meet a pointer slot is a data
access and opens it (line 1146), unless it is a slot copy between
two cells (line 1134), which joins the source and destination slots
into one group (CellFacts::groups, line 172), so a load of the copy
is a load of the group.
Still refused, by the same Lowering(Access): a heap handle in a slot
that a load reads, directly or through a copy. Carrying a heap handle
through a cell to a load would take a cell encoding for the looked-up
handle, whose form (flagged or indexed) follows its uses; that form is
not built here.
The test of the previous commit pins both: parked_heap_handles
compiles, with its two handle stores as access.cell.unread, and the
read-back and memcpy controls stay Lowering(Access).
The owned fixture parked_heap_handles loads a sampler and a texture from
argument buffers, passes them by value to a thread struct's constructor,
which stores each as a pointer into its field, and hands the struct by
reference to a function compiled out of line. Once the call is inlined
the struct is a forwarding cell, and no load reads the handle fields.
The translator refuses the first such store today as Lowering(Access)
NotImplemented, at the cell encoding of a handle with a Dynamic root.
The test expects the kernel to compile and pass L3 on every committed
profile with the sampled heap, its two handle stores selected as
unread cell stores, and ArgumentBufferTextures elsewhere. Two controls
read the parked handles back, from the cell and through a whole-struct
memcpy into a second cell, and must stay Lowering(Access).
The companions come from scripts/regen-air-fixtures on Metal
32023.922, SDK 27.2 (jobs m3-max-79932 and m3-max-79936).
A post-tessellation vertex function's module is a tessellation evaluation entry, whose output
interface the Vulkan specification limits to maxTessellationEvaluationOutputComponents / 4
locations (19.1.4, Table 21, Shader Input and Output Locations). Link's check_limits held every
vertex stage's outputs to maxVertexOutputComponents / 4, so on a device whose evaluation limit is
below its vertex limit link placed an evaluation stage's varyings past its locations, and on one
whose evaluation limit is above it refused (or packed) varyings that fit.
check_limits now takes the pre-fragment stage's limit, output_limit: the evaluation limit for a
vertex stage whose interface names an evaluation stage (StageInterface::tessellation), the vertex
limit for any other. Its packing and refusals are otherwise unchanged, and a refusal names the
limit it met. The module doc's Limits paragraph says so.
No committed profile at the floor changes: each has the two limits equal; the below-floor vk12
profile, the one that differs, has no tessellation. The lowering's own check of a
post-tessellation function's output components (lower/stage_io/plan.rs) already used the
evaluation limit.
Link's check_limits (pipeline/link/varyings.rs) holds the outputs of a render pipeline's vertex
stage to maxVertexOutputComponents / 4 locations, a post-tessellation vertex function's too. That
function's module is a tessellation evaluation entry, whose output interface the Vulkan
specification limits to maxTessellationEvaluationOutputComponents / 4 locations (19.1.4, Table 21,
Shader Input and Output Locations). Every committed profile at the floor has the two equal; the
below-floor vk12 profile has 64 and 0.
The test links three four-component varyings, which no packing shares, from a vertex stage whose
interface names an evaluation stage (`PipelineInterface::tessellation`) into a fragment stage:
- with the vertex limit 8 and the evaluation limit 12 they must take locations 0, 1 and 2;
- with the vertex limit 12 and the evaluation limit 8 they must be refused as
InterfaceComponents needing MaxTessellationEvaluationOutputComponents, 12 of 8.
Red today at the first half: link refuses them naming MaxVertexOutputComponents.
Three doc nits from the audit lane's cold read of today's landings:
- TypedModule::remove_dead's doc (spirv/ir/edit.rs) had one 120-column line since dead removal
took any type; it is rewrapped within 100 columns, word for word.
- AccessCause::IndexType said "an index of a type other than an integer". Its one site,
index_form (lower/access/mod.rs), refuses every type but an integer of 1 to 64 bits: a 0-bit
integer and an integer wider than 64 bits too. The doc now names them.
- AccessCause::UnfixedLocation listed "a table's count". A threadgroup argument's count is
checked in check_tables (memory/plan.rs), which names ArgumentTable for any count that is not
a constant 1, a constant or not; the doc now says so and names an argument table's count
alone.
Docs only; no generated doc carries these comments (docs/REFUSALS.md, API.md and the coverage
tables do not), and neither file is a runtime or classifier input of the validation crate.
50170636e7 passed both sides' texel buffers to texel_texture_copy as one
(Option<(Buffer, u64)>, Option<(Buffer, u64)>), which clippy's type_complexity refuses under
-D warnings (blit.rs:344, all three clippy configurations, job m3-max-80104 on ms01). Each side
is now one TexelSide (the texture, its place, and its Texture::texel_buffer where it is a texture
buffer), as the two sides were (texture, place) pairs before. No behaviour changes.
Metal makes copyFromTexture:...toTexture: with a texture buffer as the source or the destination.
copy_from_texture refused it as Gap::TextureCopy ("A texture buffer's texels are its buffer's
bytes, which no image copy reaches"). Under the rule that a refusal of what Metal makes is built,
it now copies a texture buffer's texels as the bytes of its buffer (texel_texture_copy):
- Checked as Metal checks any copy: one pixel format and one sample count
(Refusal::TextureCopyMismatch), and each region inside its texture's level and slice (`place`,
Refusal::TextureRegion), sizes of 0 taken as copy_from_texture takes them.
- Between two texture buffers: the region's bytes copied between their buffers by
copy_from_buffer_to_buffer, from each one's offset plus origin.x texels. The same bytes copy
nothing, as the same region of one image does, and bytes that meet are
Refusal::BufferCopyOverlap, as that call refuses them.
- Between a texture buffer and another texture: copy_from_buffer into the texture from the texture
buffer's row in its buffer, or copy_from_texture_to_buffer out of it into that row. That is one
vkCmdCopyBufferToImage or vkCmdCopyImageToBuffer region, checked and ordered as those calls are.
The command buffer keeps both textures. Gap::TextureCopy's doc drops the texture buffer case, and
docs/REFUSALS.md is regenerated. Buffer::new_texture's doc, copy_from_texture's doc and the runtime
README's texture buffer contract say what such a copy does. The texture buffer refusal test no
longer expects the gap from a copy of one into itself; that copy of the same bytes now copies
nothing.
Metal makes copyFromTexture:...toTexture: with a texture buffer on either side; the runtime refuses
it as Gap::TextureCopy (blit.rs, copy_from_texture: "A texture buffer's texels are its buffer's
bytes, which no image copy reaches"). The test makes two RGBA8Unorm texture buffers of 64 texels
over one Shared buffer (A at offset 0 with known bytes, B at 1024 holding 0x5a) and a Private 2D
texture of 16 x 4. A blit copies texels 8 to 23 of A into texels 4 to 19 of B, texels 0 to 15 of A
into the texture's row 2, and that row back into texels 32 to 47 of B. B must hold A's bytes at
both places and 0x5a around them, and A must keep its own. Red today at the first copy.
The runtime README's host-memory bullet gains a second measurement and the condition under which
that copy would have another form on KosmicKrisp.
The second measurement is the consumer's census on the M3 Max (KosmicKrisp, Mesa 26.3.1), at rt
d122da6ae3:
- run A, m3-max-80100, software decode;
- run B, m3-max-80121, the host's decoder;
- two 30 s 1080p screen recordings in each run.
Metrics::over_copy_bytes_host_memory came to 12,178,324,736 bytes in run A and 12,624,820,212 in
run B. The census's other over-copies in run B are 10 Linear copies of 8,294,400 bytes (a 1080p
BGRA8Unorm render target) and Pitch copies of small textures, which it does not total. So the 99.3%
share is derived here from the census's counts: 12,624,820,212 / (12,624,820,212 + 82,944,000).
It covers the host-memory and Linear bytes.
The condition comes from probe m3-max-80267 (Apple M3 Max, KosmicKrisp Mesa 26.3.1; queries only):
- The one handle type with an owner the driver offers is MTLHEAP: importable and exportable for a
plain buffer and for linear sampled BGRA8 and R8 images.
- It lists no VK_EXT_queue_family_foreign. An acquire of another driver's writes would name its
queue family; VK_QUEUE_FAMILY_EXTERNAL covers only the same driver.
- It makes no linear image with COLOR_ATTACHMENT, with or without a handle type.
The bullet says the copy has no other form on that driver until it lists that extension or offers
that attachment.
Docs only. refusal-surface --check passes.
Dead removal dropped only vector and function types, and a module's
requirements were derived from every type its interner ever held, a
forgotten one included. So once a slot's direct base and address left
(fd8b132834), their OpTypeInt 64 and { uint, uint } struct stayed declared,
and the module still declared OpCapability Int64 and required shaderInt64.
Now:
- unread_types drops any declared type nothing that stays refers to (a kept
instruction or phi result, a function that stays, a variable of one, a
global, a push member, a kept constant, or a type itself referred to), of
any kind, after the sweep and the offers' weighing;
- an array type's length is no longer counted as a use up front, since
which array types stay is known only then: the length of each array type
that stays is revived (a scalar constant, which reads nothing), and a
length only a removed array type read leaves with it;
- TypedModule::remove_dead accepts any type, and Types::iter lists only the
types still interned, so the requirements and spec_bits walk the types
the module declares, not the ones it forgot.
This starts from the L155 seat's partial patch (its three changes), which
lacked the lengths list and the edit's check.
Tests: the dead-removal
tests change where more types now leave: the constants kernel's array type
nothing has leaves with its length while a private variable's array type
keeps its own; the offers kernel's pointer type no value has leaves with
the uvec3 only it names (3 types, was 1); the routines kernel without r's
call loses the float type too (3, was 2).
Module words change where an unused type was declared: SEMANTICS_VERSION
2318 -> 2319. The golden tables re-bless on development.
Verified: job m3-max-79992 (no card) at this tree. The previous commit's
test fails there alone, left (2, 0) against (2, 2): two dead instructions,
no type removed. Here all 7 dead-removal tests pass; clippy plain, cpu-icd
and gpu cfg, doc and privdoc exit 0; rt on lavapipe 933 passed, 3 skipped;
translator and AIR 3402 passed, 37 skipped (golden tables excluded, due);
validation 1315 passed, 3 skipped; conformance 1047 passed. Release-mode
translation time and peak memory were not measured.
After fd8b132834 made a slot's direct base and address in the entry block,
dead removal leaves the ones no access reads, but not their types: an
unused OpTypeInt 64 and a { uint, uint } struct stay declared, and with
the 64-bit type the module's OpCapability Int64 (3 of 8 sampled modules in
the byte-identity probe). Dead removal drops only vector and function
types.
The test builds that shape: a kernel that widens a loaded word to a 64-bit
integer and pairs the word with itself in a { uint, uint } struct, and
reads neither. After dead removal both types must leave, and the module
must no longer require Int64 or shaderInt64. Red here: no type leaves, so
the report counts 0 types and Int64 stays.
The runtime README listed that form with no test. tests::reflection_answers (d8efdd3e20) reaches
it: the device's translator refuses the tile pipeline of engine/k10ts_tile_grid with
"unsupported: IdentityDomains (a resource bound through a descriptor)" on lavapipe (job
m3-max-80179) and an RX 7900 XTX (job m3-max-80228), and the test compares that text across every
make.
Docs only. Verified: cargo fmt.
Job m3-max-80136: clippy under m2v_cpu_icd and m2v_gpu flagged the Subject enum's variants'
size difference. Verified: cargo fmt; clippy follows as a job.
The first lavapipe run (job m3-max-80136) panicked at the translator's compile of the tile
pipeline on the device, before any comparison. The tile answer is now the refusal's text where
the translator refuses it, compared like every other answer.
Verified: cargo fmt. The runs follow as jobs.
A pipeline's reflection answers must not depend on the make. This test makes each pipeline
seven times:
- three times on one device;
- once on a second device;
- once on a fresh cache directory, which lowers and keeps each translation;
- once on a device after it on that directory, which reads them;
- once in a second process on the directory.
It compares the answers byte for byte.
The pipelines:
- compute states:
- a tiling kernel;
- an observing kernel;
- one with static threadgroup memory;
- one that declares its thread limit;
- fold_config, specialized by function constants.
It compares maxTotalThreadsPerThreadgroup, threadExecutionWidth, staticThreadgroupMemoryLength,
imageblockMemoryLengthForDimensions:, supportIndirectCommandBuffers and
requiredThreadsPerThreadgroup.
- render states:
- one colour attachment;
- two attachments;
- made for indirect command buffers;
- a fragment function specialized by function constants.
It compares imageblockSampleLength, the memory length and supportIndirectCommandBuffers.
- the translator's tile pipeline of k10ts_tile_grid with threadgroupSizeMatchesTileSize: its
ComputePipelineMetalInfo and the flag. The runtime makes no tile state.
The device after the first on the directory must read translations, which shows the hit path
ran.
The consumer's row reported reflections that differed between two makes of one identity. Their
logs hold no observed difference, so this test is the property's guard.
Verified: cargo fmt. The lavapipe and card runs and clippy follow as jobs.
The play calls Surface::external_writes_done once a picture lands on a video surface's pages. That
call records no acquire: each submission part that uses the planes acquires and releases them
itself, and the call marks the other API's writes on the host side. videos.rs' module doc already
said so, but its counter and report line still named the call an acquire, as did
docs/REPLAY-STREAM.md (the `m2v.externalWriteDone` row in section 4, and the video surface
paragraph and its counters in section 10) and the replay test's doc.
The executed counter video_surface_acquires is now video_surface_writes_done, and the report's
`video surfaces` line says "N writes marked done" for "N acquires". Its one reader in the tree is
rt_replay.rs' a_video_surface_is_waited_for_at_its_ready_point_once, updated; no script in the
tree names it (grep for surface_acquires over *.rs, *.md, *.py and *.sh). The count is unchanged:
one a picture landed in a surface.
Wording and naming only; no behaviour changes.
tb_blit_read declares its output buffer at buffer index 0 (`air.location_index` 0), but the test
bound it at slot 1, so the kernel wrote nowhere and its output read zero. Both blit reads (the
copy out and the buffer's bytes) were already exact on lavapipe at 65ea05bf4a (job m3-max-80061).
d80c9eb173 named the new inherent method Texture::texel_bytes, which shadowed TextureObject's
texel_bytes (a texel's bytes, u64) where render_encoder.rs reads it for a shadowed attachment, so
the crate did not compile (lavapipe job m3-max-80035). The method is now texel_buffer.
A guest's 3D model window stayed blank: it fills an RGBA8Unorm texture buffer placed in a heap by
copyFromBuffer:...toTexture:, which BlitCommandEncoder::buffer_copy refused as Gap::TextureBytes
("A texture buffer's texels are its buffer's bytes, which no image copy reaches"). A texture
buffer has no image: its texels are its buffer's bytes from its offset. So a copy between it and a
buffer, in either direction (copy_from_buffer into it, copy_from_texture_to_buffer out of it), is
now checked as any texture's copy is, by the same checker (`buffer_copy`: the region inside its one
row, level 0 and slice 0, Refusal::TextureRegion past it; Metal's measured layout rules,
Refusal::BufferCopyLayout), and then the region's bytes (origin.x and width in texels times the
texel's bytes, at the texture buffer's offset) are copied between the two buffers by
copy_from_buffer_to_buffer. That path keeps both buffers, takes the Managed copies and the heap
places, and orders the copy as any copy between buffers. A texture buffer's uses take its buffer's
id in the hazard sets, so a later kernel's read is ordered after it. The command buffer also keeps
the texture. Two parts of the generic check don't apply: an image's rows or memory meeting the
region (it has none), and a copy command's offset alignment (vkCmdCopyBuffer takes any). The check
runs without them. Bytes of the texture buffer that meet the other buffer's region are
Refusal::BufferCopyOverlap, as copy_from_buffer_to_buffer refuses them.
Gap::TextureBytes's doc drops the texture buffer case and its basis line ("nor a texture buffer's
copy as a buffer copy; no recorded stream copies a texture buffer"), and docs/REFUSALS.md is
regenerated. Buffer::new_texture's doc, copy_from_buffer's and copy_from_texture_to_buffer's docs
and the runtime README's texture buffer contract now say what a blit with a buffer does. The
texture buffer refusal test no longer expects the gap from copy_from_buffer_with_options. A copy
between a texture buffer and a texture (Gap::TextureCopy) is left as it is.
9d3249b1f8's test named its source words `words`, which shadowed the module's `words` function
its reads call, so the test did not compile (lavapipe job m3-max-79857). Still red at the copy in.
A guest's 3D model window stays blank: it fills an RGBA8Unorm texture buffer placed in a heap by
copyFromBuffer:...toTexture:, which the runtime refuses as Gap::TextureBytes (blit.rs, buffer_copy:
"A texture buffer's texels are its buffer's bytes, which no image copy reaches"). The test makes
an RGBA8Unorm texture buffer of 64 texels at offset 256 in a buffer placed in a Private heap,
fills the buffer with 0x5a, copies 32 texels of a Shared buffer into texels 16 to 47, copies
texels 8 to 55 out into a Shared buffer, copies the heap buffer's bytes into another, and reads
every texel in a kernel (an owned AIR kernel over texture_buffer<float, read>). Each read must
hold the source's bytes at texels 16 to 47 and 0x5a around them. Red today at the copy in.
Blessed with bless_engine_inventory and bless_engine_goldens (job m3-max-80148 on the M3, which has
every assembler) at 066d192863: the fixture's two entries, dic_full_screen and dic_post_process,
compile (ok) on all 15 profiles from both its typed .air.ll and its .ll, and tests/air_input gets
dic_post_process.txt. No other row or printout moved; both bless tests passed.
On every device of the cfg's kind: asked twice, then made, the form equals the answer, and the asking makes no texture and counts no copy. A guest's four textures at offset 32, rows 3648 apart, over a Private buffer (copied for Alignment on lavapipe), and RGBA8Unorm controls over a Shared and a Private buffer at the device's pitch (in place over Shared on every device) and one rounding past it (copied for Pitch everywhere).
The test keeps every texture it makes until it ends. A texture's release is asynchronous, so when
the 3090 dropped one case's texture before the next case asked, the textures gauge moved during
the ask (m3-max-79921, copy_cause.rs:82).
Passed at this change on 4c613f389b, with each case printing its answer and its form:
- RTX 3090 (m3-max-79946): Pitch for the guest's four.
- RX 7900 XTX (m3-max-79947): Pitch for the guest's four.
- Iris Xe (m3-max-79948): in place for the guest's four.
- lavapipe (m3-max-79982): Alignment for the guest's four.
- On all four, the controls were in place at the pitch and Pitch past it.
On the tree rebased onto 8c927efe94 (m3-max-79985), the runtime suite on lavapipe ran 934 tests:
934 passed, 3 skipped.
A consumer that keeps its own copy form for textures over a buffer asks rt only where rt would
place the texture in place. The answer is new_texture's own decision, with no texture made:
Device::over_cause takes the descriptor's checks (prepare), check_over, the bind texture() lays
(over_bind, factored out of texture()), and the linear image's fit with and without the feedback
usage (without_loop_where_unfit, which texture() now takes too). The fit is one function, unfit(),
that Made::make and the query both call: the pitch and the memory alignment are the linear image's
own, so the query makes the image new_texture would bind (linear_info, shared with make), reads its
layout and memory requirements, and destroys it, never bound, as minimum_linear_texture_alignment
does. None where in place, else the OverCause its copies count under; a texture buffer is never
copied. The answer holds for the life of the buffer's block.
The runtime README names why a guest's textures at offset 32 with rows 3648 bytes apart copy on
three of the four devices probed: the row rounded up to 128 (RTX 3090) and 256 (RX 7900 XTX) bytes,
and lavapipe's 64-byte memory alignment, from probe jobs m3-max-79849..79852. api_signatures.tsv
blessed; refusal-surface, metal-coverage and conformance-coverage checks pass with no change.
Verified with the next commit's test at this change on 4c613f389b. A guest's four textures over a
Private buffer (offset 32, rows 3648 bytes apart) were answered and made Pitch on the RTX 3090
(m3-max-79946) and RX 7900 XTX (m3-max-79947), in place on Iris Xe (m3-max-79948), and Alignment on
lavapipe (m3-max-79982). The RGBA8Unorm controls were in place at the device's pitch and Pitch one
rounding past it, over Shared and Private, on all four. On the tree rebased onto 8c927efe94
(m3-max-79985), lint passed (generated tables, fmt, clippy plain, m2v_gpu and m2v_cpu_icd, doc and
private doc all exit 0), and the runtime suite on lavapipe ran 934 tests: 934 passed, 3 skipped.
The runtime README's rule (Textures: Texture slots and usage), pipeline::slot_usage's doc and
RESOURCE-ID.md's sentence on slot usage said the runtime asks a texture's usage at a slot as
Metal's validation asks it, ShaderWrite alone at a read_write slot the function does not read.
Metal's validation asks both at every read_write slot, by the declared access, whatever the
function does there. Measured on an Apple M3 Max, macOS 27.0.1 (job m3-max-80068, a scratch
probe of runtime-compiled MSL, R32Float 4x4):
- a read_write slot the function only writes, of a ShaderWrite-alone texture, asserts "Compute
Function(k_rw_write): reads texture (t[0]) whose usage (0x02) doesn't specify
MTLTextureUsageShaderRead (0x01)";
- one the function only asks the width of asserts the same of 0x02 and the write of 0x01;
- one it only reads asserts the write of 0x01 and the read of 0x02;
- both usages run.
Plain Metal runs every case, and the written one writes its texels.
The runtime keeps its rule: such a slot asks ShaderWrite alone, as its write reaches the texture
through its storage element alone, so a ShaderWrite-alone texture runs there as plain Metal runs
it. The three texts now say what Metal's validation asks and what the runtime asks. They also
name a texture atomic's slot as one that reads. Metal's validation asks both there: a 0x21
texture asserts the write and a 0x22 one the read; 0x03 runs without ShaderAtomic.
Docs only; no behaviour changes. Verified: cargo fmt. Rustdoc runs as a job.
The test of 12126b64d6 expected one vkQueueSubmit2 a member, two in all. On lavapipe (job
m3-max-79795, llvmpipe, Copy(Pitch { plane: 0 })) the group went as three, with acquires and
releases [2, 2] and B's bytes picture 1's. Three is the design: a group sent member by member
takes one part ahead of the first member's, with the submission's uploads, and one for each
member, and a part left empty is left out (`submit::parts`; the apart count, starts plus one).
Here the over copy into the planes' images is an upload, so the parts are the uploads', A's and
B's. The `read` branch puts the block in the uploads' part, which acquires and releases it once;
A's part takes no hand-over; B's takes one. The Direct3D 11 apart test expects one call a member
because its submissions carry no uploads: its part ahead of the first member is empty and left
out. The test now expects three calls and its doc names the uploads' part; the [2, 2] and texel
asserts stay.
Where a group goes member by member, the uploads' copies into textures over a buffer in a block
another API shares read that block in the first part, which hands it over too (`read` in
submit.rs). No device test covered that: the only test of a group sent apart is Direct3D 11's, on
Windows, whose planes are images with no over copy. On the copy-form row (an opaque handle at a
pitch multiple of 4096) and the 1080p picture, the other device writes picture 1 and the consumer
calls external_writes_done; on one queue behind the busy work, a copy between two buffers that
uses no plane (A) and a blit read of both planes (B) join one group, which goes member by member.
The test asserts two vkQueueSubmit2 calls, one acquire and one release in each part (two of each,
a part handing a block over at most once), B's bytes picture 1's, and no layer message. A device
that takes another form for the row says so and checks nothing. rt_read's blits move into
encode_read, which the new test encodes into a command buffer it commits itself.
Since each submission part that uses shared memory hands it over (acquire at its head, release at
its end), `Block::external_writes_done` records no acquire: it marks the other API's writes on the
host side (`Work::exported_changed`, `ExportedOvers::owe`). ExportedOvers' doc still named "an
acquire" as an event that changes a texture's bytes, as did owe's and exported_changed's docs and
four places in the runtime's README (the copy form's planes "copied at each acquire and release",
"an acquire among them", "after its acquire", "the block's acquire"). They now name the mark, and
say the per-part acquire and release change no byte. Block::external_writes_done,
Surface::external_writes_done and the README's hand-over contract already said so. Wording only;
no behaviour changes.
A surface in the copy form holds a buffer of the runtime's over its exported block
(`Device::copy_form`), which its planes, textures over it, hold too. The play's count of its own
buffers (`NewRuntime::play_holds`) took none of them, so each copy-form surface the program made
between frames 100 and 200 moved `buffers_excess`. The copy-form merge leg's RX 550 (m3-max-79613)
and a rerun on the RTX 5080 Laptop GPU (m3-max-79696, at 2361470bff) failed
the_play_s_own_textures_take_its_video_and_exported_surface_planes on `buffers`: excess 1 at frame
100 and 2 at 200, with both video surfaces copied (Tiling) and both exported surfaces in place.
No leak: the growth is the second video surface's buffer, freed with the surface.
The play now holds one buffer for each video surface in the copy form while the player keeps it
(`Videos::held_buffers`), and one for each exported surface in the copy form while it or a plane
of it the stream holds lives (`Exported::held_buffers`), as the textures term counts their planes.
The test's first exported surface is a dma-buf's, which NVIDIA's dma-buf takes in the copy form,
so the exported term with a plane outliving its surface runs there too.
Feature::Lowering(LowerFamily::Access) with Needs::NotImplemented covered
about 235 refusal sites behind one name, so a walk's log line could not say
which without the AIR. Unsupported gains `cause: Option<Cause>`; an access
refusal carries Cause::Access(AccessCause), one variant per structure the
sites refuse: the access's shape, the type it moves or the memory it
reaches. Sites that refuse the same structure share a variant, wherever
they are; none is named by a file, a line or a string of its own.
The five helpers that build the refusal (lower/access/mod.rs refuse() and
memory/{alloca,leaf,plan,provenance}.rs not_lowered()) take the cause, so
the compiler makes every site name one; the three direct constructions in
memory/handles.rs and lower/access/handle.rs do too, through
Unsupported::access. Feature stays Lowering(Access), so validation's
outcome key (feature_key, the Debug of the feature) and the census are
unchanged. Display prints the cause after the feature:
"Lowering(Access): PointerStore; needs NotImplemented at ...".
Storage: nothing stores the cause. Validation keys a refusal by
feature_key(&u.feature) (engine.rs); a FALLBACK repro bundle keeps the
failure as text (repro.rs, whose only serde record is the device); the
runtime's cache marks a refused translation with fixed bytes. No version
bump.
A buffer argument of a count other than one outside an argument table
names BufferArray, apart from an index or count the metadata does not fix
(UnfixedLocation).
Tests: the error module's Display test of an access refusal; the plan's
table gaps assert ArgumentTable, and its typed-depth, initializer and
buffer-array refusals PrivateType, Initializer and BufferArray.
runtime-sources.sha256 rewritten: memory/handles.rs's two refusals name
their cause, and no run behaves otherwise. api_signatures blessed (Cause,
AccessCause, Unsupported.cause), api_surface lists the two enums,
REFUSALS.md regenerated (the access refusals are built in error/mod.rs),
docs/API.md's error table names the field.
Consumer uses (consumer-uses.sh, read-only, plus git grep, over the
consumer's development 22cfe51a54 and its lane tips of the last day): no
struct literal or exhaustive destructuring of the translator's Unsupported
("Unsupported {" hits only its video crate's own Unsupported(String),
codec/encode.rs:494-502). Its rt platform builds refusals in tests with
Unsupported::not_implemented (rt_platform/diag.rs:3076, 3078, 3490;
rt_platform/unbuilt.rs:1203, 1293), whose cause is None, so their keys
("Translation-Lowering") hold. It reads u.feature where it names a refusal
(rt_platform/diag.rs:1082) and where it says one (rt_platform/unbuilt.rs:
507); each shows the cause once it reads u.cause too.
The shape of the render pipeline state a guest's model viewer had refused
as a draw input (RenderPipelineKind::DrawInput), from our own MSL:
dic_post_process.metal's full-screen vertex function reads a float4 at
attribute 0 and a float2 at attribute 1, which the test's vertex descriptor
fetches from buffers 0 and 5 at strides 16 and 8, and its fragment function
samples a texture and changes the colour under bool function constants 0, 1,
3 and 4 (set false, true, false, true), into one RGBA16Float colour.
The companions come from scripts/regen-air-fixtures on the oracle Mac's
toolchain (job m3-max-79796; TOOLCHAIN records it). The engine fixture
expectations' bless is due on development for the new fixture.
RenderPipelineKind::DrawInput covered a dozen causes behind one name, so a
walk's log line could not say which without the AIR. It now carries
DrawInputCause, one variant per reason the runtime's draws() (and the
constexpr numbering it hands its gap to) refuses a render pipeline state's
input for:
- pointer translation, handle translation, a descriptor set that is not the device's
- a slot, fact, sampler or pushed parameter of a stage other than vertex and fragment
- a runtime fact the encoder does not supply, by its RuntimeFact::name
- a slot the encoder does not bind (a visible or intersection function table)
- a push field the encoder does not fill
- the stride of a layout of MTLBufferLayoutStrideDynamic
- a constexpr sampler the state does not hold, and an unnormalized one
- a parameter block past one ring chunk, and one without its pushed address
- pushed bytes past the device's push window
The variants follow KernelInputKind's names where a cause is the same.
Gap's Display shows the cause ("a render pipeline state with DrawInput
{ cause: Slot } is not built"), so the conformance ledger's seven DrawInput
rows now name theirs: DynamicStride for the indirect vertex-stride case,
Slot for the visible-table stage cases. The icb_stage_in test asserts
DynamicStride.
api_signatures blessed (DrawInputCause and its variants; DrawInput's
signature). REFUSALS.md regenerates unchanged at this base.
Consumer uses (consumer-uses.sh, read-only, over the consumer's
development 22cfe51a54 and its lane tips of the last day): one
construction of RenderPipelineKind::DrawInput, in a test of its rt
platform (rt_platform/diag.rs:3494, on development and ten lane tips),
which needs `DrawInput { cause: .. }`; no match on the kind's fields
("DrawInput {" 0 code hits; its IndirectCommandBuffers-DrawInput keys are
another enum's). Its refusal name keys every RenderPipeline gap by the
gap's variant alone (rt_platform/diag.rs:1074), so its counts line names
the cause once an arm for DrawInput { cause } precedes that one.
ComputePipelineState::allocated_size and RenderPipelineState::allocated_size
answer MTLAllocation's allocatedSize, which both Metal pipeline states adopt.
The answer is our code's size, not the driver's compiled binary, which the
runtime does not measure. A compute state answers its kernel's module, the
one its interface is read from. A render state answers its stages' modules,
summed. Both numbers are taken from the translation when the content is made
and kept as a u64 in the content (a compute content's Answers, a field of
RenderCompiled); no module is kept for them. Every device takes the same form.
No variant counts: not the emulated-SIMD-group or partial-threadgroups
variant lowered with a compute state, not one made at a dispatch (the
emulated-partial variant), and not a render content made later for a pass.
So the answer never changes once a state is made, and two states of one
content answer one size.
docs/API.md's accepted differences (Heaps and memory) gets the entry.
MTLAllocation.allocatedSize stays missing in the coverage ledger: buffers,
textures and heaps still lack it. Its note now names the pipeline states'
answers, and docs/METAL-COVERAGE.md is regenerated. api_signatures.tsv is
blessed with the two methods.
Tests:
- state_answers: a new test. block_scan (plain module) and sample_down
(partial-threadgroups variant) answer non-zero. Each equals the bytes of
the module the state keeps (a test-only Kernel::module_bytes). The
render state of first_texel_fragment answers the sum of the translator's
compile_render_pipeline stages' SPIR-V lengths. Two states of one content
answer one size.
- translate.rs: the ragged-grid test on emulated SIMD groups now also checks
that a state's answer is the same after the dispatches that make the
variant later.
Verified: job m3-max-79929 on lavapipe, a check of this tree.
- signatures --check, coverage --check, clippy (plain, m2v_gpu,
m2v_cpu_icd), workspace doc and the runtime's private doc: all 0.
- The runtime suite: 928 passed, 3 skipped.
- The two tests rerun with output: both pass. On lavapipe the variant
already emulates its SIMD groups, so the ragged test makes nothing at a
dispatch there. No card run yet.
draws() refused a state whose function reads [[amplification_count]]
(RuntimeFact::AmplificationCount) as DrawInput, though the state's creation
already fixes the fact's SpecKey::AmplificationCount constant at 1 in each
stage's module. 1 is every draw's count: the runtime makes no state whose
maxVertexAmplificationCount is above 1
(RenderPipelineKind::VertexAmplification), and its render encoder sets no
count, so each draw has Metal's default. draws() now names the fact as
supplied, beside the sample count it fixes the same way.
This is the cause of a guest's model viewer's five refusals of three
post-process states in a walk (job m3-max-79894, XTX/RADV, where the
typed cause named it).
A guest's model viewer leaves its window blank because the runtime refused
its post-process states as RenderPipelineKind::DrawInput: their vertex
functions read [[amplification_count]], and draws() named no such fact as
supplied. The fact is RuntimeFact::AmplificationCount, as the typed draw
input cause on steelbrain/fix-rt-causes printed over the walk's refused
states (job m3-max-79894, XTX/RADV).
The owned fixture engine/vertex_amplification.ll's amp_vertex_store reads
[[amplification_count]] and [[amplification_id]] and stores both; drawn
with rasterization disabled in a state whose maxVertexAmplificationCount
is 1, each vertex must write (1 << 16) | 1 to word vid * 8. Red here: the
state's creation refuses it as DrawInput.
A pipeline state keeps its descriptor's functions to lower its later variants from, and a
function held its whole library through an Arc: a guest that made a state of one function of a
metallib of many, then released the library, kept every module of it alive as long as the
state lived.
At load, a library now splits the one copy it makes of the loaded bytes: each module (each run
of bytes one or more functions' bitcode covers, so functions over one module, as a Core Image
kernel library's or a dynamic library's exported functions, share one) in an allocation of its
own, and every other byte (header, function list, metadata, other sections, padding) in one
more. A function holds its library's function table (rows, content hash, type, install name,
dependencies), its own module's allocation and its index, and the library weakly. So a state
keeps exactly its functions' modules whether the library lives or not: while it lives, the
same allocations the library holds, each module once; nothing is copied at a state's make.
Public changes (api_signatures.tsv, docs/API.md, the doc comments):
- Library::bytes() returns an owned Vec<u8>, assembled from the allocations, equal byte for
byte to the loaded bytes (of a universal file, its AIR slice, as before); content_hash() is
their SHA-256, computed at load as before.
- Function::library() returns Option<Library>: the library while a Library value of it lives,
None after; MTLFunction names no library either.
- Function::library_content_hash() (new): the library's content hash, kept with the table.
- Function::bitcode() (now public, infallible): the function's own module (a metallib
function's wrapped module, a bare module's whole module, a dynamic library's one module); its
doc says the bytes are the guest's shader, never committed or sent anywhere.
- Function's PartialEq and Eq: equal tables (each holding its library's content hash) and
indices.
The translator's own uses of a function's library read the table (compile.rs's dependency
order and EntryNotFound's count); linked_sources no longer fails.
The consumer's call sites (reims-vgpu development 53e7385993, read only; search: git grep -n -E
'\.(bytes|library)\(\)' over crates/reims-vgpu-vulkan and crates/reims-vgpu, and \.library\(\)
over the whole tree; every other hit is a string's, a NAL's, a staging buffer's or
graphics().library()): crates/reims-vgpu-vulkan/src/rt_platform/diag.rs:1860 and :1863 (the
kept-AIR bundle: the container while the library lives, else the function's own module through
bitcode(), the line naming which), diag.rs:1934 (FunctionName::of: library_content_hash()),
diag.rs:3495 (test; unchanged, the bytes compare equal) and unbuilt.rs:653 (test; a function
keeps bitcode().len()).
Tests: the red test's two states (lavapipe; their test accessors now read a kept function's
library where it lives, else its own module); a_live_library_and_its_states_hold_each_module_once
(two compute states and a render state share the library's own allocations);
tests/library_modules.rs: bytes() equals the loaded input for a plain metallib, a Core Image
kernel library (shared module), a dynamic library, each universal header and a bare module, the
content hash their SHA-256; a function holds its module (one allocation per module, shared over
a shared module), names no library once it is released, keeps the content hash and compiles
under the same keys to the same words. The runtime's README says what a state keeps.
A compute state keeps its descriptor to lower its later variants from, and a render state keeps
its descriptor to make a pass's content from; each function there holds its whole library. A
guest that makes a state of one function of a metallib of many, then releases the library,
leaves every module of that library alive as long as the state lives.
Two device tests, each over a metallib of one function and four other kernels, each entry over
a module of its own as Apple's toolchain writes one: a compute state of the kernel pool_reach,
and a render state of a bare module's colored_vertex with the metallib's fragment
a2_front_facing. Each makes the state, drops the libraries and the descriptor, and asserts the
state keeps no more of the metallib than its function's own module (plus 1 KiB); the render
test also asserts the bare module's vertex function stays whole. Test-only accessors on both
states read the bytes kept.
The known gaps of textures say which formats Metal makes a texture
buffer of where the runtime answers Gap::TextureFormat. Plain Metal on
an Apple M3 Max under macOS 27.0.1 (jobs m3-max-79872 and m3-max-79879,
the same answers both runs), asked for each of the 300 formats the
runtime names, over a buffer and from the device, for reading, writing
and both, made one of 99, ended the process for 125 and answered nil
for 71. The runtime's refused sets come from texel_form and the
committed vulkaninfo profiles, not from a card run, and the README
says so. Docs only; no refusal or public item moves.
The widened counter replaced variant_translations_at_dispatch; the table was
not blessed with it (the_public_signatures_are_the_committed_table failed in
the translator suites, job m3-max-79131).
translation_at_encode_max_nanos is a maximum since the device was made, so a
frame's difference of it means nothing: the report gives it once, as
`translation at encode longest N ns` beside the commit lock's, and keeps
translations_at_encode among the executed counters.
Four threads dispatch wps_uint_k40_s32's ragged grid at threadgroups of 48
at once, each through its own queue and buffers: where the kernel's
partial-threadgroups variant runs only whole SIMD groups, one lowers the
variant on emulated SIMD groups and the rest wait for it in its OnceLock
(translations_at_encode moves by 1); every racer's whole SIMD groups have
the CPU's words.
The planner widened the counter of the fourth variant made at dispatch to
every translation made at encode, named once: Metrics::translations_at_encode
counts the makes, made or refused, and translation_at_encode_max_nanos holds
the longest (a maximum since the device was made, as maker_wait_max_nanos).
Its sites, each a module or content the state's creation did not make, made on
the encoding thread that waits for it:
- an observing kernel's partial-threadgroups variant on emulated SIMD groups
lowered by a dispatch (not by prepare_dispatch);
- a compute state's content for a dispatch's buffers bound at a multiple of 4
below their alignment, or its 8-bit sRGB textures' UNORM twins
(PipelineInner::variant, one function for both);
- a render state's content for a draw's buffers bound so (for_words);
- a render state's content for a pass it does not render into as made
(for_pass: a colour attachment the pass lacks, or a fetched colour in a 2D
array).
The first replaces variant_translations_at_dispatch. A content the map of
contents holds is a reuse and counts nothing; one it forgot counts again. The
replay's metrics report both fields.
Tests: each site counts one make at its first need and none at a reuse:
the word-bound compute variant (and again for a second mask and a forgotten
variant), the sRGB variant, the word-bound render content per draw case, the
pass content of a lacking pass, and the fourth variant's dispatch (with the
maximum above 0).
An observing kernel whose partial-threadgroups variant runs only whole SIMD
groups (a subgroup tier) refused a dispatchThreads grid that is not whole
threadgroups at a threadgroup that is not whole SIMD groups
(Gap::PartialThreadgroups, site SimdGroups). The translator now lowers the
partial-threadgroups variant on emulated SIMD groups, so the runtime runs it.
What: a fourth KernelVariant, EmulatedPartialThreadgroups, in ALL, whose
inputs set both partial_threadgroups and emulated_simdgroups. The state's make
does not lower it (the planner's form: made at the first dispatch shape that
needs it). Compiled holds its inputs and a OnceLock for its lowering, made
for a content whose partial-threadgroups variant runs only whole SIMD groups.
encoder::decide takes a Need: prepare_dispatch and a dispatch lower it from
their state's descriptor, once, a racing thread waiting in the OnceLock; the
state's make and dispatch_variant read keys and lower nothing. A dispatch's
lowering counts in Metrics::variant_translations_at_dispatch (also in the
replay's metrics), which a pre-pass that prepares every dispatch keeps at 0.
The lowering is lower_variant's, the same bounded translation through the
cache directory as every variant's; the translator's refusal of it stays the
dispatch's Gap::PartialThreadgroups { site: SimdGroups }, any other failure
is reported as itself. Its dispatches count as emulated SIMD-group
dispatches and partial-variant ragged grids. Compiled's drop releases it.
Docs: prepare_dispatch's and dispatch_variant's docs, the counter's, the
SimdGroups site's, the runtime README (which variant is made when, the gap's
narrowed scope); api_signatures.tsv re-blessed.
Tests: every_device_runs_a_ragged_grid_of_partial_simdgroups_on_emulated_simdgroups
and every_device_frees_a_ragged_grid_s_modules_with_its_content now also read
the counter: 1 for k24_s32's first dispatch on a subgroup-tier card, 0 after
k8_s48's prepare_dispatch, 0 where the variant emulates its SIMD groups
already.
wps_uint_k24_s32 and wps_uint_k8_s48 over dispatchThreads grids of 184
threads in threadgroups of 48: each threadgroup one whole SIMD group and a
partial one. Where the kernel's partial-threadgroups variant runs only whole
SIMD groups (a subgroup tier), the dispatch is refused today with
Gap::PartialThreadgroups { site: SimdGroups }. The tests want the grid run on
emulated SIMD groups, the whole SIMD groups' words equal to the CPU's, the
words past the grid untouched, a prepare_dispatch ahead of k8_s48's
dispatches, and the map of compiled contents, filled past a cap of 1, freeing
the first content's modules with its state.
Red on a subgroup-tier card; passes where the variant emulates its SIMD
groups already (lavapipe, the Intel GPUs).
The known gaps of textures named lavapipe and the Radeon 780M as the
devices whose optimal images take the Shared memory type. The Iris Xe
(Mesa 26.2.6) takes it as well: its run of the rt and harness heap,
Shared-heap sampling, export and churn_rest tests at development
30e7be6aff's product code (archive m3-max-79814, run m3-max-79854)
placed a source and a target in a Shared heap, wrote, read back and
sampled them, and churn_rest held every gauge with the kind included.
The same archive on the RTX 2080 (m3-max-79855) took the refusal path
and passed, heap.rs's Shared-descriptor size queries included, and on
the Radeon 780M (m3-max-79856) placed and sampled them: 8 of 8 each.
This is the timed row the ruling on Shared heap textures asked for. It was taken on the RX 7900 XTX
(RADV, Mesa 26.2.6, job m3-max-79841), behind a PCIe 4.0 x4 link. That is the narrowest link
upstream of the card: the bridge at 16 GT/s x4. The test is a helper branch's own and does not
land.
- The harness's sample_down kernel sampled a 4096 by 4096 RGBA16Float texture (128 MiB) into a
2048 by 2048 target, 10 dispatches in each command buffer.
- The texture was placed once in a Private heap and once in a Shared heap, with the same
descriptor.
- 7 command buffers of each were alternated in one job. The GPU spans are the command buffers'
own GPU start and end times.
- Private: median 2.099 ms (2.093 to 2.103).
- Shared: median 203.136 ms (203.079 to 203.184).
- The ratio is 96.8: about 640 GB/s against 6.6 GB/s, the link's rate.
A first run (job m3-max-79822) filled the texture with one repeated texel. Its Private arm read
1.28 GB in 0.458 ms, faster than the card's memory, because the image compresses a constant
texel. The row above uses texels from a xorshift64 sequence, which nothing compresses.
The NVIDIA cards place no Shared heap texture (the bullet above), so this cost is the discrete
AMD case. Nothing works around it, as the ruling says. A Mac whose Metal makes Shared heap
textures has unified memory, where the cost does not arise.
The RTX 2080 refused it (job m3-max-79682) because its optimal images take no Shared memory type.
The 3090 runs the same NVIDIA driver (620.70.06) and was not run, so the known gap says expected,
as the planner asked.
On the RTX 2080 (NVIDIA 620.70.06, job m3-max-79682) the device's optimal images take no Shared
memory type. Two things followed from that:
- The parent commits' size query, which checked a Shared descriptor against the Shared type,
refused Shared descriptors there. heap.rs's two Private-block tests size Shared descriptors, and
both failed at their size query.
- A guest that sizes a texture with a Shared descriptor would have lost an answer it had before.
The size query now checks the Private type for every descriptor, as it did before this series.
Its answer does not depend on the storage mode. The Shared type is checked where the texture is
placed in a Shared block, and the placement is Gap::HeapTexture where the image does not take
it.
Follow-on changes:
- The Shared-heap device test expects the size query to answer on every device and the placement
to be refused exactly where `Device::heap_image_fits` says the image does not take the Shared
type.
- The conformance side holds a Shared query to the placement and read-back steps in a Shared heap,
and to step 1 where that placement is Gap::HeapTexture (docs/API.md section 10 says so).
- churn_rest finds out once, by placing a texture for views in a Shared block and releasing it,
whether the device places its Shared heap texture. Where it does not, the row leaves the kind
out, naming it with the reason.
- The rt README's known gaps of textures name where a Shared heap's texture is placed: lavapipe
and the Radeon 780M take it (jobs m3-max-79654 and m3-max-79685); the RTX 2080 does not. The
Gap::HeapTexture doc says the same.
Ledger: the five rows of the RGB10A8_2P_XR10 heap cases (texture-fills-550, texture-fills-551,
texture-fills-heap-run-550-b5, texture-fills-heap-run-551-b5 and two-plane-heap-blits) take the
Err the replay at 1e1c3f39b8 pasted (lavapipe, job m3-max-79680). Their Shared heap no longer
refuses first, so the format's own Gap::TextureFormat answers. Their venue stays *, since the
format check comes before the placement on every device, and their justification already names
Gap::TextureFormat. CONFORMANCE-COVERAGE.md is regenerated and unchanged.
The gauge loop covers the new kind's release, as the ruling on Shared heap textures asks. Each of
churn_rest's 200 iterations:
- takes a Shared block of its own, of the texture's size rounded up to its alignment, at which
such a block starts;
- places a 64 by 64 RGBA8Unorm texture of shader-read usage there by new_heap_texture, at the next
index;
- copies it into the row's Shared scratch buffer in the blit encoder that reads the texture over
the exported block;
- drops the texture and the block with the rest.
The gauges read at the 100th and 200th iterations and at the drop then include the heap texture's
texture and Shared block.
Where the device does not place the texture (the size query is Gap::HeapTexture), the row leaves
it out from the start and names it with the reason, as it does an export the device lacks.
Verification is to follow: the harness's churn_rest test on lavapipe and on one card per vendor.
The red commit set these two tests' descriptors to Private, the mode of the block they are placed
in. replace_region refuses a Private texture, so both tests failed at their first write on
lavapipe (jobs m3-max-79642 and m3-max-79644, heap.rs:106 and :229). They take back the Shared
descriptors they had. The runtime does not check a descriptor's mode against its heap's; the
consumer refuses that mismatch as Metal does.
The size query sizes a Shared descriptor against the Shared type now. That changes nothing on a
device whose optimal images take both types. On lavapipe the Shared-heap test placed and sampled
its textures at the fix commit (m3-max-79644), so its images take the Shared type.
Metal places textures in a Shared heap: the M3 Max makes them, in automatic and placement heaps
(job m3-max-79576). The runtime refused every texture in a Shared block as Gap::HeapTexture. Now
new_heap_texture and new_heap_texture_for_views bind the device's optimal image in a Shared block's
memory exactly as in a Private block's. That is one form, with no linear image and no copy.
- heap_source refuses an exported block alone, whose memory is dedicated to its buffer.
- heap_fit takes the heap's memory class. At the placement, the class is the block's (Bind::Heap
carries it). At heap_texture_size_and_align, it is the class the descriptor's storage mode names:
Shared for Shared, Private for any other, as before.
- Gap::HeapTexture stays typed for an image the device requires an allocation of its own for, or
whose memoryTypeBits leave out the heap's type, at the size query and at the placement. The
consumer counts it.
The host reaches such a texture as any texture's, through replace_region and get_bytes. Their
copies go through the GPU and flush or invalidate only their staging bytes. The block's mapping
over the image holds the device's own layout, so the image's range needs no flush or invalidate of
its own. A command buffer that uses the heap (use_heap) flushes and invalidates its whole Shared
block, as it did for the heap's buffers.
Nothing in the runtime asks which Mac the guest has. Whether a guest may make a Shared heap at all
is the consumer's decision; the runtime has no heap object and hands a Shared block to any take.
Docs:
- the rt README's heap paragraph covers Shared heaps;
- the Gap::HeapTexture doc is updated, and REFUSALS.md regenerated;
- docs/API.md's heap-size entry: a Shared descriptor is now held to the placement and read-back
steps in a heap of a Shared block, as the conformance side's heap_sizes::hold now does;
- the known-gap sentence of the UHD 630 Windows texel-buffer refusal gains its trigger: a second
device above the floor whose formats lack those buffer features, or a walk that meets the
refusal.
The test is the parent commit's. Verification is to follow in the handover: lavapipe red then
green, one card per vendor, the gate, and the conformance replay.
Metal places a texture in a Shared heap on the M3 Max, and the runtime refuses every texture in a
Shared block as Gap::HeapTexture. The new device test
`every_device_samples_textures_placed_in_a_shared_heap` (sampling.rs) does two things:
- Where the device's image of a Shared RGBA16Float descriptor takes the Shared memory type with
no allocation of its own (the Vulkan query, through the test helper `Device::heap_image_fits`),
it places a source and a target first-fit in a Shared block's heap by the size query's answers
and checks that nothing is allocated. It writes the source by replace_region, reads it back by
get_bytes, and samples it into the target with the harness's sample_down, checking the linear
filter's mean.
- Where the query excludes the type, it checks that the size query and the placement are
Gap::HeapTexture.
The two Shared-heap refusal pins in heap.rs go, and that file's descriptors take the Private mode
of the heap they are placed in, as Metal asks. The exported block's pin (export.rs) stays.
heap_texture_size_and_align's image query moves into `heap_image_requirements`, which the test
helper shares; heap_fit takes the dedicated answer as a bool. Neither changes behaviour.
Expected red on lavapipe: the source's placement in the Shared block is Gap::HeapTexture.
The known gap for a pass that mixes a linear-only surface plane with another attachment gave a
worked 1920x1080 example. It now gives what was measured on the RTX 3090 (job m3-max-79781): a
guest's screen recording of 1676 frames renders one such pass a frame (a 3648x2038 R8Unorm luma
plane beside a 3648x2038 RG8Unorm colour attachment, both loaded and stored), paying 1676 copies
in and 1676 out of 7,434,624 bytes each (12.46 GB each way), with at most 8 stand-ins of
59,768,832 bytes. The planner ruled no form change for this pass: the forms that drop the copies
run fragment side effects twice, grow rule 3's exceptions, or trade one workload for another.
Docs only; no build.
docs/REFUSALS.md listed 89 runtime Refusal variants but its two totals tables still counted 88
(and 24 metal-measured where there are 25). A union of two branches' rows keeps every variant row
and one side's totals, and --check compared only the variant rows, so it passed. The totals count
variants alone (no sites, no line numbers), so they are structural: --check now compares them too.
Verified locally (plain script, no build): with the old REFUSALS.md, --check exits 1 naming the
two stale Refusal totals rows; after regeneration it exits 0. The regeneration changes only those
two rows; basis.rs is unchanged.
The runtime answered no default positions (its README's known gap). Device::default_sample_positions
answers a count with the positions a pass of that many samples that sets none rasterizes at:
Vulkan's standard sample locations, which the floor's standardSampleLocations makes every such pass
take, and which are plain Metal's answers at 1, 2 and 4 samples on an Apple M3 Max, macOS 27.0.1
(probes/default_sample_positions.m, m3-max-78953). supports_texture_sample_count answers at most
1, 2 and 4, so no other count is answered. A count it does not answer is
Refusal::DefaultSamplePositions (basis metal-measured: plain Metal asserts "count (n) is not
supported on this device." and ends the process, at 0, 3, 5, 6, 8, 16, 17, 32 and 33 on the M3).
README (the device's answers; the sample-positions gap sentence), coverage.tsv (I), and the
generated REFUSALS.md, basis.rs, api_signatures.tsv, METAL-COVERAGE.md and CONFORMANCE-COVERAGE.md.
Verified on lavapipe, job m3-max-79650: clippy, doc and private doc EXIT=0; the runtime suite 923
passed, 3 skipped. Metal's answers: m3-max-78953 (Apple M3 Max).
Plain Metal's answers on an Apple M3 Max, macOS 27.0.1 (probes/default_sample_positions.m, job
m3-max-78953): (0.5, 0.5) at 1 sample; (0.75, 0.75), (0.25, 0.25) at 2; (0.375, 0.125),
(0.875, 0.375), (0.125, 0.625), (0.625, 0.875) at 4; and for 0, 3, 5, 6, 8, 16, 17, 32 and 33, which
the M3 does not render, the assertion "count (n) is not supported on this device." ends the
process, with or without the validation layer.
- placed::the_default_positions_are_metal_s_at_each_count_it_renders: the standard locations the
runtime answers with are those values, bit for bit.
- on_device::every_device_answers_metal_s_default_positions_and_a_pass_set_to_them_is_one_set_to_none:
on every device, Device::default_sample_positions answers them at each count the device renders
and Refusal::DefaultSamplePositions at every other count; a pass of that count that sets them,
under a triangle whose slanted edge crosses the target's pixels, resolves to the same bytes as one
that sets none.
Red: the runtime has no such method or refusal yet, so the tests do not build (job named in the
next commit).
A probe of plain Metal's answer at counts the device renders and counts it does not, each count
in its own process so a validation stop ends only that count, the reference the runtime's answer
is read against. Run on the M3 oracle in the commit that adds the runtime's answer.
fragment_simd_fills (engine/gsm2_quad_ops.ll), whose shuffles-and-fills read other lanes of its
simdgroup, is now drawn over a whole 8 by 8 RGBA32Float target cleared to -1 on every device with
shaderQuadControl. Every channel of every pixel must be a word some pixel of the draw holds: its
index_at or that plus 10000. A lane that takes no part gives no promised value, but never one no
invocation holds.
The point is lavapipe. Its fragment subgroups are 8 lanes (4 on arm64), and no card's fragment
stage is narrower than 32, so lavapipe is the one device that takes the translator's
PartialFragment tier. There, a fill whose source is a Metal lane at or above the subgroup's size
reads the calling lane's word without naming that lane, testing the source against the
SubgroupSize builtin. Until now only translation tests (spirv-val, and an interpreter on a
synthetic 4-lane profile) covered that lane-naming branch; no device drew it. On such a device the
test also asserts that the fragment stage reads SubgroupSize, so the run shows the tier ran.
The draw of the existing 32-wide lane test moves into a helper both tests share.
The rows of visibility-boolean-accumulate, visibility-counting-accumulate (both),
visibility-counting-accumulate-one-command-buffer and visibility-counting-accumulate-revisit
named the Gap::Draw{AccumulatedVisibilityResults} refusal, which is gone. The conformance
replay on lavapipe at efa04c576a (job m3-max-79548) read those five rows as fixed and gave
six in their place, pasted as it printed them with the venue widened to every venue, as the
rows they replace were:
- divergent at case/pass-0/words and case/pass-1/words of the Boolean and the Counting
shapes, and at case/pass-1/words of the one-command-buffer shape: Metal on the M3 Max adds
into the words, the runtime writes each result in place of its word;
- refused at case/pass-0/calls/0-render of the revisit shape: its first mode is now taken,
so the second mode at the same offset meets Refusal::VisibilityResultOffsetTaken, the
refusal of visibility-counting-revisit's row, whose text it takes.
No other row moved in that run. docs/CONFORMANCE-COVERAGE.md regenerated.
set_visibility_result_mode refused Boolean and Counting in a pass whose
visibilityResultType is Accumulate (Gap::Draw{AccumulatedVisibilityResults}, counted in
Metrics::accumulated_visibility_refused). MTLRenderPass.h documents Accumulate in one
sentence, "Accumulate visibility results data across multiple render passes." Measured
(the conformance recordings, values.rs VisibilityResultType): Metal on an Apple M3 Max
(macOS 27.0.1) adds a Counting result into the word's low 32 bits and ORs a Boolean one,
while Metal on a Radeon Pro 5300M and a UHD Graphics 630 (macOS 26.7.1) writes it in
place of the word, as Reset does. The documented sum needs an add of a query's count into
a buffer word: a scratch copy of the query results and a kernel of the runtime's own after
the rendering, which is not built. The planner ruled that the runtime answers Accumulate
as Reset on every device until that sum is built, which then replaces it everywhere.
So the setter takes every mode in an Accumulate pass as in a Reset pass, and the
encoder no longer keeps the pass's visibilityResultType, which nothing reads now.
Removed public items: DrawKind::AccumulatedVisibilityResults and
Metrics::accumulated_visibility_refused (the consumer's checkout names neither in code;
two doc comments and one test of its rt platform describe the refusal:
rt_platform/render.rs:76 and its test at :2299, rt_platform/descriptor.rs:21).
DrawKind::VisibilityResultInterrupt stays refused, its doc now saying why: its answer
needs the same add. docs/API.md's accepted differences records the measured answers; the
rt README, VisibilityResultType's doc, the validation replay's docs and
docs/REPLAY-STREAM.md follow. The validation replay test of an Accumulate stream now
holds that its modes write as a Reset pass's, nothing skipped. REFUSALS.md regenerated
(Gap::Draw loses one site); api_signatures blessed (the two removed records).
set_visibility_result_mode refuses Boolean and Counting in a pass whose
visibilityResultType is Accumulate (Gap::Draw{AccumulatedVisibilityResults}). The planner
ruled that the runtime answers Accumulate as Reset on every device: Metal on a Radeon Pro
5300M and a UHD Graphics 630 does, and Metal on an Apple M3 Max adds each result into its
word, which no form here builds yet.
The test replaces the refusal's pin: two passes of one command buffer, Reset and
Accumulate, each Counting at 0 over the whole target, Boolean at 8 over its top half and
Counting at 16 with no draw, into buffers of 0xaa bytes. Both read 64, 32, 0 and the
untouched word. Red at the base: the Accumulate pass's first mode is refused.
The planner asked for the executed path's objects in churn_rest's gauges. Each iteration's
indirect command buffer (16 indexed draws, three vertex buffers and one fragment buffer a
command, as the owned fixture engine/icb_merged_indexed.ll's icb_indexed_vertex and
icb_indexed_fragment read) is now executed whole, in a pass of its own into an RGBA32Uint target,
with a state of those functions made once for indirect command buffers. Its commands are as the
commit resets them, each drawing nothing: the execution records and takes its preprocess region
as any does. The row's records add preprocess_used_bytes, 0 once a command buffer completed, at
100, 200 and the drop; the first iteration's line shows the idle preprocess bytes kept for the
next execution, which are no record, as they fall to zero at an idle age a settled read does not
fix.
set_triangle_fill_mode refused TriangleFillMode::Points, the raw value 2 that no SDK
header declares (MTLRenderCommandEncoder.h declares Fill and Lines alone), as
Gap::Draw{FillMode} on every device. Apple's OpenGL renderer sends it for
glPolygonMode(GL_POINT). Metal refuses it on no Mac measured, and the Macs disagree: an
Apple M3 Max and an Intel UHD Graphics 630 draw a triangle's vertices as points, an AMD
Radeon Pro 5300M fills the triangle. The planner ruled that the runtime takes the Fill
answer, which needs no device feature, no pipeline of its own and no precision note.
The setter now takes Points as Fill. DrawKind::FillMode keeps one case, Lines on a
device without fillModeNonSolid. docs/API.md's accepted differences records the
measured answers and that a points form waits for a guest's report that the points
answer matters; the rt README's fill modes and known gaps say the same. REFUSALS.md
regenerated, unchanged (it lists no DrawKind text).
Verified: tests::raster::on_device::every_device_draws_the_fill_mode_of_raw_value_2_as_fill
on lavapipe, red at the test's commit (the setter refused), green here.
set_triangle_fill_mode refuses TriangleFillMode::Points, the raw value 2 that no SDK
header declares, as Gap::Draw{FillMode} on every device. Metal refuses it on no Mac
measured: an Apple M3 Max and an Intel UHD Graphics 630 draw a triangle's vertices as
points, a Radeon Pro 5300M fills it. The planner ruled that the runtime takes the Fill
answer, which needs no query and no new path.
The test draws the edge triangle under Fill and under raw value 2, in passes of one
command buffer, and holds that both targets read the same filled texels, and that the
second pass makes no pipeline and waits for none. Red at the base: the setter refuses.
The excess judge's count of the play's own textures adds the planes of its video surfaces
(`Videos::held`) and of its exported surfaces, a plane object that outlives its surface among
them (`Exported::held`); no matrix stream makes either, so neither term had a test. The new
replay test makes a video surface and an exported surface by frame 100, then a second video
surface, releases the exported surface and its plane 1 while keeping plane 0's object, and makes
another exported surface by frame 200: where the device makes every surface the play holds 6
textures at frame 100 and 11 at 200, and every kind's excess holds still.
The thirteen gauge kinds no replay judges and no harness workload recorded now each have a loop,
grouped as the planner ranked them. `churn_all_day` (OwnRow::ChurnAllDay) makes, uses and releases
in each iteration: a host memory import with a buffer over it; an exported block with a buffer
over it; a video surface of each decoder route the device exports (a dma-buf at the VA-API
layout, the host's opaque handle at NVIDIA's), as the replay player makes them, with a view of
each plane at an index, its buffer in place, and plane 0 kept past the surface's release; the
runtime device tests' plane stand-in surface (two RGBA8Unorm planes of the opaque handle) whose
plane 0 a pass renders beside another colour attachment; two render pipeline states; and a
Private target and a target over a Shared buffer, each drawn into, then read through a texture
after a memory barrier. `churn_rest` (OwnRow::ChurnRest) makes a compute state of one of 40
contents in turn (past the 32 stage entries kept), a draw under a Counting visibility mode into 4
samples resolved into a texture over a Shared buffer, a texture over an exported block read by a
blit, and an indirect command buffer.
Each row reads the device's gauges once it settles (no release waiting, no command buffer
unretired, two reads 20 ms apart equal) after the 100th and the 200th iterations, and once more
after its device dropped (own::run, through the counters that outlive it), and the command prints
them as `M2V-MATRIX gauge harness-<runtime>/<row>/<gauge>@100|@200|@drop`: the harness's gauges
and the eleven kinds they left out (imports, exports, surface imports and buffers, plane
stand-ins, shadows, stage entries, resolve images, textures copied over, occlusion pools,
indirect command buffers). The matrix judges them as every gauge. A kind the device does not
make is left out with its reason on the row's lines; the first line gives each of the group's
kinds live in the first iteration before its release. No kind needed a consumer-side object: the
host import's memory is the row's own, as in the runtime's import tests.
The device tests churn_all_day_holds_every_gauge_still_and_frees_all_at_the_drop and
churn_rest_holds_every_gauge_still_and_frees_all_at_the_drop hold the matrix's rule on the
report.
rt put Metal's 64-bit event values on the event's timeline semaphore as they were. Vulkan bounds
a signal's distance from the semaphore's value and from every signal pending on it by the
device's maxTimelineSemaphoreValueDifference (VUID-VkSubmitInfo2-semaphore-03883), which a
device may report as 2,147,483,647 (two committed profiles do: nvidia-pascal-linux and
runtime-floor; the 780M under AMDVLK reports 2^32 - 1). So an event's first signal of 2^31 or
more, or a GPU signal just above a host value far above the last GPU signal, was outside valid
usage there.
One form on every device: the k-th signal of an event the submit thread stages signals its
semaphore to k (submit.rs stage), and the event keeps each pending signal as (count, Metal
value). Both rise, since a signal not above the highest value submitted or set is still left
out, so the value the host sees is the value of the signal the confirmed count reached
(EventState::value_of), and a wait for a Metal value waits for the count of the first pending
signal that reaches it (EventState::count_reaching). Every signal moves the semaphore by one, so
no signal lies further from its value than the signals pending on it. rt submits no semaphore
wait for an event, so 03884 never applied; the README's known-gap paragraph, which named it and
waits, is removed, and the event paragraph says what the semaphore holds. The completion thread
confirms and takes in counts (EventInner::take_in); reached() now takes the state its callers
hold. No Vulkan call, GPU work or copy is added: per signal one increment and a (u64, u64) pushed
where a u64 was; per host read an index into the pending signals under the lock already taken.
Metal's answer for a lower signal: the MTLEvent.h and MTLCommandBuffer.h headers say nothing of
one; the conformance case event-highest-signal, recorded on an Apple M3 Max under macOS 27.0.1,
reads 7 after 7 then 4 and after 4 then 7, so a lower signal changes nothing. rt matches: it is
left out and takes no count.
The pending signals have no bound of their own: one 16-byte entry each, which the signals the
submit thread has staged bound (256 of one command buffer were pending at once behind the gate
on the RX 7900 XTX, job m3-max-78721). The count cannot wrap: at one signal a nanosecond, 2^64
counts take about 584 years.
the_largest_value_is_kept no longer skips a device whose limit is below u64::MAX, and its
semaphore reads 1. The tests of the previous two commits failed at them on the RX 7900 XTX (jobs
m3-max-78698 and m3-max-78708: the semaphore read 7 for a 7, 2^40 for a 2^40, 9 for a 9).
The first run of many_pending_signals_each_take_the_next_count on the RX 7900 XTX (job
m3-max-78698) found 61 of the 256 signals pending at its first read, not 256: the submit thread
stages a command buffer's signalling segments as its queue's room allows, so the test now reads
the pending signals 200 ms after the first submission, prints how many, and checks that they are
the first ones in order with the semaphore still at 0. Its check of the semaphore's count once
the GPU runs is unchanged, and still fails here.
rt puts Metal's 64-bit event values on the event's timeline semaphore as they are, so a signal
can lie further from the semaphore's value than the device's maxTimelineSemaphoreValueDifference
(VUID-VkSubmitInfo2-semaphore-03883; Vulkan lets the limit be as low as 2,147,483,647). These
tests ask for the semaphore to count the event's signals instead:
- a first signal of 2^40 is the semaphore's 1, one of 3 * 2^40 its 2;
- a lower signal moves neither the value nor the semaphore (Metal keeps the highest value: the
conformance case event-highest-signal, recorded on an Apple M3 Max under macOS 27.0.1, reads 7
after 7 then 4 and after 4 then 7; the MTLEvent.h and MTLCommandBuffer.h headers say nothing of
a lower signal);
- a host set between two GPU signals leaves the semaphore where it is, and the next GPU signal
above it moves it by one;
- a host wait for 8 is met by the later of two pending signals (9), and one at the host's value
at once;
- 256 signals pending at once take the counts 1 to 256.
They fail at this commit, where the semaphore reads Metal's values: the fix follows.
A blob write skipped past the bound left the last written size where it was. So when the reaper's
last write had read the cache's data and skipped its write past the bound, the device's drop
(Caches::close) found the size changed since the last write. It read the same data again from the
driver and counted a second skip (Metrics::pipeline_cache_writes_skipped) of data that had not
changed.
A skip past the bound now records the cache's size as the last written. The drop then finds no
change since the reaper's last write and neither reads nor counts again. A look never meets this
path: it replaces a cache past the bound before it would write. Skips for a quiesce's deadline
record nothing, so the drop still writes what a quiesce skipped for time.
The cache module's doc, the field's doc, write's doc and the runtime README say so.
Verified, at this commit, by red then green on every_device_replaces_its_pipeline_cache_past_its_bound.
Each job ran the test at this tree, then with cache.rs from the red commit:
- Iris Xe (ANV), m3-max-79405.
- RX 7900 XTX (RADV), m3-max-79427.
- RTX 5080 Laptop (NVIDIA 615.71.09), m3-max-79433.
Green on all three: "writes skipped at the teardown 1", PASS. Red: left (2, 2), right (1, 1).
Lint and the suite on lavapipe, m3-max-79406: clippy -D warnings plain, m2v_cpu_icd and m2v_gpu
EXIT=0; rustdoc EXIT=0; workspace rustdoc of private items EXIT=0; the runtime's suite 914
passed, 3 skipped. On lavapipe this test returns before the teardown part, since lavapipe keeps
no blob or creation to bound.
A blob write skipped past the bound leaves the cache's last written size where it was. So when the
reaper's last write has read the cache's data and skipped its write past the bound, the device's
drop (Caches::close) finds the size changed since the last write. It reads the same data again and
counts a second skip of it.
The bound test now counts the reads of the cache's data for a blob write at the teardown, through
a cfg(test) counter (Counters::read_cache_data, read at the look's, the last write's and the
drop's reads). With the bound at 1 and the cache grown since its last write, the teardown should
read the data once, in the reaper's last write, and count one skip. The test asserted 2 skips
before.
Expected red today: 2 skips and 2 reads at the teardown.
The paragraph said only a burst reaches past 48 idle recorders. What was measured is narrower:
the most recorders idle at once in three steady plays (36 on an RTX 5080, 31 on an RX 7900 XTX,
28 on an Iris Xe), so in those plays no recorder of steady use took the releasing reset. The
memory the release gives the driver back is by structure, not measured, and the CPU cost per
frame is not resolved by the Iris instruction count, whose plays spread 22%. Docs only.
The device keeps up to 64 idle recorders. Until now, every reset that idled one kept its pool's
memory and its hazard table, so a burst of command buffers left up to 64 pools holding the memory
of the largest command buffers they had recorded until the device went.
The idle recorders now sit in two lists:
- warm: at most WARM (48), taken first. A reset that idles a recorder while fewer than 48 are warm
keeps the pool's memory and the table, as before. Releasing at every reset cost the UHD 630's
Windows driver about 170 us per command buffer (m3-max-46545).
- cold: past the warm ones, which only a burst reaches, the reset releases the pool's memory
(RELEASE_RESOURCES) and the recorder drops its hazard table.
64 idle in all stay the bound, and one given back past them is destroyed.
WARM comes from the most recorders idle at once in steady play of three recorded streams, measured
by a probe build (never merged):
- RTX 5080, m3-max-79136: 36, every recorder the play made, idle at each frame's end; in use p50
5, p90 10.
- RX 7900 XTX, m3-max-79135: 31 (p50 15, p90 26).
- Iris Xe, m3-max-79134: 28 (p50 20, p90 23).
The XTX and Iris counts leave out the moments the play's work drained, when 56 and 64 were idle.
48 is the most (36) and a third. The steady ~50 in use on the XTX and Iris plays are command buffers
held at once; every recorder came back by teardown.
The reset runs outside the lock, after it reads the warm count. A give-back on another thread can
pass that count meanwhile, and a recorder that kept its memory then goes cold, holding it until
its next use, as the doc says.
The runtime README states the rule after the parameter ring's.
Verified:
- Red, then green on the test, a_burst_s_recorders_past_the_warm_ones_release_their_memory. Each
job ran the test at 904bfe3b45 (base 6a14aa4192), then with this commit's record.rs taken from
the red commit. Green: 72 given back, 48 idle kept their memory, 16 released it. Red: left
[(64, 64), (0, 0)], right [(48, 48), (16, 0)].
- Iris Xe (ANV): m3-max-79201.
- Radeon 780M (RADV): m3-max-79202.
- RTX 5080 Laptop (NVIDIA 615.71.09): m3-max-79203.
- At the rebased tip, m3-max-79278 (lavapipe suite): clippy -D warnings plain, m2v_cpu_icd and
m2v_gpu EXIT=0; rustdoc EXIT=0; workspace rustdoc of private items EXIT=0; the runtime's suite
913 passed, 3 skipped.
- CPU instructions on Iris Xe, m3-max-79308. The same 792-frame recorded stream was played a b a b,
each play with a fresh pipeline cache and Mesa's disk cache off (512 pipelines created in each).
perf stat counted user-space instructions over the whole play: a = the parent, b = this commit.
- a: 198.1 and 192.7 M per frame.
- b: 212.1 and 170.1 M per frame.
The means are 195.4 (a) and 191.1 (b). No increase shows, but the measure only resolves
differences well above the plays' own spread (b against b, 22%).
- What the device tests show is the pools reset with release and the tables dropped. The memory
a driver gets back is not measured.
The device keeps up to 64 idle recorders, and every reset that idles one keeps its pool's memory
and its hazard table. So a burst of command buffers leaves 64 command pools holding the memory of
the largest command buffers they recorded, plus their hazard tables, until the device goes.
The test: 64 and 8 recorders, each with a command buffer recorded and a hazard table marked, are
given back. The first 48 (WARM) should keep their memory and tables, and the other 16 should be idle
with both released. Taking the 48 again should leave the released ones idle, and giving them back
should make them warm again. Taking every idle one records into the released ones as well, and
giving them back should leave the same split.
The test seams are cfg(test): WARM, the idle accessor (kept and released, each with how many hold
a table) and Hazards::holds_table.
Expected red today: the burst leaves 64 idle that kept their memory and tables, and none released.
A play's frames 100 and 200 are not one loop's iterations: the program makes and releases
objects between them (glbench-3090-r4 holds 62 textures at frame 100 and 690 at 200), so a
runtime gauge held flat there judged the program. The matrix's records of a play are now,
for buffers, textures, samplers and events, the runtime's live objects of the kind less the
play's own (`KIND_excess`): the stream's live objects the backend made, and the backend's own
that stand for them (two-copy Managed buffers' CPU copies and the released ones a commit still
copies, the asides, the guest RAM scratches; the planes' shapes, one texture a plane and shape
that the plane's surface textures and views are views of; the video and exported surfaces'
planes). The settled end lines at frames 100 and 200 carry the play's count of each kind as
KIND_held. An excess below zero is written as it is, which results.py takes for no count.
The runtime's other kinds follow the program's objects and work, not one object each: they are
not replay records (the harness's loops hold those its workloads reach), and every kind stays
held at zero at the device's drop.
Verified: in the hand-over.
What:
- The runtime backend's end lines (`Backend::live`) carry every count of an object kind the
runtime keeps live: samplers, LOD clamp variants, level elements, kernel variants and entries,
render contents, attachment views, descriptor slots, device samplers, shadows, resolve images,
plane stand-ins, buffer set pools, surface buffers, indirect command buffers, releases waiting
and handles out join them, and the pipeline cache's bytes.
- At the ends of frames 100 and 200 (GAUGE_FRAMES) the player reads them once they hold still
(Backend::settled_live): the runtime backend reads them every 10 ms until no release waits and
two reads in a row agree on every recorded kind, for at most 2 s, a wait no frame's time holds.
What the program released goes on the runtime's block-maker and reaper threads after the work
before it retired, so a read straight after the frame's waits could differ between two plays.
- command-replay prints, where the play ended frame 200 and skipped nothing by then,
`M2V-MATRIX gauge replay-rt/STEM/GAUGE@100` and `@200` for each kind of GAUGED (gauge_records).
scripts/matrix/results.py judges them as it judges the harness's: equal at 100 and 200, blocks
no higher at 200.
- Left out, and why: handles_out (1 while the play holds the device), releases_waiting (lowered by
the block-maker thread whenever it runs), private_units (a layout of memory that follows the
bytes the program holds), and every byte and age gauge, which follows the program's content and
the pool's idle clock: the pipeline cache's data (bound 128 MiB), the translator's entries'
bytes (bound 64 MiB), the staging bytes, the pool's allocated, idle, reserved, reused, taken and
block bytes, and the shadows', resolve images' and stand-ins' bytes, whose counts are recorded.
Why: the matrix's leak rule (live gauges per resource kind flat between iterations 100 and 200)
reached only the harness's compute workloads. The kinds only draws and passes make (render
contents, attachment views, shadows, resolve images, stand-ins, the samplers draws reach) had no
such check, and a play's end lines lacked 17 of the kinds.
Docs: REPLAY-STREAM.md section 10 (the end line's gauges, the settled read, the records),
VALIDATION.md's gauge row, command-replay's module doc.
Tests: replay::tests the_player_settles_the_gauges_at_frames_100_and_200_alone and
the_gauge_records_are_the_counted_kinds_at_frames_100_and_200; replay::rt_replay
the_end_lines_carry_every_gauge_the_gauge_records_carry (device); test_results.py
test_a_plays_gauges_at_frames_100_and_200_are_held_flat_as_the_harness_s.
Verified: in the hand-over.
Tally::refused now reads the input's own version and keys the skip on the toolchain's own refusal
of it, compared with the version the toolchain says it takes:
- typed AIR: the input's `!air.version` node, and `xcrun metallib`'s "air version set to X (...),
but expecting Y". Skipped only where X is the input's version and Y is below it.
- MSL: the source's `// metal-std:` standard S, and `xcrun metal`'s "invalid value 'S' in
'-std=S'". Skipped only where every `metalX.Y` the compiler's notes offer is below S.
Anything else stays a failure. finish lists each skipped input with both versions, then prints
"SKIP <n> of <inputs> inputs above the toolchain's newest version".
Over the public fixtures, 31 of 582 typed inputs state AIR 2.9.0 (545 state 2.8.0, the rest
older) and 10 of 747 MSL sources name metal4.1. Those are the counts of the two refusals in CI
run 46959260218 on macos-26 (31 and 10). On that runner, the two round trips should print
"SKIP 31 of 582" and "SKIP 10 of 747" and pass.
ci.yml is unchanged. The macos-26 arm64 image 20261123.0526.1 carries Xcode 26.0.1 to 26.6
(default 26.6) and SDKs up to macOS 26.5, so no Xcode on it takes AIR 2.9.
On macos-26, CI's Xcode 26.6 refuses the public fixtures of AIR 2.9 and Metal 4.1, which come from
the macOS 27 SDK: `xcrun metallib` says "air version set to 2.9.0 (...), but expecting 2.8" for 31
typed fixtures, and `xcrun metal` says "invalid value 'metal4.1' in '-std=metal4.1'" for the 10
sources that name metal4.1. typed_fixtures_round_trip and msl_fixtures_round_trip fail on them.
round_trip_all now keeps each input's outcome in a Tally, whose finish lists every skipped input
and the total above the toolchain's newest version. The tests own their inputs and need no Mac: a
fixture of AIR 2.9 refused by a toolchain that states 2.8, and a source naming metal4.1 refused by
a compiler whose notes offer up to metal4.0, are each to be skipped and counted; every other error
(another metallib error, a refusal whose expected version is not below the input's or names
another version, a refused standard the source does not name or that the compiler offers, any
other compiler error) is a failure, and a failure fails the round trip.
Red here: Tally::refused files every refusal as a failure, so the two skip tests fail.
A newer heap texture placed over an older one's bytes moved out of UNDEFINED
in the upload ahead of its first command buffer. Vulkan lets that move write
the image's memory (a compression state's initialization), and a command
buffer that reads the older texture before writing the newer one then reads
changed bytes, where Metal changes none. AMDVLK does this on a Radeon 780M
(round job m3-max-79662, 1 of 915 failed; RADV and ANV pass).
The ruled form, one form on every device with no device or driver key: no
upload moves such a texture. Its first use moves it, in the command stream,
after the earlier reads.
- alias: a texture placed with links is unmoved (Placement::unmoved) as well
as stale. A first use in a command buffer of a texture unmoved as it is
encoded, a read included, adds a check at the head of its segment, as a
first write already did. The segment ends first where a link was read in
it. The submit thread resolves the check in queue order: a write's check
moves a stale texture, and any check moves an unmoved one, which is then
unmoved no more.
- Each heap lists its unmoved textures (Places::unmoved). An entry leaves as
its texture moves or is released, so the list never holds more than the
heap's live placements. The device counts them, so use_heap on a device with
none loads one atomic and locks nothing.
- use_heap (compute and render) is a read of each unmoved texture of the heap,
since a kernel or a draw may reach it next through an address: its check
goes where the use_heap is.
- get_bytes of an unmoved texture moves it in its own upload, ahead of its copy
(alias::host_read). replace_region already moved a stale texture
(host_write).
- Image.over and its source scope in Image::homing are gone: an unmoved
image is made homed and never enters an upload's homes.
- Runtime README: the heap texture contract says when the move happens. The
known gap of textures carries the residuals: a never-written newer texture
that is read; an older texture read through a heap declaration after a newer
one over its bytes was made and before that one is written (in both, the
move may change the older bytes, as AMDVLK's does); a first use rt cannot
name; and a draw's first use, checked where the pass's part of the command
buffer starts.
To verify at this commit (jobs in the handover): the red commit's counts test
and heap_alias on lavapipe, clippy in three configurations, doc and private
doc, the runtime and validation suites on lavapipe, AMDVLK on a Radeon 780M
red at the red commit and green here, and RADV, ANV and NVIDIA unchanged.
A newer heap texture placed over an older one's bytes takes its move from
UNDEFINED in the upload ahead of its first command buffer. Vulkan lets that
move write the image's memory. If the command buffer reads the older texture
before it writes the newer one, the read can see changed bytes, and Metal
changes none. The pin round's AMDVLK leg showed it: Radeon 780M under AMDVLK,
job m3-max-79662 at 685df4244e, 1 of 915 failed. The failing test is
heap_alias's every_device_reads_an_older_texture_before_a_newer_one_over_its_bytes_is_written:
554 of 262144 texels of the older RGBA16Float texture read NaN, for the
RGBA8Unorm 256x256 newer shape, with the RGBA16Float 256x128 and R32Float
256x256 shapes failing the same way. RADV and ANV pass it. That test's comment
now says so.
New counts test in tests/alias.rs, deterministic on every device lavapipe
included. P is written; then Q, R, S and U are each placed over P's bytes:
- Q is written after a read of P: checks [0, 1], one heap move, no upload
barrier.
- R is read after a read of P: the same for a first use that reads.
- S's heap is declared (useHeap:), then P is read: checks [1], one heap move,
no upload barrier; declaring the heap again moves nothing.
- U is read by the host (get_bytes): its upload moves it once, the second
read not at all.
At this commit the uploads move each newer texture, so the upload-barrier,
check and heap-move counts differ (red); the fix follows.
lavapipe exports a dma-buf through /dev/udmabuf. The image's containers now get the host's node
wherever the host has one (docker's daemon opens it for them; rootless podman only where the
user may), with the node's group, and `lavapipe-image udmabuf`, which the build step runs, says
which. Where they get none, `nextest` skips the tests and `replay` (new: the conformance replay in
the image) leaves out the cases scripts/lavapipe-image/needs-udmabuf names, each named in the log:
those are measured, each failing without the node and passing with it. The workflow decides by the
node's presence alone; no test is loosened. LAVAPIPE_IMAGE_UDMABUF names another node, or none,
which is how the lab's replica shows what a runner without the node runs.
The downloads are restored before the build and saved right after it, keyed on the pin (the
tarball's sha256, the date and the packages' versions), so a job whose later steps fail still
keeps them. The build step's limit is 90 minutes: a cold fetch at the slowest rate measured from
the archive, one connection at 57 KB/s, of the 127 MB tarball and 135 MB of databases and
packages (262 MB) takes 77 minutes. A fetch that fails ends the build step with the URL and curl's
status, or pacman's, before any test runs; the fetches retry three times.
Measured at this change's parent plus the probe (job m3-max-79668, lavapipe on x86-64 AVX2, no
node passed in): of 807 device tests run, 806 pass and
replay::rt_replay::a_video_surface_is_waited_for_at_its_ready_point_once fails with "the device
exports no DmaBuf"; with the node (m3-max-79517) every one passes. The four surface-textures cases
are refused at replace-region without the node (m3-max-79408) and hold the ledger's expectations
with it (m3-max-79517).
CI's lavapipe steps ran on Ubuntu's Mesa 26.0.8 (LLVM 21.1.8), whose llvmpipe faults in its JIT
code on the conformance case reconvergence-constructs' rc_break draw (a null load on its
rasterizer thread), while the ledger's llvmpipe rows were recorded on Mesa 26.2.4 with LLVM 23.1.1.
The device tests, the conformance replay and public case qualification now run in a container
image of exactly that Mesa and LLVM, and nowhere else.
scripts/lavapipe-image/pin names the image: the Arch Linux bootstrap tarball of 2026.10.01 and its
sha256, the archive date 2026-10-05 its packages come from, and each package's exact version
(vulkan-swrast 1:26.2.4-1, llvm and llvm-libs 23.1.1-1, vulkan-icd-loader and
vulkan-validation-layers 1.4.363.0-1, spirv-tools 1:1.4.363.0-1, vulkan-tools 1.4.363.0-1,
python 3.14.7-1). scripts/lavapipe-image/lavapipe-image builds it: the tarball by curl -A curl,
checked against the sha256; its root imported with docker or podman; then pacman, against that
date's archive repositories alone, fetching through curl -A curl (XferCommand), with signatures
required and checked by the bootstrap's own keyring. Its downloads stay under
~/.cache/m2v-lavapipe-image, which CI caches keyed on the pin, so a run whose pin has not moved
downloads nothing. `ensure` prints the pin, the packages the image holds and its device's name and
driver, and fails where any differs from the pin or from the ledger's new `# llvmpipe:` line,
which names the venue's Mesa, LLVM, loader and layers. That line holds upstream versions: the
image is Arch's build (mesa 1:26.2.4-1), and the rows were recorded on another distribution's
build of the same release (3:26.2.4-1).
The tests are built on the host and only run in the image, with no network, only the
environment named, and the checkout mounted read-only (qualification writes the corpus alone).
lavapipe exports a dma-buf through /dev/udmabuf, so a container gets the host's where the host's
user may open it, and offers the exports the host's lavapipe does. Each container is held to its job's memory (LAVAPIPE_IMAGE_MEMORY, else the host's) and CPUs
(CARGO_BUILD_JOBS, else the host's), since the container runtime runs it outside the job's
processes. The archive serves a connection slowly at times, so the build fetches the
transaction's packages eight at a time with the same curl command before pacman runs.
The device tests are the tests the --cfg m2v_cpu_icd build lists and the plain builds do not
(only_in.py): a test that opens a device compiles only under the cfg, and the plain builds' tests,
the .ll fixtures' test with Ubuntu's LLVM 21 among them, run on the host as before. They go into
the image as a nextest archive, which needs no toolchain there; the replay and qualification run
the binaries built in the checkout. The host keeps the Vulkan loader and no driver.
AGENTS.md and CONTRIBUTING say in one sentence each that the pin and the ledger's line move
together.
Verified in the lab's replica of CI's Linux job (job m3-max-79517, at this change on
e086e51c7e, docker 29.10.1, lavapipe on x86-64 AVX2): the image builds from the cached downloads
in 55 s and its check passes (every package equal to the pin; "llvmpipe (LLVM 23.1.1, 256 bits)",
"Mesa 26.2.4-arch1.1 (LLVM 23.1.1)"). The device tests: 810 listed, 809 run, 809 passed. The
conformance replay holds exactly the 4,712 open gaps the ledger expects on llvmpipe, with no fault.
Public case qualification passes. Without /dev/udmabuf (m3-max-79408) one device test met "the
device exports no DmaBuf" and the replay refused four surface-textures cases at replace-region;
with it both are as the ledger expects. The two red host steps of both runs, golden_hashes and
the pinned opened chains, are the tables the next pin blesses, not this change.
a_helper_killed_mid_make_leaves_every_make_its_refusal_at_once makes each
pipeline, and the stage fill, on a detached thread holding a clone of the
device, and that thread sent its answer before its clone was dropped. After
the last answer the test drops its own device and returns, so a detached
thread could hold the last reference and destroy the device while the
process exits. Each thread now drops its clone before it answers, so the
test's own drop is the device's last.
Test-only: no product file changes.
Seen once: the pin round's runtime item on a Radeon RX 7900 XTX (RADV
NAVI31), job m3-max-79526, at 685df4244e: the test printed its two lines
and "test result: ok", then the process ended with SIGSEGV. The same item
passed this test on the Iris Xe, the Radeon 780M, Hawk Point, the RX 550,
the RTX 2080 and the RTX 5080 Laptop.
a_video_surface_is_waited_for_at_its_ready_point_once asserted that only a
surface in place counts a ready wait, the copy form's returning at once.
d0a424060a made Surface::wait_until_ready wait in both forms, the copy
form's for its block's making, and documented it so; the test kept the old
expectation. Its device runs were on devices that take the surface in place
(lavapipe, the Radeon 780M, the UHD 630), so the copy form's count was not
run until the pin's round on discrete cards, which take this 64 by 64
surface at a 64-byte pitch as a copy. The test now expects one wait in
either form.
Test-only: no product file changes.
Verified (red), at 685df4244e, the round's runtime item, 979 of 980 passed,
"surface_waits" left 1 right 0 with the surface copied: GeForce RTX 2080
(m3-max-79524), Radeon RX 550 (m3-max-79581), GeForce RTX 5080 Laptop
(m3-max-79542). The Iris Xe and the Radeon 780M of the same round take it in
place and passed.
a_time_breach_is_asked_once_more_by_a_later_device made the pipeline from
a helper's fill on every device that keeps a blob. lavapipe of Mesa 26.0
keeps nothing of a creation in its pipeline cache (keeps_creations' doc), so
there a fill's entry makes no pipeline and the make after the fill met
CompileRequired. The product answered as documented; the test lacked the
guard a_kernel_past_the_stage_bound_is_made_only_from_its_helpers_fill has.
The test now asks keeps_creations for each device while the kernel is within
the bound, as that test does, and skips a device that keeps none.
Test-only: no product file changes.
Verified (red): the CI replica's lavapipe step (Ubuntu's Mesa 26.0.8, LLVM
21.1.8), job m3-max-79286, at the cut: "after the fill: a stage of entry
weight 264 past the stage bound is not made: its helper's compile met
CompileRequired".
The census table moves with the translator since the last pin: 1903 rows change, every one a
new artifact hash (the product fingerprint moves with SEMANTICS_VERSION 2311-2318). Fifteen rows
change class, all from not_supported to compiled, none the other way: eight that needed the
IdentityDomains form, which the identity-domain reads since 2f16658ac2 build, and seven whose
PixelCoverageAtSampleRate or SampleRateShading needed ShaderSampleRateInterpolationFunctions,
which the moltenvk-m3 profile's stated portability feature now meets (341b80cdef). Blessed by
corpus-triage --audit authored-compile --bless on an Apple M3 Max (job m3-max-79338, census
exit 0). Table only.
The golden hashes table moves from semantics 2310 to 2318 (the bumps of 2311-2318 since the last
bless): 2418 rows change, 1136 engine .ll and 1131 engine .air.ll fixtures plus 151 others, every
change a hash to a hash. Blessed by bless_golden_hashes on an Apple M3 Max (job m3-max-79327),
where the engine inventory and the AIR printouts were blessed unchanged and the metallib half of
committed_air_fixtures_parse_and_link ran un-skipped and passed (linkhalf 0).
opened_chains.txt: the moltenvk-m3 device and restricted contexts now enable the portability
features that profile states (constantAlphaColorBlendFactors and the others 341b80cdef passes on),
so their chain hashes move. Blessed by bless_opened_chains (job m3-max-79328, lavapipe node);
every_committed_profiles_context_enables_its_pinned_chain passes after it, and failed before it
in the pin's lavapipe suite (job m3-max-79276).
Tables only; no source change.
The floor asked a device listing VK_KHR_portability_subset for four portability features and
enabled only those, so the translator's description withheld the six others it names
(constantAlphaColorBlendFactors, vertexAttributeAccessBeyondStride, samplerMipLodBias,
shaderSampleRateInterpolationFunctions, separateStencilMaskRef, pointPolygons) on every such
device, and the translator took its form without each (a refusal of sample-rate interpolation,
of triangles filled as points, a withheld sampler bias) though the device states it.
floor.rs: PORTABILITY_STATED holds the six. decide() copies each as the device states it, beside
the optional tables, and no device misses the floor for one; device creation enables what decide
copies (consumer_features starts from it), and ENABLED carries the table, so named_features and
shader_enables pass each enabled one to the translator. A device that does not list the subset
reports none and chains no portability structure.
README: the table of stated portability features under Portability features; tests::floor holds
it to the code.
No device above the floor lists the subset: on the M3, KosmicKrisp (Mesa 26.3.1) lists none, and
MoltenVK 1.4.2 lists it but lacks nullDescriptor and logicOp (job m3-max-79220, which ran a
device leg printing each device's stated and given features). So the change is held by the unit
test on the floor's queries.
The floor's PORTABILITY table enables only the four portability features it requires
(imageViewFormatSwizzle, mutableComparisonSamplers, multisampleArrayImage, imageView2DOn3DImage),
so on a device that lists VK_KHR_portability_subset, shader_enables passes the translator none of
the six other portability features it names (constantAlphaColorBlendFactors,
vertexAttributeAccessBeyondStride, samplerMipLodBias, shaderSampleRateInterpolationFunctions,
separateStencilMaskRef, pointPolygons). The translator then refuses what they carry (sample-rate
interpolation in census 65547 on MoltenVK) though the device states them.
A unit test on the floor's queries: a device at the floor listing the subset and stating every
portability feature; it asks that each portability feature the translator names reach
shader_enables. Expected red until creation enables them where the device states them.
The emulated simdgroup tier's partial-threadgroups variant (15e53e4209, 54d2087b83) changed
metal2vulkan/src/lower/dispatch.rs, one of the runtime inputs: KernelDecl::live now also returns
the threadgroup's live thread count, and emit_entry keeps it for the entry. That is compile-time
emission only; what it emits is in the pipeline the artifact digests, and SEMANTICS_VERSION 2318
already covers it. No behaviour of a run changes beyond that, so only the hash moves and
RUNTIME_VERSION stays 2551. Seen in merge check m3-max-79171 (lavapipe, validation suite).
every_device_replaces_its_pipeline_cache_past_its_bound hung on every card (XTX, RTX 2080,
Iris Xe; 600 s, then killed). It holds a creation guard open (cache::creation) so no look comes
before the teardown, and it dropped the device's last handle before that guard. Since
4346532344 the teardown's last write (Caches::last_write, with no deadline at a teardown)
waits for a creation still running, so the drop waited for the reaper, and the reaper for the
guard the same thread held: under gdb on the XTX (m3-max-79155) the test thread was in
Shared::drop -> halt -> finish -> Ended::wait and the reaper in last_write (cache.rs:1841).
8dd00ec58c hangs the same way (79155, the test alone, exit 124).
No product path can do this. The one creation guard, in made_through_cache (pipeline.rs), covers
only its vkCreate*Pipelines call (render.rs, pipeline.rs, own.rs); no consumer code, no
completion handler and no drop of a state, library or handle runs under it, and the runtime
has no completionHandler forms. A last handle dropped on another thread waits only for that
create to end. Creation's doc now says the guard lives on its creating thread for that create.
The test now drops the device on another thread, waits for the reaper to stop, and then ends
the creation. With the bound lowered past the cache, both of the teardown's writes are skipped
and counted: the reaper's last write (1), then the drop's (2), since a skipped write leaves the
size last written as it was. The blob keeps the fresh cache's data.
The hang begins at 4346532344: the test alone on the XTX passes at 9f680a352e and at its parent
1149c04081, and is killed at 120 s at 4346532344 (m3-max-79175).
Verified: the test and the other blob and stage tests, 15 in all, pass on an RTX 2080
(m3-max-79189), an Iris Xe (m3-max-79188), a Radeon 780M and an RX 550 (m3-max-79242) and the
lab's lavapipe (m3-max-79237). Lint (fmt, the generated tables' checks, clippy plain, under
m2v_gpu and under m2v_cpu_icd, rustdoc and the private rustdoc) passes (m3-max-79221).
Twelve device tests wanted a blob, a grown blob or a stage fill's pipeline wherever the device's
cache data begins with a usable header. The runtime writes the blob only where the cache's size
changed since the last write, and a stage's pipeline is made from the helper's cache data alone;
a driver may keep nothing of a creation in its cache. On Mesa 26.0.8's lavapipe (LLVM 21.1.8,
the CI's) the empty cache's data is its 32-byte header and stays 32 bytes after a render
pipeline or a kernel is made through it, so no blob is written, and a stage fill's data is
answered compile-required, which the runtime keeps as a breach and refuses as a typed
StageSize gap (StageBreach::CompileRequired). The render test failed there at 9f680a352e too,
before the blob-write changes, so this is the device's answer, not a regression. The node's own
lavapipe (Mesa 26.2.4) gives a header the runtime does not take, so those tests already took
their no-blob arm there.
tests::keeps_creations asks it: a device on no cache directory makes the test's own pipeline,
and the cache's data grew. Where it did not, it says so, and:
- the render and kernel cache-directory tests, the second-process test and the header test want
no blob;
- the bound, quiesce, deadline, skipped-write, removal, three-times and seed tests take their
no-blob arm, as for a device with no header;
- the stage-fill test wants the fill's make refused with the compile-required breach, and asks
the driver before it sets the test's stage bound, while the kernel compiles in this process.
Every other assertion is unchanged; a driver that keeps its creations runs each test as before.
Verified: the CI replica's step 15 in full with no fail-fast, 2331 passed and 6 skipped
(m3-max-79120, Mesa 26.0.8 lavapipe). The twelve tests and the stage test pass on an RTX 2080
(m3-max-79189), an Iris Xe (m3-max-79188), a Radeon 780M and an RX 550 (m3-max-79242) and the
lab's lavapipe, Mesa 26.2.6 (m3-max-79237), with the next commit.
The exported-surface stand-in (replay/new_runtime/standin.rs) opens a Vulkan device of its own
with vkCreateDevice, and gpu::tests::device_opens_exist_only_behind_the_tripwire_check failed on
it: the open was in no row of the test's table. The stand-in is made at a play's first export,
after the play's GPU work began, so a hang its waits wrote to the tripwire could already be set
when it opens; the tripwire's contract is that no GPU entry point starts new work while it is
set. StandIn::new now calls refuse_if_tripped first, and the table names its open.
The test's ordered check (the tripwire check before the open, in the open's own file) held only
the runtime's device opens; it now holds every row, each of which already met it.
Verified in the CI replica's environment (Ubuntu's Mesa 26.0.8 lavapipe, LLVM 21.1.8, VVL
1.4.341): the test passes (job m3-max-79044), and CI's step 12 in full with no fail-fast passes,
1313 passed and 3 skipped (m3-max-79062).
The draw now refuses a missing pipeline state at two sites, one from the word-bound content's
path (7a1da6cb22) and one from the slot-usage check (73bb5eb204); each branch regenerated the
table on its own base, so the landed tree counted one. Regenerated with
scripts/refusal-surface/refusal_surface.py; no code change.
8811dd6790 checked a texture slot against the usage Metal answers, and answered a view made with a
swizzle as ShaderRead and PixelFormatView alone, so a kernel's write through such a view became
Refusal::TextureUsageAtSlot. That reversed the runtime's recorded known gap of swizzles (README,
Known gaps of textures: a view's descriptor reports its base texture's usage, so a draw into such
a view and a kernel's write through it run, the write stored unswizzled; docs/API.md's accepted
differences), on which OpenCL mode stands: Apple's OpenCL binds an image of most channel orders
as a swizzled view and writes it (tests/opencl_swizzles.rs, job m3-max-16336). The runtime suite
on lavapipe at b28f70e076 (job m3-max-78531) failed three tests on it:
opencl_mode_queries_of_a_swizzled_write_only_image_answer_the_view,
opencl_mode_writes_through_a_swizzled_image_store_the_value_as_written and
every_device_reads_through_a_view_s_swizzle_and_writes_past_it, each "the Kernel function uses
texture slot 0, whose texture's usage MTLTextureUsageShaderRead |
MTLTextureUsagePixelFormatView lacks what its access there asks".
The slot check now takes the texture's descriptor usage (TextureObject::metal_usage: Metal's
unknown usage as 0x17, a view's its texture's, a swizzled view's included). The known-gap text
and new_texture_view_with_swizzle's doc are as before 8811dd6790; the refusal's doc, the README's
Texture slots and usage and RESOURCE-ID.md say a view's usage is its texture's, a swizzled one
included. The slot_usage test's swizzled destination is now a case that runs and stores the
texel as written.
The same run failed every_device_gives_an_index_to_the_texture_placed_there_last, whose dispatch
wrote through A, a texture of ShaderRead usage alone, at sample_down's written slot: that is the
refusal Metal's validation gives, and the test's point is that A's placement empties D's storage
element. It now writes through D's ID, the same index, which D's ShaderWrite usage lets the slot
check pass, and D still keeps its texels.
Verified: cargo fmt; refusal_surface.py --check (REFUSALS.md unchanged). The suite run of this
commit follows as a job. The other 865 tests of job m3-max-78531 passed (3 skipped).
Rustdoc with -D warnings refused the basis line of Refusal::TextureUsageAtSlot: the quoted Metal
validation text "reads texture (t[0]) whose usage ..." holds t[0], which rustdoc reads as an
intra-doc link to an item named 0 ("unresolved link to `0`", error.rs, three times, in both the
public and the private-items build). The three t[0] are now code spans and the lines reflowed
under 100 columns; REFUSALS.md regenerated (the row's text; basis.rs is unchanged).
Verified: the failure is job m3-max-78486's rustdoc steps (doc and privdoc EXIT=101; fmt, clippy
over the workspace and under --cfg m2v_cpu_icd and --cfg m2v_gpu, refusal_surface --check and
the signatures check passed there). Here: cargo fmt and refusal_surface.py --check; the rustdoc
run of this commit follows as a job.
A function's texture slot bound to a texture whose usage lacks what the function's access there
asks reached no element of the texture's and ran: it read element 0 of set 1 (nil's null
descriptor) or a null element as zeros and dropped its writes, with no refusal and no count. The
textures: one no shader reaches (no index: a Depth32Float target of RenderTarget usage alone, a
texture of PixelFormatView usage alone), a colour target of RenderTarget usage alone (null
elements), a texture not made for shader writes at a written slot (no storage element), and a
view made with a swizzle at a written slot (written unswizzled, where plain Metal writes through
the swizzle).
Each dispatch and draw now checks, once after the pipeline state or a binding changes and before
it records anything, each texture its functions' slots reach against the usage Metal's validation
asks by the access the function declares there (pipeline::slot_usage): ShaderRead for a sample or
read slot, a size query alone included; ShaderWrite for a write or read_write slot; both for a
read_write slot it reads. The texture's usage is Metal's answer (TextureObject::metal_usage):
the descriptor's, Metal's unknown usage as 0x17, and a texture reading through a swizzle other
than the identity ShaderRead and PixelFormatView alone. A texture short of it refuses the command,
Refusal::TextureUsageAtSlot { stage, index, usage }, binding and recording nothing. The binds take
every texture, as Metal's do. Gap::SwizzledReadWrite stays checked first for a read_write slot it
reads. The check reads facts the interface and the texture already hold; nothing runs per draw.
Basis (the previous commit's measurement, an Apple M3 Max, macOS 27.0.1, jobs m3-max-78392 and
m3-max-78422): plain Metal reads and writes the texels; Metal's validation asserts "Compute
Function(k_read): reads texture (t[0]) whose usage (0x04) doesn't specify
MTLTextureUsageShaderRead (0x01)", "writes texture (t[0]) whose usage (0x01) doesn't specify
MTLTextureUsageShaderWrite (0x02)" (an access::write argument asked only its width included), and
"Fragment Function(f_first): Shader reads texture (t[0]) whose usage (0x04) doesn't specify
MTLTextureUsageShaderRead (0x01)".
Docs: REFUSALS.md regenerated (the refusal's site); the runtime README's Textures section states
the rule (Texture slots and usage) and its compute encoder, render encoder and swizzle entries
name the refusal; RESOURCE-ID.md's sentence that a slot binding a colour target of neither usage
reads nil now says what a runtime refuses; the doc comments of set_texture, set_vertex_texture,
dispatch_threadgroups, draw_primitives, gpu_resource_id and new_texture_view_with_swizzle name it.
The test literals of the kernel interface and of a content's draws (tests/compute.rs,
tests/indirect.rs) take the new field.
Verified: cargo fmt. The red and green runs, clippy and the runtime suite on lavapipe follow as
jobs.
A texture slot a function uses, bound to a texture whose usage lacks what the function's access
there asks, reaches no element of the texture's, and nothing refuses it: the slot reads element 0
of set 1 (nil's null descriptor) as zeros and its writes are dropped. A texture no shader reaches
(a Depth32Float target of RenderTarget usage alone, a texture of PixelFormatView usage alone) has
no index; a colour target of RenderTarget usage alone has an index whose elements are null; a
texture not made for shader writes has no storage element. This is the index-free direct bind of
the consumer's row 194 that is still open after f3bb94275b, which refuses the bind of a texture
reached through its views alone.
Metal binds such a texture and its validation stops the command that uses the slot, by the
argument's declared access; plain Metal reads and writes the texels. Measured on an Apple M3 Max,
macOS 27.0.1 (jobs m3-max-78392 and m3-max-78422, runtime-compiled MSL):
- setTexture:atIndex: binds every such texture, under the validation layer too;
- the validation layer asserts at the dispatch "Compute Function(k_read): reads texture (t[0])
whose usage (0x04) doesn't specify MTLTextureUsageShaderRead (0x01)" for a sample, a read or a
get_width alone of an access::read or access::sample argument; "writes texture (t[0]) whose
usage (0x01) doesn't specify MTLTextureUsageShaderWrite (0x02)" for an access::write argument,
its get_width alone included; both for access::read_write; and at the draw "Fragment
Function(f_first): Shader reads texture (t[0]) whose usage (0x04) doesn't specify
MTLTextureUsageShaderRead (0x01)", the pass's own attachment included;
- Metal's unknown usage answers 0x17 and passes every access; a view's usage is its texture's
(0x14, 0x11); a view made with a swizzle answers 0x11 (ShaderRead | PixelFormatView) of a
texture of 0x13 and of one of unknown usage, and a write of it asserts;
- with the layer off, plain Metal reads the depth (0.75), the texels (64, 128, 192, 255) and the
width (4) in every case, and writes a swizzled view through its swizzle.
This commit adds the refusal a dispatch or draw will return (stage, slot index, the texture's
usage as Metal answers it), its basis line, REFUSALS.md, basis.rs and the signature table, and the
device test slot_usage: sample_down (slot 0 sampled, slot 1 written and its size asked),
depth_fill_read and first_texel_fragment over textures of each usage. Its controls (read and
write usage, unknown usage, a view of a read texture, a read depth) run with their texels; a
render-target colour source, a read-only destination, a swizzled view's destination, a
render-target depth with no index and a PixelFormatView-only texture with no index expect the
refusal and their bytes kept. The commands do not refuse yet, so the test is red here: they run
and read zeros (or drop or unswizzle the write). The next commit makes them refuse.
Verified: cargo fmt; the red run is the next commit's job.
The queues' known gap (c9cf5bb1cc) said what the runtime does and what Metal's documented order
asks. This adds what Metal does, measured in the same two shapes by a new conformance probe,
cross_queue_event_stall.m: A on one queue runs a short dispatch, signals an MTLEvent, then 25
spins of 4.00 ms; B on another queue, committed after it, waits and runs one thread over its own
buffer; then the same with an MTLSharedEvent the host sets after both commits. Five rounds each,
MTL_DEBUG_LAYER unset, job m3-max-79181 on an M3 Max with macOS 27.0.1: B's GPU end came 0.01-0.08
ms after A's GPU start while A ran 99.96-100.00 ms, and 0.13-0.15 ms after the host's set while
A ran 99.95 ms. So the gap stands: the runtime's waiter starts at the signalling command buffer's
end (28.5-111.0 ms in the runtime's measurement), Metal's at the signal.
The probe's header records the result. Docs and a probe only.
L65. Every queue submits to the device's one VkQueue and each segment ends with one global
barrier, so a waiter runs after every segment its signaller submitted ahead of it: the rest of
the signalling command buffer, not only the signal. Metal's documented order asks only for the
signal. Recorded in the queues' known gaps with what was measured.
Measured by a WIP probe (not landed; steelbrain/fix-rt-l65 7d5b5cbd21, lavapipe at cef6068642):
A runs a short dispatch, signals an Event, then about 100 ms of dispatches; B, committed after
it on another queue, waits and runs one short dispatch over buffers of its own; five rounds,
then the same with a SharedEvent the host sets after both commits. The stall beyond the event's
order: RTX 2080 99.2-100.8 ms (job m3-max-79162), Radeon 780M RADV 99.6-99.7 ms (79142), Iris Xe
ANV 28.8-46.0 ms (79143, its A 28-46 ms), lavapipe 110.5-110.9 ms (79126, B on A's buffers);
host shape 100.9-101.0, 100.5-101.4, 28.5-29.0, 110.3-111.0 ms. Docs only.
wps_uint_k24_s32 over 160 threads in threadgroups of 64 (two whole and
one of 32, a whole simdgroup) runs the partial-threadgroups variant:
the Emulated tier on lavapipe (compute subgroups below 32) and on the
Intel GPUs (the widest-pin rule), a subgroup tier elsewhere. Each
thread's 24 words must be the CPU's and every word past the grid keeps
its fill; partial_variant_ragged_grids counts the dispatch.
The partial-threadgroups variant of a4_simdgroup_barrier now compiles in
the Emulated tier (runtime-floor), whose predicated walk runs no subgroup
operation and keeps no reconvergence mode: Guaranteed with no note, as
the plain module. The test expected the subgroup tiers' answer there
(job m3-max-78909).
compile.rs refused partial_threadgroups beside emulated_simdgroups before
lowering, so the emulated variant's partial form never reached the walk
a1cbbe66cf plans. Only a flat grid, folded groups and a replay's bindings
are refused with it now. Found by an_emulated_partial_threadgroup_
exchanges_among_metal_s_threads on moltenvk-m3 (job m3-max-78894).
select.rs refused a kernel's partial-threadgroups variant in the
Emulated tier (Unsupported{PartialThreadgroups}), which the runtime
reports for a ragged grid as Gap::PartialThreadgroups{Translator}. The
tier is lavapipe's for every SIMD-group kernel (its compute subgroups
are below 32), Intel's for a large kernel the widest-pin rule sends
there, and the emulated variant's on every device.
The variant now walks the tier's synchronizations as the subgroup tiers
walk their barriers. workgroup::check plans the predicated walk for a
kernel of partial threadgroups with any of the tier's synchronizations
(an exchange or a threadgroup barrier), with Predication::partial_groups
set, so emit_entry starts `live` from Metal's threads (lin < n) and the
invocations past them reach each exchange's barriers never live, storing
nothing. The exchanges take Metal's thread count as the threadgroup's
N: KernelDecl::live also answers that count, emit_entry keeps it as
EmitCx::entry_threads, and Emu::n is it in place of the local-size
constant. Every existing rule below N then answers Metal's partial
threadgroup: a read of a lane past it reads the calling lane, folds,
votes, ballots and quad masks take only the lanes below it. The scratch
stays sized from the local size, so every invocation has its slot.
Docs: LoweringInputs::partial_threadgroups, the divergent and workgroup
module docs, PartialThreadgroupsSite::Translator, the runtime README's
partial-threadgroups gap, and docs/REFUSALS.md regenerated.
SEMANTICS_VERSION 2316 -> 2317.
The interpreter runs neighbour (a threadgroup barrier and a simd_sum)
over a ragged grid of 100 threads in threadgroups of 48, its region
flagged NONUNIFORM, in the Emulated tier: lavapipe's and gate-lavapipe's
own (compute subgroups of 8 and 4) and moltenvk-m3's emulated variant.
Each thread must read its neighbour modulo its threadgroup's threads and
sum its simdgroup's lanes among them, and the invocations past the grid
store nothing. The widest-pin rule's four large shuffle kernels must
take the partial-threadgroups variant in the Emulated tier on the four
Intel profiles.
partial_threadgroups_are_refused_with_another_form drops its emulated
form, which the variant now takes.
Red at this commit: select.rs refuses the variant in the Emulated tier
(Unsupported{PartialThreadgroups}).
What: the ring's idle rule (Ring::due), run on the block-maker thread beside the pool's: a block
past the first goes once every chunk of it has been free for the idle age (250 ms), where the
ring, at its fewest free chunks since the block fell idle, kept more than a block's chunks free
without it, so neither a take in that time nor the next would have asked for a block. The fewest
is set at the give-back that made the block idle, from the chunks the ring has free once that
give-back is done, and falls with each take. The first block stays, and so does a block holding
the nil buffer, the zero range or the whole range. A take now takes a chunk of the oldest block
with one free, so the newest blocks fall idle first; each block keeps its own free chunks. A
block past the first that falls idle wakes the block-maker thread (Pool::nudge); the thread
frees it as memory of its own (Loose::RingBlock: its fault span noted freed, the buffer
destroyed, the memory freed, the blocks gauge falling). A block that does not meet the rule now
cannot meet it in the same idle time, so the thread sets no wake for it.
Why: the planner's cache ruling (1). The ring kept every block it made for the device's life, so
a burst of parameter writes left its peak of 2 MiB blocks of the ring type (device-local and
host-visible, small without resizable BAR) until the device went. Freed at idle alone, a ring in
steady use would free its second block and make it again each idle age. A second condition, no
take for the idle age, which took an idle ring down to its first block, was dropped by the
planner's ruling: whether a take waited for a block it then made again could not be read on a
recorded play, so an idle ring keeps its first block and the one ahead of it.
Docs: the ring module doc, Ring::due, Pool::nudge, memory::run, the runtime README's internals
paragraph.
Verified: red on the RX 7900 XTX (RADV 26.2.6) with the parent's runtime and this branch's tests,
m3-max-79046: the burst test timed out waiting for the ring back to its first block and the one
ahead; the steady-use test passed (nothing is freed). Green in the same job at this code: the
ring, ahead and memory modules, 33 passed, "6 blocks after the burst, 2 once idle; the next take
made none". At this tree (f882510ace, the same tree): clippy -D warnings plain, under m2v_cpu_icd
and under m2v_gpu, rustdoc -D warnings, and the workspace's rustdoc of private items, all exit 0;
the runtime's suite on lavapipe 904 passed, 3 skipped, with the same line (m3-max-79050).
The cost line, one job on the Radeon 780M (RADV PHOENIX, Mesa 26.2.6), the release replay player
on stream glbench-780m-r2 with a fresh pipeline cache each play, arms a (the parent's runtime)
and b (this one) alternated a b a b (m3-max-79045): 792 frames each; blocks made a 300 and 299, b
300 and 299, 37.88 and 37.75 per 100 frames in each arm, with block bytes made equal pair by pair
(the one-block difference between the pairs is a pool allocation, 33.5 MB, in both arms). This
play makes no ring block more than the parent.
The parameter ring keeps every block it makes for the device's life, so a burst of parameter writes
(a guest's set_bytes, long parameter blocks) leaves its peak of 2 MiB blocks of the ring type,
device-local and host-visible memory, which is small on a device without resizable BAR, until the
device goes.
The tests: with the nil buffer kept in the first block, a burst of four blocks' chunks makes blocks
past them; given back, the ring goes back at the idle age to its first block and the one ahead of
it, and no block more goes another idle age later; the blocks gauge falls with the blocks freed,
and the next take makes no block. And a ring settled at two blocks that serves frames of three
chunks, taken and given back every few milliseconds for six idle ages, makes and frees no block.
Expected red today: the burst's blocks stay; the steady test passes (nothing is freed).
Main's ruling on the stage cache's time breach. The first breach refuses in
its own device life alone, and a later device asks the helper once more. A
second breach, in another life, refuses in every life until the driver's
version changes. A fill after the first clears the count. Old records are
dropped.
- Core.stage_life: an id for each device life (stage::life(): the process
id and the host time, hashed under fresh RandomState keys).
- Entry::Timed(Timed { lives, life }): a time breach's record after its
byte is TIME_FORMAT (2), the count of lives (1 or 2) and the last life's
id (8 bytes).
- record_stage_breach(Time) keeps stage::timed(dir, key, life). The count
is 1 where the directory holds no time breach of the key (none kept, or a
fill took its place), and 2 where it holds one of another life. A breach
kept again in the same life changes nothing.
- read_entry takes the reader's life:
- a time breach of 2 lives, or of the reader's own life, refuses
(StageGap::Breach(Time));
- one of 1 other life is a miss that keeps its file: Error::StageUnfilled
again, the consumer asks its helper once more, and the record stays for
a second breach to count;
- any other time record is a miss and removed: the old one (the byte
alone), another format version, a count of 0 or 3, a life cut short.
The format version is the time record's own byte after the breach's byte,
not a change to the stage key. So the other breaches and the cache-data
entries keep their format and stay: no helper compiles again for them.
Docs:
- the stage module docs; StageBreach::Time; record_stage_breach;
StageGap::Breach;
- the runtime README, under Kernels past the stage bound: a bullet for the
count, and the sentence on a breach refusing with no helper asked
qualified for a time breach of one life;
- the README's known gap on heavy kernels: refused for the cap, or for the
time in two device lives. One sentence: a kernel whose helper passed the
time in one life is asked once more by the next device, which waits up to
that time again;
- REFUSALS.md regenerated (unchanged); api signatures --check 0.
Tests, in tests/stage.rs, device-free: the ruling's four.
- a_time_breach_refuses_in_its_own_life_alone_and_a_later_device_asks_again
(also: the record is 68 bytes; two lives' ids differ);
- a_second_time_breach_in_another_life_refuses_in_every_life (a breach kept
again in the first life counts no second life, and a third counts no
third);
- a_fill_after_a_first_time_breach_clears_its_count;
- a_time_breach_of_an_old_format_is_dropped.
The existing unit tests read in a fixed life, and the time breach leaves
their list of breaches that hold their byte alone.
Verified (green): Radeon 780M (RADV PHOENIX, Mesa 26.2.6), m3-max-79073, at
this commit. tests::stage: 15 tests run, 15 passed, 897 skipped, the device
tests included.
m3-max-79094, at this commit: workspace clippy (all targets, all features,
-D warnings) EXIT=0 in all three configurations (plain, --cfg m2v_cpu_icd,
--cfg m2v_gpu); Rustdoc EXIT=0; the runtime's private Rustdoc EXIT=0. The
runtime suite on lavapipe: 907 tests run, 907 passed, 3 skipped.
The stage cache's time breach (StageBreach::Time) refused its pipeline on
every later device life until the driver's version changed. So one helper
compile past the consumer's time limit, on a loaded host for example,
refused a heavy kernel for good. Main's ruling: the record counts the device
lives that met the breach. The first refuses in its own life alone, and a
later device asks the helper once more. A second, in another life, refuses
in every life, as before. A fill after the first clears the count. The
record's format version is bumped, so old records are dropped, not trusted.
tests/stage.rs, on a device, through the public API alone:
- a_time_breach_is_asked_once_more_by_a_later_device: six device lives on
one cache directory.
- The first keeps a time breach and is refused.
- The second asks for the same fill. A helper's fill there takes the
breach's place, and the pipeline is made.
- The third makes the pipeline from that fill.
- The fourth keeps a time breach before its make (a first again) and is
refused.
- The fifth asks past it, keeps its own breach (the second life's), and is
refused.
- The sixth is refused, with no fill asked.
- a_helper_killed_mid_make_leaves_every_make_its_refusal_at_once: after the
time breach, the later device now asks for the same fill once. Its own
breach then refuses there and on the device after it. The memory breach
is unchanged.
Verified (red): Radeon 780M (RADV PHOENIX, Mesa 26.2.6), m3-max-79073, at
this commit. Both tests fail where the later device is refused:
"Some(Unsupported(StageSize { weight: 204, cause: Breach(Time) }))"
(stage.rs:577 "the second life"; stage.rs:782 "a later device, one time
breach"). tests::stage: 11 tests run, 9 passed, 2 failed, 897 skipped.
Row L97 (the draw residual). A dispatch of a function's kernel whose buffer
argument of 8 or 16 is bound at a multiple of 4 below that alignment runs a
variant of its kernel that holds the slot to 4 (8 where a 64-bit atomic may
reach it). A draw refused such a bind (Refusal::BufferOffsetAlignment). It
now draws the same way.
- RenderPipelineState::for_words(device, words) makes the state's content
with LoweringInputs::word_bound_buffers set for its vertex function (bits
0..31) and fragment function (bits 32..63). The device's map of contents
keeps it under the state's key with that mask (KernelKey.words widens to
u64). Like a pass's 2D-array content, it has no cache record of its own.
Its samplers are numbered at the state's indices; a mismatch is
Gap::KernelInput (ConstexprSampler).
- RenderCommandEncoder keeps the state set (`base`) apart from the state it
draws through (`pipeline`). Where a draw's facts are not held (a bind or
the state changed), bind_words reads the base's buffer address fields. A
slot of mask 7 or 15 whose bound address is a multiple of 4 but not of
its alignment sets its bit. The mask is ANDed with the slots the state
lowers from AIR (word_slots: a function the consumer compiled has none,
and its bind stays refused). A new mask switches `pipeline` to that
content, or back to `base`. An execution of an indirect command buffer
draws through `base`.
- The draw's own checks then hold each slot to the content's alignment: an
address off a multiple of 4 is still refused, as is one off 8 that a
64-bit atomic may reach.
Cost: a draw bound aligned keeps the state it was set with, and the scan of
its address fields runs only where the draw's facts are found again
(expected from the code, not measured). The first draw of a new mask lowers
both functions again and makes the content's VkPipeline (a first-use wait),
as the compute variant does. A later draw of that mask finds the content.
Docs: the runtime README (Render encoders: the draw bullet; Compute
encoders: the variant's paragraph); error.rs's BufferOffsetAlignment;
docs/API.md section 1 and its accepted differences. REFUSALS.md unchanged
(refusal_surface --check 0); api signatures --check 0.
Verified:
- Green on lavapipe, m3-max-79015 (at this commit's tree before its rebase
onto 8dd00ec58c). Over tests::draw, render_offsets and indirect: 67 of 67
passed, 838 skipped. The new test draws every case through the content,
and the second draw of a bind finds it.
- The two draw-alignment tests on a card per vendor, 2 of 2 passed on each:
- Radeon 780M (RADV PHOENIX, Mesa 26.2.6), m3-max-79076, at this commit;
- RTX 3090 (NVIDIA 620.70.06), m3-max-79043, and Iris Xe (ANV, Mesa
26.2.6), m3-max-79051, both before the rebase.
- m3-max-79086, at this commit: workspace clippy (all targets, all
features, -D warnings) EXIT=0 in all three configurations (plain,
--cfg m2v_cpu_icd, --cfg m2v_gpu); Rustdoc EXIT=0; the runtime's private
Rustdoc EXIT=0. The runtime suite on lavapipe: 903 tests run, 903 passed,
3 skipped.
Row L97 (the draw residual): a draw whose vertex or fragment function takes
a buffer argument of 8- or 16-byte alignment bound at a multiple of 4 below
it is refused (Refusal::BufferOffsetAlignment). A dispatch of a function's
kernel bound so runs a variant of its kernel that holds the slot to 4
(LoweringInputs::word_bound_buffers). Plain Metal draws it, each element at
its own address; Metal's API validation stops the bind offset.
tests/draw.rs, new:
every_device_draws_through_buffers_bound_at_a_multiple_of_4_below_their_alignment.
It binds colored_vertex's float2 positions at 20 and float4 colours at 24,
and branching_fragment's float4 weights (examples/icb_linked_arguments.ll)
at 4, apart and together. Each draw must give the texels the same values
give bound aligned. The first draw of each new bind lowers a content (the
translations counter rises); a second draw of the same bind finds it.
Positions bound at 18 are still refused (index 0, offset 18, alignment 8).
every_device_refuses_a_draw_whose_buffer_is_off_its_alignment now binds off
a multiple of 4 (18), which stays refused.
Verified (red): lavapipe, m3-max-79015, at this commit alone (tree equal to
this one before its rebase onto 8dd00ec58c). The new test fails with its
first misaligned draw refused (draw.rs:2892): "vertex: the buffer at index
0, bound at offset 20, is not at a multiple of 8 bytes, the alignment its
function holds it to". Over tests::draw, render_offsets and indirect: 67
tests run, 66 passed, 1 failed, 838 skipped.
Audit finding F3 (wording). The runtime README said a colour render target's
linear image over a buffer is made again without the sampled and feedback
usages where the image with them "does not lie at bytes_per_row". The
retry (texture.rs, after make's Unmade::Unfit) runs for every cause Unfit
names:
- Pitch: its rows not at bytes_per_row;
- RenderReach: its subresource past the texture's rows or the buffer;
- Alignment: its memory alignment not met;
- ImageMemory: its memory type not taken.
The sentence now names those conditions. It also says what follows the
retry: the texture lies in place where the image without the usages meets
them, and is copied where it does not.
Docs only; nothing built.
named()'s doc said it held every count of an object kind the runtime keeps live; it held 15 of
them. It now says what it holds: the kinds a compute workload makes or reaches, and the render
contents and attachment views, which none makes; the kinds only draws, passes, surfaces, imports,
exports and indirect command buffers make are a replay's gauge records. It adds the three of
those kinds a compute workload reaches: level_elements (a texture's levels' storage elements),
timestamp_pools (the command buffers' GPU time queries) and buffer_set_pools (a dispatch's bound
buffers' descriptor sets). Each is recorded at the 100th and 200th runs and at device drop, as
the others are.
Verified: in the hand-over.
What: Caches::last_write, the reaper's last write at a quiesce, checks the quiesce's deadline
before each try for the creations lock and again before it reads the cache's data to write: past
the deadline it writes nothing and counts the skip in Metrics::pipeline_cache_writes_skipped. A
write begun before the deadline still runs to its end. Past the deadline before the lock, the size
is not read, so the skip is counted whether or not the cache changed; the doc says so. At the
device's teardown, with no deadline, nothing changes.
Why: the audit lane's finding. The deadline was checked only while a creation held the lock, and
halt() asks the reaper to stop after the submit, block-maker and completion stages, which may use
the whole timeout; so with no creation running a write of up to 128 MiB could begin past the
deadline, quiesce answering false while it ran on, against the quiesce doc.
Docs: Device::quiesce, Metrics::pipeline_cache_writes_skipped, Caches::last_write, the runtime
README's Quiesce and exit.
Verified: red on the RTX 5080 Laptop (NVIDIA 615.71.09) with the runtime sources of the test's
commit, m3-max-78990: the new test timed out waiting for the skip (61.7 s; the last write took the
lock and wrote). Green in the same job at this code: the five blob tests passed, 902 skipped;
"quiesce late: the last write past a passed deadline skipped, the drop wrote the blob"; the
doubling test 5 writes of 286050 bytes for a 108159-byte blob. At this tree (dd0a40d8c6, the same
tree): clippy -D warnings plain, under m2v_cpu_icd and under m2v_gpu, and rustdoc -D warnings, all
exit 0; the runtime's suite on lavapipe 902 passed, 3 skipped (m3-max-78987). lavapipe keeps no
blob, so the blob tests pass there without one.
Caches::last_write checks a quiesce's deadline only while a creation holds the creations lock.
halt() asks the reaper to stop after the submit, block-maker and completion stages, which may use
the whole timeout, so with no creation running a blob write of up to 128 MiB could begin past the
deadline: quiesce answers false, and the write runs on after it, which the quiesce doc says does
not happen.
The test: a cache grown with its look skipped under a creation held open; the reaper held at a job
of the test's; the creation ended; a quiesce of no time, which answers false; then the reaper,
let go, comes to its end with the deadline passed and no creation running. It writes nothing and
counts one skip in Metrics::pipeline_cache_writes_skipped, and the drop then writes the grown
cache.
Expected red today: the last write takes the lock at once and writes the blob; no skip counted.
The private-items rustdoc (CI's "Private intra-doc links" step, merge check m3-max-78917 at
9c375eb504, STEP privdoc EXIT=1) failed on redundant explicit links that 1c307b4608 added:
`Refusal::SamplePositions` in device.rs (programmable_sample_positions_supported) and pass.rs
(RenderPassDescriptor::sample_positions), each in scope by its import, so the explicit target
repeated the text's own path. pass.rs's `RenderPassKind::SamplePositions` link, also imported, takes
the same form. The links that name items not imported there (Device, DrawKind) keep their targets.
Verified: the job named in the handover runs rustdoc with -D warnings over the workspace, with and
without --document-private-items, and cargo fmt --check.
Row L212. Metal leaves overlapping copies undefined; an Apple M3 Max reads the
source whole before it writes, which the runtime gives as slabs, and no Vulkan
copy command may read bytes it writes (VUID-vkCmdCopyImage-pRegions-00124,
VUID-vkCmdCopyBufferToImage-pRegions-00173,
VUID-vkCmdCopyImageToBuffer-pRegions-00184).
Form (blit.rs):
- Slabs becomes an enum: Across (the existing single-axis cut) and Rows
(RowSlabs). Where cut() finds no axis, row_by_row() takes the rows one at a
time. Each row goes before every row whose source its destination lies on:
descending where every destination row lies on a source row after its own
(meeting()'s y shifts all positive), ascending where all are negative.
- Within a row, the shift from the destination row to its own source row
(the first row's, plus the pitch difference per row) decides the cut. Zero:
the row is its own bytes and copies nothing. Less than the row: slabs of
|shift| in whole texels, the far end first. Otherwise: one command.
- Slabs::of yields each slab's 3D start, which ImageCopy::regions and
BufferCopy::slabs add to the other side's origin and to the buffer offset.
- An execution barrier still separates two commands. Every hazard between
them is a write after a read, as no row reads bytes an earlier row wrote.
- Still refused (Gap::OverlappingCopy): rows of two pitches that cross, where
one destination row lies on a source row before its own and another on one
after its own.
Surface (texture.rs, buffer.rs, surface.rs, d3d11.rs):
- An exported surface's plane image keeps its PlaneLayout (Under::Surface
laid, from SurfaceImage).
- TextureObject::rows_in(buffer) answers the plane's rows in a buffer on the
surface's memory: BufferObject::surface_range matches the buffer's block
aliases to the plane's (Arc::ptr_eq) and maps the plane's offset through the
block's memory range.
- A copy between a buffer and a texture takes those rows where the texture
has none of its own. A texture over the surface's buffer is always the copied
form (OverCause::Surface), so a copy between it and a plane shares no bytes
in Vulkan, and is left as it was.
- The surface's buffer and planes are aliases that read alike in the general
layout. Surface::buffer's doc quotes the section.
Docs:
- blit.rs and the copy methods' docs; error.rs's OverlappingCopy (REFUSALS.md
regenerated).
- The runtime README: Blit encoders, their known gaps (only crossing pitches
remain refused), and the surface's buffer.
Verified:
- Green, on lavapipe, m3-max-78902 (at 70c887a155, before the rebase): the
blit module, 26 of 26 passed (865 skipped). The plane is in place
(OpaqueFd); into it and out of it go a row at a time.
- Cards, the blit module at 02421a08a9, 26 of 26 passed (867 skipped) on each.
That tree differs from this one only by a branch for a texture in place over
a surface's buffer, now deleted: no device laid one in place, and each
printed "copied".
- Radeon 780M (RADV, Mesa 26.2.6), m3-max-78888.
- Iris Xe (ANV, Mesa 26.2.6), m3-max-78889.
- RTX 3090 (NVIDIA 620.70.06), m3-max-78896.
On each, the textures over one buffer are in place: whole rows go a row at a
time (16 slabs; 256 on the Iris, whose memory alignment is 4), and two
pitches go a row at a time. The surface's plane is in place (OpaqueFd), into
it and out of it a row at a time.
- m3-max-78906 at 70c887a155: workspace clippy (all targets, all features,
-D warnings) EXIT=0 in all three configurations (plain, --cfg m2v_cpu_icd,
--cfg m2v_gpu). Rustdoc and the runtime's private Rustdoc EXIT=0. The
runtime suite on lavapipe: 888 tests run, 888 passed, 3 skipped.
- refusal_surface.py --check: 0 at this commit.
Row L212: copies between rows in place over one buffer (two textures over it,
or a region of it and a texture over it) whose rows meet in no order a cut
along one axis keeps were refused (Gap::OverlappingCopy): a destination row
across the end of its own source row and the start of the next, and rows of
two pitches that meet at their starts. Copies between an exported surface's
buffer and its own plane in place were not checked at all: the plane carried
no rows, so the copy was one command whose source and destination share bytes.
Unit tests (blit.rs):
- regions_of_two_textures_over_one_buffer_copy_in_slabs_where_their_bytes_meet
expects whole rows two texels on to copy a row at a time, the last row first
on and the first row first back, each row in slabs of two texels, the far end
of its shift first. Rows of two pitches that meet at their starts copy a row
at a time, after the row whose source each writes, and the first rows (the
same bytes) copy nothing.
- a_buffer_copy_over_its_texture_s_own_bytes_copies_in_slabs_or_in_no_order
expects the same of a region and a texture over its bytes, into the texture
and out of it, with each command's buffer offset.
Device tests:
- Textures over one buffer: whole rows a memory alignment on and back. Where
the device lays a texture twice as wide at twice the pitch in place, the two
pitches both ways.
- A buffer and a texture over it: whole rows on, and a region at twice the
texture's pitch, into it and out of it.
- New: a copy between an exported surface's buffer (Surface::buffer) and its own
plane, a row on, into the plane and out of it.
Each checks every byte against a memmove of the source from before the copy,
one submission, and the barriers of one command a row (blit barriers for the
surface, whose hand-overs add barriers of their own). None is refused.
Verified (red): on lavapipe, m3-max-78902 at this commit alone: 26 tests run,
21 passed, 5 failed, the five tests above. The unit tests and the two device
tests of rows in place are refused (Gap::OverlappingCopy). The surface test
records one command where three rows were due: blit barriers (1, 2, 0, 0)
against (1, 4, 0, 0).
The rt side of the suite now hands a pass's positions to the runtime's RenderPassDescriptor
instead of answering `setSamplePositions:count:` Unavailable, so the answer those rows expect,
`Err(Unavailable({call: "setSamplePositions:count:"}))`, can no longer occur on any venue. The
fourteen `*` rows (custom-left, custom-mixed, custom-right, the three fewer-, high, off-grid,
off-grid-low and the five rounded- cases) and the three venue rows of sample-positions-custom-2x
(Iris(R) Xe, RADV, NVIDIA) are dropped. A venue without VK_EXT_sample_locations, or whose
properties fall short of the answer, would answer at the same site with
`Refusal::SamplePositions` of `Unsupported` or `Gap::RenderPass`, which its replay would print as
unlisted; no venue run here does. docs/CONFORMANCE-COVERAGE.md is regenerated (7979 ledger rows to
7962); docs/METAL-COVERAGE.md is unchanged.
Verified: `conformance replay` of the 19 sample-positions cases and pass-sample-positions at
33865b2a57, before this edit, on each venue: every one of them listed exactly these rows as no
longer held ("now matches: 15", 14 on the Apple M3 Max, which has no custom-2x row) and nothing
unlisted; the custom and rounded cases read announced (justified by notices) on each.
- RX 7900 XTX, RADV NAVI31, Mesa 26.2.6: m3-max-78702
- Radeon 780M, RADV PHOENIX, Mesa 26.2.6: m3-max-78710
- RX 550, RADV POLARIS12, Mesa 26.2.6: m3-max-78713
- RTX 2080, NVIDIA 620.70.06: m3-max-78703
- RTX 3090, NVIDIA 620.70.06: m3-max-78711
- Iris Xe (RPL-P), Mesa 26.2.6: m3-max-78704
- Apple M3 Max, KosmicKrisp Mesa 26.3.1 (VK_EXT_sample_locations revision 1): m3-max-78722
lavapipe's replay with this ledger runs in the green job. Not run: the RTX 5080 Laptop GPU and the
Windows host's UHD Graphics 630.
L168: a pass's custom sample positions were dropped while the guest could be told they are
supported, so a non-default set rendered at the standard positions with no refusal.
What changed:
- VK_EXT_sample_locations joins the floor's OPTIONAL_EXTENSIONS (enabled where listed; it has no
feature). Device::programmable_sample_positions_supported (programmableSamplePositionsSupported)
is true where the device lists it with locations at every sample count above 1 it renders, a
1 x 1 grid, every sixteenth from 0 to 15/16 and variableSampleLocations; false elsewhere. No
second form: a device that answers no refuses positions other than the defaults.
- RenderPassDescriptor::sample_positions is checked as the pass begins (crate::positions): each
coordinate is taken to the nearest sixteenth, a tie up, at most 15/16, and each sample past the
positions given at the pixel's corner, as the conformance suite's sample_positions rows measured
an Apple M4. A set that comes to Vulkan's standard locations (Metal's defaults at 1, 2 and 4
samples) rasterizes as an empty one on every device.
- Refusal::SamplePositions (Count, Coordinate, OneSample, Unsupported) where Metal's validation
stops the descriptor or the device answers no. Gap::RenderPass of SamplePositions for other
positions beside a depth attachment (Vulkan needs a sample-locations-compatible depth image whose
layout transitions name the last locations) or at a count the device's locations lack.
Gap::Draw of SamplePositions for a draw in such a pass whose fragment module uses
InterpolateAtSample (VUID-01524), read from the translator's GraphicsState.
- A draw in such a pass takes a VkPipeline of its class made with sampleLocationsEnable and the
locations as dynamic state (Raster::positions), one pipeline for every set; the encoder records
vkCmdSetSampleLocationsEXT before the pass's first draw. Every coordinate handed to Vulkan is a
sixteenth in [0, 15/16], which Vulkan's required 4 sub-pixel bits hold exactly, so no precision
note.
- The translator's description of a device that enables the extension states it
(floor::shader_extension), as for every extension creation enables that the translator names;
the translator reads none of its properties. tests::translator_fields gives
GraphicsState::interpolates_at_sample its verdict (refused at custom positions).
- The conformance rt side passes a case's positions to the runtime; the replay player sets them on
the runtime's descriptor and drops its count of passes at other positions (docs/REPLAY-STREAM.md
says so).
- README (floor table, the device's answers, the known gap rewritten), REFUSALS.md and basis.rs,
api_signatures.tsv, METAL-COVERAGE.md and CONFORMANCE-COVERAGE.md regenerated.
Tests: the device test every_device_rasterizes_a_pass_at_its_sample_positions now gates on the
device's answer and holds the answer to the extension's properties; new device tests
every_device_refuses_the_positions_metal_refuses and
a_draw_that_interpolates_at_a_sample_is_refused_at_custom_positions; new device-free tests
(placed::) of the answer's gates (each count above 1 the device renders in
sampleLocationSampleCounts, a 1 x 1 grid, a range holding 15/16, 4 sub-pixel bits, variable
locations) and of the placement (every coordinate in [0, 1) on a sixteenth from 0 to 15/16,
refusals, the corner, the standard sets, the count and depth gaps); the replay device test
sample_positions_play_through_the_runtime_s_descriptor. Verification: the lane's jobs, named in
the ledger commit that follows.
The red test of L168 (custom sample positions dropped while the guest is told they are
supported): RenderPassDescriptor gains sample_positions (`setSamplePositions:count:`), held and not
applied, and SamplePosition (`MTLSamplePosition`). The device test
every_device_rasterizes_a_pass_at_its_sample_positions draws a white triangle left of a vertical
edge through column 4 of an 8 x 8, 4-sample RGBA8Unorm target, resolves it, and checks the samples
of that column the positions cover, as the conformance suite's sample_positions rows measured
Metal on an Apple M4: the defaults 2 of 4 at the column's middle, four at x 0.25 all, at 0.75
none, one at 0.25 and three at 0.75 one, a tie at 0.53125 taken up to 9/16, 0.97 taken to 15/16,
and two positions in the pass of four putting samples 2 and 3 at the pixel's corner. It runs on
each device that lists VK_EXT_sample_locations with 4 samples and variable locations, and prints
the extension's properties.
Red here: the positions are dropped, so every custom case covers what the defaults cover.
GraphicsState::interpolates_at_sample is true where the fragment stage's module statically uses
GLSL.std.450's InterpolateAtSample (interpolate_at_sample, or a sample-qualified varying read in
the loop over the covered samples), read from the module's instructions at link: an OpExtInst of
instruction 77 through the GLSL.std.450 import. Vulkan forbids that instruction in a pipeline
whose sampleLocationsEnable is true (VUID-VkGraphicsPipelineCreateInfo-sampleLocationsEnable-01524),
so a runtime that draws Metal's programmable sample positions through VK_EXT_sample_locations
reads it before it makes such a pipeline.
The field is encoded with the graphics state, so ARTIFACT_FORMAT_VERSION moves to 600, and it is a
new reflection fact of every render pipeline, so SEMANTICS_VERSION moves to 2317 (development's is
2316). No module's words change.
Test: engine_pull_model's the_graphics_state_states_whether_the_fragment_module_interpolates_at_a_sample
(pm_sample and pm_sample_id true, pm_center, pm_centroid and pm_offset false, at four samples on
every committed profile that compiles them). Verification: the lane's msi job (below the fix).
A colour render target takes an index of set 1's texture arrays (Refusal::TextureIndex), so
both tests stopped at their target's make on lavapipe (job m3-max-78835) before reaching a
pass. Each now grants index 4096 and makes its target there, as the pass tests do.
A texture kept an image view for each level, first layer and layer count a pass rendered into,
for its whole life and with no bound (the field's doc said levels times slices, but the key
holds the layer count, so an N-slice array could keep N(N+1)/2 a level). Now a texture keeps at
most one view for each level and slice (each depth plane of a 3D texture's levels) and one more
a level (texture.rs attachment_bound): a cube's six faces one by one and its six layered fit.
A view made past the bound first evicts the least recently taken views that no command buffer
holds, to the reaper, until the bound has room (texture.rs evict_idle); where command buffers in
flight hold every one it evicts none, so the list holds the bound and what work not yet retired
holds past it.
How a view a command buffer in flight uses is known never to be evicted:
- Each view is an Arc (texture.rs AttachmentView). The texture's list holds one count; a take
(texture.rs attachment_view) clones another only under the list's lock, into the pass's
Attachment::held (texture.rs:406).
- The pass's begin keeps that Arc in its command buffer's kept list before the pass records
(render_encoder.rs:935 for each target, :940 for each resolve; command.rs:1701
hold_attachment_view into kept.rs:256 ByKind::attachment_views, via Kept::hold, kept.rs:191).
A stencil target that targets() skips shares the depth target's view, which the pass checks
(pass.rs DepthStencilViews).
- That list is cleared only at the command buffer's retirement (command.rs:2124, in retire) or
at the drop of one never committed (command.rs:2201), before the texture list
(kept.rs:264).
- Eviction takes only a view whose strong count is 1, the list's own (texture.rs:386), counted
under the same lock, so no other hold can appear while it decides.
Between the take and the keep, the pass's own Attachment holds a count, so a view is never seen
idle in that window.
Docs: the field's, the attachment call's, Gauges::attachment_views' and the runtime README's
pass section now state the key and the bound. The kept-list size note counts eight lists.
Verification is in the jobs named where this lands; the device tests of the previous commit
are red without this change.
A texture keeps an image view per level, first layer and layer count a pass renders into
(texture.rs attachment_view), with no bound: the field's doc says at most its levels times its
slices, but each distinct renderTargetArrayLength from each first slice adds one, so an N-slice
array can keep N(N+1)/2 a level for its whole life.
Two device tests, red here:
- a cube's six faces one by one, then all six layered: seven views, the cube's bound, and the
same passes again make none (no thrash at the bound); the views go with the cube;
- a 4-slice 2D array rendered at all ten first slices and layer counts keeps five (its bound),
the most recently rendered. The first view's command buffer is held in flight (its pass ran,
then it waits at a shared event) while the other nine render on another queue, each retired
before the next: the held view stays through every eviction, though least recently rendered,
and once its command buffer retires a view rendered again takes its place.
A test-only accessor lists a texture's views.
StageEntries bounds its module decodes (KEPT_DECODES, 4) and its plain answers (32) with
least-recently-used eviction (pipeline/compile.rs evict), but no test drove either past its
bound: the existing fill test asks forty entries of one module, so it holds one decode and no
answer.
The new test assembles the multi-entry fixture under seven source file names (seven libraries
of different bytes, six stages each) and asks every stage's plain answer through one object:
seven decodes read, forty-two answers made, and four decodes and thirty-two answers held. The
last answer is found again with no decode read; the first library's first answer, gone past both
bounds, is made again and its decode read again, and both bounds still hold.
KEPT_DECODES becomes pub(crate) for the test, and a test-only accessor reads the answers held.
What: the reaper's look writes the blob only where the size the driver gives is at least twice the
size at the last write (and more than it, so an empty cache's first pipelines write once); the
drop still writes where the size changed at all. The looks' writes then sum to at most twice the
last of them, and with the drop's the data of a device's writes over its life comes to at most
three times the data it leaves, where the cache stays within its bound. One threshold, no switch.
Why: L171. At the eighth, a run from an empty cache wrote the blob at nearly every look while it
was small, up to about nine times the blob it left (9 writes, 271.9 MB, for a 62.6 MB blob on the
Mac host, seedfoot m3-max-68006). The cost, now in the runtime README beside the bound: a crash
loses the pipelines made since the last write, at most those made since the size last doubled,
where at the eighth it lost at most an eighth; a later run compiles them again. A run seeded from
its own blob writes once, at the drop, where it made anything new.
Docs: the cache module doc, Caches::look, DeviceOptions::pipeline_cache_dir,
Metrics::cache_bytes_written and the runtime README's pipeline cache paragraph.
Verified: red at the parent on the Iris Xe, m3-max-78862: ten kernels wrote the blob 8 times,
254030 bytes in all, for a 60535-byte blob left (4.2 times). With the fix, m3-max-78867 on the Iris
Xe: 4 writes, 122950 bytes in all, for the same 60535-byte blob (2.0 times). The file part of a
write (create, write, rename, no fsync) on a btrfs disk, m3-max-78865: 62.6 MB in 6.1, 37.3 and
37.4 ms; 128 MiB in 74.1, 93.4 and 89.7 ms.
The series' tree (cd06eda084, the same tree as this branch's tip): clippy -D warnings plain,
under m2v_cpu_icd and under m2v_gpu, and rustdoc -D warnings, all exit 0; the runtime's suite on
lavapipe 892 passed, 3 skipped (m3-max-78869). lavapipe keeps no blob, so the device blob tests
pass there without a blob; their evidence is the Iris Xe's.
The reaper's look writes the pipeline cache blob whenever the cache's size grew by more than an
eighth since the last write, so from an empty cache a run's writes come to up to about nine times
the blob it leaves (L171: 9 writes, 271.9 MB, for a 62.6 MB blob on the Mac host). The test makes
ten kernels one after another on a new cache directory, each followed by the reaper's look, sums
the bytes of every blob write (each look's that wrote, and the drop's where it changed the blob),
and asks for at most three times the blob left.
Expected red today: a write at nearly every look while the cache is small.
What: prune_blobs, run at a device's seed, also removes each blob's temporary file
(<blob>.<pid>.<n>.tmp, write_whole's) older than STALE_TEMP, 60 s. A younger one stays: another
process's write may still rename it, and where the prune removes one a write still holds, that
write fails, a miss that leaves the blob as it was. Anything not named as a blob or its temporary
file stays, as before.
Why: L171, the coordinator's question on the last write at a quiesce. A write begun before the
quiesce's deadline runs to its end, so a SIGKILL can land in it. The blob survives that: the write
goes to the temporary file, and only its rename replaces the blob. The temporary file, up to
128 MiB, was never removed, nor written again under its name (which carries the process id and
the write's number), so killed writes gathered them without bound.
Docs: prune_blobs, STALE_TEMP, the cache module doc and the runtime README's directory paragraph.
Verified: red at the parent on lavapipe, m3-max-78841: the ten-minute-old temporary file stayed
("...4321.7.tmp removed" failed). Green on the Iris Xe, m3-max-78867, and in the suite below.
The series' tree (cd06eda084, the same tree as this branch's tip): clippy -D warnings plain,
under m2v_cpu_icd and under m2v_gpu, and rustdoc -D warnings, all exit 0; the runtime's suite on
lavapipe 892 passed, 3 skipped (m3-max-78869). lavapipe keeps no blob, so the device blob tests
pass there without a blob; their evidence is the Iris Xe's.
A blob write is a temporary file beside the blob, named for its process and write
(<blob>.<pid>.<n>.tmp), renamed over the blob. A process killed between the two, which the
reaper's last write at a quiesce makes likelier (a write begun before the deadline runs on, and
the consumer's SIGKILL can land in it), leaves that file, up to 128 MiB, and nothing removes it:
prune_blobs keeps every temporary file, so they gather, one a killed write.
The test leaves two such files ten minutes old, for the device's own blob and another's, a young
one and another file's temporary file, and runs the seed's prune: the old two are to go, the
other two to stay.
Expected red today: the old temporary files stay.
What: the reaper's end, at Device::quiesce or at the device's teardown, writes the blob where the
cache's size changed since the last write (Caches::last_write), before it ends. Where a creation
still runs, it tries for the creations lock every 10 ms (LAST_WRITE_STEP) until the quiesce's
deadline, the same deadline quiesce's other waits share (Reaper::stop now carries it), and past it
skips the write and counts it in Metrics::pipeline_cache_writes_skipped; at the teardown, with no
deadline, until the creation ends. It waits for no GPU work: the wait is for a creation, which
compiles on the CPU, and reading a cache's data waits for nothing the GPU does. The drop's write in
Caches::close then finds nothing changed. No public item is added.
Why: L171, the planner's addition. A consumer's process that ends with _exit after quiesce, as the
README's Quiesce and exit says it does, kept none of the pipelines made since the last look's
write: quiesce stopped the reaper, which ended with no blob write, and only the device's drop wrote
the blob.
Docs: Device::quiesce, Metrics::pipeline_cache_writes_skipped, the cache and reaper module docs,
the runtime README's Quiesce and exit and pipeline cache paragraphs.
Verified: red at the parent on the Iris Xe (ANV, i915), m3-max-78842, at the test's first form
(the skip test then read the count as soon as the quiesce returned): no blob after the quiesce, and
no skip counted. With the series, m3-max-78867 on the Iris Xe: a 6439-byte blob written at the
quiesce after the creation it waited for, nothing more at the drop nor at a seeded device's
quiesce with no growth; under a creation held past a 300 ms quiesce's deadline, one skip counted,
no blob, and the drop then wrote it. The reaper counts that skip as it ends alone, about one 10 ms
step past the deadline at most, after the quiesce may have returned (m3-max-78866, at the first
form, read the count too early); the test now waits for it.
The series' tree (cd06eda084, the same tree as this branch's tip): clippy -D warnings plain,
under m2v_cpu_icd and under m2v_gpu, and rustdoc -D warnings, all exit 0; the runtime's suite on
lavapipe 892 passed, 3 skipped (m3-max-78869). lavapipe keeps no blob, so the device blob tests
pass there without a blob; their evidence is the Iris Xe's.
The blob is written only at the reaper's looks and at the device's drop (Caches::close). A
consumer whose process ends with _exit after Device::quiesce, as the README's Quiesce and exit
says it does, keeps none of the pipelines made since the last look's write: quiesce stops the
reaper, which ends with no blob write.
The tests: a cache grown with its look skipped under a creation held open; a quiesce on another
thread, the creation ending once the reaper's stop is asked; then the blob holds the cache, the
drop writes nothing more, and a device seeded from it quiesces with no growth and writes nothing.
And with the creation held past a 300 ms quiesce's deadline, the last write is skipped and counted
in Metrics::pipeline_cache_writes_skipped, and the drop writes the grown cache.
Expected red today: no blob after the quiesce; no skip counted.
What: the release of a texture, and of each view over its image, notes its mark (the wait for the
work committed by then, and those commits) in the image. Where an upload (the move home, its
zeroing, a copy) or a command buffer holds the image past that release, the image's Free::Texture,
made when that holder lets it go, waits for that mark instead of every commit made by then, and
goes into the queue of releases waiting at its mark's place, after the releases noted at as many
commits, so the queue's waits still rise along it and the texture's index, elements and views go
before its image. Pool::release_marked carries the mark; Pool::release is unchanged.
Why: L181. The zeroing upload holds a new texture's image until it retires; a texture released
before then had its image freed only after the command buffers committed by the upload's
retirement, which cannot reach it (in the harness's busy row, an image stayed two command buffers
past its views). Work committed after a release reaches nothing it released, as the runtime's
README states; the image now keeps that too. A holder that kept the image for its own work lets it
go once that work retired, and the work that reaches the image without a handle (through set 1)
was committed before the last texture over it let go, which the mark covers.
Verified: in the hand-over.
The upload that moves a new texture's image to its home layout, zeroing it, holds the image until
it retires. Where the program released the texture before then, the image's Free::Texture is noted
at the upload's retirement, against every commit made by then, so the image waits for command
buffers committed after the texture's release, which cannot reach it (L181: two command buffers
past its views in the harness's busy row).
The test holds the completion thread in a first command buffer's completed handler, makes a
Private texture whose zeroing upload goes with the next commit (the carrier, whose scheduled
handler marks the upload taken), releases the texture, and holds a later command buffer between
its close and its submission. Once the completion thread goes on, the image is to go while the
later one is held.
Expected red today: the image waits for the later submission, and the wait times out.
What: the dma-buf rule reads the first type a dma-buf's fd query offers as the driver's word for
where such an import lives. Where that type is host-visible and host-coherent and the buffer's
requirements list it, the import takes it, as before. Where it is device-local, the import takes
the first type offered that the requirements list and that is device-local, host-visible and
host-coherent, in that first type's own heap. Anything else is Limit::ImportType. It is still one
choice from the query and one import, never a type after another (on NVIDIA's 620.70.06 one failed
import into a later type broke that type's later allocations). DmaBufTypes holds each type's
coherent and device-local bits and its heap, read once at the device's making. import_dma_bufs
takes its fds' types by the same rule. Docs: the module doc, import_dma_buf, Limit::ImportType,
and the runtime README (the import contract, the NVIDIA paragraph, the Iris Xe known gap with the
Xe2 claim as read, the pointer-import and texture-over-dma-buf paragraphs, and the AMDVLK row,
which now says nothing of a dma-buf pick: its recorded row gives no flags or heap of type 0).
Why: the planner's ruling (rule A). The Iris Xe's query offers its device-local type 0 first, so
every dma-buf was refused there, and its pages took the host-memory import and the counted copy.
Rows, each from the device test every_device_takes_its_dma_buf_type_by_the_rule at f3f332b209
(before, the rule's pick):
- Iris Xe RPL-P (ANV, Mesa 26.2.6, i915), m3-max-78652: offered 0x7f, listed 0x7, types
[0:DL 1:DL|HV|HC 2:DL|HV|HC|HCACHED 3:DL 4:DL 5:DL|HV|HC 6:DL|HV|HC|HCACHED], one heap:
refused, 1.
- RX 7900 XTX (RADV), m3-max-78660: offered 0x420, listed 0x7ad: 5, 5.
- Radeon 780M Phoenix (RADV), m3-max-78662: offered 0x10820, listed 0x1eaad: 5, 5; the same
table as Hawk Point's, m3-max-78548: 5, 5. RX 550 (RADV), m3-max-78563: 5, 5.
- RTX 3090, m3-max-78667, and RTX 2080, m3-max-78547 (620.70.06): offered 0x11, listed 0x3b,
type 0 with no flag, both offered types of heap 1: refused, refused.
- lavapipe, m3-max-78608: offered 0x1, listed 0x1: 0, 0.
Coherence both ways, every_device_imports_a_dma_buf_by_the_rule_and_each_side_reads_the_other_s_write:
65,536 bytes the guest's side wrote through a shared mapping of the memfd after the import, read
by a GPU copy, then a GPU fill read through that mapping, with no flush or invalidate call: 0
stale each way on the Iris Xe in type 1 under i915 (m3-max-78652), the XTX (m3-max-78660), the
Phoenix 780M (m3-max-78662), the RX 550 (m3-max-78563) and lavapipe (m3-max-78608).
Tests: the unit test a_dma_buf_takes_the_first_offered_type_or_a_coherent_type_of_its_device_memory
over the three table shapes (RADV's from m3-max-78548, the Iris Xe's from m3-max-78652, the RTX
2080's from m3-max-78547) and its refusals: a coherent first type not listed, nothing coherent
offered or listed, a coherent device-local type of another heap, no type offered.
Verified: the dma-buf modules (import, import_time, import_overs, dma_bufs, the Managed buffer
over a dma-buf) on the Iris Xe at this code, m3-max-78694: 24 passed, 860 skipped; a texture over
a dma-buf in place there with 0 copies and 1 acquire. At this tree (74c6614ae9): clippy -D warnings
plain, under m2v_cpu_icd and under m2v_gpu, and rustdoc -D warnings, all exit 0 (job m3-max-78815);
the runtime suite on lavapipe 884 passed, 3 skipped (job m3-max-78816).
Row L291: a texture over a buffer laid in place (a linear image on the
buffer's memory, rule 3's form) took neither the feedback usage nor a shadow,
so a draw that read it as an attachment of its own pass, through a texture or
by a fetch, was Gap::Draw (AttachmentRead, FetchedAttachment) on every device.
Metal reads any render target this way.
Form (the ruled one: rule 2's attachment feedback loop form, with the counted
shadow copy where it is not available, a known gap):
- Plan::linear_loop. check_over sets it where the plan reads attachments, the
device has the feedback loop, the format's linear tiling features sample it,
and the linear image query makes the image with the sampled and feedback
usages at the texture's extent (asked with the dma-buf handle for a dma-buf's
import). Plan::linear_usage then adds both usages.
- If the linear image with those usages does not lie as the texture's bytes do
(Unmade::Unfit), it is made again in place without them, and a draw reads it
through its shadow where the device makes one (Plan::shadow_offered), as a
device without the loop does. Only after that does a texture fall back to the
copied form, as before.
- The pass moves the image from the general layout to the feedback layout and
back, through the same moves a surface plane takes. Once it is back in
general, the image and the buffer are again aliases that read their bytes
alike. vkspec, memory aliasing: "Buffers, linear tensors, and linear image
subresources are considered host-accessible subresources when they are in
any of these layouts: VK_IMAGE_LAYOUT_PREINITIALIZED, VK_IMAGE_LAYOUT_GENERAL,
VK_IMAGE_LAYOUT_ZERO_INITIALIZED_EXT" and "If two aliases are both
host-accessible, then they interpret the contents of the memory in
consistent ways, and data written to one alias can be read by the other
alias."
Docs: the runtime README says where the image leaves the general layout
(Memory blocks and buffers) and how a draw reads it (Render encoders). Its
known gaps of render encoders gain the shadow for an in-place target whose
linear image takes no feedback usage, and drop the refusal. error.rs's
AttachmentRead doc is updated, and REFUSALS.md is regenerated (unchanged).
known-gaps-rt.tsv drops the 15 rows the change fixes, each of which the replay
printed as "the gap looks fixed" once the draw read its target in place:
- pass-start-barrier-over-buffer-{read, sample, barrier-read, barrier-sample,
draw-barrier-read} on llvmpipe and the Iris Xe (10 rows): their targets are
in place on these two, and the reading draw was refused; it now reads its
target in place. The 780M, the RX 7900 XTX and the RX 550 had no rows for
these cases; their replays report "differed, justified" (the case's
accepted difference).
- pass-start-barrier-new-texture-chain on llvmpipe, the Iris Xe, the 780M, the
RX 7900 XTX and the RX 550 (5 rows): its new texture over a buffer is in
place on all five (the refusal arose only there), and its reading draw was
refused the same way; it now reads its target in place.
CONFORMANCE-COVERAGE.md is regenerated.
Verified:
- Green, on lavapipe, m3-max-78715 (at 60d2af3017, this change before the
ledger and layouts edits): 12 of 12 passed (876 skipped). Both forms read
in place through the feedback loop.
- Cards, at 921a33a894, running over_reads, fetch-over and the layouts
in-place test, 3 of 3 passed on each:
- Radeon 780M (RADV, Mesa 26.2.6), m3-max-78784: in place, through the loop.
- Iris Xe (ANV, Mesa 26.2.6), m3-max-78819: in place, through the loop.
- RTX 3090 (NVIDIA 620.70.06), m3-max-78785: its linear tiling lays these
targets in the copied form, so the in-place path did not run there.
- The shadow form for an in-place target (a linear query that refuses the
feedback usage) ran on no lab device: unaudited.
- Conformance replay (the case selection, or every case for lavapipe) with
the 15 rows dropped, EXIT=0 with no surprise either way:
- llvmpipe, m3-max-78743 (at 580fecacb7, every case);
- RX 7900 XTX, m3-max-78749; RX 550, m3-max-78750; Radeon 780M,
m3-max-78751; Iris Xe, m3-max-78760 (each at f9f3178302).
The trees differ from 921a33a894 only in other venues' rows and the
layouts test.
- m3-max-78783 at 921a33a894: workspace clippy (all targets, all features,
-D warnings) EXIT=0 in all three configurations (plain, --cfg m2v_cpu_icd,
--cfg m2v_gpu); Rustdoc EXIT=0. The runtime suite on lavapipe: 885 tests
run, 885 passed, 3 skipped.
- m3-max-78757 at f9f3178302: private Rustdoc of the runtime EXIT=0. The
conformance crate's suite: 1047 of 1047 passed, 0 skipped.
Row L291: a draw that reads the colour target its own pass renders, through a
texture or by a fetch ([[color(n)]]), is refused (Gap::Draw AttachmentRead,
FetchedAttachment) where that target is a texture over a Shared buffer laid
in place, a linear image on the buffer's memory. Metal reads any render target
this way.
tests/over_reads.rs: an RGBA8Unorm render target of shader-read usage over a
Shared buffer, its rows a whole number of the device's linear alignment answer
and the rest of the buffer a sentinel. A pass reads it at the fragment's own
pixel and at the first texel, draws blue over it, then after a memory barrier
draws each pixel read plus green. Every texel in the buffer must be blue plus
green and every other byte the sentinel. Both reading draws go through the
feedback loop (2 loop reads) or through the shadow (1 copy), and the texture's
form must match the counts.
tests/fetch.rs: exf_fetch_count over 1 and 4 draws into an RGBA32Uint target
over a Shared buffer. The values must be exact in the buffer at its pitch, and
the draws counted as for a texture of its own image.
A device without the attachment reads refuses both. Each device prints whether
its target lies in place and which form read it.
Verified (red): on lavapipe, m3-max-78715 at this commit alone, both tests
fail with the draws refused (fetch.rs:558, over_reads.rs:125): 12 tests run,
10 passed, 2 failed.
A command buffer's part before its last goes at an event's signal as a
submission of its own (submit.rs, WorkState::step), and its queue
counts it in flight (Fifo::in_flight), so it takes room (submit::room).
It carries no command buffer, upload or copy-in, so the completion
thread had nothing to retire for it: with nothing else in flight it
waited on the host, never read the progress semaphore, never raised
`completed` and never woke the submit thread. A command buffer whose
signals made IN_FLIGHT parts then held its last part for room for good,
unless a host wait for it or another queue's work came. Its completed
handler never ran and polling its status never saw it complete.
Done::submitted now gives such a submission a retiree of its own
(Item::Part), which retires nothing: the round that sees it complete
raises the completed value and wakes the submit thread, as the round
for any other submission does.
One command buffer signals an event IN_FLIGHT times, a fill after each,
with nothing else in flight, no later commit and no host wait. Its parts
before its last go at their signals, one submission each, and fill the
queue's room (submit::room); its last part is held for room.
Red at development's tip: the command buffer stays Scheduled. The parts
carry nothing that retires, so the completion thread waits on the host
and never reads the progress semaphore; the submit thread's settled
value stays below the first part and the held last part never goes.
A newer texture placed over an older one's bytes takes its move home from
UNDEFINED in the upload ahead of its first command buffer. Vulkan lets that
move write the image's memory: RADV initializes DCC, and ANV ambiguates the
CCS, each inside the image's own range. If that command buffer reads the older
texture before writing the newer one, the move can change bytes the read
still needs.
The test takes that shape: for four newer shapes, each smaller than the older
512 by 512 RGBA16Float texture, A is written in one command buffer, which
completes. B is then placed over A's bytes, and a second command buffer reads
A, then writes B. Each read of A must be A's write.
No lab driver showed the loss, so the test lands as coverage, and its comment
says so:
- Radeon 780M (RADV): m3-max-78630.
- Iris Xe (ANV, Mesa 26.2.6): m3-max-78670.
On each, every one of the four shapes read A's write.
Row L223: a fragment function's fetch ([[color(n)]]) of a one-slice 2D array
attachment of a layered pass was refused (Gap::Draw FetchedAttachment), where
Metal reads the attachment at the fragment's pixel. The fetch reads the
texture's second element, which for a 2D array texture holds a 2D_ARRAY view.
Vulkan reads such a view only through an arrayed image (vkspec, image view
validation). The function read every element as a 2D image.
Form (ruled B, the per-state variant, as L97's compute variant):
- Translator: LoweringInputs::arrayed_fetches names the colours read through
such an element. The fragment function declares that element's class arrayed
and fetches it at (x, y, 0). The key takes the field only when it is set,
so every existing function keeps its key and its bytes. No SEMANTICS bump.
- Runtime: set_render_pipeline_state binds, for a pass whose fetched attachment
is a 2D array texture (a multisample one too), the state's content lowered
with those colours (RenderPipelineState::for_pass, which also makes the
content without colours past the pass's last attachment, as before). The
content is kept in the device's bounded map of contents under the
descriptor's key and its colour mask (KernelKey::arrays). The cache
directory's render record is neither read nor kept for it. A failed variant
leaves the state itself, whose fetching draws are then refused.
- attachment_reads accepts a 2D array texture whose first level and slice the
pass renders, one layer, where the bound content fetches that colour
arrayed.
Still refused (README, error.rs): an array whose pass renders more than one
layer, a slice past an array's first, and a view whose first slice is not the
rendered one.
REFUSALS.md and the api_signatures table are regenerated (the new
LoweringInputs field). API.md and the runtime README are updated.
Verified:
- Red, lavapipe, m3-max-78542: the test commit alone fails at fetch.rs:396
(FetchedAttachment): 10 tests run, 9 passed, 1 failed.
- Green, lavapipe, m3-max-78570: 45 of 45 passed (832 skipped); the one-slice
array is fetched exactly through the feedback loop.
- Radeon 780M (RADV), m3-max-78604; RTX 3090 (NVIDIA 620.70.06), m3-max-78609;
Iris Xe (ANV, Mesa 26.2.6), m3-max-78649: the fetch and unattached-colour
tests, 6 of 6 each, the array fetched exactly through the feedback loop.
- States-only play, m3-max-78602, lavapipe, this change against 118bd0dff7:
identical on both replay streams (one recorded on the 3090: 10643 render and
15299 compute states made; one on the 780M: 8972 and 225), 0 refused.
- m3-max-78600 (at the pre-rebase 90726b13b7): clippy, Rustdoc and private
Rustdoc EXIT 0; runtime 874 of 874 passed (3 skipped), translator 3393 of
3393 (37 skipped).
- Workspace clippy in all three configurations (plain, --cfg m2v_cpu_icd,
--cfg m2v_gpu; all targets, all features, -D warnings): m3-max-78645 at
this change alone on development, and m3-max-78677 at this tree on top of
the row-1166 tests. Every EXIT=0.
Row L223: a fragment function's fetch ([[color(n)]]) of a one-slice 2D array
attachment of a layered pass is refused (Gap::Draw FetchedAttachment), where
Metal reads the attachment at the fragment's pixel.
The test draws exf_fetch_count over 1 and 4 draws into a one-slice
RGBA32Uint 2D array in a pass of render_target_array_length 1, and into slice 0
of a two-slice array in a pass of one layer. Every texel must hold the exact
count, slice 1 must keep the bytes written to it, and the counts must match a
2D target's (through the feedback loop or the image's shadow). The arrayed
content must be lowered once and kept in the device's map of contents at a cap
of 1. Slice 1 of the array, and a pass over both slices, stay
FetchedAttachment. A device without attachment reads refuses every case.
The build of the hand-over tests warned that the value assigned to b is never
read (seen in the 780M job m3-max-78533's build); the last run's B now goes by
an explicit drop.
Verified (these three commits' tests, at 38d497f6cb, before this warning fix):
one run per device of 4 pairs x 3 hand-overs x 256 runs; every pair and
hand-over read 0 of 256 runs a value not written:
- lavapipe: m3-max-78501
- RTX 3090: m3-max-78519
- Radeon 780M (RADV): m3-max-78533
- Iris Xe (ANV, Mesa 26.2.6): m3-max-78659
Row 1166 did not reproduce on any lab device; the tests land as coverage.
A device may keep a compression state only for images past a size; the
hand-overs now take a 512 by 512 RGBA16Float texture and a 512 by 256 RGBA8Unorm
one over its bytes too, their buffers 4 MiB apart.
The consumer's row 1166: heap textures over one memory give compute results
that vary run to run (2 of 64 on the Iris Xe). Its recording of the compute
benchmark shows the guest keeps Metal's aliasing contract: textures at one
offset of a Tracked heap, the older never used after the newer's first use,
handed over inside one serial compute encoder with no fence, in a later
command buffer of the same queue, or on another queue after the older's
release.
These tests take that shape: for three pairs (one shape twice, and two pairs of
different formats and sizes) A and B at offset 0 of one heap, 256 runs each of
A written, A read, B written over A's bytes and B read, every read compared
with its write. Hand-overs: one serial encoder; the next command buffer of the
same queue; another queue after A's release. Each prints how many runs read a
value not written.
clippy -D warnings under --cfg m2v_cpu_icd and --cfg m2v_gpu denied `chunks_exact` with a constant
size in both device tests that 039de2090e and 283d8d8f50 added (use `as_chunks::<N>()`), seen in
m3-max-78608. Plain clippy compiles neither test. Each now takes the fixed-size chunks of its
read-back with as_chunks, as the AIR crate's bitcode readers do; the values read are the same.
Verified: the next job runs clippy over the runtime under both cfgs and the two tests on lavapipe.
What: Texture::backing answered TextureBacking::Buffer for every texture that names bytes in a
buffer, a Managed texture's among them. A Managed texture's image is memory of its own; the bytes
the consumer names are a copy beside it, which upload_region and synchronize_resource move. It now
answers Texture for a Managed texture, and Buffer for a texture over a buffer in place or through
the image the runtime copies the buffer's bytes into, and for a texture buffer.
Why: TextureBacking's doc says Texture is memory of its own and Buffer a buffer's bytes
(Buffer::new_texture), and Metal answers a Managed texture's buffer with nil (L319). The doc of
Texture and Buffer now names the Managed and copied forms.
Verified: the test every_device_names_a_managed_texture_s_texels_its_own_in_a_storage_gap, red at
the previous commit on lavapipe (job m3-max-78576: "a Managed texture's texels left: Buffer right:
Texture"); at this change (job m3-max-78577, tested at 9b29e1405c, the same change on an earlier base; rebased
since onto 2f16658ac2 with no conflict): clippy -D warnings plain, under m2v_cpu_icd and under m2v_gpu, and
rustdoc -D warnings, all exit 0; the runtime's suite on lavapipe 875 passed, 3 skipped, the test
among them.
TextureBacking's doc says Texture covers memory of the texture's own, and Metal answers a Managed
texture's buffer with nil; Texture::backing reports a Managed texture, whose bytes the consumer
names in a buffer beside its image, as TextureBacking::Buffer (L319). The test binds a 2 by 2
RGBA8Unorm_sRGB Managed texture of shader-read and shader-write usage to the fixture's
access::read_write slot, which is Gap::StorageElement on every device, and asks the gap's backing
to be Texture.
Expected red today: backing Buffer.
L61. A kernel of OpenCL mode that takes a 1D image stated RuntimeFact::OpenClLineTexture for each
such slot. That fact marks the variant in which the table domains read a 1D texture bound there,
as a Radeon Pro 5300M answers. The identity domains source no such fact, so every such kernel's
pipeline was Unsupported{IdentityDomains} when made, whatever else it did.
Apple's OpenCL binds a 2D texture of height 1 for an image1d_t and a 2D array of that height for an
image1d_array_t, and never a 1D texture. The kernel already reads its 1D images as those 2D textures
at row 0 (canon::opencl_1d), as the M3 Max and the 5300M answer. A 1D texture bound there is
outside documented Metal, and the Macs disagree on it: the M3 Max reads texel 0 at every
coordinate, the 5300M the 1D texture's texels, a UHD Graphics 630 layer 0 of an array.
- Translator: under the identity domains a kernel states no OpenClLineTexture and has no such
variant; it reads the 2D textures. The table domains keep the fact and the variant.
identity_unsourced no longer names a fact the identity domains never state.
- Runtime: a state records whether its kernel is of OpenCL mode (RuntimeFact::OpenClMode). A
dispatch of one with a 1D or 1D array texture bound at any of its texture slots is the new
typed Gap::OpenClLineTexture { slot }, not a read: Apple's OpenCL binds none, and Metal defines
no reading of one. It is checked where the swizzle and bicubic checks run, when the state or a
binding changes. Its doc ends in "Basis: ours".
- Docs: the runtime README's known gap is rewritten for the dispatch's refusal. API.md and the
fact's doc say what the identity domains do. docs/REFUSALS.md and error/basis.rs are regenerated
(Gap 30 to 31), and api_signatures.tsv is blessed (one variant).
- The runtime test opencl_lines now also binds a 1D texture at each of the kernel's three slots in
turn. Each dispatch answers Gap::OpenClLineTexture naming that slot and writes nothing.
A refusal becomes a module, so SEMANTICS_VERSION 2316. The translator's refusal sites are
unchanged.
Red first for L61. Every kernel of OpenCL mode that takes a 1D image (image1d_t or
image1d_array_t) is refused when its pipeline is made: Unsupported{IdentityDomains} naming
RuntimeFact::OpenClLineTexture, the fact by which the table domains read a 1D texture bound
there in a variant. Apple's OpenCL binds a 2D texture of height 1 for an image1d_t and a 2D array
of that height for an image1d_array_t, and the M3 Max and the Radeon Pro 5300M read those as the
1D image's row 0. These tests now ask for that answer.
- engine_opencl_mode: __entry_lr (read_imagef of an image1d_t at 2 and of an image1d_array_t at
(1, 1)) compiles in OpenCL mode and passes L3 on every profile the identity domains derive. It
states OpenClMode and no OpenClLineTexture, and its images are elements of the sampled float 2D
and 2D-array classes. On the CPU interpreter, over a 4 x 1 2D texture and a 4 x 1 2D array of two
layers, it reads texel 2 of the first and texel 1 of the second's layer 1.
- runtime opencl_lines (device cfg, under the validation layer): __entry_ol, with its hidden
buffers bound as Apple's OpenCL binds them, reads a 4 x 1 2D texture at x and a 2D array at
(x, 1). It writes their sum to a third 2D texture and the array's texel to o[x]; both are
checked.
L215 (a). A texturecube or texturecube_array read by face was declared as the binder's 2D-array
view of its faces (RuntimeFact::ImageViewShape), since SPIR-V's OpImageFetch takes no cube. The
identity domains hold a sampled cube's element as its cube view and source no such fact, so
every such read was Unsupported{IdentityDomains}.
Under the identity domains a sampled cube (not a depth cube) that is read is now declared as its
cube element, and the read samples it. It goes through element 0 of its numeric type's sampler
array (binding 2, or 4 for an integer texture), which no ID reaches: the default sampler. It
samples at the direction of the read texel's centre on its face, with the read's level as the
explicit Lod.
- On face f the centre is (sc, tc) = ((2x + 1 - w) / w, (2y + 1 - h) / h), whose numerator is an
exact integer.
- The direction is Vulkan's cube map face selection read backwards, the table Metal's faces share.
With m the face's sign, it is (m, -tc, -m*sc), (sc, m, m*tc) or (m*sc, -tc, m).
- Its major axis is the face's, at magnitude 1, so (s, t) on that face is the texel's centre, half
a texel inside its cell, and nearest reads that texel. Integer Lod l under nearest mip selects
level l.
- A sample clamps every operand, so the read is checked in the shader on every device
(ReadCheck::Shader). x and y are tested against the extent at the level, the face against 6, the
cube index against the cube count, and the level against the level count, with Metal's
out-of-bounds texel outside (its alpha from the ID's word).
- slot::samples_cube_element is the one rule the declaration and the read's check share.
SlotPlan::face_sampler gives the sampler use the sampler family declares.
- A depth cube read by face, and a cube whose faces an emulated filter fetches, keep the 2D-array
view and stay refused under the identity domains. The table domains are unchanged.
The runtime's default samplers now reach every level (maxLod VK_LOD_CLAMP_NONE, was 0), so an
explicit level past 0 reads that level. A sampler element nobody owns holds the default, as do
nil, freed and out-of-range sampler IDs. Their samples could reach only level 0 before; they now
reach the level they ask for.
Existing tests that cover the default samplers:
- tests::arrays' set_1_is_filled_at_creation (both live with set 1);
- tests::device's gauge check (set 1's two default samplers and nothing else);
- tests::argument_sampling's argument_sampler_edges (an argument buffer's sampler against the
default's answer).
RESOURCE-ID.md states the default sampler and the cube read's contract for a consumer that lays
the arrays out itself. API.md and the runtime README say so too; the README's known gap now names
only the depth cube read.
A refusal becomes a module, so SEMANTICS_VERSION 2315. The golden table's cube_faces cells
change from the refusal, a bless at the next pin. No refusal site was added or removed:
docs/REFUSALS.md regenerates unchanged.
Red first for L215 (a). Under the identity domains a texturecube or texturecube_array read by
face (access::read or access::sample) is refused, Unsupported{IdentityDomains} naming
ImageViewShape: the read takes the binder's 2D-array view, which the identity arrays do not hold.
These tests now ask for Metal's answer, the texel read(coord, face[, cube], lod) names.
- engine_texture: texture_ops' cube_faces compiles and passes L3 on every profile the identity
domains derive, with no ImageViewShape, its textures elements of the sampled float cube and
cube-array classes, the plain sampler array declared, and an explicit-level sample where it
fetches nothing. The CPU interpreter models no sampler, so values are a device's.
- runtime cube_reads (device cfg, under the validation layer): an RGBA32Float and an RGBA32Uint
cube (4 x 4, three levels) and an R32Sint cube array (two cubes, two levels) read at every texel
of every face, level and cube, each the uploaded texel bit for bit; an RGBA8Unorm_sRGB cube read
the same way equals a 2D array's fetches of the same bytes (the device's decode); and reads past
the level's extent on each axis, at face 6 and past, at the level count and past, at the cube
count and past, and at u32::MAX on each operand are Metal's out-of-bounds texel (zero, alpha 1
for R32Sint).
- validation engine_textures: the cube_faces case through the runtime, which asserted the
refusal, now asserts its values: face 3's texel, cube 1's face 4 (layer 10), then width 1, 2
cubes and 1 level.
clippy's result_large_err refused Result<Allocation, Allocation> (job m3-max-78507, all three cfgs).
map_made now returns (Allocation, bool); a refusal is freed by its caller as before, outside the
timed map in Pool::take.
The taker thread held its Arc of the core until its closure returned, after its answer, so the
device's teardown could wait for it past the test's gauge read: job m3-max-78507 read 8 blocks and
2 device samplers after the map case's teardown, the device not yet torn down. The taker now drops
the core first.
What: run() holds an Ends guard whose drop, on a stop or a panic alike, stops the pool, clears
every internal asked or being made, wakes the waiters, and hands the ring's next block back to the
takes (Ring::unasked). The stop branch, which did the same for a stop alone, now only returns.
The consumer's two hooks on that thread:
- map: Pool::map_made runs BlockMappings::map under catch_unwind. Where it panics, the allocation
just made is freed and the panic goes on (resume_unwind), on the block-maker thread (ahead) and
on a take's thread (Pool::take) alike.
- unmap: free_idle runs BlockMappings::unmap under catch_unwind. Where it panics, the consumer's
mappings may stand, so the allocation is not freed there: it goes back to the pool, which is
stopped under the same lock so no take lands in it, and teardown frees it with no second unmap.
Then the panic goes on.
Why: a panic of either hook ended the thread with the ring's ask outstanding, so a ring take that
found no free chunk waited for good, as did a call in Pool::await_made; and the allocation the
hook panicked over was never freed. Now a panic ends the thread as a quiesce does: a take of the
pool's memory is Error::Quiesced (the typed error rt already has; no new public type), what was
asked of the thread is made on the thread that needs it, as after a stop, and nothing waits.
Docs: Error::Quiesced, BlockMappings::map and BlockMappings::unmap say what a panic of the hook
does; the runtime README's mappings section the same.
Verified: the two tests every_device_whose_block_maker_thread_ends_by_{a_map,an_unmap}_hook_s_panic_leaves_nothing_waiting
(red at the previous commit) are the check; jobs in the hand-over.
The block-maker thread runs two of the consumer's hooks: BlockMappings::map for an allocation made
ahead of need, and BlockMappings::unmap before the free of an allocation idle past the idle age.
Where either panics, the thread ends with what was asked of it still marked asked or being made:
the ring's next block stays the thread's to make, so a ring take that finds no free chunk waits
for good, as does a call in Pool::await_made.
Two tests, one per hook, share one body. The hook is armed to hold the thread inside its run (the
map of the allocation a 12 MiB Shared take sets off; the unmap of a whole Shared unit given back
once the next is made). Takes of the parameter ring run past every free chunk on a thread of their
own until the ring has asked the thread for its next block; then the hook panics. The test waits
for the takes at most the tests' patience (60 s) and fails, not hangs, where they still wait. Then:
the pool is stopped, a take is Error::Quiesced, an internal asked now is the asking call's, the
allocation the hook panicked over is freed (gauges zero after teardown), and every other mapped
allocation is unmapped once, the one whose unmap panicked never a second time.
Expected red today: the ring's takes still wait after 60 s, in both tests.
The step counts the lines of `cargo doc --document-private-items` that begin `error: ` and holds
each crate at its ceiling. The workflow sets CARGO_TERM_COLOR=always, under which Cargo prints
each diagnostic with a colour code ahead of `error`, so the count was 0 whatever rustdoc
reported: the step could not fail.
Verified: m3-max-78564 (msi) plants one broken private intra-doc link in the harness crate and
runs the step's count over it: CARGO_TERM_COLOR=always counts 0 (the unresolved-link diagnostic
is in the log), never counts 1. The step now sets never.
L215 (b). An argument buffer's texture that a function only queries has no texel class: nothing
structural types it (the member's texture type is only its MSL type name, which decides nothing),
so its group is declared Float and states RuntimeFact::HeapNumericType for the binder of the
table domains. The identity domains source no such fact, so every function with such a member
was refused, whatever its shape.
Under the identity domains the group's element is the texture its resource ID names, as a
texture slot's is, and a slot only queried already takes the Float class there with no fact.
A query reads the element's extent and its level, layer and sample counts; Vulkan's image query
instructions access no texel (13.4.4), so the texture's numeric type changes nothing a query
returns. So under the identity domains a query-only group states no HeapNumericType; the table
domains keep it.
The runtime README's known gap for it goes; the golden table's tail_heap_cube_queries cells
change from the refusal, a bless at the next pin. SEMANTICS_VERSION 2314. No refusal site was
added or removed.
Verified (job m3-max-78379, msi, at this tree before its rebase onto 0b71bdf72a): the interpreter
test passes on every identity profile (2 passed with its neighbour), and on lavapipe (llvmpipe,
LLVM 23.1.1) the runtime test passes under the validation layer, both dispatches at their
addresses (M2V-FORM 0 bound, 2 at their addresses).
Red first for L215 (b). The pin that held the refusal of an argument buffer's texture a kernel
only queries (Unsupported{IdentityDomains}, naming HeapNumericType) now asks for Metal's answer:
the size of the texture the member's resource ID names, whatever its numeric type.
- engine_heap_groups: abq_2d (a 2D texture's width) and abq_cube_array (a cube array's cube
count) on every profile the identity domains derive: no HeapNumericType fact, one Float sampled
class, L3, and on the CPU interpreter, with an R32Uint texture's resource ID naming element 3,
the width 12 and the 2 cubes from each thread, the word past them kept.
- runtime query_only_textures (device cfg, under the validation layer): the same kernels over an
R32Uint 2D texture of 12 x 5 and three levels and an RGBA8Uint cube array of two cubes, each
reached through an argument buffer's resource ID.
Verified red (job m3-max-78379, msi, at this tree before its rebase onto 0b71bdf72a): the
interpreter test fails at compile_kept with the refusal (1 passed, 1 failed with its neighbour),
and on lavapipe the runtime test fails at new_compute_pipeline_state (0 passed, 1 failed).
56cf3dbd1b and 5d62e2079a moved the macro's compile-time fallback to option_env!, on the reading
that Cargo does not set `CARGO_BIN_EXE_<name>` for `cargo clippy --all-targets`. That reading was
wrong: Cargo sets it, and the remote CI's Linux leg lost it in scripts/rustc-wrapper, whose
/bin/sh there (dash) drops variables with a hyphen in the name. c231c41ddd runs the wrapper under
bash. The macro is again the text it had before 56cf3dbd1b, where a missing variable is a build
error rather than a test-time panic.
Verified: the next msi job's green arm runs clippy over the validation crate at this tree as CI
runs it (CI=1, a fresh target) through c231c41ddd's wrapper.
The remote CI's Linux leg has failed "Clippy (warnings denied)" on master since at least
11-15 (run 43704398652 and every push after it, 46893773054 at d8735b75f0 included): each bin_exe!
use in the validation crate's integration tests stopped with "environment variable
`CARGO_BIN_EXE_corpus-triage` not defined at compile time" (and corpus-pipeline, corpus-vulkan,
corpus-index, command-replay). The macOS leg's clippy, and every clippy in the lab, passed the
same tree on the same nightly.
The cause is the wrapper's shell. Cargo sets `CARGO_BIN_EXE_<name>` for the test's compile and
runs `scripts/rustc-wrapper` as `#!/bin/sh`. On ubuntu-26.04 /bin/sh is dash, which drops every
variable whose name is not a shell identifier from the environment it passes to exec, so rustc
never saw the hyphenated names. On Arch (the lab) and macOS /bin/sh is bash, which passes them
through. Checked by hand on macOS: `env 'CARGO_BIN_EXE_x-y=1' /bin/dash -c 'exec env'` prints
no such line; /bin/bash and /bin/sh print it.
The wrapper now names bash, present at /bin/bash on Ubuntu, Arch and macOS.
Verified: the next msi job runs clippy over the validation crate as CI runs it (CI=1, a fresh
target, env! in bin_exe!), once through the parent's wrapper under Debian's dash (red, "not
defined at compile time") and once through this one (green).
56cf3dbd1b called .expect on option_env!(...), and clippy::option_env_unwrap ("this will panic at
run-time if the environment variable doesn't exist at compile-time") is denied under -D warnings:
m3-max-78487's run at 01d80f2d65 failed five of them. The compile-time path is now one more fallback
after nextest's NEXTEST_BIN_EXE_<name>, and a test that finds neither panics naming both.
Verified: the next msi job runs clippy over the validation crate as CI does (CI=1, so
scripts/rustc-wrapper runs the compiler itself, and a fresh target), at the old macro and at this one.
What: make_allocation reads the allocation's device address and, where it is not a multiple of
16, frees the allocation and returns the new Limit::AllocationAddress { class, address }. A take
that no free range fits returns it; an allocation made ahead of need (Device::new's stock, the
block-maker thread) is not kept, so the next take makes its own and gets the refusal.
Why: Vulkan places a buffer's address at a multiple of the largest of its memory requirements'
alignment and its usages' minimum offset alignments (vkGetBufferDeviceAddress), none of which has
a lower bound of 16. Metal's offset rule for a device buffer (offset aligned to the data type's
size, at most 16) asks a base at a multiple of 16, which the translator's accesses take. A block's
buffers take the allocation's address as their base and its images sit beside them in the same
allocation, so no offset serves both; an allocation off 16 cannot keep Metal's alignment, and it
now fails visibly instead of handing out blocks the translated kernels misread (L84).
Docs: the variant's doc names Metal's counterpart and what differs; take_block's errors; the
runtime README's block contract; docs/REFUSALS.md, src/error/basis.rs (Basis: device) and
api_signatures.tsv regenerated (refusal_surface.py, signatures.py --bless).
Verified: the test every_device_hands_out_no_block_at_an_address_off_16 (red at the previous
commit) is the check; jobs in the hand-over.
What: a device-test answer, DeviceOptions::placed_past (cfg test with a device cfg), adds bytes
to the device address each pool allocation reads from vkGetBufferDeviceAddress, as a device that
places its memory there would answer. every_device_hands_out_no_block_at_an_address_off_16 opens
each device with 4 and asks that no Private or Shared block a take hands out has its first byte
off a multiple of 16.
Why (L84): a block's buffers take their allocation's address as their base. The blocks hold
images bound at memory offsets beside buffers reached by address, so no offset of ours can put
both on their alignment where Vulkan places the allocation off 16, which it may (it promises the
largest of the buffer's memory requirements' alignment and its usages' offset alignments, none
bounded below 16). Metal's offset rule for a device buffer (Apple's setBuffer(_:offset:index:):
the offset aligned to the data type's size, at most 16) asks a base at a multiple of 16. The fix
refuses such an allocation, typed.
How verified: expected red at this commit (the take hands out a block at 4 past 16); the fix
follows.
What: every_device_of_the_cfgs_kind_opens_presents_and_tears_down_to_zero prints the alignment
Vulkan promises the device's buffer addresses (the largest of the buffers' memory requirements'
alignment, minStorageBufferOffsetAlignment, minUniformBufferOffsetAlignment and
minTexelBufferOffsetAlignment, the floor's usage holding each) and asserts that a Private and a
Shared block's first buffer, and the ring's nil buffer and zero range, lie at multiples of 16.
Why (L84): the ring now starts its chunks on 16 wherever the device places a block, but a block's
buffers take their allocation's address, and the blocks hold images bound at memory offsets beside
buffers reached by address, so no offset can serve both where an allocation's address is off 16.
Metal's offset rule for a device buffer (the offset aligned to its data type, up to 16; Apple's
setBuffer(_:offset:index:) page) asks a base at a multiple of 16. This pins, on every device the
device suites open, that the allocations they make lie on 16, and names the device where one does
not.
How verified: in the hand-over (lavapipe on msi, the Iris on ms01).
What: chunk_starts(address, align) now answers the skew, the first offset in a ring block whose
device address is a multiple of the ring's alignment (16, or the translator's buffer base
alignment where larger), and the chunks the block holds whole from there: 32 where Vulkan places
the block at a multiple of the alignment, 31 elsewhere. State::add places chunk i at skew + i * 64
KiB. So every write, the nil buffer, the zero range and the whole execution range lie at a
multiple of the alignment in the device address space on every device. The skew is a multiple of
the block's own placement, which holds minStorageBufferOffsetAlignment, so a set_bytes copy's
descriptor offset still meets that limit; view()'s debug check now asks the copy's device address,
not its buffer offset, to be a multiple of the alignment. Ring and README docs say so.
Why (L84): the ring assumed every chunk lay at a multiple of 16 ('like every chunk'), which held
only where the block's address did. Vulkan's vkGetBufferDeviceAddress promises a multiple of the
largest of the buffer's memory requirements' alignment and its usages' minStorage/Uniform/Texel
BufferOffsetAlignment, none bounded below 16. The translator reads a parameter block in 16-byte
lines at multiples of 16, and PushField::ZeroAddress is documented (docs/API.md section 5) as a
multiple of 16. One form on every device: the skew is 0 wherever the block's address is already a
multiple of the alignment (no lab card is expected to differ: their buffer alignments are 16 or
64), so nothing changes there; no device in reach places a block off 16.
How verified: a_block_placed_off_the_ring_s_alignment_starts_every_chunk_on_it, red at the parent
commit, green here (jobs in the hand-over).
What: State::add takes its chunks' places from chunk_starts(address, align), which answers today's
layout (the first chunk at the block's first byte, 32 of them), and a device-free test,
a_block_placed_off_the_ring_s_alignment_starts_every_chunk_on_it, asks of a block at a device
address that is a multiple of 1, 2, 4, 8, 16, 64 or 256 alone that every chunk start at a multiple
of the ring's alignment (16, 64, 256) in the device address space and at a multiple of the block's
own placement in its buffer, and lie whole in the block.
Why (L84): the ring places its writes at multiples of its alignment from each chunk's first byte,
and each chunk at a multiple of 64 KiB from the block's first byte, so a write's device address is
a multiple of 16 only where the block's is. Vulkan promises a buffer's address only at a multiple
of the largest of its memory requirements' alignment and the offset alignments of its usages
(vkGetBufferDeviceAddress, the spec's alignment list), none of which has a lower bound of 16.
How verified: expected red at this commit (a block at a multiple of 4 alone puts chunk 0 at 4 past
a multiple of 16); the fix follows.
The remote CI's macOS leg (macos-26) has failed "Test metal2vulkan" on master since at least
959a4ccbcd (runs 46004353737, 46104484064, 46893773054): container::tests::
committed_air_fixtures_parse_and_link asserted the link succeeded, and that runner's xcrun metallib
answers "air version set to 2.9.0 (!10 = !{i32 2, i32 9, i32 0}), but expecting 2.8 in fbd_vertex".
The fixtures are compiled by the SDK scripts/regen-air-fixtures ran on, newer than the runner's, and
that linker cannot link them at all. The parse half still runs on every host; the link half is skipped
with a SKIPPED line naming the linker's answer, as it already is where xcrun metallib is absent. Any
other link failure still fails the test with the linker's stderr.
Verified: not run here (the M3 runs no tests, and its SDK links AIR 2.9); the next remote macOS run
shows it.
The remote CI's Linux leg has failed "Clippy (warnings denied)" on master since at least fc9c99916d
(runs 45911520903, 46004353737, 46104484064, and 46893773054 at d8735b75f0): every bin_exe! use in the
validation crate's integration tests stops with "environment variable `CARGO_BIN_EXE_corpus-triage`
not defined at compile time" (and corpus-pipeline, corpus-vulkan, corpus-index, command-replay), on
the pinned nightly-2026-11-03. The macro read the path with env!, a compile-time error where Cargo
does not set the variable. option_env! compiles either way; when the test runs, nextest's
NEXTEST_BIN_EXE_<name> or Cargo's baked-in path is still taken first, and a missing one panics with
its name instead of failing the build.
Verified: the next msi job runs clippy over the validation crate with no rustc wrapper and a fresh
target, at the parent's macro and at this one.
Metal makes, under the private OpenGL mode, a rasterizing render pipeline
state whose vertex function returns void, with or without a fragment
function, and its draws run the vertex function and rasterize nothing (an
Apple M3 Max, macOS 27.0.1, conformance/probes/opengl_mode.m). The link
refused it whatever the mode (DescriptorError::RasterizedVoidVertex), so the
runtime refused a state the guest GL renderer may make.
The compile now takes such a descriptor as the descriptor with rasterization
disabled and no fragment function (private_state::unrasterized_void_vertex),
in both render_variant_key and render_pipeline, before anything compiles: a
Function vertex stage's answer through StageEntries::returns_value (the
decode its specialization through the same object shares), a Compiled one's
from its interface's position, as the link reads it. The fragment function,
which never runs, is neither compiled nor checked; a state Metal would refuse
for another reason is then made, an answer not measured, recorded in
private_state's docs. Without the mode the refusal stands, as Metal's.
The runtime needs no change: its pipelines with rasterization disabled take
the discard as dynamic state. The runtime README's known gap for this state
is removed; docs/REFUSALS.md does not list descriptor errors (its --check
passes unchanged). SEMANTICS_VERSION 2312 -> 2313 (a refusal lifted).
Verified on lavapipe (llvmpipe, msi): job m3-max-78373 at 6aab044c24 (this
change before its rebase onto 472cfba642): the runtime's opengl_mode tests 3
run, 3 passed; the translator's link test 1 run, 1 passed. Job m3-max-78378 at
24d71d71be, this commit's tree but for the version and development's two
translator commits since (edabd70447, fd8b132834) and the four that followed
up to f29613d057: clippy -D warnings over the
workspace (all targets, all features) and over the runtime under m2v_cpu_icd
and m2v_gpu, rustdoc -D warnings and the private docs of metal2vulkan and the
runtime, all clean; the runtime's suite on lavapipe 868 run, 868 passed, 3
skipped; the translator's and AIR's suites without the tables a bless is due
for 3392 run, 3392 passed, 37 skipped. No card run: the state is one form on
every device (rasterization disabled, its discard dynamic state), the form
every_device_runs_a_vertex_function_that_stores already draws on each card.
Under the private OpenGL mode an Apple M3 Max (macOS 27.0.1, the probe
conformance/probes/opengl_mode.m) makes a rasterizing render pipeline state
whose vertex function returns void, with or without a fragment function: its
draw runs the vertex function, its stores landing, and leaves the colour as
cleared. The runtime refuses it in either mode (Error::Translation naming
RasterizedVoidVertex), a known gap.
The runtime's device test now asserts Metal's answer on every device: the
state is made with and without inputless_fragment, a draw of three vertices
of void_store_vertex stores the tint texel three times into its buffer, and
the cleared target reads all zero. The refusal without the mode stays
asserted. The translator's link test asserts that the mode's state compiles
to the pipeline of the descriptor with rasterization disabled and no
fragment function, rasterizer discard set.
Red until the fix that follows, verified on lavapipe in job m3-max-78373
(msi, this commit before its rebase, e25fc1be7d): the runtime's opengl_mode
tests 3 run, 2 passed, 1 failed (the new test, its state refused at
creation); the translator's test 1 run, 1 failed (the OpenGL-mode compile
refused).
L288. Under the identity domains (and on Profile F) an escaping slot root stays static, so a
stored slot pointer is access::pointer's: its Metal address, the slot's SlotGuestBase plus its
displacement, as an 8-byte leaf. That leaf went only through a static-root destination; a store
through a pointer loaded from memory, or into a pointer cell whose bytes are read at an offset only
the run knows (an open cell), was Unsupported{Lowering(Access), NotImplemented}. Metal stores the
pointer's 64-bit address wherever it is stored.
Now the stored address goes through any destination dynamic stores a wide pointer's through: a
static-root pointer (unchanged), the address a wide pointer holds (an 8-byte store there), or an
arena's pointer cell. dynamic::store_destination and dynamic::emit_store_word are the one form
both share; dynamic's own StorePointer selects and emits through them as before. A destination in
the blob, a typed object or a constant global stays refused. Census names:
access.pointer.store_pointer.wide and .arena, as dynamic names its own.
Existing inputs keep their modules (the static-root path is unchanged); a refusal becomes a
module, so SEMANTICS_VERSION 2312. No refusal site was added or removed: docs/REFUSALS.md
regenerates unchanged.
Verified (job m3-max-78337, msi, at this tree before its rebase onto f1dfed1138): the interpreter
test passes on every identity profile and compiles and passes L3 on the bound ones (1 passed);
on lavapipe the runtime test passes, both dispatches at their addresses ("32 slot pointers stored
as their Metal addresses", M2V-FORM 0 bound, 2 at their addresses).
Red first for L288. The pin that held the refusal (Unsupported{Lowering(Access)}, NotImplemented)
of a slot pointer stored through a pointer loaded from memory, or into an open thread cell, now
asks for Metal's answer: the stored 8 bytes are the slot's address (gpuAddress plus the bind
offset) plus the element's offset.
- engine_identity_pointers: sp_into_slot, sp_through_loaded and sp_open_cell run on the CPU
interpreter on every profile the identity domains derive, buf bound 16 bytes past its start,
each above 4 GiB, and must store those addresses and nothing else (a spare cell keeps its
bytes); on the profiles that bind a kernel's buffers each must compile and pass L3.
- runtime stored_slot_pointers (device cfg): the same two kernels dispatched on every device of
the cfg's kind, the loaded pointer naming a buffer made resident by useResource:usage:.
Verified red (job m3-max-78337, msi, at this tree before its rebase onto f1dfed1138): the
interpreter test fails at compile_kept with the refusal (0 passed, 1 failed), and on lavapipe
(llvmpipe, LLVM 23.1.1) the runtime test fails at new_compute_pipeline_state (0 passed, 1 failed).
What: a device test, a_helper_killed_mid_make_leaves_every_make_its_refusal_at_once. A helper
that reads the request whole and is killed partway through its reply (the consumer's memory cap
or time limit) ends Device::fill_stage at once with StageFill::Ended; the breach the consumer then
keeps, StageBreach::Memory or StageBreach::Time, answers four makes of the pipeline on threads at
once, and a later device's on the same directory, with Gap::StageSize of that breach, with no
helper asked again and no fill counted. Each call runs on a thread of its own and is given the
tests' patience, so one that waits for good fails rather than hangs. The test runs on a device
whose driver writes a pipeline cache header (lavapipe writes none and is skipped, as the other
stage tests skip it).
new_compute_pipeline_state's doc now says every error is the call's answer as it returns on the
calling thread, that no refusal waits for the consumer's helper, and that Metal's
completionHandler: forms are the consumer's, made over this call.
Why: the consumer's ledger row 1120 (an Iris Xe run at pin 28e1026b3d: 2 of 8 heavy kernels
made, 6 refused, 5 at the helper's memory cap and 1 at its time limit, then the guest app waited
at its first sample for good) was put to rt with a lead: the ring's lost-ask race (the consumer's
row 393). That race was fixed by 9749fcbd63 on 11-23, after 28e1026b3d, and is in the consumer's
current pin d8735b75f0. rt's paths from a refused or killed make to its caller hold no wait: the
make reads the stage entry and answers StageUnfilled or Gap::StageSize at once; a dispatch that
waits for another thread's make of its variant is woken when that make ends, made or failed
(Pending's drop), and makes it itself; a render state's main pipeline the same (Making's drop).
This test pins that answer for the two breaches the run met.
How verified: see the hand-over (msi lavapipe suite and clippy, Iris card run).
e2e76d8879 made a slot's direct base and Metal address once, in the block that first asks for
them, and recalled them where that block dominates. Where that block was the walk's first one,
the first application of a function inlined more than once made the base after work of its own,
and every later application read it: the applications were no longer the same code, and
spirv::roll wrote the body twice where it had written it once. The identity-domains engine_roll
case shows it: three applications weighed 26,737 against one's 13,355 on lavapipe (m3-max-78287).
Now EmitCx::load_push_fields, the first hook, makes every placed SlotGuestBase slot's direct base
and address under the identity domains (pointer::make_ahead), after the push fields load and
before any other hook or the body: every block recalls them, and every application reads them
from before it. Those no access reads leave with the other unused values (spirv::dead, at the end
of emission, before the roll and the weighing). Making them in the entry block where first asked
(fb.in_entry_block) is not enough: the walk's first block is the entry block itself until a hook
closes a construct, so the base still landed inside the first application (m3-max-78326: 2.00
bodies, as before).
The arithmetic is unchanged; module bytes change (the bases move to the first block):
SEMANTICS_VERSION 2310 -> 2311. The golden table is re-blessed at the next pin.
Verified: nothing run yet for this commit; the roll, identity, identity-flow, access-size and
golden tests run next on msi.
engine_roll ran only under the resident-table domains, where an access never makes the slot's
direct base. Under the identity domains, the runtime's, each application of a function reaches its
buffer at the slot's own device address. The new kernel `@head_thrice` applies `@head` three
times: it adds its constant, then loads word 0, before the body's first branch, so the first
application makes the slot's address after an instruction of its own. The test asserts on lavapipe
and MoltenVK that the entry weighs about one application (`@head_once`), that it holds one more
loop, that the slot is reached at its address (an `OpIAddCarry`), that it passes L3, and that it
computes the three applications' values on the CPU interpreter. Each profile prints its weights.
Red at development (m3-max-78287, msi): three applications weighed 26,737 against one's 13,355 on
lavapipe (2.00 bodies), and 13,539 against 13,488 at e2e76d8879^ (1.00). With the load as the
application's first instruction both forms rolled (m3-max-78272): the run then starts after the
first application's two extracts, so that shape does not show it.
set_viewport and set_viewports refused, as Gap::Draw of DrawKind::Viewport, every viewport that
VkViewport's valid usage forbids: an extent past maxViewportDimensions, a corner past
viewportBoundsRange (VUID-VkViewport-width-01771, -height-01773, -x-01774, -x-01232, -y-01775,
-y-01776, -y-01777, -y-01233), a negative width, and depths past [0, 1] (the runtime enables no
VK_EXT_depth_range_unrestricted). Metal documents no such limit. A user met the refusal four times
in one session, and a WebGL 1 page reaches it with a far gl.viewport: 32768 is the bounds range on
the 780M and Iris profiles, 65536 on NVIDIA's.
No other Vulkan viewport maps clip space as one of these does, since a viewport's transform is
fixed by its own origin and extent. But where such a viewport covers no pixel of Metal's render
area, Metal draws nothing through it, as the rt draws nothing through a viewport of no extent. So
checked() now keeps a viewport Vulkan takes as it is, makes one it does not take that covers no
pixel (viewport_pixels) a viewport of no width or height at the area's origin with its depths cut
to [0, 1], which Vulkan takes and whose draws record an empty scissor, and refuses the rest. With
the bounds Vulkan requires (at least twice the largest extent past either side of the origin) and
an area no larger than maxViewportDimensions, a viewport past the bounds within that extent covers
a pixel only where its edge lies inside the last pixel of an area of the largest size; WebGL's
integer origins never do. What stays refused: a negative width over the area (Metal mirrors it), a
depth range past [0, 1] over it, an extent past maxViewportDimensions over it, and that last-pixel
edge. DrawKind::Viewport, set_viewport and the runtime README (Render encoders, and its known gaps)
say so. docs/REFUSALS.md regenerates unchanged: the Gap::Draw row and its checked() site stay.
The refusal test's mirrored viewport now lies over the target (origin x 4, width -4); at origin 0
it covered no pixel and now draws nothing, as Metal's. The new test also sets a mirrored viewport
and one with depths past [0, 1], both off the target.
Verified:
- Red: the test commit 17aa4279b3 on lavapipe (job m3-max-78333): 0 passed, 1 failed, at
draw.rs:501, the set_viewport of the first far viewport.
- Green, this commit's tree (fd7df2eccb), run as a scratch commit of the same tree: lavapipe (job
m3-max-78345) 3 passed, 868 skipped: the new test, the triangle test and the refusal test, under
the validation layer, "10 viewports past bounds [-32768, 32768] and dimensions [16384, 16384]
drew nothing". The same three tests from one msi-built gpucfg archive under the carried
validation layer 1.4.363.0, each 3 passed, 870 skipped: Radeon 780M, RADV, Mesa 26.2.6 (job
m3-max-78347, bounds [-32768, 32767], dimensions 16384); Iris Xe, ANV, Mesa 26.2.6 (job
m3-max-78348, the same limits); RTX 3090, NVIDIA 620.70.06 (job m3-max-78349, bounds
[-65536, 65536], dimensions 32768); RX 7900 XTX, RADV, Mesa 26.2.6 (job m3-max-78350, bounds
[-32768, 32767], dimensions 16384).
- Job m3-max-78346: clippy -D warnings on metal2vulkan-runtime, all targets and features, plain,
--cfg m2v_gpu and --cfg m2v_cpu_icd, each exit 0; the runtime's whole suite on lavapipe, 868
passed, 3 skipped. Job m3-max-78371: the runtime's rustdoc with warnings denied, public and with
private items, 0 diagnostics. scripts/api-signatures/signatures.py --check and
refusal_surface.py --check pass. cargo fmt --all.
every_device_draws_nothing_through_a_viewport_past_its_bounds sets seven viewports, each past
one of the device's own limits and over no pixel of an 8 by 8 target: an origin whose x plus the
width passes the top of viewportBoundsRange (what a WebGL 1 page's far gl.viewport reaches), an
origin below its bottom, the same two in y, a flipped viewport whose origin passes the top, and
one wider and one taller than maxViewportDimensions. It draws the whole of clip space in white
through each, and once more through setViewports with the far one as viewport 0. Metal draws
nothing through any of them: its viewport maps clip space onto pixels the target does not hold.
A viewport wider than the largest over the target stays refused (Gap::Draw Viewport), since no
Vulkan viewport maps clip space as it does. Then the whole of clip space in blue through the left
half's viewport, and the target is compared texel by texel with the CPU reference: left half
blue, right half the clear's black. The validation layer checks every viewport recorded.
Today set_viewport refuses the first viewport (Gap::Draw Viewport), so the test fails on every
device; the next commit makes it pass.
pointer::direct_base made its base in one of two ways. A biased SlotGuestBase word was used as
it is. An unbiased one, a device-replay variant's under the identity domains, was the word less
2^31, with a borrow from the high word. No admitted compile reaches the second arm.
plan_replay (lower/access/mod.rs) swaps every SlotGuestBase field for RootTableAddress, and
identity_refusal (lower/select.rs) refuses RootTableAddress. identity_admits runs at the end of
every identity select, before emission. So a replay variant that reaches a slot is refused,
typed, under the identity domains, and the emitter never runs with identity && replay.
a_replay_variant_under_the_identity_domains_is_refused_typed (pipeline/compile/tests.rs) holds
that refusal for a vertex function's and a kernel's buffers.
The arm goes. Its place returns an invariant error (EmitCx::fail), so an identity+replay
compile that select admits one day fails visibly and is never silently wrong. Nothing else was
used only by the arm: k32, BinOp and biased all keep other callers. Module bytes do not change
(the arm emitted nothing in an admitted compile), so SEMANTICS_VERSION stays.
Verified: not yet run; the msi job's results follow in the hand-over.
Since e2e76d8879 a slot's direct base and address are made once where they dominate (EmitCx's
memo). The finalize verifier catches a use its definition does not dominate, but not a wrong
address. These two shapes had no executed identity-domain test: fuzz_interp's irreducible
automata run only under the resident tables and reach no slot inside the cycle, and the public
pointer-phi fixture runs in the validation executor under the resident tables.
engine_identity_flow, on every committed profile the identity domains derive (lavapipe
asserted among them), compiled with no descriptor, passed through L3 and run on the CPU
interpreter. It checks every word of every buffer against a CPU walk of the program:
- cycle: a two-block cycle entered at either block by the thread's parity. The entry reads
slot 1. Slots 0, 2 and 3 are first reached inside the cycle, in blocks neither of which
dominates the other: step sums go to slot 0, and a slot-2 word's Metal address (ptrtoint) is
stored to slot 3 inside the cycle. The exit stores the sum and the exit block.
- merged: a phi of slot 0 and slot 1 (each path first reads the other slot), read and written at
the thread's index after the merge, compared with slot 1's pointer (eq and ult), stored as two
words and as a pointer, then slot 1 read directly.
Slots lie just below and just above 2^31, with bind offsets that are not 0, and some buffers
cross 2^31, 6 GiB or 12 GiB inside the bytes the kernel reaches. So the carry of each biased
access and the bias that a pointer used as a value adds back both show in the answers, and a
compare of biased words would answer the other way.
Verified: not yet run; the msi job's results follow in the hand-over.
The comment on PushField::SlotBindOffset's shape said the residual is below
min{Storage,Uniform}BufferOffsetAlignment. It is not: where several bind offsets share one
descriptor range, a slot's residual is hundreds or thousands of bytes, which
a_constant_slot_reads_exactly_far_above_its_descriptor_base (tests/engine_access.rs) reads
exactly at 256 and 4096. The comment now states the field as sym.rs documents it (the bind offset
less the descriptor base, modulo 2^32) and names that test, and says the other field of the arm is
a pulled vertex buffer layout's stride. One u32 holds both; nothing else changes.
Doc only; cargo fmt --all.
The audit lane found that a render pass descriptor stayed among the surface passes once any
attachment setter named a surface's texture, even after that attachment took an ordinary texture,
so its encoders' commits counted as hand-over parts and the hand-over line could show a false
"differ" (exported.rs:178-183 at cc3188c3da). The backend now keeps, per descriptor, the
attachment properties (texture or resolveTexture of each color attachment, depth and stencil) that
hold a surface's texture: a setter's object there sets or clears its property, a nil property keeps
what it held, and the descriptor counts while any property holds one. A unit test of the backend
plays the replacement: a plane at color 0, an ordinary texture at color 1 and a nil at color 0
(still a part), an ordinary texture at color 0 (no part), the plane's view as the depth
attachment's resolve texture (a part again), then object 0 there (none).
The audit lane read the stand-in cold (standin.rs:262, 288-290 at cc3188c3da):
- An opaque fd's import named the stand-in's buffer in VkMemoryDedicatedAllocateInfo wherever the
driver keeps that buffer to a dedicated allocation. Such an import must name a buffer identical
to the exporter's (VUID-VkMemoryDedicatedAllocateInfo-buffer-01879), and the runtime's export is
dedicated to its own buffer, of other usage, whose create info the export does not give. That
case is now an import the stand-in cannot make, counted with that reason; an opaque fd's import
is dedicated to no buffer.
- The import bound memory of the export's type without checking that the stand-in's buffer lists
it (VUID-vkBindBufferMemory-memory-01035). A type the buffer does not list is now an import
failure with that reason, before the allocation.
docs/REPLAY-STREAM.md section 10 says both.
At 951aff127e the stand-in's make took the plan of a Private render target, which has a
sampled view, and dropped the views make returned: one VkImageView leaked per stand-in, which
the validation layer reported at vkDestroyDevice (VUID-vkDestroyDevice-device-05137) in each
NVIDIA test that makes one (RTX 3090, NVIDIA 620.70.06, job m3-max-78190). Every render and
every plane-copy count was right there. The stand-in is only rendered, resolved into and
copied, so its plan now has no sampled view, no storage view and no sRGB twin, and make makes
no view; the stand-in's own attachment view is unchanged.
A surface plane in place whose format's LINEAR tiling renders only through
VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV (VK_NV_linear_color_attachment: such a
format renders "as long as all the color attachments in the render pass instance have
VK_IMAGE_TILING_LINEAR tiling") was refused in any pass that set something beside it,
Gap::LinearPlanePass. A guest met it: a view of an exported 1920x1080 surface's R8 luma plane as
colour 0 beside an ordinary RG8 texture as colour 1, both loaded and stored. Red on the RTX 5080
Laptop GPU (job m3-max-78092) and the RTX 3090 (job m3-max-78106, NVIDIA 620.70.06).
The planner's ruling, form (ii): in a pass that mixes a marked plane with another attachment (a
colour attachment that is not one, a depth or stencil attachment, or a multisample attachment
resolving into it; decided by the format query's mark and the pass's attachments alone,
pass::mixes_linear), each marked colour attachment and each marked resolve target renders into
its stand-in, an optimal image of the runtime's of the plane's format and size
(TextureObject::stand_in). The pass's begin moves the stand-in from undefined and, where the
plane's Vulkan load op is LOAD, copies the render area of the plane into it; its end copies the
stand-in's render area into the plane where its store op is STORE or the pass resolves into it.
The plane stays general. A pass of marked planes alone still renders them in place; a device
whose LINEAR tiling offers the format as a colour attachment renders the plane in place in every
pass.
Counted: Metrics::plane_copies_in, plane_copy_in_bytes, plane_copies_out, plane_copy_out_bytes
(in bytes_copied too). The guest's pass pays both: its luma plane is loaded and stored, so each
run copies 2,073,600 bytes in and 2,073,600 bytes out. The stand-ins are bounded by structure,
one per (plane image, format), made at the first mixed pass and freed with the plane
(StandIns, Free::StandIn), counted in Gauges::plane_stand_ins and plane_stand_in_bytes, which
each_device checks are zero at the device's drop. A draw of such a pass that reads the plane
through a texture, or fetches it, stays refused: Gap::Draw of AttachmentRead or
FetchedAttachment (the plane holds what the pass rendered only after its end); a read of another
plane of the same surface is not.
Gap::LinearPlanePass and LinearPlanePassKind are gone: every kind (OtherColor, DepthStencil,
Resolve) renders. AGENTS.md's rule 2 grows to thirteen forms with the mixed-pass entry; the
runtime README's exported surfaces, floor and render encoder known gaps say the form and its
cost; docs/REFUSALS.md and the signatures table are regenerated.
Tests: the plane tests assert the plane copies (none in place; one out for a cleared plane
beside a colour or resolved into; one in and one out for the loaded plane beside a depth
attachment and the guest's pass), and a new test runs eight mixed passes over one plane: one
stand-in where it is marked, none elsewhere, freed when the surface drops. The unit test of
mixes_linear replaces linear_shape's. Device runs follow in the lane's report.
every_device_renders_a_plane_alone_and_holds_a_marked_one_to_its_rule asserted that a marked
plane (an opaque handle's plane in place whose LINEAR tiling renders only through
VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV) is refused beside another colour attachment,
beside a depth attachment and as a resolve target. The planner ruled that such a plane renders
in every pass shape, through an optimal image of the runtime's where the pass mixes it with
another attachment. The test becomes every_device_renders_a_plane_in_every_pass_shape: a draw
into one plane, both planes in one pass, a plane cleared beside another colour attachment (that
one compared too) and a multisample attachment resolved into a plane, each read back exact.
The draw beside a depth attachment gets its own test,
every_device_draws_into_a_plane_beside_a_depth_attachment, since an RTX 3090 lost the device
rendering a linear colour attachment beside one: a plane loaded green, a depth attachment cleared
to 1, and the fixture's whole-clip-space triangle drawn blue under Less with writes; every texel
of the plane reads blue.
Expected red where the plane is marked (the RTX 3090 and the RTX 5080 Laptop GPU refuse the pass
as it begins, Gap::LinearPlanePass), green where it is not (RADV, ANV, lavapipe).
The regression's replay, from a recording's refused descriptor (an arm64 guest recording its
screen through the consumer's H.264 encoder on NVENC, every recorded frame flat green): colour 0
a view (its own format, level 0, slice 0) of the R8Unorm luma plane of an exported 1920x1080
two-plane surface in the opaque handle, colour 1 an ordinary Private RG8Unorm 1920x1080 texture,
both Load and Store, one sample, no depth or stencil. Each is cleared alone, then one draw writes
luma 1 and chroma (1, 0), and both are read back through a blit, every texel compared.
It prints the surface's form, R8's and RG8's LINEAR colour attachment bits, whether the device
enabled VK_NV_linear_color_attachment and whether the luma plane is marked. Expected to fail
where the luma plane is marked (its LINEAR tiling renders through
LINEAR_COLOR_ATTACHMENT_BIT_NV alone): the pass is refused as it begins,
Gap::LinearPlanePass { kind: OtherColor }.
README C. Vulkan 1.4 section 7.7.6's note calls an acquire after a release with no other
release between invalid. The APIs that share an exported surface or block (VA-API, NVDEC,
Direct3D 11) have no release of their own, so where the other side did nothing between two of
rt's submissions, rt's release and next acquire meet with no external operation between. The
form stays; the known gap says so and when it reopens.
README D. The residency-set line gains its exported-block case: a buffer in an exported block
reached only through an address (never bound, declared or kept) puts nothing in its segment's
hand-overs, so its part neither acquires nor releases the block.
Docs only.
FIX A. An exported surface in place is one memory that its planes' images and its buffer
alias, and Vulkan 1.4 section 7.7.6 makes "the contents of any other resource aliasing the
transferred memory" undefined after a release or an acquire. A part that used only the planes
handed over only the planes, and a part that used only Surface::buffer only the buffer's block.
Now the surface's make gives its planes one handed::Aliases set, which the buffer joins when
Surface::buffer makes it (memory::Block::aliases, Under::Surface's aliases); Handed::keep adds
every living member with any one, so each part's one acquire and one release name the planes
and the buffer as further entries of the same barriers. No barrier is added. The set holds its
members weakly: one gone is handed over no more. The making is not expanded: the buffer has no
making of its own, and the planes' making releases only what was made.
FIX B. The making released each plane from the undefined layout, while every later acquire and
release names the general layout, and a release's layouts are its acquire's (section 7.7.6). Now
Upload::hand_over records, for a making, the planes' moves out of the undefined layout first,
within the runtime's queue family (handed::moves, Image::making_move), counted in
Metrics::upload_barriers, then the release from and to the general layout. One barrier more per
surface at its making; nothing per picture changes.
The README's making and hand-over text says both.
Tests: ad65d6a70e's two structural tests, red on lavapipe at ad65d6a70e (job m3-max-78062);
the green runs follow in the lane's report.
The counts of the surface's make and its ready wait, which submits its making ([barriers,
runtime command buffers, submissions, acquires, releases]), beside each picture's: a change to
the making shows there, and a picture's counts show it changed nothing per picture.
Two structural tests over the layouts recorder, which now keeps each barrier's ownership
transfers to or from the external or foreign queue family (images with their old and new
layouts, and buffers), in the order submitted.
- A part that uses only an exported surface's planes in place, and a part that uses only its
buffer, each name both the planes and the buffer in their one acquire and their one release:
the two alias one memory, and Vulkan 1.4 section 7.7.6 makes "the contents of any other
resource aliasing the transferred memory ... undefined after a release or acquire operation".
- Every hand-over of such a plane, the making's release included, names the general layout as
its old and its new layout: a release's layouts are its acquire's (section 7.7.6), and every
acquire names the general layout.
Both fail at this commit: a planes-only part hands over only the planes, a buffer-only part only
the buffer, and the making releases each plane from the undefined layout.
VALIDATION.md's GPU-leg row says the replay player's device tests (replay::rt_replay) run under
the validation layer, but only the exported-surface test enabled it: the jobs put the layer on the
loader's path and nothing in the validation crate turned it on. Each test's pipeline cache
directory (ScratchCache), which every rt_replay test holds longer than its devices, now puts the
layer over the process's instances through candidate::Layered (the candidate runs' helper, which
validated now uses too): rt_device asserts the device lists the layer as an active tool, and the
cache's drop fails the test on any message the layer logged. The exported-surface test no longer
wraps itself. rt_replay, and places' device test that shares its helpers, are Linux's and macOS's,
where the candidate's platform gives the layer.
Cost (job m3-max-78137 at edc3bfa01b, lavapipe on msi, LP_NUM_THREADS=1): ID:rt's device filter
94.9 s; replay::rt_replay alone 1.4 s bare, 1.5 s with the layer enabled through the same
variables, no layer message. Unverified here: the run with this commit follows.
The validation crate builds for x86_64-pc-windows-gnullvm (with llvm-mingw for the bundled
SQLite, as win-cross.sh builds command-replay for the Windows play), and its clippy there (job
m3-max-78094 at abf7b8f873, plain and under --cfg m2v_gpu) reported the stand-in: its writes wait
under the crate's bounded fence waits (gpu::wait::vulkan), which the crate keeps to Linux and macOS,
and its empty extension list for an NT handle did not type-check. Rather than a Windows form of the
fence wait, the stand-in is Linux's and macOS's alone: its import is fd-only, and on any other host
StandIn::new says why it is absent, so each landing is counted unwritten with that reason and the
play goes on (the S1 ruling's handling of a stand-in that cannot be made). The NT-handle import,
which no build compiled, is gone, and so is the device test's Windows arm: the test, under the
layer through candidate::validated, is Linux's and macOS's. A plane's rows are the caller's tuple.
The same clippy reported lib-test code that predates the exported surfaces and never compiled for
Windows: build_support_tests.rs hex-encoded through crate::hash (not on Windows; now sha2's own
lower-hex), and gpu/wait.rs's tests of the fence and Metal waits' own endings, which Windows lacks
(now gated as those variants are).
docs/REPLAY-STREAM.md section 10 says the stand-in is Linux's and macOS's and what Windows counts.
Clippy of the validation crate (job m3-max-78070, aeb43cd8b7, default and m2v_cpu_icd configs)
refused the stand-in's direct vkGetDeviceQueue, vkAllocateCommandBuffers and vkDestroyDevice: the
crate's clippy.toml keeps those loader-served calls behind the loader word a driver may write over
while reporting a message (candidate/platform/loader_word.rs). The stand-in now records its device's
word as vkCreateDevice returns it and puts it back before each such call on Linux and macOS, with
the crate's #[expect(clippy::disallowed_methods)] at those sites as VulkanContext has; LoaderWord is
re-exported to the crate for it. A redundant deref and a doc line that began with "+ " (a list
item to rustdoc's markdown) are fixed.
The device test of the exported-surface snippet ran with the layer on the loader's path but not
enabled: the validation crate's replay tests make their instance with no layer. Each of its plays
now runs under the Khronos validation layer as the candidate runs do (candidate::validated, made
reachable from the replay tests): the device must list the layer as an active tool, and any
message the layer logs fails the test, the stand-in's device's included, since it lives on the
runtime's instance.
docs/REPLAY-STREAM.md: section 4 points at the records, section 7 gives them (m2v.newExportedSurface,
m2v.surfacePlane, m2v.exportSurface, m2v.surfaceWritesDone, release), and section 10 says what the
player does at each, the stand-in for the other API, what a player cannot reproduce, the runtime's
hand-overs with its Metrics docs as the contract, the hand-over and exported-surfaces report lines
and counters, --video-handle's override, and `command-replay snippet video-surfaces`.
Verified before this commit (job m3-max-78051, f58ff0a2b3, lavapipe on msi, layer on the path
but not enabled): dma-buf in place and opaque-fd in the copy form each play 3 frames that agree
with the contract (acquires 2, releases 3 in frame 0 and 2 after) and 6 checks that match.
The player plays m2v.newExportedSurface, m2v.surfacePlane, m2v.exportSurface and
m2v.surfaceWritesDone (the snippet's records) through Device::new_exported_surface,
Surface::planes, Surface::wait_until_ready and Surface::external_writes_done. Where the
stream was recorded a decoder wrote each picture; on replay a Vulkan device of the
player's own, on the runtime's instance and physical device, imports the surface's
handle, copies the picture's packed rows into its memory at the play's layout (or fills
it with the landing's number where the stream holds no bytes), releases it to the
handle's queue family and waits on its own fence. An import or write the stand-in cannot
make is counted on the exported-surfaces line and the play goes on.
The backend also counts what the runtime's hand-overs follow from, per frame: commits
whose command buffers name a texture in an exported surface, the makings a submission
carried, the pictures landed, and CPU calls on such textures (frames with those are not
judged). The report's hand-over line compares each frame's external_acquires and
external_releases with the runtime's Metrics contract at this commit: one acquire per
such submission, one release per such submission plus one per submission carrying a
making.
Unverified at this commit: the lavapipe run follows.
What: snippets::video_surfaces writes a synthetic stream of our own: one exported surface of a
64x36 8-bit 4:2:0 picture's two planes (m2v.newExportedSurface, m2v.surfacePlane, a view of the
luma plane, m2v.exportSurface), then three pictures of our own bytes (m2v.surfaceWritesDone), each
in a frame of its own: two submission parts (m2v.split) read the planes back into Shared buffers,
a third command buffer uses none of the surface, and m2v.check compares the read-backs with our
bytes. The device test plays it for each handle the host has and asserts that every frame's
external acquires and releases agree with the report's hand-over line (the runtime's documented
contract), that every check matches, and that nothing is skipped; a handle the device does not
export is counted and passed over.
Why: no recorded stream carries the exported-surface hand-over the consumer's video uses; this
test fails until the player plays the record family (it refuses m2v.newExportedSurface now).
Verified: not yet run; its first run is the red one, before the player change.
The layouts recorder's moves() took an image's move home to be a barrier of its first level from
the undefined or the preinitialized layout, so a texture over a dma-buf in place, whose move home
is its acquire from the foreign queue family from the general layout (Vulkan's section 12.10.1:
that acquire's layout is the image's true initial layout), would have been noted as a step before
its move home, as would a Direct3D 11 plane's first acquire. No test read moves() for either.
The recorder now keeps the memory allocated from another API's handle (VkImportMemoryFdInfoKHR,
VkImportMemoryWin32HandleInfoKHR, through vkAllocateMemory) and the images made with external
memory info that vkBindImageMemory binds to it. For such an image alone, an acquire of its first
level from the external or foreign queue family from the general layout is its move home where
it has not moved home, and a use after. For every other image a first move from the general
layout stays a step before its move home. An exported surface's dma-buf planes are bound to the
runtime's own imports of its export, which the record does not tell from another API's; the
module doc says so.
Tests: a device-free test of the step a barrier is (an acquire over another API's memory, over
the runtime's, at another level, a release, a plain barrier, from undefined) and of take() (the
first acquire a move home, the second a use, a plain barrier first out of order); and import_overs'
dma-buf layouts test reads moves() and asserts no step out of order.
Also: forget() gets its own doc line, and barriers()'s doc is back above barriers().
The planner's ruling on d789ca7aa5. The first acquire of a texture in place over a dma-buf's import
names the general layout as its old one, though the runtime has released nothing yet and the
image was made undefined. For a Direct3D 11 plane that layout stands on section 12.10.1 with
Table 17 (External Image Implied Layouts). Table 17 lists no dma-buf handle type, and section
12.10.1 leaves layouts to the other API, so no sentence names the dma-buf's layout there: the
first acquire's old layout is general by the same convention as the later ones. Imported blocks
says so, and Known gaps of memory blocks lists it. The undefined layout there would discard the
bytes, so the code stays.
Docs only.
no_external_preinitialized used assert_eq! on a vk::ImageLayout, which this build of ash gives no
Debug, so the runtime's lib tests did not compile at 49583b80c0 (lavapipe jobs m3-max-77905 and
m3-max-77906 stopped at E0277). The check now compares with assert! and prints the layout's
number, as the message already did.
The planner's ruling on the aliased-write row. Imported blocks' coherence paragraph says that rt
takes a write to an imported dma-buf's pages, made through another mapping of the same pages, as a
host write to that memory, and that rt imports a dma-buf only into a host-visible, host-coherent
type on a device whose Shared type is host-coherent, refusing otherwise
(Limit::ImportCoherence, Limit::ImportType), so no flush or invalidate is owed (import.rs at
lines 420, 431, 439, 444, 530 and 696, read by main). Known gaps of memory blocks records that
Vulkan defines host access only through its own mapping and host-pointer imports, so the order of
such a write rests on the pages being the same and the type host-coherent, measured on the
Radeon 780M (RADV), not on a sentence of the spec.
Docs only.
A texture over a buffer in a dma-buf's import, in place, is a linear image made with the import's
handle, so undefined (VUID-VkImageCreateInfo-pNext-01443). Its move home is the acquire of the
image and the buffer's range under it from the foreign queue family, and that acquire's old layout
is the image's true initial layout (section 12.10.1). It named the preinitialized layout: the
Source::Over in-place arm of Device::new_texture set first to PREINITIALIZED for every image in
place, the dma-buf's included, and Image::homing's foreign acquire named it.
The planner's ruling: no image with external memory info is named in the preinitialized layout,
and the acquire names the layout the memory was released in. The arm now sets first to
PREINITIALIZED only for an image of the runtime's own memory (made preinitialized, Laid::Own); the
dma-buf's image keeps first undefined, and homing's foreign acquire names the general layout
(first.old_layout(home)), the layout of the runtime's own hand-overs, in which a linear image and
the buffer are host-accessible aliases that read the bytes alike (section 12.11). copy_layout,
which took a preinitialized first to mean an image in place, also takes an image with a foreign
acquire as one, so a copy keeps it in the general layout. writes_whole already excluded it.
After this, no product code names the preinitialized layout for an image made with external
memory info: the remaining PREINITIALIZED sites are the in-place arm for the runtime's own memory
(texture.rs:1718), the probe image of linear_layout (texture.rs:2556, never bound) and
image_create's None-handle arm (texture.rs:3421); the handle arm makes undefined.
README: Imported blocks and Buffer::new_texture name the general layout as the acquire's old one.
Pinned by the previous commit's test (import_overs:
every_device_names_a_texture_over_a_dma_buf_in_no_preinitialized_layout), red before this commit
and green after on lavapipe (llvmpipe); jobs reported with the series.
The layouts recorder keeps each image made with VkExternalMemoryImageCreateInfo in its chain, with
the layout it was made in. no_external_preinitialized checks every such image of a device: made
undefined (VUID-VkImageCreateInfo-pNext-01443), and named in the preinitialized layout by no
command. An acquire's old layout is such an image's true initial layout (section 12.10.1), and
Vulkan names the preinitialized layout only as one an image is made in and, under memory
aliasing, as the old layout of a move after host writes through an alias (section 12.11).
Two tests use it, each under a recording:
- import_overs: a texture over a dma-buf's buffer, read by a blit; exact against the CPU's bytes,
and in place exactly one external image named.
- surface: every row the device exports, on the 1080p picture: read after external_writes_done,
then written by a blit; every plane in place named.
At this commit the dma-buf test fails where the texture takes the form in place: the image's move
home is the acquire from the foreign queue family from the preinitialized layout
(texture.rs, the Source::Over in-place arm sets first to PREINITIALIZED for the dma-buf's image
too; Image::homing's foreign acquire names it). The next commit fixes it.
Work::create, which an exported block's or surface's make calls to owe its making to the next
submission's upload, waits for the submit side's work lock as a texture's move home does. It now
times that wait as Part::HomeLock, so Metrics::home_lock_waits counts it again; the hand-over change
moved the surface make's upload entry into Work::create and left the wait untimed, and
make_parts' every_device_times_an_exported_surfaces_make_by_part expects one home lock wait per
make. The counter's doc names the exported make.
every_device_completes_a_surface_s_making_before_its_ready_wait_returns read the device's
completed progress (Done::completed), which the completion thread raises after the progress
semaphore does; the ready wait returns on the semaphore. The test now reads the semaphore's own
value (vkGetSemaphoreCounterValue), which the ready wait's return orders after.
Failing before: both tests on lavapipe (llvmpipe), runtime suite job m3-max-77883 at 6559c48acd.
every_device_counts_a_picture_loop_s_hand_overs runs, for each row the device exports on the
1080p picture, 8 decode pictures (the other device writes, external_writes_done, rt reads through
the planes) and 8 encode pictures (rt writes the planes by a blit, the other device reads through
the handle) after one warm-up of each, each read exact, and prints each picture's barriers,
runtime command buffers, submissions, acquires and releases counted around rt's calls alone. It
is the before-and-after measure of the hand-over: the same loop at 21d219b089, with the release
call the consumer's encode path made there, runs on a scratch branch; no lab recording carries
decoded pictures (main, 12-02). Printed only.
Verified on lavapipe with the before run; reported with the lane's tip.
6559c48acd renamed Image::made to Image::making and folded Upload::make_handed into
Upload::hand_over, and four private doc links still named the old items: the private-items
rustdoc of the runtime failed on them (job m3-max-77880, the Linux node's privdoc step; its
public rustdoc, gpu clippy and the validation crate's clippy passed there).
Verified by the next privdoc run, reported with the lane's tip.
A consumer's video path showed green frames. Its paths call external_writes_done before each
picture and a release only in their encode fills, so every acquire of an exported block or surface
after the first had no release of the runtime's to match (VUID-vkQueueSubmit2-commandBuffer-03879),
and whether memory another API wrote was acquired, or discarded, depended on the order the
consumer's calls arrived in. f6fe21431c's test shows it: no submission released the surface.
Now one form serves every kind of memory another API shares, the form Direct3D 11 planes already
took (crate::handed): each vkQueueSubmit2 part whose command buffers or uploads use an exported
block, an exported surface's planes in place or its buffer, or a Direct3D 11 plane acquires all of
it from the other API's queue family in one barrier, in a runtime command buffer at the part's head
after a global barrier, and releases it in one barrier in another at the part's end, which takes
the part's last signals. Per such part: 3 barriers and 2 runtime command buffers; no submission,
VkSubmitInfo2 or semaphore wait is added. The uploads' copies into textures over a buffer in an
exported block go with the first part, which hands that block over too.
Exported memory is the runtime's until its making (Work::create): an exported block's buffer is
released, and an exported surface's planes in place move out of the undefined layout and are
released in the same barrier, in a runtime command buffer at the head of the submission that takes
the make's upload, ahead of any acquire. The upload owes the making by weak reference, so a surface
or block dropped first owes nothing and holds nothing. The making's submission is the ready point:
Surface::wait_until_ready waits for it in both forms (the copy form's is its block's), and the new
Block::wait_until_ready is its twin (Metal counterpart none; refuses a block that is not exported;
has the submission go at once, so it returns with no command buffer committed). One barrier at the
making, nothing per frame beyond the per-part hand-over.
external_writes_done keeps only its host-side mark: on a block (and a copy-form surface) the
textures over it take its bytes again; in place and on a Direct3D 11 import it records nothing.
Surface::buffer records nothing at its make. A block that is not exported is still refused.
Deleted, with no replacement: BlitCommandEncoder::release_to_external and
BlitCommandEncoder::release_surface_to_external, and Building::release_command, which only they
used. Consumer uses (the consumer's checkout, searched for main): release_to_external at
vaapi/fill.rs:599 and nvidia/encode/fill.rs:289, each followed by EndEncoding, commit and the
consumer's CPU wait; its wrapper trait method BlitEncoder::release_to_external
(core/platform/blit.rs:395, a cfg(unix) no-op default) and the RtPlatform impl
(rt_platform/blit.rs:992-999); doc mentions at rt_platform/export.rs:33, vaapi/fill.rs:30 and
nvidia/encode/fill.rs:18. release_surface_to_external: zero uses. The consumer drops them all in
the pin that takes this commit.
The guard the planner asked for: a plane's image in place takes its tiling from InPlaceTiling
alone, whose values are LINEAR and the DRM_FORMAT_MOD_LINEAR modifier, never OPTIMAL; the
device-free test no_plane_in_place_takes_the_optimal_tiling pins it. The order test
every_device_completes_a_surface_s_making_before_its_ready_wait_returns checks that each plane
owes its move at the make and none once the wait returns, with the device's completed progress at
or past the ready point. The export, surface and Direct3D 11 tests now count one acquire and one
release per submission and one release at the making, with no release call.
The runtime README states the contract (The hand-over contract): nothing another API writes may
be handed memory of ours before that memory's ready point; the other API's next write must not
begin before the submissions that used the memory have completed; who waits by kind and what a
reader gets where no write landed; no optimal image in memory another API writes in place
(section 12.11), the Direct3D 11 import being the documented case (section 12.10.1, Table 17).
Its known gaps carry the planner's line on host-pointer memory. docs/REFUSALS.md is regenerated
and the signature table blessed (one added, two removed).
Checked before this commit: clippy of the runtime, all targets, plain and under --cfg
m2v_cpu_icd, on this commit's code less its doc changes (job m3-max-77874). The device runs at
this commit (lavapipe, the Radeon 780M, the UHD 630) follow and are reported with the lane's tip.
The dma-buf import half is not built.
The consumer's video paths (VA-API into a dma-buf surface, NVIDIA's decode into an opaque one)
call Surface::external_writes_done before each picture and release_surface_to_external only in
their encode fills, so every acquire after a surface's first has no release of rt's to match
(VUID-vkQueueSubmit2-commandBuffer-03879: "there must exist a previously submitted Queue Family
Ownership Transfer Release Operation ... with parameters matching the acquire operation").
The new test makes each row's surface (the VA-API dma-buf, the NVIDIA opaque handle, the copy form)
at 1080p, waits for its ready point, and has the second device write picture 1, then the
consumer's call and rt's read; then picture 2 the same way, with no release call between. Each read
must be its picture's exactly, the validation layer silent, and each read's submission must count
one acquire and one release of the surface's memory (Metrics::external_acquires,
Metrics::external_releases). At this commit no submission releases the surface, so it fails there.
A serial compute encoder recorded no barrier between a dispatch that reads through an address
outside its resources and a later dispatch that writes a resource through its slot or a
use_resource declaration, so on Vulkan the write could overlap the read and the read see its
bytes. Metal runs a serial encoder's dispatches in dispatched order (MTLCommandBuffer.h:
"Command encoder dispatches are executed in dispatched order"), and the README held that such a
pipeline conflicts with any write. The hazard sets marked nothing for the read
(Hazards::mark_wild_read set touched alone), and Building::dispatch_hazards tested an unbound
read against earlier writes and an unbound write against any earlier access, never a write
against an earlier unbound read.
Now Hazards keeps read_wild since the last barrier, set by mark_wild_read and cleared with the
sets, and a dispatch any of whose accesses writes conflicts with it, counted in
Metrics::dispatch_unbound_barriers (its doc says so). The flag covers any resource: what an
address read reaches is whatever the guest made resident, residency sets included, which the
runtime does not see, the breadth the rule already takes for an unbound read after any write.
The README's serial-encoder sentence and use_heap's doc say the read orders before later writes.
No public change; no new form. The barrier is the one an unbound access already takes.
Verified: not run yet; the lavapipe run of every_device_orders_a_write_after_an_unbound_read,
the runtime suite and clippy follow.
A serial compute encoder records no barrier between a dispatch that reads through an address
outside its resources and a later dispatch that writes a resource through its slot or a
use_resource declaration: the read marks nothing in the hazard sets (Hazards::mark_wild_read sets
touched alone), and the unbound test in Building::dispatch_hazards looks at earlier writes for an
unbound read and at any earlier access for an unbound write, never at an earlier unbound read for
a write. Metal runs a serial encoder's dispatches in dispatched order (MTLCommandBuffer.h), so the
read sees the bytes from before the write; on Vulkan the two may overlap.
every_device_orders_a_write_after_an_unbound_read: the wild step kernel (reads_unbound) over y,
then step over x, in one serial encoder; it asserts one barrier in the unbound source and two
barriers with the segment's end. It fails before the fix (no source, one barrier).
Verified: not run yet; the lavapipe run follows.
The golden hash table was last blessed at semantics 2307 (031c37d674). Two translator commits
since then change emitted SPIR-V and bump SEMANTICS_VERSION to 2310: 2a42256955 carries biased
buffer offsets into the high address word, and e2e76d8879 makes a slot's direct base and address
once where they dominate. golden_hashes_match_the_table therefore reports a bless due, not a
missing bump.
What moved, read from the table's diff: 2310 of 3600 rows, every one hash to hash. No refusal
class changed, no fixture source hash changed, and no row was added or removed. That is 19275
cells: 10086 in .ll fixtures, the count the Linux run reports, and 9189 in .air.ll fixtures,
which only a macOS run computes. Every changed row's fixture source holds a device or constant
buffer pointer, which is the path both commits change. The 137 rows whose fixture has none did
not move.
The table is the only file changed. Every other test in the same core run passed, and the
public cases ran at 7adf1d6603 with new_mismatch 0 on lavapipe, the Iris and the 780M.
Blessed on the M3 at 7adf1d6603 (job m3-max-78055: inventory, golden and printouts all exit 0;
only golden_hashes.tsv changed).
A command encoded right after encodeSignalEvent marked what it did to textures over a Managed
buffer's device copy (managed_reach, wrote_managed, wrote_texture_managed) in the segment the
signal ends, before ordered_command split the recording there. That segment goes in a submission
of its own ahead of the command's, so on a device with two copies a write's copy in was taken
before the write ran and never after it (a fill of the buffer, then every later reader of the
texture read the bytes from before the fill), and a texture write's copy back was made before the
write. And managed_reach took the copy back owed by a write earlier in the command buffer before
managed_backs began the command buffer, so a begin that failed dropped it for good.
Building::open_segment makes the current segment the command's (a new one past a signal) and
begins its command buffer, with what is owed left owed. The blit copies, fill, mipmap chain and
synchronize, and the dispatch, call it before their first mark; a render pass's begin marks its
attachments after its ordered_command instead, so whether it opens its command buffer, which
spares its first barrier, is read as before. No public change and no new form.
The fill-after-a-signal test prints the bytes R's submission copied between the texture and the
Managed buffer's device copy (over_copy_bytes less those over Private and over Shared memory), and
the failed-begin test the bytes the copy encoded again copied back in its own commands. Where the
texture is owed by its buffer's entry (two copies), each must be non-zero: the evidence that the
two-copy form ran, not only that the bytes match.
Unverified at this commit: the failing run follows on lavapipe.
Two device tests over a texture over a Managed buffer in an image of its own, in both forms:
- A fill of the buffer encoded right after encodeSignalEvent reaches a later reader of the
texture. Today the fill's marks (managed_reach, wrote_managed) land in the signalling segment,
whose submission goes first: the copy in it owes is taken before the fill runs, and none after.
- A blit copy of the buffer whose command buffer cannot begin fails before it takes the copy back
a write of the texture owes. Today managed_reach takes it, managed_backs fails at the begin, and
the same copy encoded again reads the buffer without the texture's write.
A test-only seam, Core::fail_begins, fails the next begins of a command buffer's recording
(Building::begin) as vkBeginCommandBuffer out of host memory, before the driver is called.
Both are expected to fail in the two-copy form until the fix that follows. Unverified at this
commit: the failing run is being dispatched on lavapipe.
engine_access_size::a_device_access_of_whole_words_is_one_access held a direct access to the old
form's cost: a 64-bit add of the slot's base and the zero-extended biased offset. PR 22 replaced
that add with an OpIAddCarry on the low word and a carry into the high word, because AMD's Windows
driver folded the biased offset's 2^31 into a sign-extended 64-bit immediate and read 4 GiB below
the buffer. The structural pass (e2e76d8879) made the base and the slot's address once per slot;
the per-access remainder is the carry. The bounds move to the measured cost, never rounded up:
float4 load at a uint offset 16 -> 19
float4 store at a uint offset 16 -> 19
float4 load at a float4 offset 16 -> 18
pointer chase 24 -> 22 (the pass took it below the old form)
The loss, as measured:
- On a device that takes compute buffers by address (lavapipe, a states-only play of 25,942
states, refused 0 in both forms; m3-max-77799, a b a b): SPIR-V +7.0% (largest entry +6.2%),
driver compile +5.1% (same-arm spread 1.1% and 2.6%), translation +0.7%, pipeline-make time
+1.6%, play wall +0.8%.
- One translation by the compile worker's counting allocator (corpus-pipeline --compile-only,
lavapipe; m3-max-77820, m3-max-77825): the corpus's largest row by allocator peak, 184,135,107
bytes in both forms (PR 22 does not reach it); its largest by SPIR-V output, 62,572 -> 62,894
words and 2,905,472 -> 2,921,373 bytes (+0.5%), 11 ms in both.
- Runtime GPU time of the frames (a b a b, one job per card): XTX +0.09% (m3-max-77764). RTX 3090 (gem10, in a
Thunderbolt enclosure): m3-max-77854 not resolved, its arms at unequal clocks (one b play 81
samples at P8 210 MHz against 50 and 51, wall 144.4 s against 133.7-137.9 s); m3-max-77895, both
pairs counted (P8 samples 109/109 and 108/103), +1.90% and -2.72%, means -0.44%: inside. The
+0.21% at 2f5f35ca47 on that card was before it moved hosts and is not a before-run. Iris Xe: no loss shown, 3% not resolved by this measure there (pair spread 7.8% and
11.3%).
The carry form is unverified in the lab on the driver it fixes: no lab device runs AMD's Windows
driver; only the contributor's run (RX 6950 XT and an integrated Radeon, driver 26.11.2, offsets 0
and 256) covers it. A cheaper form for constant offsets was not taken for that reason; the cost is
a no-lane row that reopens on a venue running that driver or a pipeline-make cost of 5% or more on
a real device that takes buffers by address.
Verified: the measured values are m3-max-77757's size table at e2e76d8879 (no translator change
since); this commit's test runs in the merge check next.
every_device_reads_what_direct3d_11_drew_through_a_commit_ahead_of_external_writes_done (d68f165aae)
now asserts what it printed: every acquire of a plane, the first included, names the general
layout as its old layout (Work::acquired). Its byte checks stay.
Why the structural check: no wrong picture was reproduced. On the UHD 630 the read committed ahead
of the call matched picture 1 at 3072 of 3072 bytes at d68f165aae, the old code, whose acquires'
old layouts were [undefined, undefined, general, general] (job m3-max-77834); at cd5d7df2f0 the
same read matched 3072 of 3072 with [general, general, general, general] (job m3-max-77839). That
driver kept the bytes through an acquire from the undefined layout, which Vulkan does not promise
(section 12.5.1: "implying that the contents of the image subresource need not be preserved"), so
the bytes cannot fail there and the old layouts are the failing proof. cd5d7df2f0 stays as the
spec's form (sections 12.5.2, 12.10.1, Table 17).
How it is verified: one job on the UHD 630 runs tests::d3d11 from two Windows cross-builds, the
old code with this assertion (expected to fail on [0, 0, 1, 1]) and this commit (expected to
pass); its job is reported with the lane's tip.
A consumer's video path showed green frames. A plane's first acquire named the undefined layout
unless Surface::external_writes_done had been called before the first commit that used it, and a
transition from the undefined layout need not keep the bytes (section 12.5.1: "implying that the
contents of the image subresource need not be preserved"). What 9737a44d98 and its test 7c5df5a317
left open: whether that first acquire discards depended on the order the commit and the call
arrived in. The consumer's decode order today is fence wait, external_writes_done, then the
session's signal, so the hole is reached by a guest command buffer that reads a new cache's planes
without waiting on the session, committed between the draw's completion and the call.
Now Image::handed names the general layout as the old layout of every acquire, the first included,
and of every release. A Direct3D 11 plane is made owing no move (its homed flag set), so no upload
moves it, as before 9737a44d98. Surface::external_writes_done records nothing and changes nothing
for a Direct3D 11 surface; Image::external_access, which it called, is gone. No barrier, command
buffer, submission or wait is added or removed: the acquire is the same barrier with another old
layout.
The spec's form for this handle type. Section 12.5.2: "When images created with external memory
handle types listed in the external image implied layouts table are accessed outside of Vulkan,
they must be in the layout specified in the table, and can be assumed to be in that layout when
they are accessed in Vulkan after external access", and Table 17 gives
VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT the layout VK_IMAGE_LAYOUT_GENERAL. The conflict
9737a44d98 met (a plane rt uses before any Direct3D 11 access, whose image is made undefined) is
answered by section 12.10.1's note on an image bound to memory another API owns: "Such an image is
not usable until it acquires ownership of its memory from the existing owner. Therefore, the layout
specified as part of this transition will be the true initial layout of the image. The undefined
layout specified when creating it is a placeholder to simplify valid usage requirements."
Direct3D 11 made the texture, so it is that owner, and VUID-VkImageMemoryBarrier-
srcQueueFamilyIndex-12332 allows the general layout for any acquire of such an image from
VK_QUEUE_FAMILY_EXTERNAL ("oldLayout must be VK_IMAGE_LAYOUT_GENERAL or
VK_IMAGE_LAYOUT_UNDEFINED"). Left open by the text: whether Direct3D 11's making of a texture with
no initial data counts as an access "outside of Vulkan"; such a texture's bytes are undefined
either way, and the acquire that names the general layout is allowed by the VUID.
The suite now states this rule: every_device_acquires_a_direct3d_11_plane_from_the_general_layout_
first_included replaces the first-use test and reads the old layouts from Work::acquired, the
general layout for every acquire, with and without the call first. The d3d11 module's doc,
import_d3d11_surface's Layout, Ownership and precondition paragraphs, external_writes_done's doc
and the runtime README say so; the consumer's precondition no longer names the call.
Not yet run on a device: the red test's run at d68f165aae and this commit's run of tests::d3d11
on the UHD 630 wait for the card, which potluck does not list on the Windows host as this is
committed; their jobs are reported with the lane's tip. The Windows cross-build of this commit is
its compile check.
A consumer's video path showed green frames: planes Direct3D 11 wrote, read by rt, came back without
Direct3D 11's content. A plane's first acquire names the undefined layout unless
Surface::external_writes_done was called before the first commit that uses it, and section 12.5.1
lets a transition from the undefined layout discard ("implying that the contents of the image
subresource need not be preserved").
The new test draws picture 1 with Direct3D 11 and waits for it, imports the planes, commits and
waits for rt's read of them with no external_writes_done before it, then makes the consumer's call
and reads again. Both reads must be picture 1's exactly. It prints the first read's matching and
zero bytes and each acquire's old layout (Work::acquired).
Its run at this commit on the UHD 630 is named in the fix's message.
every_device_signals_each_member_of_a_group_sent_apart failed once on llvmpipe in the merge check
at 1da727a583 (m3-max-77710, lvp_rt: "no value between the busy work's 6 and the group's 9 before
L's end") and passed at 2f5f35ca47 (m3-max-77732) and in round 89fb420796-1202-0117. Its proof
needed a host thread polling the progress semaphore to catch A's value inside the 4-10 ms between
A's end and L's: on a loaded CPU device the thread can be off the CPU for the whole window. The
specification bounds when a timeline signal is seen only from below (a submission's signal
follows its own commands), so a device that showed the value late would also fail it.
The deterministic form the planner asked for, a wait on an event instead of the clock, has no
valid Vulkan shape here. A GPU wait on a host-set event is defunct: "Events signaled by the host
must be signaled before the command buffer waits on those events" (6.6; also
VUID-vkCmdWaitEvents2-pEvents-03840). The runtime's own shared-event wait holds L on the host
until the event is met, so L would never join A's group.
So the test now reads what the runtime gave each member as the group went: Work::assigned, a
record kept for the device tests (as Work::acquired is), of each group member's place in the
commit order and the progress value it retires at. It asserts A then L in commit order, the
busy work's last value < A's < L's = the group's last, and still one submission each. The
timings (A's handler and L's GPU end, from A's GPU end) are printed, not asserted, and so are the
values.
Verified: nothing run yet for this commit; the merge check's lvp_rt and clippy in the device
configurations run it next.
PR 22's carry form cost about 10 SPIR-V instructions for each direct access against 2 before,
and engine_access_size::a_device_access_of_whole_words_is_one_access failed its bounds at
2f5f35ca47 (m3-max-77753, first identity profile: the uint-offset float4 load and store 24
against a bound of 16, the float4-offset load 23 against 16, the pointer chase 33 against 24;
the old form 16, 16, 15 and 24). Most of that was work repeated on every access: the base's u64
bitcast back to words and its split, and an add of the offset's zero high word; and
slot_address added the bias with the same sequence at every use.
Now:
- pointer::direct_base: the slot's address less the bias as its two words (the SlotGuestBase
push word split, or in a replay variant that word less 2^31 with a borrow), remembered under
SlotMemo::DirectBase and recalled where its block dominates (EmitCx's invariant memo, as
slot_bounds does). Reach::Direct holds the words; biased_slot_address, which only the direct
reach called, goes.
- psb::add_slot_offset: OpIAddCarry of the low word and the offset, its two words, one add of the
carry to the high word, the words joined and bitcast: six instructions, with no add of a zero
word and no 64-bit add of a constant.
- pointer::slot_address: remembered under SlotMemo::Address, so a pointer compare, a converted
or stored pointer or an access from the word below adds the bias once where it dominates.
The arithmetic is unchanged: the address plus the unsigned biased offset modulo 2^64, carried
into the high word as PR 22 made it. SEMANTICS_VERSION 2309 -> 2310 (module bytes change).
Verified: nothing run yet for this commit; the access-size table, the engine suites and the merge
check run next, and the table is reported against the bounds.
PR 23 imported PUSH_STAGES into command.rs, so the explicit target of the link in Pushed's doc
became redundant, and CI's private intra-doc links step (cargo doc --document-private-items with
-D warnings) failed on metal2vulkan-runtime: "redundant explicit link target" at command.rs:290.
Verified: found by the merge check at 2f5f35ca47 (m3-max-77732, STEP privdoc EXIT=1, the one
error); the next merge check runs the step again.
PR 18 (rponeawa) reported that a shared-range uniform descriptor could start far below the bind
offset (a residual of 256 on a device with a 64-byte uniform offset alignment), past the fixed
array the uniform view declared, so the read left the declared array. Its fix sized the array to
the device's uniform range. 5e3477e60a (11-22) has since removed the uniform view: every buffer
slot's view is a storage word array whose OpArrayLength is the bound range, with no declared size.
So the PR is credited by an empty merge and this test pins its case on the view the tree has: the
last byte of a constant window, read with residuals 0, 256 and 4096 on every tested profile, is
exact.
Verified: run in the merge check at the integrated tip, and with the residual's push word forced
to 0 (the read lands in the 0xEE fill) to show it is not vacuous; results in the PR report.
PR 22 (vistaero) adds a slot's biased 32-bit offset into the low word of its 64-bit base and carries
into the high word, at both direct-reach sites and in slot_address, in place of a 64-bit add of
the zero-extended offset (or of the 64-bit constant 2^31). This commit brings the bias's own doc
comment to that form and words the test's comment by structure.
Which case it was: (b). The old form was right by the specification: the biased offset is
the signed offset plus 2^31, in [0, 2^32), so UConvert's zero extension and a 64-bit add give the
address plus the offset exactly, and IAdd of the 64-bit constant 2^31 is exact. The PR reports
that AMD's Windows Vulkan driver (26.11.2, RX 6950 XT and an integrated Radeon) turned the bias
into a 64-bit immediate add that read 4 GiB below the buffer: a driver compiler fault, noted for
a repro draft. The carry form is rung 1 of the workaround ladder: one form for every device, chosen
by no query. Its 3% check (the XTX, the 5080 and the Iris Xe, arms alternated in one job) is owed
before the integrated commit is called regression-less. The lab has no AMD Windows host, so
the fault itself is built, not run: no venue.
The two subtract sites (biased_slot_address's unbiased arm and the indirect command's stored
word) subtract 2^31, which a sign-extended 32-bit immediate represents exactly. They are left
as they are: no report names them, and the PR's own run on the faulting driver passed with them.
Verified: nothing run for this commit alone (comments only); the merge check at the integrated tip
covers it.
Windows Radeon shaders reading the first byte of a bound vertex buffer read
4 GiB below its address when the unsigned 2 GiB bias became a native
64-bit immediate add. Add the offset to the low word and carry into the
high word for direct accesses and recovered slot addresses. Keep the push
layout and invalidate translations emitted under the previous semantics.
`[`write`]` on the private Format enum (from 4bcb58dbb1) names both the module's private fn write and
std's write! macro, so rustdoc under -D warnings with --document-private-items refuses it as an
ambiguous intra-doc link: CI's "Private intra-doc links" step reads metal2vulkan-devtools at 1 over
its ceiling of 0. Link the function with [`write()`].
Found by the private-doc step timed for the merge check on x86_64 Linux (job m3-max-77704:
M2V-PRIVDOC metal2vulkan-devtools 1, every other crate 0; the diagnostic in m3-max-77707).
Track the last push length and record only the changed words for a draw. Keep Managed index and slot reaches on the full draw path, and leave device-wide alias and unslotted reads to the existing post-update checks.
Verified with cargo fmt and runtime Clippy, 207 runtime unit tests with the existing CRLF-sensitive stage test skipped, and the draw-offset regression on Intel Arc B390 including a Managed copy back.
Reuse retained buffers for offset-only binds and track changed slots by stage. Patch indexed push fields and fixed-function bindings for eligible direct draws, and use full validation and filling when the draw cannot reuse them.
Verified with runtime clippy, the 207 lib tests in a temporary copy with LF in stage.rs, and the offset regression on Intel Arc B390.
Windows Radeon shaders reading the first byte of a bound vertex buffer read
4 GiB below its address when the unsigned 2 GiB bias became a native
64-bit immediate add. Add the offset to the low word and carry into the
high word for direct accesses and recovered slot addresses. Keep the push
layout and invalidate translations emitted under the previous semantics.
A shared descriptor can start before the nearest aligned binding base, so
its residual can exceed the fixed array sized from the Metal window.
Reads then leave the declared SPIR-V array despite fitting the descriptor,
corrupting macOS and iOS system icons and widgets on the UniXNU ports.
Declare eligible uniform views to cover the aligned device range limit
and bump the compiler semantics version. Extend the existing interpreter
case with residuals of 256 and 4096 for word and vec4 views.
The extended case reproduces IndexOutOfRange on unmodified development.
The correction has also restored the macOS icon atlas and widget
backgrounds in the downstream Adreno 740 device comparison.
2026-11-17 16:23:29 +08:00
1225 changed files with 140029 additions and 83024 deletions
/// `!llvm.module.flags`: `!{i32 <behavior>, !"<key>", <value>}`. The `air.max_*` limits are
/// decoded; `wchar_size`, `frame-pointer`, `SDK Version`, and debug info's `Dwarf Version` and
/// `Debug Info Version` are LLVM's and carry nothing the translation reads; `air.workaround.sampler_state_variable_length_encoding` (an `i1`) names the
/// form of the module's constexpr sampler words, which each `air.sampler_state` global's own type
/// states; any other flag is unknown.
/// decoded, and returned with whether `agx.allow_mismatched_component_counts` (an integer, 0 or
/// 1, stated at most once) is 1, which the module's vertex and mesh functions carry
/// (`EntryPoint::mismatched_component_counts`, which says what it changes). `wchar_size`,
/// `frame-pointer`, `SDK Version`, and debug info's `Dwarf Version` and `Debug Info Version` are
/// LLVM's and carry nothing the translation reads, and neither do `irc.version_major`,
/// `irc.version_minor` and `irc.version_patch` (integers), each stated once: their shapes are
/// checked and nothing is kept (a measured render pipeline linked the same whatever they state).
/// `air.workaround.sampler_state_variable_length_encoding` (an `i1`) names the form of the
/// module's constexpr sampler words, which each `air.sampler_state` global's own type states. Any
@@ -112,7 +112,7 @@ another's: a pipeline the runtime refuses on MoltenVK for a structural reason ca
lavapipe, and a global row would then fail the lavapipe run for existing. The field is held, without
case, against the venue's own description — its device name, for a CPU implementation the host's
widest vector instruction set (`llvmpipe (LLVM 23.1.4, 256 bits) on x86-64 AVX-512`, which its
compiler targets and its answers follow), then its driver and API version — so a row can name one
compiler targets), then its driver and API version — so a row can name one
device (`Apple M3 Max`), one implementation (`llvmpipe`), one host's (`on x86-64 AVX2`) or a family
of them, and a venue that joins later needs no new vocabulary. `*` means every venue, and it is the
**stronger** claim rather than the looser one: the row is then held on every venue the run selected
@@ -134,7 +134,12 @@ replaying one case does not read every other row as fixed, and a run on one venu
another venue's rows as fixed.
A row's identity is its case, the verdict it expects, the site and the answer there, so a gap that
changed into another gap at the same site is a new gap and not the old one.
changed into another gap at the same site is a new gap and not the old one. Where the hosts a venue
covers answer a site differently by a property the venue does not state, the row lists each answer
recorded there with ` | ` between them, and its gap names the run each came from: llvmpipe of one
Mesa and LLVM stores the `x3` sites of `fetch-ordered-*-srgb` at 6304 elements on one x86-64
AVX-512 host and at 6496 on others. Such a row covers each answer it lists and no other, and is
held while the run answers any of them.
For a divergence the answer says **how much** moved — how many of the site's leaves differ, and the
largest difference where the values are numbers — and never where the walk first noticed. Two
@@ -331,6 +336,7 @@ one.
| `color_write_masks` | Which channels of a texel a draw changes under a write mask of none, some and all of them | run on Metal |
| `blend_sweeps` | Every settable `MTLBlendFactor` in each of the four slots, every `MTLBlendOperation` against six factor pairs and against each other, all sixteen write masks with the blend on and off, blending enabled against disabled, the blend colour at and outside its range, and the `Source1` factors through a second fragment output | run on Metal |
| `fresh_contents` | What a new buffer or texture reads before anything writes it, and after memory that was written was released | run on Metal |
| `managed_naming` | Which commit takes a Managed buffer's named range to a second copy: a compute slot, `useResource:`, a vertex slot, a blit source and a reach through the address alone, each against a write after the name | carried; an AMD Radeon Pro 5300M's table, as the oracle keeps one copy |
| `argument_encoders` | What an argument encoder says of a layout, which word of an argument buffer each argument landed in, and what the kernel then sampled through it | run on Metal |
| `function_bindings` | What a kernel's reflection says each argument is: the binding, its subprotocol's fields, and an argument buffer's struct type member by member | run on Metal |
| `indirect_commands` | What an indirect command buffer's CPU-encoded compute and render commands ran: both dispatch kinds, ordinary and indexed draws, the resets, the barriers, an attribute stride, a stage-in region, and the descriptor properties no execution needs | run on Metal |
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 13.20",
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 4.11",
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 4.11",
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 4.11",
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 4.11",
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 11.10",
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 10.54",
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 9.22",
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 8.69",
"from":"an AMD Radeon Pro 5300M measurement under macOS 26.7.1, 8 rounds a reader (jobs 81602 and 81644), which found that a named Managed range reaches the GPU at the first commit whose encoders name the buffer, with its bytes as of that commit, and that a buffer no encoder names keeps the bytes its GPU copy last took",
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 11.59",
"instrument":240,
"times":{
"case":"managed-named-address-only",
"calls":0,
"in_calls":0,
"on_cpu":0,
"blocked":0,
"elsewhere":0,
"spend":0,
"spend_least":0,
"spend_most":0,
"stopped":"the case forbids running its Metal leg here: the oracle keeps one copy of a Managed buffer (hasUnifiedMemory true), so its run answers what one copy holds, not which commit takes a range to a second copy",
"from":"an AMD Radeon Pro 5300M measurement under macOS 26.7.1, 8 rounds a reader (jobs 81602 and 81644), which found that a named Managed range reaches the GPU at the first commit whose encoders name the buffer, with its bytes as of that commit, and that a buffer no encoder names keeps the bytes its GPU copy last took",
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 11.59",
"instrument":240,
"times":{
"case":"managed-named-blit-source",
"calls":0,
"in_calls":0,
"on_cpu":0,
"blocked":0,
"elsewhere":0,
"spend":0,
"spend_least":0,
"spend_most":0,
"stopped":"the case forbids running its Metal leg here: the oracle keeps one copy of a Managed buffer (hasUnifiedMemory true), so its run answers what one copy holds, not which commit takes a range to a second copy",
"from":"an AMD Radeon Pro 5300M measurement under macOS 26.7.1, 8 rounds a reader (jobs 81602 and 81644), which found that a named Managed range reaches the GPU at the first commit whose encoders name the buffer, with its bytes as of that commit, and that a buffer no encoder names keeps the bytes its GPU copy last took",
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 11.59",
"instrument":240,
"times":{
"case":"managed-named-compute-slot",
"calls":0,
"in_calls":0,
"on_cpu":0,
"blocked":0,
"elsewhere":0,
"spend":0,
"spend_least":0,
"spend_most":0,
"stopped":"the case forbids running its Metal leg here: the oracle keeps one copy of a Managed buffer (hasUnifiedMemory true), so its run answers what one copy holds, not which commit takes a range to a second copy",
"from":"an AMD Radeon Pro 5300M measurement under macOS 26.7.1, 8 rounds a reader (jobs 81602 and 81644), which found that a named Managed range reaches the GPU at the first commit whose encoders name the buffer, with its bytes as of that commit, and that a buffer no encoder names keeps the bytes its GPU copy last took",
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 11.59",
"instrument":240,
"times":{
"case":"managed-named-declared",
"calls":0,
"in_calls":0,
"on_cpu":0,
"blocked":0,
"elsewhere":0,
"spend":0,
"spend_least":0,
"spend_most":0,
"stopped":"the case forbids running its Metal leg here: the oracle keeps one copy of a Managed buffer (hasUnifiedMemory true), so its run answers what one copy holds, not which commit takes a range to a second copy",
"from":"an AMD Radeon Pro 5300M measurement under macOS 26.7.1, 8 rounds a reader (jobs 81602 and 81644), which found that a named Managed range reaches the GPU at the first commit whose encoders name the buffer, with its bytes as of that commit, and that a buffer no encoder names keeps the bytes its GPU copy last took",
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 11.59",
"instrument":240,
"times":{
"case":"managed-named-vertex-slot",
"calls":0,
"in_calls":0,
"on_cpu":0,
"blocked":0,
"elsewhere":0,
"spend":0,
"spend_least":0,
"spend_most":0,
"stopped":"the case forbids running its Metal leg here: the oracle keeps one copy of a Managed buffer (hasUnifiedMemory true), so its run answers what one copy holds, not which commit takes a range to a second copy",
"from":"an AMD Radeon Pro 5300M under macOS 26.7.1 (job 82284): the family's pass at 8 samples, plain and under Metal's API validation layer, one run each",
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 7.63",
"instrument":288,
"times":{
"case":"sample-positions-8x-custom-left",
"calls":0,
"in_calls":0,
"on_cpu":0,
"blocked":0,
"elsewhere":0,
"spend":0,
"spend_least":0,
"spend_most":0,
"stopped":"the case forbids running its Metal leg here: the oracle renders no 8 samples (an Apple M3 Max answers supportsTextureSampleCount: no for 8), so a record run there must not encode an 8-sample texture",
"from":"an AMD Radeon Pro 5300M under macOS 26.7.1 (job 82284): the family's pass at 8 samples, plain and under Metal's API validation layer, one run each",
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 7.63",
"instrument":288,
"times":{
"case":"sample-positions-8x-custom-mixed",
"calls":0,
"in_calls":0,
"on_cpu":0,
"blocked":0,
"elsewhere":0,
"spend":0,
"spend_least":0,
"spend_most":0,
"stopped":"the case forbids running its Metal leg here: the oracle renders no 8 samples (an Apple M3 Max answers supportsTextureSampleCount: no for 8), so a record run there must not encode an 8-sample texture",
"from":"an AMD Radeon Pro 5300M under macOS 26.7.1 (job 82284): the family's pass at 8 samples, plain and under Metal's API validation layer, one run each",
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 7.63",
"instrument":288,
"times":{
"case":"sample-positions-8x-default",
"calls":0,
"in_calls":0,
"on_cpu":0,
"blocked":0,
"elsewhere":0,
"spend":0,
"spend_least":0,
"spend_most":0,
"stopped":"the case forbids running its Metal leg here: the oracle renders no 8 samples (an Apple M3 Max answers supportsTextureSampleCount: no for 8), so a record run there must not encode an 8-sample texture",
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 12.22",
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 12.22",
"measured":"8 round(s) of the whole selection, in the case set's own order; a figure is the median of the rounds' own medians; Metal's leg ran at a one-minute load average of 10.89",
/// The layout covers every texel and names the texel as its row, so a diff over 256 texels
/// says which one moved.
#[test]
fnthe_texel_layout_names_the_texel(){
letlayout=texel_layout();
letlayout=texel_layout(TEXELS);
assert_eq!(layout.extent(),TEXELS*16);
assert_eq!(layout.at(0,255,3),255*16+12);
}
Loaded 100 of 1225 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.