Commit Graph
335 Commits
Author SHA1 Message Date
Anees Iqbal 6706d5b97f rt and translator: a sampler of Metal's undeclared filter 2 is made and filters as nearest
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.
2026-12-03 13:06:04 -08:00
Anees Iqbal fa5d051b64 Translator: the two-word 64-bit integer forms deleted; every profile holds 64-bit integers in u64s
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.
2026-12-03 11:57:03 -08:00
Anees Iqbal 31d8a874f1 Translator: the Floor buffer access deleted; every profile reaches buffers by address
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).
2026-12-03 11:57:02 -08:00
Anees Iqbal 09b6d0fb89 Translator: the anisotropic emulation deleted; a device without samplerAnisotropy refuses an anisotropic sampler
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).
2026-12-03 11:57:02 -08:00
Anees Iqbal 0ce2f39b71 Translator: the resident core deleted; every device compiles the one form, and the tests run it
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.
2026-12-03 09:15:33 -08:00
Anees Iqbal ed55748644 Docs: the runtime README, API.md, REPLAY-STREAM.md and VALIDATION.md state each measurement by its card and driver, not by our job id
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.
2026-12-03 09:10:35 -08:00
Anees Iqbal bac1ab1bd9 Docs: metal-measured covers Metal's validation stop; the bound form's evidence is the real cards
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.
2026-12-03 08:41:16 -08:00
Anees Iqbal ad09d74961 Stage input: an indexed step fetches at any step rate, as Metal reads it
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.
2026-12-03 07:46:03 -08:00
Anees Iqbal 2201f23e9f linux-gate-ci: the 128-bit runtime step checks the width took, as ci.yml's does
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).
2026-12-03 07:20:32 -08:00
Anees Iqbal 2549c339c6 CI: the runtime's device tests again on lavapipe at 128-bit vectors, with a Mesa shader cache of their own
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.
2026-12-03 07:03:08 -08:00
Anees Iqbal 8e912a905d Validation cases: a device-coherent texture handed between threadgroups, Metal's answer
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).
2026-12-03 06:47:18 -08:00
Anees Iqbal df54afeef2 Cases: LOD queries through a sampler bound with LOD clamps of its own, qualified on the M3 Max
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.
2026-12-03 06:46:39 -08:00
Anees Iqbal c5f979d985 Cases: kernel and vertex LOD queries through runtime samplers with LOD clamps, qualified on the M3 Max
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.
2026-12-03 06:46:39 -08:00
Anees Iqbal 2fb00a15ae CI: qualify kernel_handle_word_joins's four cases on lavapipe
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.
2026-12-03 05:57:30 -08:00
Anees Iqbal 7fcd661645 Validation cases: Metal's answer for mul24 and mad24 in and outside their 24-bit range (red)
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.
2026-12-02 23:17:08 -08:00
Anees Iqbal 39423d92f1 ICB: a kernel's indexed patch draws into an indirect command buffer, executed through a layout of indexed patch draws
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.
2026-12-02 21:09:00 -08:00
Anees Iqbal 08447f8aff ICB: a kernel's patch draws into an indirect command buffer, executed through a layout of patch draws
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.
2026-12-02 21:06:54 -08:00
Anees Iqbal 21f0cae67b ICB: a kernel's plain triangle draws into an indirect command buffer, executed through a layout of plain draws
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.
2026-12-02 21:06:03 -08:00
Anees Iqbal c50fd04219 rt: drawIndexedPatches, and patch draws through a patch index buffer
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.
2026-12-02 16:25:48 -08:00
Anees Iqbal 71aa9829d0 Validation cases: Metal's answer for a row of floats written four at a time with its tail guarded
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.
2026-12-02 16:24:50 -08:00
Anees Iqbal c1f999eb06 rt: pipeline states answer Metal's allocatedSize as their translated SPIR-V's bytes
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.
2026-12-02 14:24:11 -08:00
Anees Iqbal 86386c4873 Refusal surface: --check compares the totals, and REFUSALS.md counts Refusal::TextureUsageAtSlot
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.
2026-12-02 14:24:08 -08:00
Anees Iqbal b723c90272 rt: Device::default_sample_positions answers getDefaultSamplePositions:count:
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).
2026-12-02 14:24:08 -08:00
Anees Iqbal d9054b5164 Validation: a play's gauge records are the runtime's objects past the play's own, of each kind the program makes one at a time
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.
2026-12-02 14:24:06 -08:00
Anees Iqbal f4eb47d792 Validation: a play's gauges at frames 100 and 200 go out as the matrix's records, every kind on its end lines
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.
2026-12-02 14:24:06 -08:00
Anees Iqbal 9a89d5e25c CI: the lavapipe image's udmabuf decided by the node's presence, its downloads saved on fetch, its build step limited
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).
2026-12-02 11:59:40 -08:00
Anees Iqbal 7687644485 CI: the device-executing steps run on lavapipe in an image of one Arch Linux Archive date
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.
2026-12-02 11:50:03 -08:00
Anees Iqbal 1c307b4608 Runtime: a pass rasterizes at the sample positions its descriptor sets, through VK_EXT_sample_locations
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.
2026-12-02 08:39:10 -08:00
Anees Iqbal c231c41ddd scripts: rustc-wrapper runs under bash, so the compiler keeps Cargo's hyphenated variables
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).
2026-12-02 06:59:34 -08:00
Anees Iqbal d0664f2c10 CI: qualify the float and half function-constant cases on lavapipe
scripts/qualify-public-cases runs a named list of the owned public cases on
lavapipe against their committed Metal observations. It now names lane
fcfloat's 15 cases (engine/fc_float_gate: a kernel's gated argument and a
fragment's gated sample mask; engine/fc_half_gate: the sample mask), so CI
keeps Metal's answer for a float or half predicate: present at 1.5, -0.0
and a quiet NaN, absent at +0.0 and unsupplied (Apple M3 Max, jobs
m3-max-75714, 75716, 75726). The lane's candidate ran these 15 on lavapipe
at 7de0a8c8bb's tree plus the half fixture: 15/15 Match, every slot current
(job m3-max-75728). The script itself runs in the gate at the pin tip.
2026-11-26 17:35:09 -08:00
Anees Iqbal c718924d44 CI: qualify the AIR 1.8 sampling case on lavapipe with the other public cases
scripts/qualify-public-cases runs case 884ad7d75a22 against its committed Metal row. Run by hand
under the same operator environment (ci-lavapipe, job m3-max-73980 on lavapipe 23.1.1): Match,
candidate output 7d65bff73d82, Metal's bytes.
2026-11-25 13:37:09 -08:00
Anees Iqbal ab24c9617f Docs: comments that named a deleted module or file say what is true now
Six comments sent readers to `device::driver_facts` (the release-keyed deviation table) as the
place a driver's measured deviations come from. The module is gone and `Device::from_queries`
reads no identity, so each now says that translation takes no deviation and reads no driver
identity:
- crates/metal2vulkan/src/ash_interop/query.rs (the format query's note),
- crates/metal2vulkan/src/device/description.rs (`device_name`'s doc),
- crates/metal2vulkan/src/device/khronos.rs (the module docs' deviations paragraph),
- crates/metal2vulkan/src/device/tests/description.rs (`a_stated_deviation_is_refused`'s doc),
- scripts/regen-device-profiles/README.md and regen_device_profiles.py (the Deviations text).

lib.rs's note on the crate-private modules drops its design citation and the claim that lowering
and the binder's replay share `indirect_commands`: no lowering reads it, and validation's case
model and Metal executor reach it as `bind::indirect_commands`.

The ASTC HDR probe's header (crates/metal2vulkan-conformance/probes/astc_hdr_textures.m) named
the runtime's `astc.rs`, which does not exist; it now points at `bind::astc_decode`'s docs and
the `astc-*-hdr` recordings. No recording or test fingerprints the probe's source:
`git grep -n 'astc_hdr_textures'` finds only the probe itself, a sibling probe's comment and two
doc comments under bind/astc_decode.

Zeros, at metal2vulkan 733b14ed24 (this commit's parent) and the consumer reims-vgpu d0a7c9614:
- `git grep -nw driver_facts` here: 0 after this commit (6 before, the six above); no file
  `crates/metal2vulkan/src/device/driver_facts*` (`git ls-files`: 0). Consumer: 0.
- `git ls-files '*astc.rs'`: 0.

Comments only: no code, no test or table moves. Verified by `cargo fmt --all` (no change) and
the lane's quick check at the stack's tip.
2026-11-25 12:22:03 -08:00
Anees Iqbal 3c52ee1cf1 Render pass: a colour attachment renders one depth plane of a 3D texture's level
What: RenderPassColorAttachmentDescriptor takes `depth_plane` (Metal's `depthPlane`). A 3D
texture of RenderTarget usage is made 2D-array-compatible (VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT,
in its image format query too: Plan::flags, from the image's type and its colour attachment usage,
no query). attachment_view then takes the plane of a 3D texture's level as a 2D view of that one
layer (base layer = depthPlane, at the level), checked against the level's depth
(Refusal::AttachmentPlace past it). Every barrier on a 3D texture's image (its attachment's, its
copies' and its moves', texture::barrier_layers) names the image's layers as 0 and
VK_REMAINING_ARRAY_LAYERS, so each moves every plane of the level it names. Before, every such pass
was Gap::RenderPass of RenderPassKind::TextureType.

Still TextureType: a 3D texture in a layered pass (renderTargetArrayLength 2 or more), a depth or
stencil attachment of a 3D texture, a 3D resolve texture, and a resolve's depth plane but 0. A draw
that reads, through a shadow (a device without the attachment feedback loop), a 3D texture whose
plane its pass renders is Gap::Draw of DrawKind::AttachmentRead: a shadow's copies are of layers.
The floor asks a device that lists VK_KHR_portability_subset for imageView2DOn3DImage too
(VUID-VkImageCreateInfo-imageView2DOn3DImage-04459), as it asks multisampleArrayImage.

Why: a guest route meets the refusal. A browser's GL layer clears every 3D texture of an RGB-family
format (RGB8, RGB16F) at creation through a pass on each plane, to set the alpha it emulates; it
also renders into a plane for framebufferTextureLayer(TEXTURE_3D, k) then a clear or a draw, for a
level sampled before a full upload, and for copyTexSubImage3D. The consumer's route showed the key
at 205c8d2398 ("a render pass with TextureType is not built", colour 0 RGBA8Unorm Type3D 32x32x4,
usage 0x7, Managed), and every route that renders into a 3D texture read 0.

Metal (MTLRenderPass.h): `depthPlane` is "The depth plane of the texture to be used for rendering.
Default is zero."; Apple's page for the property, as fetched: "If the texture isn't a 3D texture,
then Metal ignores this property." Every Mac renders into a 3D texture's plane, with nothing to ask,
so it is built.

Vulkan (1.4.366): VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT "specifies that the image can be used to
create a VkImageView of type VK_IMAGE_VIEW_TYPE_2D or VK_IMAGE_VIEW_TYPE_2D_ARRAY" (core since 1.1);
the image is 3D (VUID-VkImageCreateInfo-flags-00950) and not sparse (-09403); the format query takes
the same flags (Image Creation Limits). The view is 2D, one level
(VUID-VkImageViewCreateInfo-image-04970), its base layer below the level's depth (-02724, -02725),
of an image made with the flag (-06728).
Such a view "can be used as a framebuffer attachment that refers only to the specified range of
slices of the selected mip level" (VkImageSubresourceRange). Dynamic rendering refuses only a 3D
view type (VUID-VkRenderingAttachmentInfo-imageView-12470). The runtime does not enable
maintenance9, so a barrier on the image moves the whole level
(VUID-VkImageMemoryBarrier2-subresourceRange-01488); with maintenance9 its layers would name depth
slices (-maintenance9-10798), and the layer count that names the whole level either way is
VK_REMAINING_ARRAY_LAYERS, which the validation layer asks for on such an image
(WARNING-VkImageSubresourceRange-layerCount-compatibility, met on lavapipe with layerCount 1, job
m3-max-73446). Load and store "only update values within the defined render area" of the view's
plane. The view is bound to no descriptor
(VUID-VkDescriptorImageInfo-descriptorType-06713).

Portability: KosmicKrisp, Mesa 26.3.1's source (src/kosmickrisp/vulkan), names no portability
subset, so the M3 device is not asked: a source read, unaudited at run time. MoltenVK reports
imageView2DOn3DImage (profiles/moltenvk-m3.json) and is below the floor anyway.

Conformance: the suite's `layered-attachment-places` crosses `depthPlane` over a 3D target of three
planes, recorded on Metal. Its runtime side now sets a colour attachment's `depth_plane` (a depth or
stencil attachment's plane stays Unavailable), and its twelve known-gaps-rt.tsv rows go.
docs/REFUSALS.md, docs/METAL-COVERAGE.md (depthPlane implemented), docs/CONFORMANCE-COVERAGE.md and
api_signatures.tsv are regenerated.

Tests:
- tests::depth_planes (device cfgs): RGBA8Unorm and RGBA16Float, ShaderRead | ShaderWrite |
  RenderTarget, Managed, an 8 x 8 x 4 texture of two levels (the second 4 x 4 x 2) and an 8 x 8 x 1
  one, every plane written first by replace_region. One command buffer: level 0's plane 2 cleared
  and drawn, level 1's plane 1 cleared and drawn, level 0's plane 0 loaded and drawn, level 0's
  plane 1 cleared alone, the one-deep texture cleared and drawn; every plane of both levels copied
  out and sampled at each texel's centre through a nearest sampler state (level 1 through a 3D view
  of it). A plane past level 1's depth is AttachmentPlace, a pass of two layers TextureType.
  tests::layouts records each rendering's colour attachment's view type and range and its image's
  type and create flags, which the cell asserts and prints.
- tests::floor: the portability features asked and enabled include imageView2DOn3DImage.
- The validation layer, which every device test runs under and which fails a test on any warning,
  holds the barriers: without barrier_layers the cell drew
  WARNING-VkImageSubresourceRange-layerCount-compatibility on lavapipe (job m3-max-73446).

Verified (tree of this commit, run as f748e9e8d2 on development 6047a2d8b6):
- msi, lavapipe (Mesa 26.2.4), job m3-max-73464: fmt, clippy (no cfg, m2v_gpu, m2v_cpu_icd),
  rustdoc, the refusal, signature, Metal-coverage and conformance-coverage checks all exit 0; the
  runtime's suite under the validation layer 734 passed, 3 skipped (the cell among them); the
  conformance crate's suite 1037 passed; `conformance replay --cpu` exit 0, the ledger exact,
  layered-attachment-places "announced" (the native-nan-encoding degrade notice alone).
- One leg a vendor, a nextest archive and the conformance command built on msi (job
  m3-max-73466), under the Khronos validation layer 1.4.363.0: the cell (its form printed: a 2D
  view, base layer the plane, at the level, of a 3D image made with 2D_ARRAY_COMPATIBLE, 0x28 for
  RGBA8Unorm with MUTABLE_FORMAT, 0x20 for RGBA16Float; every plane of both levels and of the
  one-deep texture exact, copied out and sampled), the blit, floor, layouts, layered, no
  attachment, over, pass, render, resolve, shadow, texture, view and depth/stencil route and copy
  families (123 tests), and `conformance replay --gpu` (exit 0, the ledger exact,
  layered-attachment-places "announced" as on lavapipe):
  - Intel Iris Xe (ANV, Mesa 26.2.6), job m3-max-73476: cell passed, 123 passed, replay exit 0.
  - AMD Radeon 780M (RADV PHOENIX, Mesa 26.2.6), job m3-max-73477: cell passed, 123 passed,
    replay exit 0. (The XTX's node was held by another job for 47 more minutes.)
  - NVIDIA RTX 3090 (620.70.06), job m3-max-73478: cell passed, 123 passed, replay exit 0.
2026-11-24 01:35:19 -08:00
Anees Iqbal 0630c1d9a7 Translator: specialize refuses an instruction it would leave half specialized
pipeline::specialize copied every instruction outside its list as it was. An
OpExecutionModeId (a LocalSizeId mode among them) beside a WorkgroupSize
composite would leave the entry point with two sizes, and an OpDecorationGroup
could carry a SpecId the pass never reads, so that constant would keep its
default. The translator writes neither, so the pass now refuses both with an
Error::Internal that names the instruction. An OpSpecConstantOp of an opcode
outside SpecOp was already refused; its refusal now names the opcode.

Op::ExecutionModeId and Op::DecorationGroup move into every build, and
ExecutionMode::LocalSizeId into test builds. Both come through
scripts/regen-spirv-grammar's items.txt and a regeneration from Khronos's
grammar (vulkan-sdk-1.4.341.0); table.rs comes out unchanged.

Test: a_module_of_an_instruction_the_pass_does_not_specialize_is_refused takes
the deep kernel with an OpExecutionModeId LocalSizeId of its LocalSize
constants, with an OpDecorationGroup, and with an OpSpecConstantOp turned to
ISub. Each must be refused, and the refusal must name the instruction. The
next check job runs it.
2026-11-23 20:59:01 -08:00
Anees Iqbal ed4b0ecd76 rt: storage textures written or read at a run-time level, through runs of set 1's level elements
What: under the identity domains a storage slot written, read or size-queried at a level other
than the constant 0 indexes a run of set 1's storage-image array instead of being refused as
Unsupported{IdentityDomains} ("an encoder value the function reads as TextureLevels(S)"). The
translator pushes the bound texture's level count (PushField::TextureLevels) and the run's first
element (the new PushField::TextureLevelBase, beside it), states no StorageTextureLevels or
StorageTextureLevelViews fact, and an access at level l takes element
first + min(l, max(n, 1) - 1) of the array, NonUniform, inside l < n. A texture of one level
pushes its own index, nil 0 with count 0.

The runtime's binding 1 grows by 65,536 level elements past its 65,536 textures, 4,096 runs of 16
(floor::LEVEL_ELEMENTS, floor::LEVEL_RUN). The first dispatch or draw that binds a texture of more
than one level to such a slot (the encoder's checks, compute and render stages alike) gives it a
run: a single-level storage view of each level, of its storage element's type (a cube's level as
the 2D array of its faces, a view's from its own first level), written at the run's elements. A
later bind takes the texture's lock and pushes the same two words: no Vulkan call. The run goes
back through the pool and reaper once the texture is released and its work retired: elements null,
views destroyed (Gauges::level_elements). Every run held, or a texture of more than 16 levels, is
the new Limit::LevelElements { max: 4096 }, and the dispatch or draw does not run. The floor's
storage-image limits and both totals rise by 65,536: storage 196,608, per-stage resources 327,688,
pools 351,680; every lab device's profile is far above (llvmpipe 1,015,808 storage, the least).

SEMANTICS_VERSION and ARTIFACT_FORMAT_VERSION bump in the branch's last commit (a new PushField).

Why: 17 guest kernels in 6 libraries were refused at state creation by this form.

Docs: REFUSALS.md and the signatures table regenerated, RESOURCE-ID.md (binding 1 past 65,536),
API.md (storage levels under identity), the runtime README (Set 1, the floor table, the known-gap
line replaced by the Limit), the runtime-floor profile's limits, and the conformance ledger's
level-sizes-storage row removed.

Checked by: engine_texture_levels' identity test and the runtime's storage_levels device tests
(red at 6ad1c33124: jobs m3-max-70886 and m3-max-70892 on lavapipe), engine_identity's
a_storage_slot_written_at_a_run_time_level_is_an_element_of_its_run; the lane's jobs report the
runs per card.
2026-11-23 09:04:38 -08:00
Anees Iqbal 624c5a38b9 Translator: a fragment's quad votes are OpGroupNonUniformQuadAllKHR and QuadAnyKHR, helpers included
What: in a fragment function, Metal's quad_all and quad_any are now
SPV_KHR_quad_control's OpGroupNonUniformQuadAllKHR and
OpGroupNonUniformQuadAnyKHR of the predicate, in place of the quad's four
bits of the ballot of the predicate (compared with the ballot of the
active lanes for quad_all). Kernels and vertex functions have no helpers
and keep the ballot form. The IR gains GroupInst::QuadAll beside
QuadAny (no scope operand; QuadControlKHR, SPV_KHR_quad_control and
shaderQuadControl), and the builder's group_quad_any becomes
group_quad_vote(all, pred), as group_vote is. The interpreter, the
serializer and the requirement deriver follow. items.txt lists
GroupNonUniformQuadAllKHR, and scripts/regen-spirv-grammar regenerated
spv.rs from SPIRV-Headers vulkan-sdk-1.4.341.0: the opcode loses its
cfg(test); the test parser's table already held it.

Why: Metal's helpers are active lanes of their quad and take part in
its votes. Vulkan section 9.31 runs quad group operations over a quad's
helpers in every entry, and its other group operations, the ballot
among them, only where the entry declares MaximallyReconvergesKHR. AMD's
open Vulkan driver leaves a partly covered quad's helper out of the
ballot even though the entry declares MaximallyReconvergesKHR beside
RequireFullQuadsKHR (report 142), so a vote read through the ballot
missed the helper: the runtime test quad_votes read quad_any(x > y) = 0
and quad_all(x <= y) = 1 on the 12 covered pixels of the diagonal quads,
where Metal answers 1 and 0 (m3-max-70847, AMDVLK 2025.Q2.1 on the RX
7900 XTX and the Radeon 780M; RADV right on both). The quad vote
instructions are right by the spec on every device whatever the entry's
reconvergence (rung 1), the form the quad reductions took (54517169dd).

What full_quads asks: unchanged, shaderQuadControl. A fragment vote's
operation class moves from Ballot to Quad, which Vulkan requires
wherever shaderQuadControl is supported. No new query.

Still through the ballot in a fragment: quad_ballot, the active mask,
is_first, broadcast_first, the quad prefix sums, and every simdgroup
operation.

Tests: operation_classes_follow_the_tier gains a fragment's quad All and
Any (Quad); fragment_quad_votes_are_quad_vote_instructions compiles a
fragment of both votes on every committed profile with quad control (one
QuadAllKHR, one QuadAnyKHR, no ballot) and checks a kernel's votes
(a3_quad_votes_divergent) take neither instruction.
2026-11-23 04:46:38 -08:00
Anees Iqbal 9f6712f172 Translator: spv.rs names OpGroupNonUniformQuadAnyKHR outside tests
The fragment quad reduction emits it (1c64701191), so items.txt lists it
and scripts/regen-spirv-grammar regenerated spv.rs from SPIRV-Headers
vulkan-sdk-1.4.341.0: the opcode loses its cfg(test). The test parser's
table already held it. 1c64701191 alone does not build without this
commit.
2026-11-23 04:05:51 -08:00
Anees Iqbal 5a03a60b6c rt: Device::max_threadgroup_memory_length, Metal's maxThreadgroupMemoryLength less the vote word
The answer is the device's maxComputeSharedMemorySize less the 4-byte vote word a kernel's
partial-threadgroups variant may take beside its threadgroup memory, rounded down to 16, and at
most Metal's 32 KiB: 32,752 on a device of 32,768 bytes (AMD's drivers on the 780M, lavapipe,
MoltenVK on the M3), where a Mac answers 32,768; 32,768 on RADV, NVIDIA and ANV. A guest that
sizes its threadgroup memory from it (a length it sets, or source it compiles at run time) runs
its ragged grids, where 32,768 is refused (Gap::PartialThreadgroups for static memory,
Limit::ThreadgroupMemory for a length). The word is one constant, pipeline::VOTE_BYTES, which the
module interface's vote word reads too.

It changes only the answer: every dispatch is still checked against the device's own limit. An
emulated SIMD group's scratch varies by kernel and is not counted; the runtime README records it
with the refusal a kernel past the answer keeps, and the unaudited cost to a guest that rounds the
answer down to a power of two.

Tests: the scan test reads the answer and checks its formula; a kernel whose variant takes no vote
word runs [25,1,1] and [1024,1,1] in [1024,1,1] with a length of 32 KiB, past the answer
(every_device_runs_a_kernel_without_a_vote_word_at_a_length_past_its_answer). METAL-COVERAGE and
the api_signatures table are regenerated. Not yet run.
2026-11-23 02:31:24 -08:00
Anees Iqbal 058fd25a7b Translator: MSL 3.2 program-scope buffer bindings become buffer parameters; other shapes refused apart
What: `!air.global_bindings` decodes into `AirAbi::global_bindings` (`GlobalBinding`: the
global, and its node's role, type information and name, read by the parameter-node decoder;
the node's index is -1). Canonicalization (`canon::global_binding`, beside the global
built-ins) makes each plain load of a bound buffer's pointer (device or constant space, one
stated slot) a read of a parameter: the entry's own parameter of the binding's role and type
where it takes one, else one appended, shared by the bindings of one role and type. Lowering
then binds it where a `[[buffer(n)]]` parameter binds; the runtime binds nothing new.

Why: the whole module was refused as ProgramScopeBinding (78 functions in 1 library of the
private corpus on runtime-floor and gate-lavapipe: kernels, one constant struct buffer each,
read only by plain loads of its pointer). Metal fills a bound global from the executing stage's
own argument table. Measured on an Apple M3 Max under macOS 27.0.1:
- m3-max-70268: a kernel's globals read and write the buffers bound at their indices;
  reflection lists each as a binding at its index; a parameter and a global of one type at one
  index, and two globals of one type at one index, read the one buffer; a vertex and a fragment
  function reading one global each read their own stage's buffer at its index.
- m3-max-70306: Metal also takes a bound texture and sampler, bound threadgroup memory, a bound
  sampler array, and a linked visible function of another library that reads a bound buffer.

What stays refused, each a refusal of its own (docs/REFUSALS.md regenerated):
ProgramScopeResource (a texture, sampler or threadgroup memory, one or an array),
ProgramScopeSharedSlot (a binding at a slot an entry parameter or another binding binds with
another role or type), ProgramScopeLinked (bindings in a linked or dynamic-library module),
ProgramScopeRead (a read of a bound buffer other than a load of its pointer, which
`xcrun metal` 32023.922 does not write). ProgramScopeBinding is gone: a consumer's exhaustive
match on Feature breaks, and a consumer's AirAbi literal needs the new field (git grep of the
consumer's checkout at aed8655a62: 0 hits for ProgramScopeBinding and for `AirAbi {`).

Tests: the ABI decode of a binding (a node with a parameter's index, or a global that is not the
externally initialized undef constant, is malformed); canonicalization over a kernel with three
bound buffers (two appended parameters, one shared with the entry's own) and the refused
shapes; linking and dynamic-library refusals.
2026-11-23 00:51:10 -08:00
Anees Iqbal 0eb982e471 Runtime floor profile, conformance notices and ledger rows for the LOD-clamp variants
The committed runtime-floor profile (and its generator's RUNTIME_FLOOR block) states the
floor's raised sampler limits: 24,000 maxPerStage and maxDescriptorSet
UpdateAfterBindSamplers, 286,144 maxUpdateAfterBindDescriptorsInAllPools.
tests::floor::the_floor_profile_states_exactly_the_floor failed without it on lavapipe
(job m3-max-70138) and on the 780M, Iris Xe and RTX 3090 (m3-max-70152, -70153, -70151).

The two sampler-bind-lod-clamps cases declare pixel-sampler-scaling, the static note of a
sample through a runtime sampler slot, which fired on every venue (same jobs). The kernel
case takes the ledger's dispatch_type row every compute-pass case of the rt side takes.
compute-plural-texture-and-sampler-binding now compares its four-bindings site on
lavapipe, which reads lavapipe's one-ulp 8-bit conversion, as compute-inline-bytes does
over the same texture and kernel: a llvmpipe row. The cards compared it exact.
2026-11-23 00:11:46 -08:00
Anees Iqbal 29e54794ca Runtime: a sampler state bound with LOD clamps of its own samples with them
A bind's LOD clamps (setSamplerState:lodMinClamp:lodMaxClamp:atIndex:, its
vertex and fragment forms and the range forms) that read otherwise than the
state's own were Gap::LodClamps. Metal takes the call; on the M3 Max
(conformance cases sampler-bind-lod-clamps-kernel and -fragment) the pair
replaces the state's clamps, a lower bound above the upper reads at the upper's
level, and a plain bind afterwards reads the state's own clamps again.

How: such a bind takes the state's variant of the pair, the state's descriptor
with the pair as its clamps, its device samplers from the shared sampler table,
placed at a variant element of set 1's sampler arrays. The three sampler arrays
grow from 4,000 to 8,000 elements in the runtime's layout; elements 4,000 to
7,999 are the variants'. Shaders declare the heap arrays unsized, so the
translator is unchanged: a slot's sampler index is the runtime's push, and an
argument buffer's sampler index of 4,000 or more still reads element 0, so no
program-written ID reaches a variant. A state keeps its 16 most recently bound
variants; a new one past them takes the place of the least recently bound one
no command buffer holds, and where work holds all 16 the new one is held by its
command buffer alone. Past 4,000 live variants a bind is
Limit::LodClampVariants { max: 4000 }. The lod_clamp_variants gauge counts the
live variants. A NaN bound, which Metal documents no answer for, binds the
state as it is.

The floor's sampler limits rise to 24,000 (maxPerStage and maxDescriptorSet
UpdateAfterBindSamplers) and 286,144 (maxUpdateAfterBindDescriptorsInAllPools);
the lab's least are 500,000 (MoltenVK on the M3 Max) and 1,048,576 (Intel UHD
Graphics 630 on Windows), and Vulkan requires 500,000 of each with
descriptorIndexing.

Gap::LodClamps goes; REFUSALS.md, basis.rs, the signature table, the Metal and
conformance coverage pages regenerate. The validation replay plays clamped
binds (no skipped_clamped_samplers). The ledger drops three rows the clamped
binds now answer (compute-plural-texture-and-sampler-binding steps 11 and 14,
render-state-unread-slots). The compute single clamp form's coverage row named
set_sampler_state; it names set_sampler_state_with_lod_clamps.

Tests: a kernel samples through the binds as Metal reads them; a state's 16
kept variants filled past that; the 4,000 variant elements filled past their
capacity; the gauge flat across a bind and retire loop and zero at device
drop. Verified: see the lane's report (jobs named there).
2026-11-23 00:11:19 -08:00
Anees Iqbal afbcfec9a7 Runtime: the compute encoder's imageblock size; a kernel's explicit imageblock is dispatched
ComputeCommandEncoder::set_imageblock_size is Metal's setImageblockWidth:height:. The encoder
keeps the size, 1 by 1 until a call sets one (Metal's size for an encoder that never sets one),
and a dispatch of a kernel that reaches an explicit imageblock runs at it: the translator's
SpecKey::ImageblockWidth and ImageblockHeight are specialized per VkPipeline (Constant::Imageblock),
as a threadgroup memory length is. The dispatch's refusal (Gap::KernelInput naming
RuntimeFact::ImageblockSize) goes.

- encoder: Sizes carries the encoder's threadgroup memory lengths and imageblock size to decide()
  and threadgroup_memory(); Lengths holds the imageblock size for a kernel that reaches one (0 by
  0 otherwise, so other kernels keep one pipeline whatever the encoder set), and its cells
  (w x h x cell bytes, rounded to 16) count in Limit::ThreadgroupMemory with the lengths.
- pipeline: Variant keeps its Lengths (the key is ([u32; 3], &Lengths, bool)); an imageblock
  kernel has no main pipeline, as a kernel that takes a threadgroup memory length has none;
  keeps_plain counts the imageblock as encoder-sized memory.
- Refusal::ImageblockSize: a side that is not a power of two (0 included) or more than 1024
  cells, whatever the state's maxTotalThreadsPerThreadgroup, as Metal's validation layer stops
  them at the call (probe crates/metal2vulkan-conformance/probes/imageblock_size_rules.m, job
  m3-max-70002, M3 Max, macOS 27.0.1).
- prepare_dispatch and dispatch_variant take the imageblock size as a fourth argument ([1, 1]
  where the encoder set none); a size the encoder would refuse makes nothing and answers None.
  The consumer's two call sites take the argument (planner, through main).
- Validation: the engine candidate sets a case's explicit imageblock size and passes it to
  prepare_dispatch; KernelImageblock narrows to a tile pass's implicit imageblock (the runtime
  builds no tile function). No executor ABI bump: no recorded row ran an explicit imageblock
  case, which the requirement refused. The replay player plays setImageblockWidth:height:, and the
  pre-pass passes each dispatch's size.

Form (step 0, jobs m3-max-69983, m3-max-69984): Metal compiles nothing for a new size (a new
size's first dispatch 202-312 us median against 205-228 us second use and 222 us at the control
size, a state's make 15-20 ms); a pushed size would size the Workgroup arena at Metal's 1024
cells on every dispatch. A new size here is one VkPipeline make at its first dispatch, a known gap.

Tests: tests::imageblock (replacing tests::kernel_input): a dispatch never sized runs 1 by 1; one
encoder runs 4 by 2 and 4 by 4, each read back, two first-use variant waits and no main
pipeline; the setter's refusals.
2026-11-23 00:09:50 -08:00
Anees Iqbal d825e52482 Validation: the suite's pins for the table work
- runtime-sources.sha256: the runtime inputs include the translator's bind
  module, where function_table_header and function_table_entry_offset became
  public; they lay out the words the shader already read, and no run of an
  unchanged artifact does anything else, so RUNTIME_VERSION does not move.
- public_linked_modules_resolve_by_hash_without_a_private_store lists the
  new public linked module visible_table_ops.
- coverage.tsv: MTLFunctionHandle's counterpart is the translator's
  FunctionHandle (the runtime re-exports it), and
  visibleFunctionTableDescriptor is VisibleFunctionTableDescriptor's Default,
  as the coverage test finds items.

The three failed in the validation suite at dabc455312 (m3-max-69738:
1291 passed, 3 failed).
2026-11-22 22:11:30 -08:00
Anees Iqbal 11d8892858 Validation: an authored case calls through a kernel's visible-function table
visible-table-entry-by-thread-calls-add-mul-null-sub (af884d65cb): twelve
threads of the owned visible_table_dispatch each call entry tid % 4 of a
table of four, linking table_add, table_mul and table_sub from the owned
module visible_table_ops, entry 2 left null. Installed with
corpus-case-check and qualified on Metal on the M3 in the primary reference
environment (m3-max-69730: three runs, 3, 3, 0xfffffffd, 0, 7, 15,
0xfffffffd, 4, 11, 27, 0xfffffffd, 8).

The public qualification (CI's lavapipe step) now also runs it and the
public table-query case 3a8f75e182, which the runtime refused before.
2026-11-22 22:11:30 -08:00
Anees Iqbal 28e2b0e6ca Validation: a kernel case's visible-function tables run through the runtime
The runtime candidate makes each table the case binds of the pipeline
state (newVisibleFunctionTableWithDescriptor: of its size, each authored
entry set to the handle of its linked function made with the case's
constants, as the Metal oracle sets it) and binds it at its buffer index.
ToolingRequirement::KernelFunctionTable, which held such cases to Metal
alone, is retired; a render stage's table stays the runtime's limit
(RenderFunctionTable). ENGINE_EXECUTOR_ABI does not move: no recorded row
ran a kernel table case (they were refused).

The runtime README states the device answer, the encoder's bind, the
state's handles and tables, and the known gaps (a table's 64 KiB block, a
consumer-compiled kernel's handles, an argument buffer's table). The
coverage table marks the compute items implemented; METAL-COVERAGE.md and
CONFORMANCE-COVERAGE.md are regenerated. Adds the owned linked module
visible_table_ops.metal, whose companions scripts/regen-air-fixtures
writes on the Mac.

Verified: the lane's jobs.
2026-11-22 22:11:29 -08:00
Anees Iqbal da020e5d7b Runtime: a compute kernel that reaches an explicit imageblock gets its state; its dispatch is refused
A compute pipeline state whose kernel reaches an explicit imageblock was refused at its make as
Gap::KernelInput of KernelInputKind::RuntimeFact naming ImageblockSize, which every arm64 macOS
guest boot meets once. The state is now made, and what stays refused is the dispatch, where Metal
reads the extent setImageblockWidth:height: set, which the compute encoder does not have:

- interface() takes RuntimeFact::ImageblockSize, keeping its cell bytes as Interface::imageblock,
  and leaves SpecKey::ImageblockWidth and ImageblockHeight at the module's default (0 by 0)
  instead of refusing them as a specialization it does not set.
- encoder::decide, which the dispatch, prepare_dispatch, dispatch_variant and the main pipeline's
  key all go through, refuses a kernel with an imageblock first, as Gap::KernelInput of
  RuntimeFact naming the fact (RuntimeFact::name). So no VkPipeline of such a kernel is made:
  finish_pipeline has no main key, and a pre-pass gets no key. A dispatch of such a kernel that
  writes no memory records nothing and is not refused, as for any kernel without effects.
- imageblock_memory_length_for_dimensions keeps its typed answer, Gap::ImageblockLength, for a
  kernel that declares an imageblock: the one recording of Metal's answer for such a kernel
  (conformance pipeline-facts-compute-imageblock, M3 Max, 256 bytes at 8 by 4 by 3) settles no rule.

The translator is untouched. Gap and KernelInputKind keep their variants; the docs of
Gap::KernelInput, KernelInputKind::RuntimeFact and Specialization, Gap::ImageblockLength (and its
basis line), the dispatch and the state's make say where the refusal now is. docs/REFUSALS.md,
docs/METAL-COVERAGE.md (setImageblockWidth:height:'s note) and docs/CONFORMANCE-COVERAGE.md are
regenerated. The runtime README's state facts and its known gap are re-worded, with the counts and
jobs kept. The conformance ledger's pipeline-facts-compute-imageblock row moves from case/state to
the facts' label and device (the consumer's own, as for every state) and imageblock_memory_length
(Gap::ImageblockLength). Validation's KernelImageblock requirement doc and its acceptance test's doc
name the dispatch's refusal and the renamed device test.

Test: tests::kernel_input::an_explicit_imageblock_kernel_is_made_and_its_dispatch_refused_as_its_named_runtime_fact
(replacing an_explicit_imageblock_kernel_is_refused_as_its_named_runtime_fact) makes a4_imageblock_extent's
state, reads its imageblock length as Gap::ImageblockLength, gets no dispatch_variant key, and has
one 4 by 2 threadgroup's dispatch refused as Gap::KernelInput of RuntimeFact { fact: "ImageblockSize" }.
2026-11-22 20:15:34 -08:00
Anees Iqbal a916e61185 Runtime: a kernel's [[stage_in]] is fetched; the three forms not built are Gap::StageIn by kind
A compute pipeline state whose kernel reads [[stage_in]] attributes was refused at its creation as
Gap::KernelInput of KernelInputKind::StageIn, which a guest met (a descriptor-form compute state, the
app's context closed right after). The translator already fetches every attribute in the shader from
the buffer slot at its layout's bufferIndex, through that slot's pushed address, by the stage-in and
dispatch regions the encoder already pushes. Two things stood in the way, both in the runtime:

- interface() refused any kernel whose PipelineInterface::stage_in is non-empty. The line goes.
- The thread-position fetch's reach check reads SpecKey::StageInReach, which the runtime's constant
  loop refused as a specialization it does not set. The runtime now leaves it at the module's default
  (true): one pipeline, the check kept for every dispatch.

What stays refused is a typed refusal naming its own form, Gap::StageIn of a new StageInKind:
- IndirectRegion: setStageInRegionWithIndirectBuffer:indirectBufferOffset:, now the method
  ComputeCommandEncoder::set_stage_in_region_with_indirect_buffer, which always refuses (the
  conformance rt side calls it in place of its own Unavailable);
- DynamicStride: an attribute the kernel reads through a thread-position layout of
  MTLBufferLayoutStrideDynamic (the compute encoder has no attributeStride setter), at the state's
  creation, before the translator's IdentityDomains refusal of StageInStride;
- IndexedStepRate: an attribute it reads through an indexed step at a step rate past 1, at the
  state's creation.
Both creation checks read the descriptor narrowed to the attributes the kernel reads
(kernel_inputs_read), so an attribute it never reads, and a constant step of a dynamic layout,
refuse nothing.

KernelInputKind::StageIn is deleted. Consumer search: `git grep -n 'KernelInputKind'` in the
reims-vgpu checkout at c8201ec2ba: 0 hits (nor any for `StageIn` as a refusal kind).

Tests: the device test every_device_fetches_stage_in_by_each_step_function dispatches
engine/kernel_stage_in's stage_in_fetch under ThreadPositionInGridX at rates 1 and 2,
ThreadPositionInGridXIndexed and Constant, and checks every thread's four attributes (threads past
the region read its last element); without the change the state is Gap::KernelInput.
every_device_refuses_each_unbuilt_stage_in_form_by_its_kind holds the three kinds and the two
states that are made. kernel_input's refusal test of StageIn goes; lowered and the harness's gap
test take Slot. The conformance case stage-in-region-clamps carries on past a refused row (probe,
as attribute_formats does), so its 27 other rows compare where the indirect one is refused. The
ledger drops the 82 rows of the old refusal (stage-in-region-clamps 1, attribute-format-fetches 29,
attribute-format-class-crossings 16, stage-in-unread-attributes 36), takes the indirect row's new
refusal, and the four compute attribute-stride rows' DynamicStride refusal. The validation
requirement KernelStageInput stays: the engine's run through the runtime passes no stage-input
descriptor or region. README, REFUSALS.md, METAL-COVERAGE.md, CONFORMANCE-COVERAGE.md and the
signatures table regenerated.
2026-11-22 13:07:16 -08:00
Anees Iqbal a7dd2e846e Translator: the binder's plan goes, with everything only it reaches, and the TexelRows and YCbCrInPlace forms
The runtime never made a plan (it binds each draw and dispatch by the pipeline's interface), and
since the census digests each pipeline's content alone (two commits back) nothing in the tree calls
one. What only the plan reached goes with it:

- bind: BindState, BindShape and their shapes, BindingPlan and its instantiation
  (DispatchCommands, DrawCommands, push, descriptor and root-table templates and writes),
  plan.rs and plan/ (compute, resources, slots), instantiate.rs, resident.rs, the neutral
  resources' plan side, the heap's member planning and table bytes, the mesh arguments pass
  (MeshArguments, MeshArgumentsForm, fold_object_grid, metal_object_grid), ExecutionStatus and
  StatusBits as public items, TextureShape::Buffer, IndirectRef with the four indirect call
  variants (Dispatch::ThreadgroupsIndirect, DrawCall::Indirect, PatchesIndirect,
  MeshThreadgroupsIndirect) and IndexBufferRef::fetch_end. Dispatch, DrawCall and IndexBufferRef
  stay: validation states its cases' calls with them.
- error::BindError leaves the public surface; a crate-private BindError of three variants stays
  as the error of the heap's view derivation, which lower::texture::slot's storage-read check
  reads (bind::heap::tier_read_gaps). That check keeps only the storage view's format: the
  sampled-view branch and ImageViewDesc were reached by the plan alone.
- vk::DrawCommand, the plan's draw output.
- pipeline: ComputePipeline::plan, RenderPipeline::plan; cache: VariantKey::covers and
  large_buffer_form.
- The TexelRows form (bind::texel_rows, LoweringInputs::texel_rows, RuntimeFact and PushField
  TexelRows) and the YCbCrInPlace form (bind::ycbcr_in_place, lower/sampler/in_place.rs,
  LoweringInputs::ycbcr_in_place and ycbcr_planes_sampled, RuntimeFact and PushField
  YCbCrInPlace, PrecisionNote FloatSampleFilter and HalfSampleFilter, Routine::Quad). Only the
  binder set those inputs.
- The tests of the deleted items, and the plan halves of mixed tests. Of 6810 tests (`#[test]`
  functions in the workspace) 309 leave and 11 come in their place: the lowering halves of mixed
  tests, kept without the plan (the heap layout, the stage-in stride and region facts, the
  emulated-simdgroup and bicubic facts, the iris-xe storage classes), and the kept tests of the two
  renamed files. 50 others are edited to drop a plan half or a deleted item (the api_surface round
  trips; the simd_emulated, extended-range, recursion, dynamic-root, handles, heap-storage-read
  and mesh lowering cases). 6512 remain. engine_graphics_binder.rs and engine_heap_binder.rs keep
  one and two tests and are renamed engine_unattached_colors.rs and engine_heap_groups.rs.
- The runtime guard test's list of files the runtime inputs reach without being inputs drops the
  seven no input reaches since the cut: cache/digest.rs, lower/simd/divergent.rs,
  lower/simd/workgroup.rs, pipeline/artifact.rs, pipeline/layout.rs, pipeline/stage_io.rs and
  pipeline/vertex.rs; three of its reasons that named the plan or the binder say what reaches the file now.

559 public items leave (api_signatures.tsv: 55 structs, 26 enums, 140 variants, 245 fields,
52 methods, 24 associated constants, 7 constants, 5 functions, 5 impls). Consumer search, the
consumer's development at 92ffbed817, `git grep -w NAME` of each of the 112 removed names: 0 hits
for 105; the others are the consumer's own items: TessellationFactors 4 (its
Bound::TessellationFactors), YCbCrMatrix 3 (its own string and doc), texel_rows 2 (its own fn),
ThreadgroupsIndirect 6 (its own Dispatch enums and rt::Dispatch::Indirect), DrawIndexed 1 (a doc
naming MTLIndirectCommandType values), covers 109 and plan 105 (generic words; the `.covers(`
calls are its Extent's, the `.plan(` calls its video encoder's rate.plan). Its one import of
metal2vulkan::bind is the argument-buffer layout types, which stay.

The forms' audit. A texture over a buffer: the runtime's
tests::over::every_device_holds_a_texture_over_a_buffer_in_place. A two-plane YCbCr sample: no
runtime test; the runtime makes no texture of a two-plane YCbCr format (Gap::TextureFormat, the
runtime README's "A format is made where the translator's format table maps it" row), the
conformance cases ycbcr_gathers and ycbcr_textures record Metal's answers, and
known-gaps-rt.tsv lists the runtime's refusals (ycbcr-gathers-*, ycbcr-texel-reads-420v).

Versions:
- RUNTIME_VERSION 2550: it covers plan instantiation and the binder's run-time data. Nothing calls
  those since step 2: the runtime never used the binder, and the own-context executor is gone. A
  run of an unchanged artifact does nothing different, so the guard hash (runtime-sources.sha256)
  moves alone, and the RUNTIME_VERSION doc is rewritten to name what it still covers.
- SEMANTICS_VERSION 2273: no output changes for any input that still exists. The TexelRows and
  YCbCrInPlace forms, their facts, push fields and the two notes were reachable only through
  LoweringInputs::ycbcr_in_place, ycbcr_planes_sampled and texel_rows. Only the binder set those;
  the runtime sets none. The function key appended each of them only when set, so every surviving
  key hashes the same bytes. Two type declarations stay where they were, so module words do not
  move: bool in the bicubic types, uvec4 in the bicubic routines. Byte-identical modules are
  expected, not verified here; the 252-row hash probe is the check.
- ARTIFACT_FORMAT_VERSION 591: the codec tags enum variants by name. The removed RuntimeFact,
  PushField and PrecisionNote variants leave their tags unused, which cache/mod.rs's rule says
  needs no bump: an old entry holding one fails to decode, which is a miss. No codec_struct field
  is removed. That is why SamplerDesc.ycbcr stays.

The guard hash (crates/metal2vulkan-validation/runtime-sources.sha256) moves for the bind/
sources this deletes and edits and for vk/draw.rs, which leaves its list. No run of an unchanged
artifact changes: what stays in bind/ computes what it did (the heap's tier check takes the same
storage format; its removed sampled branch had no caller).

Docs: docs/API.md (section 5 is the interface; the binding and plan sections go), README.md,
docs/ARCHITECTURE.md, docs/HOWTO.md, docs/VALIDATION.md, the runtime README's DrawInput and
identity-domain rows, docs/REFUSALS.md (regenerated; the binder's section goes),
api_reference.md, api_signatures.tsv (blessed: removals only), tests/api_surface.rs, the
signatures floor (5000), the bind modules' own docs, and the public field docs of PushField,
RuntimeFact and SpecKey that named BindState, BindShape or BindingPlan. AGENTS.md: the project
table names pipelines and their interfaces, not binding plans; its "core lives in" line stays
true (bind/ still holds what the lowering reads).

Verified on 31692939d4, this commit's tree (steelbrain/cutbinder-probe-6): job m3-max-68107,
fmt, signatures, refusal surface, clippy -D warnings (workspace plain, --cfg m2v_gpu,
--cfg m2v_cpu_icd; the translator with no feature and with each alone; the AIR crate alone),
workspace Rustdoc -D warnings, each crate's private intra-doc links at 0, api-docs; job
m3-max-68109, the product, validation and conformance suites, doctests, and on lavapipe the
validation and runtime suites under --cfg m2v_cpu_icd, the conformance replay and the public
cases' qualification.
2026-11-22 10:15:34 -08:00
Anees Iqbal d9077dfa0d Push window: each device's maxPushConstantsSize sizes it, up to 256 bytes (rule 2's ninth form)
What: the push window is one value per device, `DeviceProfile::push_window`, the description's
maxPushConstantsSize up to 256 bytes, decided in the profile `Device::from_queries` derives
(device/profile.rs:115). Every window reads it: push placement (`lower::push::window`, `place`,
`spills` and `check_floor` take its bytes; lower/select.rs, lower/access/mod.rs and
lower/access/table.rs pass it), and in the runtime the one pipeline layout's push range
(device.rs:688), the kernel and render pipelines' push checks (pipeline.rs:2119, render.rs:1043)
and the encoder's push bound (encoder.rs:1759). With W that value, a kernel pushes in [0, W), a
vertex function in [base, W - 8) and a fragment function in [base, W); object and mesh functions
keep 0..32 and 32..64. A stage's fields past its window spill to its parameter block, whose
address the window holds, as they did past 256. `from_queries` refuses a maxPushConstantsSize
below 128, Vulkan's least, only (`Unsupported{PushWindow}`, required 128), and the runtime's
floor no longer lists maxPushConstantsSize (floor.rs: its row and PUSH_CONSTANT_BYTES go; the
layout's range was a constant 256). There is no constant 128 path, no switch and no environment
gate: the limit query is the only input. Ported from the held branch steelbrain/amdfloor-window
(d6880ca16b) onto today's development, every line reference confirmed against this tree.

Why: the owner's word choosing option B. A device reporting 128 bytes was refused by the floor;
it now runs with a window of 128.

AGENTS.md rule 2 takes the owner's authorized text: "for eight only" becomes "for nine only",
and the push window joins the list after run-time texel offsets.

Known gap (runtime README, Known gaps of indirect command buffers): in a window of 128 bytes a
command reaches 9 vertex slots, and 8 where the vertex function spills, against 25 and 24 at 256
((W - 8 - 16 - 28) / 8; from code: lower::push's
an_indirect_draw_s_vertex_function_pushes_25_or_9_slot_words). A kernel pushes 8 buffer
addresses beside its dispatch region at 128 bytes against 24 at 256, the rest from its ring.

Caches: a device of 128 and one of 256 share no cached artifact and no pipeline. The profile's
fingerprint hashes every ProfileFields field by Debug (device/profile.rs:312, :327), the limits
included (:346, maxPushConstantsSize at :625); `function_key` hashes the fingerprint
(pipeline/compile/key.rs:182, :189; passed at pipeline/compile.rs:2973), as does
`queried_render_descriptor_key` (key.rs:546); a cached artifact or pipeline loads only under an
equal fingerprint (cache/artifacts.rs:71, :204, :238; cache/envelope.rs:142); and the runtime's
enables digest, which the stage keys check, hashes it (metal2vulkan-runtime/src/device.rs:1533).

SEMANTICS_VERSION stays 2273: no module changes under an unchanged key. Every device
`from_queries` accepted before reports 256 bytes or more (it refused below 256), so its window is
256 as before and its modules are the same bytes; a device of fewer bytes was refused, so it
holds no artifact to go stale, and its modules are new under its own fingerprint. The golden
test at this tree found 0 cells changed under an unchanged key over the 15 committed profiles,
and 1855 under a changed profile fingerprint, runtime-floor's column alone (m3-max-68089; the rows
whose assembler Linux lacks are not observed there).

Golden table: runtime-floor.json and its generator drop the floor block's maxPushConstantsSize
of 256, so the profile reads Vulkan 1.3's least, 128, and its fingerprint moves. Its cells are
re-blessed on development (the bless needs macOS's assembler).

Validation: runtime-sources.sha256 is rewritten (d4a8dbf2...), since device/derive.rs and
device/profile.rs are runtime inputs the guard hashes.

Docs: the runtime README (the floor's limits note and table, compute Parameters, the render push
range, the indirect command buffers' known gaps), docs/API.md section 5 and the from_queries
paragraph, PushWindow's doc, reach.tsv and docs/REFUSALS.md (regenerated; the PushWindow row
only), the device profiles' README, and api_signatures.tsv (DeviceProfile::push_window). The
api_surface table is unchanged: no public type is added.

Tests: lower::push's placement at 256 and 128; from_queries (each committed profile's window is
its limit up to 256, runtime-floor's 128; 128 derives, 64 is refused with required 128); the
tessellation control range, the engine identity and spill tests in each profile's window; and
the runtime's push_window, patch and indirect token tests in two arms each, the device's own
limit and the limit held at 128 by the tests' device shim (tests/command.rs push_window_128,
DeviceOptions::described).

Verified:
- m3-max-68088 (this tree): fmt, the signatures table, the refusal surface, clippy -D warnings
  plain, --cfg m2v_gpu and --cfg m2v_cpu_icd, workspace Rustdoc -D warnings: each exit 0. The
  runtime suite on lavapipe (--cfg m2v_cpu_icd): 647 passed, 3 skipped. Its push lines read
  "push_window: the push window is 256 bytes", "push_window_128: the push window is 128 bytes",
  "window 128, 12 buffers: 3 ring writes and 3 pushes over 3 dispatches", "icb_tokens: ... the
  push window 256 bytes, 25 slot words", "icb_tokens_128: ... the push window 128 bytes, 9 slot
  words", and draw_patches_full_range at 256 and _128 at 128.
- m3-max-68089 (this tree): the core crates 3881 of 3882 passed, 24 skipped; the one failure
  is the golden table, stale under runtime-floor's moved fingerprint (1855 cells, one per row
  observed on Linux, 0 new, 0 gone, 0 under a changed source, 0 changed under an unchanged key).
  Validation 1314 passed, 3 skipped. The translator's push tests print each committed profile's
  window: runtime-floor 128, the vertex function ending at 120, 9 inputs; the 14 others 256.
- m3-max-68067: the whole runtime suite on lavapipe at an earlier tree of this change
  (a98af765ad, before the rebase onto 91fed9449c and the options alias) with a probe commit that
  holds every device's limit at 128 in Device::open (steelbrain/amdfloorb-probe128, never landed):
  647 passed, 3 skipped; the conformance replay exited 0; every push line read 128 bytes.

No card under 256 ran it; the 128 form ran on lavapipe with the limit held at 128.
2026-11-22 10:14:23 -08:00
Anees Iqbal c1bcce40f5 Validation: the drm-shim recipe goes, with its image, its wrapper and its test
The runtime does not open the drm-shim devices as a guest's device (step 0's P2, ruled: the shim
has no venue), so the corpus-pipeline kernel rows that now run through the runtime have no
drm-shim sweep, and nothing else used the recipe. Gone: scripts/drm-shim.Dockerfile,
scripts/drm-shim-exec, scripts/linux-gate's `--recipe drm-shim` with its `--driver` and `--chip`
(and `--recipe` itself, which had only `gate` left), scripts/linux-gate-vulkan's shim ICD block,
and the integration test tests/integration/drm_shim.rs. Driver acceptance on RADV, ANV and NVIDIA
stays on the real cards.

Search at this commit: `git grep -n -i -E 'drm.?shim|M2V_DRM_SHIM'` gives 0 lines; `git grep -n
-e '--recipe'` gives 0. The consumer has no copy of these scripts (they are not part of a
published crate).

(cherry picked from commit 59693588b00825ed312beb67841fe5b8352a6508)
2026-11-22 07:37:15 -08:00