What: driver_facts::DEVIATIONS gains MetalSmallFloatNans for MESA_LLVMPIPE (every
CPU). A half or float texel's write that may reach an RG11B10Float storage image
on lavapipe then records no DeviceNanEncoding for it and requires
VkProperty::MetalSmallFloatNans, as on MoltenVK's Apple9 identity. Two lane tests
measure the deviation on every venue and gate it where a driver is listed:
half_storage_writes::every_nan_a_kernel_writes_to_a_small_float_texture_is_metal_s_where_measured
(32,766 float NaNs: every top-13 payload pattern, low bits clear and set, both
signs; write, read_write, texture buffer and argument buffer forms) and
half_write_nans::every_half_nan_written_to_a_small_float_texture_is_metal_s_where_measured
(all 2,046 half NaNs; write, read_write, held). Each requires every NaN field
Metal's canonical one and no device-nan-encoding where the profile takes the
deviation, and device-nan-encoding where any field differs elsewhere. half_write_nans'
stored() takes its texels. The existing half_write_nans lane's measured branch
no longer requires native-nan-encoding absent where the device's widening is
unmeasured (no MetalNanMoves): that note is the kernel making's, for its widening of
the half whatever texture it writes, and a 32-bit float store shows it.
Why: lavapipe announced device-nan-encoding on every RG11B10Float half write of
runtime_lane::half_write_nans (write, read_write and held) with 0 of 25 lanes
differing from Metal's (msi, Mesa 26.2.4, LLVM 23.1.1, at 7d7085f9d0), and the
conformance case half-write-nans-rg11b10f differed only in its notices. The note
fires because the profile lacked the deviation, not because the store differs:
llvmpipe packs a small float in its shader code and writes every NaN as the
field's quiet NaN with its sign dropped, which is Metal's. RADV and NVIDIA keep
payload bits, so they stay unlisted. No SEMANTICS_VERSION bump: the deviation is
an enabled property the profile fingerprint hashes, so lavapipe's keys change
(golden_hashes' lavapipe cells re-key; re-blessed on development).
Test that fails without it: device::tests::driver_facts::
the_profile_takes_the_deviations_its_driver_is_measured_with now expects
MetalSmallFloatNans on lavapipe, gate-lavapipe and gate-lavapipe-x86_64.
Verified: the lavapipe, PHOENIX and M3 runs in the branch's report.
930e3aa49e made a pooled block of images a sixteenth larger than every other
pool's (68 MiB, IMAGE_BLOCK_SLACK), so that four images of a quarter block
fit in one past the driver's metadata. On the consumer's 780M scroll gate
those blocks were pin 36's regression against pin 30. Pin 36 with images'
blocks at BLOCK_BYTES (probe e674b9c87d) matched pin 30 over 4 + 4 boots in
ABBA BAAB order (um870 Hawk Point 780M, x86 macOS 12.7.6 guest, page scroll,
job m3-max-13952): rAF gaps of 100 ms or more 8 against 8, of 50 ms or more
22 against 24, presents 29.0/s against 29.3/s; its ready thread made 72 blocks
of 64 MiB a boot and none of 68 MiB.
Every pooled block is now Memory::block_bytes: IMAGE_BLOCK_SLACK,
Memory::image_block_bytes, BlockMaker::image_block_bytes and the two
pooled_bytes lookups that existed only to tell images apart go; their callers
read block_bytes.
tests::blocks_ahead: the packing test now holds that a pool of images' blocks
are BLOCK_BYTES (fails at 68 MiB) and that textures pack as many to a block
as the driver's own placed bytes and alignment fit (three 2048x2048 RGBA8 on
RADV and ANV, four on lavapipe), instead of four to a block.
docs/FAST-PATHS.md: the NVIDIA, blocks-ahead and RADV plain-blocks rows say
64 MiB for images too, with the scroll A/B above.
Owed on development: RUNTIME_VERSION and the pin (block sizes change what a
run allocates), and the cost records of the two cases whose
device_memory_allocated read 71303168 (shared-creator-extended-range-samples,
shared-creator-padded-format-storage) at the next whole-set re-bless.
What: on a driver whose compiler loses a simdgroup's texture writes after an `optnone` call that
only its helper invocations make (DriverWorkaround::DiscardDropsSimdgroupStores: MoltenVK on an
Apple GPU), a call the helper guard cannot keep the helpers away from exactly (an arm with a
derivative or subgroup operation, a loop the helpers repeat alone) and that no tangled
instruction reading its result follows was left as it was, with
PrecisionNote::HelperBranchDropsSimdgroupStores recorded. Now spirv::helper_branches fences each
such call: an OpGroupNonUniformShuffle of its result at SubgroupLocalInvocationId (a
MulExtended's structure member by member, put together again) follows it, and every use reads
the shuffled value. Each invocation, a helper too, reads its own lane, so no answer changes and
no lane reads another's; the shuffle is the simdgroup operation after the call, reading what it
computes, that the M4 probe found keeps the writes. The fences are placed once every analysis of
the module has run (compile.rs, before the verifier): those analyses would read a shuffle as a
move between lanes.
- guard_for returns the Fences beside Guarded (Guarded::fences counts them); plan lists every
bare call (Facts::bare, which any_bare was) and no longer stops at the first function with one.
- The census names the fences `fragment.helper-fence`; the runtime's pipeline creation log
prints `helper-fence <stage>`.
- The note stays where no shuffle can follow: no fragment-stage subgroup shuffle on the profile,
or a 64-bit or bool lane, or an 8- or 16-bit one without shaderSubgroupExtendedTypes.
Why: the weather widget's glass edges in the 27.0.1 guest on the M3 draw white 8x4-pixel blocks
along the primitive's edges (solid strips in some boots, a comb in others, at every pin since 30),
and the guest's run announces helper-branch-drops-simdgroup-stores for a fragment function.
Tests: engine_fragment's helper guard tests (rch_helper_branch_loop and rch_helper_tangle's
`before` and `unread` functions fenced, census and shuffles counted, no note, L3), a new test that
the note stays with the fragment shuffle taken out of the profile, and the runtime lane
helper_tangle, which now requires the fence and no lost write where the fragment stage shuffles.
SEMANTICS_VERSION 2021.
Verified: cargo fmt; the build, the touched tests and the M3 lane follow.
Replayed on lavapipe (llvmpipe, LLVM 23.1.4, homelab-um790-xtx-1, job
m3-max-13976), both policies: case/out differs in 24 elements, the largest
difference 27, and nothing else in the case. The 24 are the four slots of the
six far draws at strides 4 and 12, the layouts the runtime leaves to the
device's fixed-function vertex input. The first differs at byte 32 (Metal 0,
ours 0x10, word 0: element 2^30 at stride 4, displacement 2^32 read mod 2^32),
and 27 is word 11 (0x1b), element WRAP_12 + 3 at 2^32 + 44 read at byte 44. The
pulled stride-6 draws read zero as Metal does. llvmpipe reports
robustBufferAccess2 (vulkaninfo in job m3-max-14015), under which a vertex input
past the bound range reads zero, so the wrapped word is lavapipe's own fetch.
The same case replays exact on RADV (AMD Radeon 780M, RADV PHOENIX, job
m3-max-14015) and on MoltenVK on the M3 Max (m3-max-13932), under both policies.
The row is scoped to llvmpipe and names what is open on our side: pulling an
attribute whose draw may fetch past 2^32 bytes of its bind offset on a device
whose fixed-function input wraps, which no device check finds today.
docs/CONFORMANCE-COVERAGE.md counts the row (3584 ledger rows).
Verified: coverage.py --check "as derived" locally; the Linux conformance suite
and the lavapipe replay of the case at this tip.
scripts/conformance-coverage/coverage.py over the tree with the case's
recording: 1277 committed recordings, 853 cases running a committed shader
fixture, 1193 metal_run answers, and vertex_fetch_reach's row reads one case,
one recording, 110 compared fields. The other rows move only where the
module joins the lists of families that call an item.
Verified: coverage.py --check reads "as derived" at this commit (locally);
the_case_set_is_the_recordings_the_document_counted in the Linux
conformance suite at this tip.
GPU work now runs under the cluster scheduler's exclusive GPU hold, which already gives a job
the GPU to itself, so the repo's own cross-process GPU locks only duplicated it.
- vulkan_batch: delete run_lock.rs, the ~/.cache/m2v-gpu/run.lock + run.turn flock that made
GPU batches on one host take turns run by run, and its two tests. A GPU batch already runs
one executor at a time (it refuses jobs != 1), and it still reads the hang tripwire before
every run and writes it on a hang; the tripwire is a stop, not a lock, and stays.
- scripts/device-lane: drop --wrap, which existed to put each shard under a host GPU lock and a
memory cap; the report's "wrapped" column and totals become the run's.
- docs/VALIDATION.md: the device-lane section says to run it under the host's exclusive GPU
hold instead of a --wrap lock.
- Comments that told the reader to run probes under `maclock` or spoke of "the Mac's GPU lock"
now say the run has the GPU to itself (Metal probes, recording.rs, stage-input-split, two
runtime test modules, which are outside the runtime-sources pin).
Checked on a Linux node before landing: cargo clippy -p metal2vulkan-validation --all-targets
--all-features (plain and --cfg m2v_gpu) -D warnings, the vulkan_batch tests, and the
runtime-sources guard (the pin is unchanged).
What: on the owner's word (11-10 ~06:35, "stop tests, merge as-is into development"), with no further check:
- steelbrain/triage-c (8): the vertex_fetch_reach fixture, its AIR and the conformance case
vertex-fetch-past-4gib-small-buffer (no Metal recording or cost record yet); InstanceShadows::holds by binary
search; the GPU-fault lane prints its notices; the color-groups lane's four-color option
(DeviceOptions::color_attachment_limit, doc-hidden) in place of the profiles layer, and the dropped re-exports.
- steelbrain/triage-a-720 (2, marked WIP/UNVERIFIED by their author): merge verdicts recorded only clear of load
and repeated (CHECK_VERSION 6); the paths test's relay condition.
RUNTIME_VERSION 2015 -> 2016; the pin and docs/CONFORMANCE-COVERAGE.md follow.
Known state: the vertex-fetch case lacks its Metal recording and cost record; 720's after-fix counts never ran.
Not in pin 36 (ef7af82fe4). Verified here: pin-compute, generators, api-signatures --check clean only.
What: a `half` texel's write to a heap element recorded `PrecisionNote::DeviceNanEncoding`
unconditionally ("a heap element may be any format"), so on MoltenVK on the M3 Max a write
through an argument buffer into an RGBA32Float or RG11B10Float texture announced the note
though the store is Metal's there (0 of 25 lanes differ, job 13458's lanes128.log). A new key,
`SpecKey::HeapNanFamilies(Stage)`, gives from the command's heap members the families whose
texels may hold a NaN a `half` write stores (`lower::texture::nan_family`, the same classes
the slot path tests of a bound format: 1 a 16-bit float format, 2 a 32-bit one, 4 a packed
small float one, 8 a float format of none of those; normalized, sRGB, extended-range,
integer and stencil formats none). `half_write_nans` now records the heap write's note under
one clause per family whose deviation the profile lacks (`MetalHalfTexelWrites`,
`MetalNanMoves`, `MetalSmallFloatNans`) and the no-family bit, requiring the property of each
family it takes, as a slot's write does.
Measured, before the change (`runtime_lane::half_write_nans`, argument-buffer writes):
- M3 Max, MoltenVK (job 13458): 16-bit float formats 15 of 25 lanes differ (signalling NaNs
stored 0x7e00); 32-bit float and RG11B10Float 0 differ. The note now holds there only where
the heap can name a 16-bit float texture (or one of no family).
- lavapipe (job 13553): 16-bit 8 differ, 32-bit 15 differ, RG11B10Float 0 differ. lavapipe
takes none of the three deviations, so its note keeps every family's clause.
Runtime: `degrade_bound_values` reads the clause at each draw or dispatch (generic; no
runtime code changed). The lane `half_write_nans` now holds argument-buffer writes to the
measured rule as it holds slot writes: on a device with the family's property, 0 lanes differ
and nothing is announced.
Public API: `SpecKey` gains `HeapNanFamilies(Stage)` (a `#[non_exhaustive]` enum; no
consumer breaks); api_signatures.tsv blessed.
Tests: heap::a_heap_half_write_s_nan_note_follows_the_families_its_command_can_name (the
clauses and required properties on every committed profile with a heap; plan values 1/2/4/0
for R16Float, RGBA32Float, RG11B10Float, RGBA8Unorm and R32Uint residents and the note held
under them).
SEMANTICS_VERSION 2019, ARTIFACT_FORMAT_VERSION 500 (a SpecKey tag; both renumbered at
landing).
(cherry picked from commit 8f6f24055459c9143f3473da8ab60e6532b30676)
What: half_texels' clause for a sample of a 32-bit float texel (Bound & BicubicTexels::LINEAR,
'Metal rounds toward zero, saturating') is no longer added on a profile that takes
DriverDeviation::MetalHalfConversion; the module then requires VkProperty::MetalHalfConversion
(TexturePlan::storage_properties), as half_texel_nans' NaN clauses do since 782da3582b. Elsewhere
the clause stays. The unmeasured-class and 16-bit normalized clauses are unchanged.
Why: on MoltenVK over the M3 Max a half sample of RGBX32Float through a runtime sampler (the
consumer's rgbx_sample_half) announced half-texel-conversion ('where it binds texture 0 bound as
RGBX32Float') while every value was Metal's. The deviation's measurement covers the half result
of a read, sample and gather of every float word of RGBA32Float (half-texel-nans-rgba32f,
m3-max-13447: every value Metal's), and RGBX32Float is held in that twin.
Test: runtime_lane::rgbx_textures::rgbx_half_samples_are_metals (the previous commit): nearest and
linear runtime samplers, edge and border, shared and private, RGBX32Float and RGBA32Float; on a
profile of MetalSampler and MetalHalfConversion no half-texel-conversion may be announced.
Docs: the note's rustdoc and API.md's catalogue entry. SEMANTICS_VERSION 2019.
Verified: the M3 run of the control and of this commit follows.
(cherry picked from commit bb5662fd6d9bb512bc8d185c85a5d7098b1f2d9d)
What: remove "Blocks filled exportable first". The device computes no fill types;
Memory::fill_plain_blocks and its state, Fills, the FILL_* constants, the fill branch of
BlockMaker::make_as and BlockMaker::fill_first, Block::filled and Fill go, with the
public counters WorkCounts::plain_block_fills_saved, plain_block_fills_missed and
plain_block_fills_skipped (api_signatures.tsv re-blessed), tests::block_fills, the Fills
unit test, the fill parts of memory/making_parts.rs and the reclaim bench's unfilled arms
and fill printouts. DriverFact::PlainAllocationsHoldSubmissions stays as a measured fact;
its docs say the runtime makes such blocks by their own allocation on every driver.
docs/FAST-PATHS.md drops the fill's row; the plain-makings-hold-submissions known gap says
the runtime does not fill first and why.
Why: on the Radeon 780M most fills miss under memory pressure (saved/missed per scroll
1/7, 7/20, 2/7, 2/8), so the kernel compacts order-9 pages for both the fill and the
block. The consumer's scroll gate traces: all 11 rAF gaps of 100 ms or more overlap one
ready-thread direct-compaction episode of 46-164 ms inside one block making; on pin 35, 6
of 9 gaps sit in a fill making (68M+68M makes, 134-162 ms of compaction), most of it
between the fill's free and the block's create. Their no-fill A/B (fill_plain_blocks(0)):
0 gaps of 100 ms or more, against pin 30's 6 and pin 33's 11.
Verified here: scripts/api-signatures/signatures.py --check passes after --bless (only the
three counters left the table); refusal_surface.py regenerated docs/REFUSALS.md unchanged;
cargo fmt --all. Builds, clippy, rustdoc and the runtime's memory tests run on potluck
after this commit.
(cherry picked from commit c11bf907bced149e81301c6319d3fab1d615061c)
A layer that answers as Metal does needs to know, per refused pipeline, whether Metal returns nil
with an NSError or its descriptor validation asserts and ends the process. ColorAttachment now
carries `metal: MetalAnswer` (NilWithError | EndsProcess), set at each of its 17 sites from plain
Metal's answer on an Apple M3 Max under macOS 27.0.1 (probes/color_attachment_answers.m, no
MTL_DEBUG_LAYER, job m3-max-13738):
- EndsProcess (SIGABRT, "Render Pipeline Descriptor Validation"): blending on a bfloat attachment,
with a function, a fetching function or none ("... MTLPixelFormatRGBA16Bfloat for this render
target is not blendable."); alpha to coverage over an integer attachment 0, rasterizing or not
("... alphaToCoverageEnabled requires a float/unorm pixel format ..."). The link's doc said the
second was unmeasured with rasterization off; it is measured now.
- NilWithError (code 3, domain AGXMetalG15X_M1): an output of another numeric class (half4, float4
and int4 into RGBA8Uint; uint4 into RGBA8Unorm and RGBA8Sint; a fetching uint4 of RGBA8Unorm);
a color input of another class (uint4 of RGBA8Unorm, BGR10_XR, A8Unorm); fewer output components
than channels (with and without fetch); a blend of the second source without the second output,
or without the first (with and without fetch); a color input without an attachment; a tile
function's imageblock member without a format ("Invalid pixel format for render target 1").
- A `Compiled` tile function compiled under another format than the descriptor's has no Metal
counterpart (Metal compiles the function for its pipeline) and answers EndsProcess, the answer
of an unmeasured case; under no format it answers Metal's NilWithError.
Public API: the new `error::MetalAnswer` and the changed variant are in api_signatures.tsv and the
api_surface table. Refusals are not serialized in any cache, and translation output is unchanged,
so neither ARTIFACT_FORMAT_VERSION nor SEMANTICS_VERSION moves. docs/REFUSALS.md regenerates
unchanged (descriptor errors are not in it). docs/API.md states the two answers.
Tests: each existing test of a ColorAttachment refusal now names its answer (bfloat blends,
alpha to coverage, a tile function compiled for other formats: EndsProcess; output class and
components, the second source, unattached inputs, unformatted tile members: NilWithError), and a
new unit test holds the storage form's class refusal to NilWithError for reads and writes.
(cherry picked from commit cd17476e5a4ae2b9fbf8118453ad089691adaba2)
The known gap now counts command buffers begun (barrier command buffers took blocks too), names
the passes that still take a secondary, the 2,048 planned barrier command buffers a batch begins
at most, and what ms01's Iris Xe (Mesa 26.2.6) measured: 10,000 passes beside a cleared depth in
one command buffer run in 12,049 command buffers (tests::many_passes); passes inline encode to
16,173; passes with a secondary fail at the end of the 8,087th; with the targets' first clears in
the submission 14,000 passes ran and 14,300 crashed in the driver, recorded as the open part.
Verified: the numbers are the probe runs' (jobs m3-max-13726, -13731, -13643).
(cherry picked from commit 67f1d8710d78adf21768002c82a86e739721e271)
The Adaptive long mark read a command buffer's own GPU timestamps alone. A batch that waits on the
GPU for another VkQueue's work (an MTLEvent's signal pending there, the tracker's wait for another
VkQueue's writes, new resources' first work there) writes its start timestamp only once that wait
is met, so a queue of short command buffers, each waiting for another queue's 30 ms one, never went
long: it kept sharing its VkQueue, and every command buffer the queues sharing it committed behind
each wait waited for the other queue's whole long command buffer.
Now submit_batch notes, at the first batch whose VkQueue it hands such a wait (an event wait whose
signal is pending on another VkQueue or is the caller's, EventTimeline::waits_across; a tracker or
first-work wait on another VkQueue), the host time its submission was called (Times::waited_across).
place_gpu_times marks the queue long also where more than LONG_HEAD ran from then to the command
buffer's GPU end, placed in the host's time. A command buffer with no such wait is timed as before,
by its own timestamps, so the host-view false marks the module docs describe stay out.
The device test a_compositor_beside_a_queue_waiting_on_the_gpu_for_long_work_keeps_its_latency now
also asserts that the waiting queue goes long (WorkCounts::queues_gone_long >= 2). The QueueSharing
notice's cost, docs/API.md's catalogue entry and the FAST-PATHS row name the wait.
Verified: cargo fmt; unit test a_wait_crosses_queues_where_its_signal_is_pending_on_another; the
build, clippy and the 5080 device run are dispatched.
(cherry picked from commit 6391625634472fb158b6477dfad36340956ae2dd)
What: a heap sample the function emulates (`sampler::heap_raw`) recorded
`PrecisionNote::BicubicFilterArithmetic` whatever the command's heap held: unconditionally
through a constexpr linear sampler, and under the bound sampler's word through a runtime
slot. A command whose heap holds no raw texture samples through the device's own sampler,
and a bfloat form's sample reads the nearest texel, so neither filters by the device's
arithmetic. `SpecKey::HeapRawTextures`' value now carries two bits, which the plan gives
from the command's heap members (`slots::heap_raw`): `heap_raw::HELD` (1, a raw-held
texture: the decode's `DevicePackConversion`, unchanged) and `heap_raw::FILTERED` (2, a
raw-held texture of a form the function filters: not a bfloat one). The filter note's
clauses each test `FILTERED` (beside the bound word's test through a runtime slot).
Runtime: `degrade_bound_values` reads the clause at each draw or dispatch, so a command
whose heap holds only RGBA8Unorm or RGBA16Bfloat textures no longer announces
bicubic-filter-arithmetic for a linear heap sample; one holding a BGRA10XR texture still
does. No runtime code changed (the path is generic).
Tests: heap::a_heap_sample_s_filter_note_follows_the_raw_texture_and_the_bound_sampler_word
(artifact clauses on every committed profile), heap::a_heap_sample_s_filter_note_holds_where_its_command_can_name_a_filtered_raw_texture
(plan values 3/1/0 and the notes bound under them), the decode-note plan test's values
(3 for BGRA10XR, 1 for RGBA16Bfloat), engine_sampler's argument-buffer stage check, and the
lane heap_extended_reads::a_heap_sample_s_filter_note_is_announced_where_its_command_can_name_a_filtered_raw_texture.
Docs: SpecKey::HeapRawTextures, the note's rustdoc, API.md.
SEMANTICS_VERSION 2018 (renumbered at landing).
(cherry picked from commit dbc8a2781ef6170f797d5b7a7a83b46264c5e4e2)
What: a Metal 4.1 read(sampler, ...) of a texture held in an argument buffer now hands back
Metal's border texel of the resident texture, its pixel format's through its swizzle, for every
sampler: a constexpr one of any border colour, a runtime [[sampler(n)]] and an argument buffer's
sampler (the colour from the sampler's word).
- The binder writes each texture's border texels (metal::sampler::border_texels of its format
and swizzle, the layout of a slot's BorderTexels specialization) in its handle-table entry's
flags, bits 3 to 14 (memory::handles::FLAG_BORDER_TEXELS); handle_entry_flags carries them, so
a consumer's own table of every ID gets them too.
- A module with such a read searches the table in a new indexed form (Lookup::Indexed): the
handle is the element with the found entry's index in its top 16 bits (HANDLE_ENTRY). The read
loads the entry's border texels by it (handles::border_texels); every use that reads another of
the entry's flags (texel class, red-blue order, out-of-bounds alpha) loads them from the entry
into the flagged handle's layout (handles::flagged_handle), through one typed value
(texture::emit::HeapFlags) so no reader sees the entry index in those bits.
- through::finish selects the border texel for slots and heap elements alike; a heap member read
by its raw texels (an extended-range form) takes its border and its zero past the level or
layer from its own image's addressing inside the raw arm, not the float array's neutral's.
- The old heap path, which selected the out-of-bounds texel (transparent black, unswizzled) and
refused every other border colour and runtime sampler NotImplemented(ArgumentBufferTextures),
is gone, with ReadSampler::transparent and the forced alpha flag of such reads.
Why: the M3 runs all three (conformance cases read-through-heap-border, read-through-heap-sampler,
and read-through-rgba8-swizzled's rt_heap_zero, where (G, R, 1, 0) reads (0, 0, 1, 0) past the
edge and we read (0, 0, 0, 0)). A 32-bit heap handle had no room for 12 border bits beside the
element, class, red-blue and alpha fields; the entry does (bits 3 to 14 were unused).
SEMANTICS_VERSION 2017 (translation output changes). ARTIFACT_FORMAT_VERSION unchanged: no
encoded type changed. RUNTIME (for the orchestrator's bump): the runtime's handle tables
(heap_sets.rs, through bind::handle_entry_flags) now carry the border-texel bits.
Ledger: the three rows of these gaps go; llvmpipe's rt_heap_zero row of the swizzled case keeps
only llvmpipe's 8-bit unorm conversion. FAST-PATHS known gap removed; REFUSALS.md,
CONFORMANCE-COVERAGE.md regenerated (METAL-COVERAGE.md unchanged).
Verified: not yet built (next: Linux build, clippy and the touched tests).
(cherry picked from commit bc000fa475e572131248b908541dbe29f1f5996c)
The llvmpipe 3D mirror rows' text and the RADV row of pass-bytes-srgb-decode-all-bytes
(the two commits before this one) change what the coverage document derives.
Verified: scripts/conformance-coverage/coverage.py regenerated it.
coverage.py's SDK line still said the macOS 27.0 SDK (Xcode 27.0, 27A266a),
while the M3 has Xcode 27.2 (27B52) and its MacOSX27.2.sdk; the generated
enum tables already name 27.2. The table needed no row change: on the M3,
coverage.py --sdk against MacOSX27.2.sdk answered 'coverage.tsv names every
SDK item (2135)', rc 0 (potluck job m3-max-13567). docs/METAL-COVERAGE.md
regenerated (coverage.py), coverage.py --check current.
(cherry picked from commit ca8424427caaa8636587eb5593e7b91b68afe9b1)
The XTX's first get_bytes after the GPU idled into runtime suspend took 4.7 to
5.2 s. A run decides whose that is: any first submission after the suspend
pays it, so it is the kernel's resume of the device, not our staging queue.
tests::cpu_copy_times gains an ignored measurement, run by name: per size
(1920 x 1080 in a pooled block, 4096 x 4096 in a block of its own) it makes a
Shared BGRA8Unorm texture, copies it awake once, then for three sequences,
each twice, waits for the PCI function's power/runtime_status to read
suspended and times each step: replace_region then get_bytes; get_bytes then
replace_region; a fill command buffer on the program's queue (commit timed
apart from its wait) then both copies. It prints the status after each step
and the staging submissions made.
Evidence, RX 7900 XTX on gem10 (Mesa 26.2.6, autosuspend delay 5000 ms),
job m3-max-13545, two runs, 24 suspends:
- the program queue's command buffer: commit 0.12 to 0.52 ms, its wait 4.83
to 4.86 s;
- the staging queue: replace_region returned in its awake time (0.48 to 12.74
ms at 1080p, 5.02 to 5.58 ms at 4096^2) with the device still suspended,
and the get_bytes after it, the first staging submission, took 4.73 to
4.79 s; get_bytes first took 4.76 to 4.88 s;
- after the command buffer woke the device, get_bytes took 3.2 to 4.0 ms
(1080p) and 18.7 to 20.8 ms (4096^2).
The kernel's log of the run's last resume: SMU resumed at :09, "Wait for DMUB
auto-load failed" at :10, 16 "DMCUB error" lines to :13, "Cannot find any crtc
or sizes", then the rings: the card has no display attached.
Paying it ahead off the caller's path: a commit already hands its batches to
the scheduler thread and returns in under a millisecond, so only a wait or a
synchronous read waits. A wake started when a replace_region queues its copy
would win only the time between that call and the next submission (none in
the measured sequences) against a 4.8 s resume, and the program's queue and
the staging queue pay alike, so no queue choice avoids it. A keep-alive is
out. No runtime change.
docs/FAST-PATHS.md's known gap is rewritten with these numbers; its 86 ms
and 73 ms first replace_region of the host path no longer apply on the XTX,
whose Shared textures copy on the staging queue (replace_region now
returns in its awake time after a suspend).
(cherry picked from commit 112b405a9167666407ae15cd08b7bdf76d09d038)
What: a sample of an extended-range or padded texture that the module filters itself
(`sampler::extended`, through the slot's variant, and `sampler::heap_raw`, through an
argument buffer's raw element) recorded `PrecisionNote::BicubicFilterArithmetic`
unconditionally through a runtime sampler slot. It is now specialized on the word of the
sampler bound at that slot (`NoteOn::BoundSampler`, `SpecKey::BoundSamplerWord`), with the
two tests `linear::filtering_word` gives, as the YCbCr filter note does: a linear
minification or magnification filter, anisotropy or a cubic filter (any of those bits), or
a linear mip filter. The level blend of a word-stated mip filter holds on the linear mip
test alone. A constexpr sampler keeps its rule (linear: unconditional; nearest: none).
Runtime: the clauses test a bound value, so `Device::degrade_bound_values` reads them at
each draw or dispatch of the variant (no runtime code changes: the path is generic, and
`slots::record_noted` already records the word for a noted key). A nearest runtime sampler
over such a texture no longer announces bicubic-filter-arithmetic; a filtering one still
does.
Why: a nearest sample is the decoded texel at Metal's position (no filter arithmetic), yet
it announced the note, so the conformance suite's nearest cases
(`rgb10a2-srgb-samples-nearest-*`, the eight `xr-two-plane-samples-*-n*-*`) declared it.
Tests: engine_extended_range::samples::a_runtime_sampler_s_filter_note_holds_only_where_the_bound_word_filters
(every form, half and float, runtime / constexpr linear / constexpr nearest, on lavapipe,
moltenvk-m3 and the RTX 5080 profile: clauses hold for linear, linear min, linear mag,
linear mip, anisotropic and cubic words, not for nearest or nearest-mip ones; bfloat forms
record none) and heap::a_heap_sample_s_filter_note_follows_the_bound_sampler_word. The
rgb10a2_srgb lane now checks its nearest samples announce no filter note. The conformance
allowances of the rgb10a2 sRGB and two-plane sample cases name the note for the linear
cases only. Docs: the note's rustdoc and API.md's catalogue entry.
SEMANTICS_VERSION 2016: an artifact's notes change.
(cherry picked from commit fd5212bee216b823ba18d3c5ba5e5a74a4b12073)
What: on a device that samples through Metal's own texture unit (MoltenVK), a texture slot a
function converts to `half` declares SpecKey::PlainHalfTexels and SpecKey::UnmeasuredTexels.
The general form (render/residual.rs) zeroed both, so a state's creation made its predicted
key's general form (the class routine's arm, PlainHalfTexels 0) and handed the predicted key
itself (the plain arm, 1, as an unbound slot takes) to the pool right after. Every draw of a
plain class takes the predicted key, so the general form served a draw only while the
predicted key was still being made; the conformance cases render-then-sample-magnified-nearest
and -linear made it and no draw took it (cost.rs named it an open bug). PlainHalfTexels is no
longer a constant of the general form: a key keeps the plain arm its binding gives it. The
predicted key is now its own general form, and the creation makes that one pipeline.
What still takes a general form: a draw binding a class whose `half` conversion is not
measured (BC4 to BC7, the linear ASTC formats) keys UnmeasuredTexels 1, which no instruction
reads; its general form is the predicted key, made at creation, so it draws at once and runs
its own key's instructions while its own is made on the pool, as before. A draw binding a
YCbCr field on the grid 8192 (PlainHalfTexels 0) makes its own key at its draw, as any key the
creation did not predict; on a device whose memory is the host's such a slot reads its planes
in place in a variant of its own (VariantKey::ycbcr_in_place), which no creation predicts
either.
Tests: tests::general_form now expects the plain arm kept ([1,1,1,5,3] -> [0,1,0,5,3], an
unmeasured plain class's key -> the predicted key, a YCbCr class keeps the routine's arm); the
made_at_creation lane expects one making at creation on every device (it expected two on
Metal-sampler devices) and the unmeasured-class draw to take the predicted key as its general
form; ycbcr_textures' and runtime_lane's comments follow. Docs: residual.rs, predicted.rs,
WorkCounts::residual_form_draws, API.md's general-form bullet, and cost.rs's open-bug
paragraph (the recordings read 3 made until the rows' next measurement; WASTED_BY_CLASS's
draws ceiling can then drop by 2).
Verified on the M3 Max (MoltenVK 1.4.2), the same diff at 3e0db77c6f over 6f7bb169d2:
- conformance cost --runs 8 --show, each case, in order and alone (jobs m3-max-13511,
13518): render-then-sample-magnified-nearest and -linear read creation_pipelines_made 2,
creation_render_pipelines_made 2, variant_pipelines_made 2 (the record holds 3 of each),
creation_pipelines_drawn 2 (the record's 2): the pipeline no draw took is gone, every
pipeline made is drawn.
- conformance replay, the whole set (70 s): exit 0, "the 391 row(s) above are exactly the
open gaps known-gaps.tsv expects on this venue": no case's answers moved.
- 77 touched tests under --cfg m2v_gpu passed: made_at_creation, ycbcr_textures' creation-made
slot, pipeline_creation's pool draws, draw_work, general_form, uniform_bind_offsets,
draw_again, draw_shape_notices.
(cherry picked from commit 56ddedfc3498c9376384a3ad4b57e7607d78594a)
Regenerated by scripts/conformance-coverage/coverage.py in job m3-max-13466 at 94a89c5273
(gem10, lavapipe cfg): two more recordings (1265), 23 more ledger rows (3484), and the
blit_encoder_commands family's case count (11). The conformance crate's tests passed against
it there (1050 of 1050).
(cherry picked from commit 0bbbd5f379db297f84df60b129b15a4e6e1222d5)
On MoltenVK on the M3 Max (m3-max-13447, default policy) half-texel-nans-r32f, -rgba32f,
-rg11b10f and -rgb9e5f answered every value as Metal does and still announced
device-nan-encoding; runtime_lane::half_texel_nans read 0 differing half lanes. The profile takes
DriverDeviation::MetalHalfConversion, whose measurement covers the half result of a read, sample
and gather of every float word of RGBA32Float (NaNs among them) and 16,384 random words each of
RG11B10Float and RGB9E5Float.
half_texel_nans now records DeviceNanEncoding on such a profile only where the bound class is a
half-float one (packed field 0) or of no family, and requires VkProperty::MetalHalfConversion;
elsewhere it keeps the one clause of TexelFormat::NAN_FREE. The 16-bit float formats keep the
note: no deviation records their NaN payloads as measured.
Test: engine_texture's half-read test checks both forms per committed profile (clauses, formats
that hold, the property) and that a profile of the deviation ran. Docs: the note's rustdoc,
API.md's exemptions, the storage_properties doc. Under the branch's SEMANTICS_VERSION (2015).
(cherry picked from commit b03555f8c9f05e382f744593cfaa01f2dc3bbb20)
Metal's answers here depend on what its compiler compiled before, which it keeps across processes
keyed on the function's AIR. With the probe's salt now in the AIR (d49370d732), an M3 Max under
macOS 27.0.1 answered, twice over, each sequence one fresh salt (m3-max-13430):
- required-object-32-max-64: refused on a first compile ("Kernel specified max total threads per
threadgroup (32) must match compute pipeline specified max total threads per threadgroup (64)"),
refused again, and again after required-object-32x2 or plain; made only after
required-object-64-max-64. required-mesh-32-max-64 the same, made only after
required-mesh-64-max-64. The object stage was made here because an earlier compile let it be.
- A required size gives its stage its threads on a first compile: required-object-32x2 answers an
object maximum of 64 (we answered 1024), required-mesh-16x2 a mesh maximum of 32, and a
required 32 beside a function's [[max_total_threads_per_threadgroup(64)]] 32 in either stage.
So the object stage now refuses a required size of other threads than its maximum
(MaxThreadsDiffer { stage: Object }), as the mesh stage already did, and each stage's thread
limit is the least of the descriptor's maximum, the function's, the required size's threads and
1024. RUNTIME behaviour: new_mesh_render_pipeline_state refuses an object maximum beside a
required object size of other threads, and maxTotalThreadsPer{Object,Mesh}Threadgroup answer a
required size's threads. The translator's mesh answers change, under the branch's
SEMANTICS_VERSION bump (2015).
Tests: engine_mesh's refusal test adds the object cases (32 and 16x2 under 64) and makes 64
under 64; its answers test checks a required size alone in each stage and below a function's
maximum; the runtime lane's mesh test does the same on a device. docs/API.md's accepted
difference, the error's and the getters' docs and the probe's measurements say the first-compile
rule and what later compiles answer.
(cherry picked from commit 3b05b274aec46c172fd0a38276c5ca45a1ade4ca)
The 11-02 carve-out run flagged ldexp as possibly over-noted. A float
ldexp is lowered on the bits (math::ldexp_bits): an infinity or a NaN
operand is selected as the result bit for bit, which is Metal's answer
(NanAnswer::Operand: ldexp returns a NaN operand itself). No NaN of the
device's reaches the result on any device, yet float_call left the
answer to the device and recorded NativeNanEncoding everywhere,
MoltenVK included.
FloatFn::metal_nans now includes ldexp on float lanes, so the call
leaves no NaN answer and records no NaN note. A half ldexp multiplies by
2^k, so its NaN is still the device's product's where Metal answers the
canonical half NaN, and stays noted where the device does not answer
that. PrecisionNote::NativeNanEncoding's docs and docs/API.md's
catalogue say so.
Verified: lower::arith::tests::float_ldexp_answers_metals_nan_itself
(fails without the metal_nans change: call.nan is Some(Operand) and
NativeNanEncoding is recorded). SEMANTICS_VERSION 2014: a module
calling float ldexp records one note fewer.
(cherry picked from commit c4b748c1e63cee2a32400145a3665387a8ca72cf)
From the replay of the 11 padded-fetch cases on the Iris Xe (job m3-max-13463): its linear loads
exact, an sRGB twin's colour a half step from Metal's table where the device's Pow decode rounds
apart (device-pack-conversion), and the clear and draw cases the announced stored-codes
difference; the same replay held every padded-blend row on the Iris Xe. CONFORMANCE-COVERAGE.md
regenerated.
(cherry picked from commit 51f7de510a25e696fbb83be145d73e6ee70be94f)
(cherry picked from commit 92f9642928970b8d8f19731a667f9af3572881df)
(cherry picked from commit 9dd440ac76a1bbb46b6d001e936d4693dbe1cd06)
python3 -I scripts/conformance-coverage/coverage.py; the coverage test found the document stale
at 85edc61c8f (job m3-max-13469).
(cherry picked from commit 53c388806fad4a522aee606e4f8021e95cdabfdb)
(cherry picked from commit b90d930e487ed30c141f5d0e20e0d5c6496a07c6)
(cherry picked from commit 7b59616984a87356c649888200cca22fb52e00be)
python3 scripts/refusal-surface/refusal_surface.py (the padded fetch's FramebufferFetch site
gone) and python3 -I scripts/conformance-coverage/coverage.py (the padded-fetch cases);
METAL-COVERAGE.md is current (coverage.py --check).
(cherry picked from commit 0c8ad6c47d76ff7436835fa5377ff17700151c21)
(cherry picked from commit f448ad63ca5d317526e923c2363c3f05a44a0068)
(cherry picked from commit 4037ac989aa2942bdde46538b8b9856a9bfd3d78)
ExtendedRangeBlendSource and ExtendedRangeFloatBlendSource (their docs, the API
catalogue entries and the FAST-PATHS device-gap row) now say what the suite
measured: the device's compiler may contract and regroup the in-shader blend
(MoltenVK on the M3 Max and NVIDIA's driver on the RTX 5080 compute
S·F + D·(1 - F) as D + F·(S - D)); a stored channel lands within two codes of
Metal's on a linear format and within six near zero on an sRGB twin; and where
the compiler regroups a padded format's blend, an infinite second source stores
an end code where Metal's sum is NaN, stored as 0. The FAST-PATHS row names the
padded formats, which it lacked, and no longer says 'not measured'.
known-gaps.tsv: the 168 extended-range rows (xr-blend, xr-gamut, xr-gradient,
xr-masked) whose Open item was the blend notes' documentation are closed (Open:
nothing, the recorded bound covering the difference); every one is within the
bound (survey of the rows' largest differences). The padded-blend rows are
regenerated for five venues: the M3 Max, RADV PHOENIX and llvmpipe as before,
and the RTX 5080 (b5080 entry xrblend2-padded-replay-5080) and the Iris Xe
(job m3-max-13386), 17 each. The 5080's second-source cases differ by the whole
code range as the M3's do, and its counts are exactly a model of
D + a·(S - D) over an unnarrowed float destination (971 on R10Unorm_X6, 1850 on
RG10Unorm_X12); the Iris's are exactly the sum as written over the half
destination (844, 1607), as RADV's; llvmpipe's the sum as written over a float
destination (962, 1831). No venue's largest difference exceeds the M3's, the
780M's or llvmpipe's.
engine_padded_blends: a fetch of a padded attachment makes the whole pipeline
on every committed profile that orders fetch (storage form or input
attachment) and names the device gap elsewhere; a bfloat fetch stays
NotImplemented(Format), the negative control. Not yet run.
(cherry picked from commit c923b6d49c36c8354f375f6dababfd5f81f1ffbc)
(cherry picked from commit e3a2b226d7f5938811d1d251172088baf05c15cb)
(cherry picked from commit 85a2473cc6ea6a2c9165e2614d1e87ca77c1627e)
The fill row gains the decision's measurements: the images arm of
tests::reclaim_submit_bench, two runs each of the base (every block filled),
the decision (cf5561bb5d) and the arm with no fill, interleaved, the TTM
page pools emptied through the shrinker's debugfs before each arm and before
its pressed phase.
um870 (RADV, Mesa 26.2.6, Linux 7.3.1-1-cachyos), pressed, base / decision /
no fill: turnarounds of 8 ms or more 19 and 4 / 5 and 11 / 11 and 17, of
17 ms or more 1 and 1 / 1 and 2 / 8 and 9; the ready thread's makings 419
and 461 / 379 and 343 / 494 and 292 ms, in compaction 269 and 299 / 215 and
203 / 374 and 179 ms; block-sized buffer objects 2.0 / 2.0 and 1.5 / 1.0 a
making. Quiet: the decision filled every block (1 miss alone in 26) with no
turnaround of 8 ms or more; no fill had 12 a run. gem10 (quiet in both
phases): the decision made no block plain, no turnaround of 8 ms or more.
Also: the misses' free times (17 of 18 quiet misses freed in 0.06 to
0.20 ms, the pages left to the kernel's deferred delete; 44 of 47 pressed
ones in 2.7 ms or more), the fill's CPU shares (91 to 99% and 85 to 100%),
the page-table buffer objects a fill's mapping adds, and the block_fills
misses as now measured (0 or 1 of 5).
(cherry picked from commit 58bff1328f25ca7f96f4c82bab23d46ff5a40b1b)
On gem10's 780M, quiet (12 GiB of free memory left beside the bench), a
tip of 2 of the last 4 stopped once: two fills in a row whose frees
returned in 0.14 and 0.17 ms, the pages left to the kernel's deferred
delete, each block then filling its own (8.0 and 10.9 ms); the 2 plain
makings that followed held the submissions 10.0 ms. Of the misses the
benches' quiet phases saw on um870 and gem10, 14 of 15 had such a fast
free; of those under um870's pressed phase, 30 of 33 freed in 2.7 ms or
more, in runs of up to 6.
Replayed over the always-filling base's phases, stopping at 3 of the last 4
fills 6 to 8 of 12 under um870's pressure (2 of 4: 5 to 7) and none on a
quiet host.
Verified so far: the CPU test is rewritten for the threshold; its run and
the device evidence follow.
(cherry picked from commit cf5561bb5d95b659debfeeedc3454188cda701b3)
On um870's 780M (pools emptied before each arm and again before its
pressed phase), a quiet phase's fills missed alone: 1 of 13 and 1 of 5 in
the always-filling base, each the fill's free returning in 0.06 to 0.15 ms
where a free that hands its pages to the kernel's pool takes 2.7 to 3.5 ms,
so that the block's allocation ran before the pages were back. Backing off
after each such miss (837c461b2b) made the next 2 makings plain on the
quiet host, each holding the submissions 9.0 to 9.6 ms: 3 turnarounds of
8 ms or more in a quiet phase where the base had none.
Now a device keeps the outcomes of its last 4 fills (FILL_RECENT) and
stops filling once 2 of them missed (FILL_STOP_MISSES); the backoff after
that is as before (2, doubling with each missed probe up to 32), and a
probe that saves clears the record. Misses under pressure come together
(the same base, pressed: 8 of 12 and 3 of 12, runs of up to 5).
Verified so far: the rule's CPU test is rewritten for it
(tests::memory::fills_stop_once_two_of_the_last_four_miss_and_a_saved_probe_brings_them_back);
its run and the device evidence follow.
(cherry picked from commit bc3338dee50f9627b799cf68c747bef1b36a4672)
The fill rule of 6da2c8c1dc kept a device filling while each fill spared
its block's allocation half its time, so on a host short of free memory it
kept making a second block-sized allocation for each block, the kernel
compacting and reclaiming for both: the consumer's scroll on um870's 780M
(pin 33) waited longer on host compaction than pin 30 did, with no fill.
Now a fill that missed (its block's own allocation took 1 ms or more,
FILL_SAVED_BELOW, as WorkCounts::plain_block_fills_missed counts) leaves the
next 2 makings plain, then fills one, a probe; each further miss in a row
doubles the plain makings between probes, up to 32; a probe that saves
brings filling back for every making (Fills, FILL_BACKOFF_FIRST,
FILL_BACKOFF_MOST). The module docs, the skipped count's docs and the
ledger row say the rule.
Verified so far: tests::memory::fills_back_off_after_a_miss_and_a_saved_probe_brings_them_back
is the rule's CPU test (not yet run: the build is next). Device evidence
follows in a later commit.
(cherry picked from commit 837c461b2b1aa716622237afc48870307282dbf8)
Seventeen rows for the 256-bit llvmpipe venue, the counts its replay printed at
31d3ac25a2 (job m3-max-13288). lavapipe computes the second-source blend as
written with a product fused into the sum (native-fma), so an infinite second
source's NaN stores code 0 as Metal's does and no linear element is more than two
codes from Metal's.
CONFORMANCE-COVERAGE.md regenerated for the ledger's row count.
(cherry picked from commit 37237c7c805a19a814c809d13a1b2c196fd148b2)
Seventeen rows per venue, the counts the replays printed at 31d3ac25a2 (M3 under
MoltenVK, job m3-max-13278; the 780M under RADV, job m3-max-13289). Each blend runs
in the shader in the device's arithmetic, unclamped, and lands a code or two from
Metal's on a linear format, up to six near zero on an sRGB twin. The second-source
blends differ by venue: the M3's compiler computes S·a + D·(1 - a) as D + a·(S - D),
so an infinite second source stores an end code where Metal's IEEE sum is NaN,
stored as 0; RADV computes the sum as written and stores 0. A model of each form
reproduces the replay's count exactly on R10Unorm_X6 and RG10Unorm_X12.
CONFORMANCE-COVERAGE.md regenerated (the new case module, its recordings and rows).
(cherry picked from commit e117b085632700b586e56d043b91b16b2365a524)
Measured on the M3 Max under macOS 27.0.1 (probes/padded_and_bfloat_blends.m,
targets without Metal's optimized layout, whose blits moved every texel):
- Metal clamps nothing before a blend into a padded attachment (R10Unorm_X6,
RG10Unorm_X12, their sRGB twins, RGB10A2Unorm_sRGB): sources, second
sources and blend colors past both ends of [0, 1], alpha among them, blend
as they are. With the operands unclamped, the stored codes of 18 blend states
under fast and safe math, half and float outputs, match the f32 model within
one code for the linear forms (16-bit safe-math half outputs exactly in half
arithmetic), apart from NaN and infinity results; clamped to [0, 1], up to
1023 codes off in 30-50% of channels.
- A padded attachment's tile holds half through the pass: a premultiplied blend
of (0, 0, 0, 0.5) over a clear of 0.33371 stored code 171 (the half's), not
170 (code 341's), and over an unblended draw of values in [-0.5, 1.5] it
matched the unclamped half in every channel (65,536 texels of R10Unorm_X6,
131,072 channels of RG10Unorm_X12).
So blend::extended_ranges is None for a padded form (native() clamps nothing),
source_range drops its padded arm, and the model test clamps no padded lane:
every_blend_is_the_devices_arithmetic's random sources past the range fail it
with the clamp. The runtime's extended-range-blends-stored-codes now covers
padded colors (render.rs extended_colors), and ExtendedRange::clear_read_back
answers a padded form's clear by its codes' values (c / 1023, the sRGB twins'
transfer, RG10Unorm_X12_sRGB linear), so a blend over a clear between two codes
is announced as for the extended-range forms. Docs: the blend-source notes, the
stored-codes kind and its catalogue entry, ExtendedRangeColor.
(cherry picked from commit 5750641750642bdb7800da8e9618f98919d2cc9f)
The translator test of bfloat targets expects Metal's pipeline error for a
blended bfloat attachment, in the translation and at link with no fragment
function, with the unblended unwritten pipeline as its negative control. A new
engine test (engine_padded_blends) checks the same on every committed profile
through compile_render_pipeline, under a full mask and a mask of no channel, and
without a fragment function, with the unblended pipeline made as its control.
Docs: stage_io::extended_color, input_blend, ExtendedRangeColor::blended (any
blend now, not factors one and zero), DescriptorError::ColorAttachment (a
blended bfloat attachment). docs/REFUSALS.md regenerated. SEMANTICS_VERSION
2012 (a refusal's class changed, padded blends translate). A clippy literal in
extended_range's tests grouped.
(cherry picked from commit 8ef001f0a0eeed4c1b51a31df2ae093285dfbe9c)
Regenerated by scripts/conformance-coverage/coverage.py after the 96 llvmpipe
rows and the three read_through gap rows: 3410 ledger rows.
Verified: the conformance suite on msi (job m3-max-13292) failed only
the_conformance_coverage_document_is_what_the_sources_derive before this.
(cherry picked from commit 3514ac3e7a91a8245325939db06bbec5e950a63a)
Regenerated by scripts/conformance-coverage/coverage.py: 13 more recordings,
162 case modules, three ledger rows, and read_through among the families that
compare MTLSamplerState and the texture and buffer items it calls.
Verified: coverage.py --check reported the doc stale before and is the
generator's output now.
(cherry picked from commit b2b166a2d4b03ed957824bc8290b214d4c78c66b)
The read_through conformance family's per-axis states, recorded on the M3 Max,
show a texture buffer's index past its end addressed as the first texel of a
row past its one row: the border texel where t's mode is a border mode, else
texel 0, whatever s and r are; a runtime sampler whose s mode is
clamp_to_edge clamps it first (s-border reads texel 0, st-border the border,
tr-border clamps). The read took s's mode, which read the border for s-border,
sr-border, s-zero and three mixed states. The border now follows t, and never
applies where the sampler clamps.
The retaken buffer recording; known-gaps rows for the argument-buffer
texture's swizzled transparent border (divergent) and its opaque-border and
runtime-sampler reads (refused), with the swizzle gap in FAST-PATHS.md's known
gaps; the module docs say both.
Verified: the replay on the M3 through MoltenVK (job m3-max-13263) named the
six buffer divergences this fixes; the fix's replay is next.
(cherry picked from commit 22c6817d4074c1b18bbc7c6d166370fe9990c1a5)
What: SEMANTICS_VERSION 2011 -> 2012: reads through a sampler other than constexpr
clamp_to_edge now translate (they were refused), a clamp-to-edge read past its level or layer
reads zero in every lane, and a texture buffer's index outside a constexpr clamp_to_edge reads
its first texel. ARTIFACT_FORMAT_VERSION 498 -> 499: SpecKey::BorderTexels and
RuntimeFact::BorderTexels are encoded variants. docs/REFUSALS.md regenerated
(refusal_surface.py): select_through's two sites. api_signatures.tsv blessed:
SpecKey::BorderTexels, RuntimeFact::BorderTexels and SamplerWord::READ_STATE are added; nothing
is removed or changed.
Why: the translation's output changed under unchanged keys, and the encoding gained two variants.
Verified: refusal_surface.py wrote the doc with 0 unmarked variants; signatures.py --bless
reported only those three additions; METAL-COVERAGE.md --check is current.
(cherry picked from commit 26c37d74d6d2a4bb395ff64a539eb7fc617619bd)
dead_ordered_and_unattached_reads.m records what it measured on the M3
Max under macOS 27.0.1 (potluck job m3-max-13241): dfr_color,
dfr_buffer and dfr_output are made and drawn, dead and live, every texel
the closed form's, with the debug layer silent; dfr_lacks has no state,
dead and live ('Shaders reads from a color attachment whose pixel format
is MTLPixelFormatInvalid'). Its header names the tests and the lane that
read it.
docs/API.md's color-group refusal list now names a raster order group on
a color output or on a parameter the function uses; one on a parameter
it never uses orders nothing and is not refused.
(cherry picked from commit 93aaa9c6685770db04032b710ec7b36950b56f89)
docs/API.md's color groups paragraph lists what each group's draw would
read from another group as the pipeline's limit refusal; a
[[color(n)]] input of another group is that only where the specialized
function reads it, as pipeline::compile::color_group::entry now decides.
(cherry picked from commit 1df7b9589dc6bda472d3faaa14bf432677647658)
A float or half read, sample or gather through an argument buffer that
decodes a texture the heap holds by its raw texels alone (BGR10_XR,
BGRA10_XR, R10Unorm_X6, RG10Unorm_X12 and the bfloat formats; the
heap_raw routine) converts by the device's arithmetic, as a slot's decode
of the same texel does, but recorded no PrecisionNote: a reader of the
module alone saw no near-equivalent, against AGENTS.md's "allowed only
when the artifact records it".
The decode is planned in one place now, texture::heap_raw::plan, which
both the read (select_read_as) and the emulated sample or gather
(heap_raw_sample) call. It records DevicePackConversion as a specialized
note with one clause on a new bound-value key, SpecKey::HeapRawTextures
(stage): a texture the stage's handles can name is held raw. The binding
plan gives the key from the command's heap members (resident or bound
textures, as for HeapYCbCrTextures), so the note is in the module's
notes, holds under precision_notes_bound exactly where the command can
name such a texture, and the runtime announces it at that draw or
dispatch (degrade_bound_values) and never at the pipeline's making. A
stage that records the note outright for another conversion keeps it
outright. Heap accesses that reach no such texture (queries, integer
reads, storage reads, samples the function does not emulate) record
nothing.
NoteOn::HeapTextures is renamed HeapYCbCr beside the new HeapRaw.
bind::heap::raw_held is pub(crate) for the plan. The heap set's own
announcement naming the texture (heap_sets::RawRead) stays.
SEMANTICS_VERSION 2008 (heap-reading modules gain the note);
ARTIFACT_FORMAT_VERSION 498 (a SpecKey variant). api_signatures blessed;
REFUSALS.md regenerated (unchanged). docs/API.md's catalogue and the
runtime's Degradation docs say where the note is recorded and announced.
Tests: heap_decodes_record_the_device_pack_conversion now also asserts
the one HeapRawTextures clause; the new
a_heap_decode_s_note_holds_where_its_command_can_name_a_raw_texture checks
the plan's key and the bound note on every committed profile; the lane
a_heap_decode_s_stage_note_is_announced_where_its_command_can_name_a_raw_texture
checks the runtime's announcement under announce_each.
(cherry picked from commit 1ab403b671f18773a10c8572ffbe0a73b56f5bbc)
Three corrections, each checked against the tree:
- runtime/src/visibility.rs said Metal's visibility-result behaviour was
measured on an M4, which is not one of our venues. The conformance
suite's visibility cases record Metal's answers on an Apple M3 Max with
macOS 27.0.1 (recordings/visibility-*.json); the doc now names that venue.
The 5300M and UHD 630 answers it cites beside it are unchanged.
- docs/FAST-PATHS.md's DeviceSampling row (and docs/API.md's device-sampling
entry) said Metal reads any subnormal coordinate as the zero of its sign
before addressing. That holds for a normalized coordinate (measured on the
M3 Max on R32Float, PrecisionNote::DeviceSampling's documentation); a
negative subnormal pixel coordinate addresses texel -1, as the M3 Max's
recording of pixel-samplers-subnormal-border answers (the border at
-2^-149, -2^-140 and -2^-127, known-gaps.tsv). Both now say so, and the 27
known-gaps.tsv rows that quoted the old reading quote the new one.
- SharedEvent::reserve_vk_signal's Safety text lacked the same-VkQueue rule
that Event::reserve_vk_signal states. A shared event's command-buffer waits
are held on the host (event_timeline.rs: a settable timeline never hands
a wait to Vulkan), but a command buffer that signals the event after the
reservation waits on its VkQueue for the reserved index before its own
signal (EventTimeline::signal's `after`, the order wait in
command_buffer/submit.rs), so the caller's signalling submission must not
go behind it on one VkQueue, and a texture copy on the first VkQueue behind
it waits for the signal too. The rule is now stated, scoped to those
signalling command buffers.
Verified: rustdoc and the runtime's degradation_catalogue test over the
edited text; no behaviour changes.
(cherry picked from commit 12bac3fafd3d3e66dc0b88d01231dd30e2694ffb)
The cpu-block-decode notice said the call waits for the decode where a
command buffer that may read the texture is submitted and not yet complete,
or the texture is untracked. The call has waited for no GPU work since the
decode moved to the device's decode thread (texture/twin_decode.rs): it waits
only for room, while 256 MiB of written blocks wait for the thread (a 4:2:2
carrier's partial-row write also reads its rows back first), and the
scheduler holds the first command buffer that may read the texture, every
command buffer where the texture is untracked.
The declaration's rustdoc, its announced cost and docs/API.md's catalogue
entry now say that. A test ties the stated bound to the queue's QUEUED_BYTES
(made pub(crate) for it), so the text follows the constant.
Verified: tests::degradation::the_cpu_block_decode_cost_states_the_calls_
only_wait and tests::degradation_catalogue (the catalogue states the cost).
(cherry picked from commit f128722f1b2197f52833080eca738fd498cf6ce5)
A mesh function that writes a vertex's point size recorded
PrecisionNote::DevicePointSize whatever primitive its mesh outputs. The
rasterizer reads a vertex's size for points alone, so a line or triangle
mesh's size draws nothing on any device, and the runtime already announces
the note only at draws that rasterize points (7715a47be3). The note is now
recorded only where the mesh type's topology (air.mesh_type_info) is points,
a structural test, so the artifact carries no note its draws can never meet.
Apple's compiler refuses [[point_size]] in a triangle mesh's vertex, so the
case arises only for AIR not compiled from MSL. The test derives the
triangle mesh from the owned fixture's point mesh (mesh_outputs_points) by
its topology word alone.
SEMANTICS_VERSION 2008: an artifact's precision notes change. docs/API.md's
catalogue entry and the note's rustdoc say which mesh functions record it.
Verified: engine_mesh::a_mesh_point_size_is_noted_only_where_the_mesh_
outputs_points on every committed mesh profile with the largest point set
below Metal's: the point mesh is noted, the triangle mesh is not, both store
the size; the test fails with the topology check reverted.
(cherry picked from commit adc0435c64495e2f3a3355becf055941fc529fc3)
A command buffer keeps what its recording took of the driver's device-wide pools until it is
begun again, reset or freed, and the spare command pools kept each pool's peak over its recent
uses with no bound across pools. On ANV below Xe-HP each command buffer that records a binding
table takes a 64 KiB block of the device's 1 GiB binding-table pool, so a device holds at most
16,384 of them, and the next recording fails with VK_ERROR_OUT_OF_DEVICE_MEMORY with no driver
message. tests::linear_runs::checked_frames_merge_once failed so on ms01's Iris Xe (6 of 79 runs
beside the runtime suite, job m3-max-13027): its frames of 707 and 1,413 render passes, each a
command buffer whose pool kept its peak, left the spares holding 9,716 to 9,771 command buffers
in every failed run (2,786 to 7,747 in sampled passing runs) before the frame that failed. A
probe on the same Iris Xe (job m3-max-13053, twice): one command buffer of render passes, each
a primary and a secondary beside a cleared depth target, failed at the end of its 8,087th pass
with the spares holding 424, 2 x 8,086 + 212 = 16,384.
A give-back now counts the spares, the pool given back, and what each pool out of the spares
held as it went out (taken by a command buffer, out for frees, or beginning a primary ahead:
CommandPools::out, kept under the spares' lock). Past HELD (4,096) the oldest spares that hold
any shed all their command buffers on the free thread as an idle spare does and go back as the
oldest; where that is not enough, the pool given back frees its last made past the bound, a
secondary kept, never the primary begun ahead (past_held, CommandPool::past). On ANV the frees
do not trim, as before, so kept barriers stay valid. HELD leaves three quarters of the binding-
table pool to the command buffers committed and in recording.
Tests: tests::spares::the_spares_and_a_pool_given_back_hold_at_most_held_command_buffers (the
policy, no device) and tests::spares::device::
command_buffers_alive_at_once_leave_the_spares_holding_at_most_held (three command buffers of
2,112 blit encoders alive at once, each in a pool of its own). docs/FAST-PATHS.md records the
remaining ceiling: one command buffer of about 8,000 such passes still fails on ANV below Xe-HP.
Verification follows in the next commits' messages and the report: build and clippy, the
spares tests on lavapipe, the M3 and the Iris Xe with a negative control, and a loaded Iris run.
(cherry picked from commit 8ab6915d698cdaf29e2aa8bfd50c77cd8922d507)
tests::block_fills on the Radeon 780M (RADV PHOENIX, Mesa 26.2.6) missed 4 of its 5 fills in job
12841 and 2 of 5 in job 12891 (at the rebased tree of this branch); the fill row said "mostly"
from the first run alone. Documentation only.
(cherry picked from commit caa2b45263277b2696184602298e329291c8b5dd)
The row said a fragmented phase had 1 to 4 turnarounds of 8 ms or more and 1 or 2 missed fills;
job 12852's second run of the bursts arm had neither (0 and 0), so the ranges are 0 to 4 and 0 to
2. Documentation only.
(cherry picked from commit e20985fc7ff241c40edcd55b3c21506b715bb899)
The fill row's numbers were of 64 MiB blocks of images. With the 68 MiB ones made now, on the
Radeon 780M (RADV PHOENIX, Mesa 26.2.6), the kernel's page pools drained before each run, the
reclaim bench's arms (jobs 12852, two runs, and 12860, one run with the fill-window print): a
quiet phase 0 or 1 turnarounds of 8 ms or more, no fill missed, the makings' vkAllocateMemory
1.2 to 2.0 ms in all; a fragmented phase 1 to 4 (the slowest 33.1 ms, behind a missed block
whose allocation took 29.4 ms), 1 or 2 of its 12 or 13 fills missed. Of the 957 submissions
begun while a fill ran (12860), 1 turned around in 8 ms or more (14.0 ms, fragmented); in 12852
a 24.0 ms one began within a 32 ms fill on the fragmented host. The row also says that in a
process that submits nothing the fill mostly misses (tests::block_fills on the 780M, job 12841:
of 5 fills, 1 saved and 4 missed), the cause not measured, and the fill's cost for a 68 MiB
block (about 16 ms on the quiet host, at most 17.3 ms).
(cherry picked from commit 30108c53759b9f76e25c0994e7db3cd4f7de7731)