Commit Graph
9479 Commits
Author SHA1 Message Date
Anees Iqbal 7d8d96f65e Validation: the stencil reference face reads its faces by value
Fix-forward of 522914946b, whose build failed (job m3-max-73916, E0597): the array of face
references was a temporary of the method's tail expression, which outlives the local Vulkan state
it borrowed under edition 2021's drop order. The faces are Copy, so the array holds them by value;
the rule is unchanged.

Verified at this commit: cargo fmt only; the next build job compiles it.
2026-11-25 13:24:41 -08:00
Anees Iqbal 5517e2df1b Validation: a stencil output whose test it decides needs VK_EXT_shader_stencil_export on a device without it
What: the engine's render route through the runtime now reads, from the case's own structure, the
draws the runtime refuses on a device without VK_EXT_shader_stencil_export, and records them as the
device's refusal (NotSupported::NotEnabled, not_supported{not_enabled}, class device) naming the
extension, the face and its compare function, instead of drawing them and failing on the runtime's
Gap::Draw { kind: StencilOutput }.

- RenderCase::stencil_output: the case's own fragment function writes a live [[stencil]] output,
  read from its AIR outputs' roles (executor_contract::depth_stencil_test), false for a vertex case.
- DrawDepthStencil::stencil_reference_face (executor_contract/depth_stencil.rs): the first face
  whose stencil test the output decides. It is the runtime's rule, depth_stencil::BitDraws::of, on
  the same Vulkan state (metal::state::depth_stencil_state of the same descriptor): None where the
  stencil test is off; otherwise a face whose compare op is other than ALWAYS and NEVER, whatever
  its operations and masks (BitDraws::of returns None before it reads the replaced bits).
- runtime_render::run: once the state is made, a case with a stencil output, on a device whose
  translator profile lacks fragment.stencil_export (the bit the translator chose the bit-draws form
  by), under a state with such a face, is NotEnabled. After the make, so the product's own refusals
  at creation (a colour beside the output: StencilExport) keep their records.

The runtime's second refusal, a draw that replaces a bit inside a Counting visibility segment,
meets no authored case: the case schema and the executor set no visibility result mode, so no
draw is in a segment. The doc comment and docs/VALIDATION.md say so.

Why this form and not the runtime limit: a ToolingRequirement with Limit::Runtime stops the engine
on every device, and lavapipe, RADV and ANV list the extension and run and match these cases. The
refusal holds only on a device without the extension, which is what a device's NotEnabled records.
Before the stencil form (5a722b5c3f) such a case was the device's refusal on NVIDIA too, through the
translator's StencilExport. Round 733b14ed24's RTX 3090 public leg failed 14 such cases
(stencil-output-reference-* and stencil-output-at-*-rate-*: "the runtime refused a case its
structure classifies as one it runs (Draw { kind: StencilOutput })").

Versions: none move. The authoring-capability census classifies by ToolingRequirement, which this
does not touch, so no census or index version. ENGINE_EXECUTOR_ABI stays: on a device with the
extension nothing changes, and on one without it every case this refuses failed at the base with
no row and no refusal recorded, so no recorded row observes the change (engine.rs's rule for a
bump).

Tests: runtime_render's a_stencil_output_needs_the_extension_where_it_decides_its_test, on the
committed profiles nvidia-rtx5080-laptop (no extension) and gate-lavapipe (the extension): every
pair of the eight compare functions on the two faces under Keep and Replace, 120 refused naming
the face and its function, the 8 of Always and Never drawn; a function with no stencil output and
a device with the extension draw every state. The graphics mapping tests assert stencil_output for
fragment_depth_stencil and its absence for fragment_varying_color. Without this change the case
reaches the runtime's draw and fails, as on the 3090.

Verified at this commit: cargo fmt only. The jobs that check it (the validation suite, the 3090
public leg, lavapipe's public leg) report to the orchestrator.
2026-11-25 13:24:41 -08:00
Anees Iqbal c5cedb39b3 Landing note: AIR 1.8's pre-LLVM-4 records, read as LLVM 23.1.2 reads them, compile the launcher's library
No code change. This commit carries what the reader change (be0718e716) and its fix (d8e42b5e8c)
were verified by, since published history is not amended.

- The six forms (METADATA_STRING_OLD, METADATA_KIND in the METADATA block, METADATA_OLD_NODE,
  INBOUNDS_GEP_OLD, and LOAD and CALL without their types) follow LLVM's reader at
  llvmorg-23.1.2. Its BitcodeReader.cpp and MetadataLoader.cpp are byte-identical to
  llvmorg-23.1.5's, the release of the llvm-dis and llvm-as the differential used.
- The real file (the guest's library, which stays on our hosts), job m3-max-73898 on um870 at
  d8e42b5e8c, release CLI, runtime-floor profile: each of the 7 modules alone passes the reader
  (f0 and f1, the vertex functions, compile; f2 to f6 get the CLI's "fragment compiles in a render
  pipeline" usage answer). The 6 pipelines Metal makes (f0+f2, f1+f2 to f1+f6) compile and
  spirv-val accepts them, as it does f0 and f1 alone. The 4 pairs Metal refuses (f0+f3 to f0+f6)
  are refused as UnmatchedVarying, as Metal refuses them for a fragment input the vertex function
  does not write. Every run takes under 0.01 s and peaks at 15 MiB. The largest public fixture
  (engine/wps_shuffles.ll, 10 kernels) takes 0.01 to 0.02 s per kernel and peaks at 17 to 18 MiB.
- The differential, the same job m3-max-73898: each module rewritten by llvm-dis of 23.1.5, then
  read by the existing path through llvm-as (llvm-link joining a pair's two modules), gives word
  for word the SPIR-V of the new reader: f0 and f1 alone and the 6 pipelines. The 4 refused pairs
  are refused both ways.
- The ABI check against Metal's reflection on the M3 (job m3-max-73835): the 6 pipelines' bindings
  are equal in stage, kind, index, access, texture type and data type, and sampler. Today's rule,
  not this change's: a buffer slot's window is the byte range the shader can touch, not the
  declared size, so f2's buffer 0 reads 16 B where Metal reflects the 48 B struct.
2026-11-25 13:14:58 -08:00
Anees Iqbal a68c6633c2 Bitcode: count the module values with type ids before reserving room for the rest
The reserve borrowed value_type_ids mutably while its own length was an argument (E0502 at
be0718e716, jobs m3-max-73885 and 73886). The count is taken first.

Verified: not yet run at this commit; the lane's check jobs follow.
2026-11-25 13:14:58 -08:00
Anees Iqbal b6b940fd5f SEMANTICS 2304: AIR 1.8's pre-LLVM-4 metadata and typed-pointer records now read
What: SEMANTICS_VERSION 2303 -> 2304.

Why: the reader change before this commit changes the output for an input under an unchanged
key. A module with METADATA_STRING_OLD, METADATA_KIND in the METADATA block, METADATA_OLD_NODE,
INBOUNDS_GEP_OLD, or a LOAD or CALL without its type was refused InvalidInput(Unsupported(
BitcodeRecord or Instruction)), and it now decodes and its functions may compile. docs/HOWTO.md
section 4 lets a consumer keep a non-transient error as the answer for that input and device, so
without the bump a cached refusal would outlive the fix. A module that decoded before decodes to
the same tables, except that a METADATA_KIND record with fewer than 2 operands or a kind id stated
twice is now malformed, as LLVM's reader refuses it. The golden table reports a bless due; it is
re-blessed on development.

Verified: not yet run at this commit; the lane's suite job follows.
2026-11-25 13:14:58 -08:00
Anees Iqbal 31b3470a3e Bitcode: read the pre-LLVM-4 metadata and typed-pointer records of AIR 1.8
A game launcher's metallib (AIR 1.8, language 1.1) parses since the container fix, but each
of its 7 functions stopped in the bitcode reader at METADATA_STRING_OLD. A structure-only census
of its 7 modules (job m3-max-73828) found six refused forms in all and nothing else unknown:
METADATA_STRING_OLD, METADATA_KIND inside the METADATA block, METADATA_OLD_NODE,
FUNC_INBOUNDS_GEP_OLD, LOAD without its type, and CALL without the explicit-type flag.

Each is now read as LLVM's reader reads it at llvmorg-23.1.2:

- STRING_OLD (MetadataLoader.cpp:2424-2433): one MDString of the operands as bytes, the next
  metadata id. Its llvm.vectorizer. loop-key upgrade (AutoUpgrade.cpp:6979-7026) renames keys
  the IR keeps in neither spelling, so the decoded loop hints are unchanged.
- KIND in the METADATA block (2457, parseMetadataKindRecord 2631-2643): the METADATA_KIND
  block's record. Both places now refuse a record with fewer than 2 operands and a kind id
  stated twice, as LLVM does.
- OLD_NODE (1401-1428): a uniqued node of (type, value) pairs. A metadata-typed operand is a
  metadata id, a void one is null, and any other is the module value of that type and id, as
  ValueAsMetadata. LLVM numbers no id for such a value; the arena keeps one Md::Value entry per
  value after the block's own ids, and MdIds moves every id LLVM numbers later (later module
  blocks, function blocks, attachments, call operands) past them.
- INBOUNDS_GEP_OLD (BitcodeReader.cpp:5383-5450), LOAD (6418-6436) and CALL (6886-6964)
  without their types: the source element, loaded or function type is the pointer operand's
  contained type. The reader follows LLVM's type ids (getContainedTypeID, 1510;
  getVirtualTypeID, 1532) for every value: TypeIds keeps the virtual ids for pointers made by
  alloca, GEP and the module's globals and functions, shuffles and cmpxchg; each instruction's
  result takes the id LLVM's reader gives it.

Still refused, by name: METADATA_OLD_FN_NODE; KIND and OLD_NODE in a function's block; an
OLD_NODE value in a module block after one whose old nodes kept values; a load atomic without
its type; GEP_OLD (not inbounds) and STORE_OLD. None is in the file. A typed-pointer load, call
or GEP whose operand has no contained type (an opaque pointer, a non-pointer) is BadType or a
malformed record.

Tests: typed_pointer_records_without_their_types_read_as_with_them decodes one typed-pointer
module in both spellings (a struct field, an array element, a loaded pointer, a cast, an
argument, and a function whose record names a pointer to its type) and asserts the tables are
equal, plus the refusals. legacy_metadata_records_read_as_their_modern_twins decodes the
function-test module with its metadata in the old records, asserts the body equals the modern
twin's, the arena's layout, and the shifted ids in a second module block and in a function
block, plus each refusal. Both fail without the fix: the old records were refused. The tests
that asserted those refusals now assert the remaining ones (OLD_FN_NODE).

docs/REFUSALS.md regenerated. Not yet run at this commit: the suite job follows.
2026-11-25 13:14:58 -08:00
Anees Iqbal 8f74582eb3 Docs: CONFORMANCE-COVERAGE.md regenerated for pass-sequence-aspect-actions' NVIDIA ledger row
b7ec03d37a added the row; the generated coverage document counts ledger rows (7983 -> 7984) and lists the case.
Development's suites at a551bbed9f (m3-max-73870) failed the_conformance_coverage_document_is_what_the_sources_derive
on it. Regenerated with scripts/conformance-coverage/coverage.py; no other change.
2026-11-25 12:53:50 -08:00
Anees Iqbal f08dab8584 Runtime tests: the refused device's memory view is one test function
What: the seam's real-use test's view moves out of
a_device_with_no_cached_coherent_type_is_refused_naming_its_types into
crate::tests::cached_types_incoherent (under the device cfgs), which the test now calls. The
view takes HOST_COHERENT from every type that is host-visible, host-coherent and host-cached, so
no type is both cached and coherent, the shape of the user's Meteor Lake GPU under Mesa's Intel
driver and i915; every other type keeps its flags. It now asks HOST_VISIBLE too, which every
cached or coherent type has.

Why: the planner rules one view for both lanes on that regression (anarrow and sharedimport),
whose builds run the device suite through it; one function holds it.

Verified: not yet run (cargo fmt only). A lavapipe and a real-card run of the test follow.
2026-11-25 12:48:48 -08:00
Anees Iqbal a551bbed9f Runtime tests: a test-only memory view for the device, and a device refused through it
What: DeviceOptions gains a test-only field beside `maker` and `described`, under the same cfg
(all(test, any(m2v_gpu, m2v_cpu_icd))): `memory: Option<fn(&mut vk::PhysicalDeviceMemoryProperties)>`.
Device::open applies it to the floor's capabilities.memory right after physical.check(), before
anything reads them: floor::memory_types -> choose, arena::budget, the device-local bits and
Imports::new. The floor's check of the physical device still reads the device's own answers.
floor::buffer_memory_bits is the memoryTypeBits question floor::memory_types already asked, now
its own function so the test asks it too.

Its use: tests::floor::a_device_with_no_cached_coherent_type_is_refused_naming_its_types, under
the device cfgs. For every device of the cfg's kind, the view takes HOST_COHERENT from each type
that is both host-cached and host-coherent, so the device lists its types as the user's Meteor
Lake GPU does under Mesa's Intel driver and i915. The device is refused at its make, and the
refusal equals the floor's choose() over the view with the buffer bits a device made without the
view answers: it names the Shared flags and the types the device offers a buffer.

Why: no lab card lists a host-cached type that is not coherent (vulkaninfo, jobs m3-max-73858 to
73861), so the floor's answer for such a device can only be reached through a view of a real
device. Lanes on that regression run the device suite through it. No product path changes: the
field and its application exist only in the device test builds; no env var, no switch.

Verified: not yet run (cargo fmt only). The build and the lavapipe and real-card runs follow.
2026-11-25 12:44:05 -08:00
Anees Iqbal b7ec03d37a Conformance ledger: pass-sequence-aspect-actions is refused on NVIDIA as on every other venue
Before the stencil form (5a722b5c3f), NVIDIA's replay refused this case at its pipeline for lacking
VK_EXT_shader_stencil_export: lacks-feature (round 0c9db49765, 3090 replay m3-max-73622). With the form, that refusal
is gone, and the case reaches the refusal every other venue's row names: a render pipeline state with
DepthStencilFormats (separate depth and stencil formats) is not built, Gap::RenderPipeline. The NVIDIA replays of
round 733b14ed24 stopped on the missing row on the 3090 (m3-max-73826), the 2080 (73831) and the 5080 (73829).

The row is the RADV row's text with the venue NVIDIA. No product change.
2026-11-25 12:43:21 -08:00
Anees Iqbal 470fac6d77 Census at 9df5c5a8ac: the authored compile census is unchanged after deadbind and the format 2.2 reader
2347 cases x 9 profiles: 21123 cells, 19539 compiles, 18829 compiled, 2294 refused, 0 failed, 0 differences,
0 regressions. Only the artifacts_at product fingerprint moves (1bdc9e86... -> c9520053...).

Verified: census job m3-max-73853 on the M3 at 9df5c5a8ac (census-exit=0).
2026-11-25 12:42:03 -08:00
Anees Iqbal 6a9115a1ec Bless at 9df5c5a8ac: the golden table's semantics line moves to 2303
SEMANTICS_VERSION moved 2302 -> 2303 with the metallib format 2.2 reader (25945236d1). Every golden cell is
unchanged (0 moved cells); only the semantics line follows. Engine inventory and air_input printouts unchanged.

Verified: bless job m3-max-73854 on the M3 at 9df5c5a8ac (inventory=0, golden=0, printouts=0; patch is this one line).
2026-11-25 12:42:03 -08:00
Anees Iqbal 9df5c5a8ac Tests: the format 2.2 library test takes each name by auto-deref
What: name: *name became the field shorthand; clippy's explicit_auto_deref
refused the deref in all three configurations (quick check m3-max-73798).

Verified: the next quick check.
2026-11-25 12:25:49 -08:00
Anees Iqbal 25945236d1 SEMANTICS 2303: a metallib without MDSZ or an extended header now translates
What: SEMANTICS_VERSION 2302 -> 2303.

Why: the container fix (c9b08b08f5) changes the output for an input under
an unchanged key: a format 2.2 library, whose entries carry no MDSZ and
which has no extended header, was refused InvalidInput(Container(
MissingTag)), and it now parses and its functions compile. docs/HOWTO.md
section 4 lets a consumer keep a non-transient error as the answer for
that input and device, so without the bump a cached InvalidInput would
outlive the fix. A library that parsed before parses to the same
functions, so no other output changes. The validation censuses key on
SEMANTICS_VERSION (the translation census and the authored-compile
census through the product's census key) and move with it. Harvest
carves the modules of a library the reader refuses and keys nothing on
the reader, so no census, index or harvest version needs a bump of its
own. The golden table reports a bless due; it is re-blessed on
development.

Verified: the lane's quick check and suites at this commit.
2026-11-25 12:25:49 -08:00
Anees Iqbal ca4759d43f Tests: the format 2.2 library test compares the compiled module's words
What: the compiled function's artifact holds its words in module.words;
the test now compares them and the whole artifact (m3-max-73786 did not
compile the spirv field).

Verified: the next build job.
2026-11-25 12:25:49 -08:00
Anees Iqbal 86a813dc06 Tests: the format 2.2 container test's table is a function, its lifetimes named
What: the closure returning the parsed functions' borrowed fields did not
compile (lifetime may not live long enough, m3-max-73782); a nested fn
names the library's lifetime.

Verified: the next build job.
2026-11-25 12:25:49 -08:00
Anees Iqbal 4bcb58dbb1 Container: read a metallib of format 2.2, whose entries carry no MDSZ and which has no extended header
What: MDSZ is no longer a required function-entry tag. An entry without it
holds its module from its start (OFFT) to the next module's start, the
nearest larger bitcode start of any entry, or to the bitcode section's end
for the last. And where a section holding bytes starts at the last entry's
end, the library has no extended header and no extended tags. The entries'
bitcode ranges are resolved once every entry's start is known (a new
Entry, read from the tags, then with_bitcode). NAME, TYPE, HASH, OFFT and
VERS stay required. The overlap, section-bounds and HASH checks are as
before, and HASH is verified over the resolved range.

Why: a guest's library, an app's precompiled metallib of format 2.2 from
an older toolchain, was refused as Container(MissingTag) at its first
entry, and every pipeline made from it was dropped. Its seven entries are
NAME, TYPE, HASH, OFFT, VERS. The length rule comes from what the file
itself states and is exact. In Apple's output every module is a bitcode
wrapper padded to a multiple of 16 bytes, written right after the one
before it, and MDSZ is the distance to the next module's start, not the
wrapper's offset plus size (probe m3-max-73748, 4 of 4 modules). In the
guest's file, read for structure only on its lab host (m3-max-73749), each
HASH is the SHA-256 of the bytes up to the next module's start for 7 of 7
functions. The wrapper's own size gives that range for only 4 of 7, so
reading it would have refused 3 with HashMismatch. Since HASH is checked
over the range, a module of any other length is still refused. Behind the
MDSZ refusal the same file met a second one: its public metadata starts
right at the end of its function list (939), so there is no extended
header, and the reader would have parsed the metadata as tags (BadTag).
Metal takes such a library and runs it: m3-max-73748 made a library from
our own MSL with MDSZ removed from every entry, at header 2.9 and 2.2,
made all its functions, and ran both kernels and the render pipeline as
expected, with MTL_DEBUG_LAYER on and off. Without any of the other five
tags Metal makes no function that runs as written, so they stay required.

Docs: mtlb.rs's module docs (the 2.2 layout, the length rule and why it is
exact, Metal's answers); ContainerError::MissingTag's doc. No refusal
kind, public type or cached artifact changes: a library that parsed before
parses to the same functions.

Fixture: metal2vulkan-devtools' metallib_2_2 writes the 2.2 layout (header
2.2 with os and os version 0, no MDSZ, no extended header) around the
modules a test supplies.

Tests: container::tests::format_2_2_entries_hold_their_module_to_the_next_start
(padded and unpadded modules, the table equal to the MDSZ layout's, one
entry without MDSZ among entries with it, a HASH of the unpadded wrapper
refused as HashMismatch); malformed_function_tags no longer lists MDSZ;
tests::format_2_2_libraries (three owned fixtures padded to 16 bytes, one
past its wrapper's end, in metallib_2_2: same content keys, compile keys
and SPIR-V words as in today's layout). Both new tests fail without the
reader change (MissingTag).
2026-11-25 12:25:48 -08:00
Anees Iqbal b9e8caacce Probe: the padding past a module's wrapper is 8 or 12 bytes
What: the probe's header said 8 bytes; in m3-max-73748 the fragment
module of one run was padded by 12.

Verified: read from m3-max-73748's output.
2026-11-25 12:25:48 -08:00
Anees Iqbal bca06b344d Probe: Metal takes a metallib without MDSZ, and no function without the other entry tags
What: the answers job m3-max-73748 measured with
probes/metallib_without_entry_tags.sh (an M3 Max, macOS 27.0.1), written
into the probe's header.

Why: they decide which of the reader's required entry tags a library may
lack. Metal makes a library whose entries carry no MDSZ, at header 2.9 and
2.2, and runs its kernels and its render pipeline as written. Without NAME
it makes no function; without TYPE newFunctionWithName: ends the process;
without HASH it answers with code compiled for another library; without
OFFT every function reads the first module; without VERS every pipeline
fails. In Apple's own output each MDSZ is the distance to the next
module's start, its padding counted, and HASH covers those bytes.

Verified: m3-max-73748, every case with MTL_DEBUG_LAYER=1 and without
(the runner exits 1 because no-TYPE ends its processes).
2026-11-25 12:25:48 -08:00
Anees Iqbal 03bd95725d Probe: what Metal answers for a metallib whose entries lack a required tag
What: a Metal probe (metallib_without_entry_tags.m and its runner) that
compiles our own MSL (two kernels, a vertex and a fragment function) into
a metallib with Apple's toolchain, then leaves one of NAME, TYPE, HASH,
MDSZ, OFFT or VERS out of every function entry (the entries shrink; the
rest of the file stays put, or moves up with its offsets), optionally at
header version 2.2, and asks newLibraryWithData: for it: the library,
each function, each kernel's dispatch and the render pipeline's texel.
The as-is case prints the file's structure: per module its MDSZ, the
bitcode wrapper's end, the next module's start, and which range's
SHA-256 is its HASH.

Why: a guest's metallib of format 2.2 carries no MDSZ in any entry and
the reader refuses it (Container(MissingTag)); Metal's own answer comes
first. Each run compiles with its own seed, so no run is answered from
another's compiled functions.

Verified: not yet run; the M3 job's answers follow in the probe's header.
2026-11-25 12:25:48 -08:00
Anees Iqbal 6436d131b4 Docs: the comments that cited X34 or the deleted binding plan say what is true now
Two validation module docs cited the design record X34, which AGENTS.md forbids:
- air/reflect/tests.rs now says only what its tests do: hold the declared interface's access and descriptor rules to
  fixed expectations.
- metal/command_guard.rs no longer says a test holds it to the product's copy until X34 deletes that copy. The
  product has no copy (git grep NativeCommandPolicies under crates/metal2vulkan and crates/metal2vulkan-runtime: 0 hits
  at 19b5e99b9b), and no such test exists.

bind/state.rs said "the plan" for the deleted BindingPlan. It now names what decides today:
- the binder refuses a sparse texture where the module has no sparse form (Feature::SparseTexture);
- the binder checks a linear sampler's filter features;
- a cubic sampler is emulated under its pipeline variant's cubic samplers;
- a sampler shape is checked by check_sampler when vk_sampler makes it;
- a texture's view facts change the variant, specialization or views a slot binds it through.

Comments only; no code changes. bind/ is an input of validation's runtime guard, so runtime-sources.sha256 moves to
c34d72c7..., computed by a copy of build.rs's hash. The same copy reproduces 19b5e99b9b's committed 8d8c9df1...
RUNTIME_VERSION is unchanged, since no behaviour changes.

Deadbind's follow-ups, done in session on the planner's word. They are verified by the development check that follows.
2026-11-25 12:25:44 -08:00
Anees Iqbal 19b5e99b9b Validation: the runtime guard's hash for the deleted indirect-command and Y′CbCr planes code
The suites job m3-max-73743 at efd3aa17a1 failed one test,
candidate::engine::artifact::tests::the_runtime_sources_are_the_committed_ones: this stack edits
twelve runtime guard inputs. No run of a given artifact changes, so the hash alone moves:

- indirect_commands.rs, indirect_commands/host.rs and descriptor.rs lose only items nothing calls
  (04070aeb56 names their zeros) and docs; every item a run reaches is unchanged.
- vk/structs.rs loses SamplerDesc's and SamplerKey's `ycbcr` and SamplerDesc::ycbcr, and
  metal/sampler.rs its `ycbcr: None`. At 733b14ed24,
  `git grep -nE '\.ycbcr([^_a-zA-Z]|$)|ycbcr: (Some|None)|SamplerDesc::ycbcr' 733b14ed24 -- 'crates/*.rs'`
  shows the only `Some` was SamplerDesc::ycbcr, called only from pipeline/link.rs's
  ResourceKind::YCbCrPlanes arm, which nothing constructed (60cf39099e), and the field's only read
  copied it into SamplerKey. Every run's sampler had `ycbcr: None`, so its creation and its key
  are the same. The artifact codec's SamplerDesc lost the field, and 60cf39099e bumped
  ARTIFACT_FORMAT_VERSION for that.
- bind/ycbcr_convert.rs and bind/mod.rs lose YCbCrPlanesSampler, which nothing constructed.
  bind/indirect_commands.rs's re-export list shrinks by the deleted items.
- ash_interop/convert.rs, ash_interop/query.rs, device/description.rs and device/khronos.rs
  change in comments only.

The value, 8d8c9df1a81c345dc071876868d550a19e9b2fb82e69084b1d621493946e6538, comes from
build.rs's hash: its listed inputs plus bind/'s non-test sources, sorted, each hashed as its
relative path, a zero byte, its length as a little-endian u64, then its bytes. Computed the same
way at 733b14ed24, it reproduces that commit's committed
b484a6b037e2ae562f5a3c89313babecbce60262b0adbe70508e73426167dff8.

How verified: the suites check runs again at this commit.
2026-11-25 12:22:04 -08:00
Anees Iqbal 794fa13f4b indirect_commands: Bindings::buffers stays public; validation's tests read it
04070aeb56 made `Bindings::buffers` private so the compiler would say whether anything outside
the module used it. It did: job m3-max-73728 (clippy, all three configurations, at 60cf39099e)
failed with E0624 "method `buffers` is private" at ten sites of
crates/metal2vulkan-validation/src/case/tests/indirect_commands.rs (lines 590, 609, 623, 864, 871,
878, 889, 893, 1627, 1631). So it has a user and stays `pub`, with `BufferBinding`'s doc linking
it again as before. `scripts/api-signatures/signatures.py --bless` puts its one record back.

How verified: the same quick check runs again at this commit.
2026-11-25 12:22:04 -08:00
Anees Iqbal 7ae0e4da5f Translator: the Y′CbCr planes chain goes; nothing has made it since its producer went
`ResourceKind::YCbCrPlanes(YCbCrPlanesSampler)` sampled a two-plane YCbCr texture's planes
through the device's own sampler Y′CbCr conversion. The form that made such a slot (the
YCbCrInPlace lowering inputs and `fn sampler(&self) -> YCbCrPlanesSampler`) went in a7dd2e846e,
and no code has constructed one since. Every remaining mention is a match pattern, an arm under
one, or the cache codec's tag table. Deleted:
- `bind::YCbCrPlanesSampler` (bind/ycbcr_convert.rs) and its re-export and bind/mod.rs doc line;
- `pipeline::ResourceKind::YCbCrPlanes` (pipeline/sym.rs) and `pipeline::BindingSource::YCbCrPlanes`
  (pipeline/layout.rs);
- `vk::SamplerDesc.ycbcr`, `vk::SamplerDesc::ycbcr()` and the private `SamplerKey.ycbcr`
  (vk/structs.rs), and the `ycbcr: None` lines of metal/sampler.rs and of the vk and ash_interop
  tests;
- the match arms: pipeline/link.rs (the binding source, the immutable sampler, the
  combined-descriptor check), spirv/builder/module.rs (the combined-descriptor check),
  spirv/requirements/level_reads.rs and own_pixel.rs (their seeds);
- the cache codec's rows: `YCbCrPlanesSampler { conversion }`, `YCbCrPlanes(f0)` in ResourceKind
  and in BindingSource, and `ycbcr` in SamplerDesc's field list;
- tests/api_surface.rs's `YCbCrPlanesSampler` row; api_signatures.tsv loses its 5 records.
level_reads' seed carried an "any level" flag that only the planes arm set; with that arm gone
the flag is always false, so the seed drops it and keeps the entry it inserted.
ash_interop's `sampler_create_info` doc no longer speaks of a conversion it cannot meet.

The codec's enum tags are variant names, so no other tag moves: an entry holding a removed
variant fails to decode, which is a miss. Removing `ycbcr` from SamplerDesc's encoded field
list does change the byte layout of every encoded SamplerDesc (cache/mod.rs: "a field ...
removed ... in an encoded type"), so ARTIFACT_FORMAT_VERSION goes from 596 to 597.
SEMANTICS_VERSION stays: no input ever produced the removed form, so no module word,
refusal, requirement or fact value changes (a golden cell hashes SPIR-V words only).

Zeros, at metal2vulkan 733b14ed24 (this stack's base) and the consumer reims-vgpu d0a7c9614
(whose Cargo.toml pins metal2vulkan 0c9db49765):
- `git grep -nE 'YCbCrPlanes|SamplerDesc::ycbcr|\.ycbcr[^_a-zA-Z(]|ycbcr: (None|Some)'
  733b14ed24 -- ':!crates/metal2vulkan/src'`: only api_signatures.tsv's five records and
  tests/api_surface.rs:459, both updated here.
- Constructions in crates/metal2vulkan/src, `git grep -nE 'ResourceKind::YCbCrPlanes\(|
  BindingSource::YCbCrPlanes\(|SamplerDesc::ycbcr\(|YCbCrPlanesSampler \{' 733b14ed24 --
  crates/metal2vulkan/src`: the struct's own declaration, the codec's decoder (cache/codec.rs:819),
  and pipeline/link.rs:683 and :740, each the arm of a `ResourceKind::YCbCrPlanes` pattern. The
  other four hits are patterns.
- Consumer: `git grep -n 'YCbCrPlanes\|\.ycbcr\b' d0a7c9614 -- '*.rs'`: 0.

Tables: `scripts/api-signatures/signatures.py --bless` removed 5 records and added none;
`scripts/refusal-surface/refusal_surface.py` leaves docs/REFUSALS.md unchanged. Build, clippy,
the suites and a states-only play run at the stack's tip.
2026-11-25 12:22:04 -08:00
Anees Iqbal a1b955eec9 indirect_commands: the plumbing only the deleted runtime drove goes
`bind::indirect_commands` kept entry points that the removed in-crate runtime used to execute
indirect command buffers. Nothing calls them now: not the runtime crate, not the command line,
not validation, conformance, harness, devtools or the translator, and not the consumer. Deleted,
each with its own tests, its re-export, its api_surface row, its api_signatures rows and its
docs/API.md sentence:
- `RecordField` (referenced by nothing at all);
- `records_address`, `RECORDS_ADDRESS_BASE`, `RECORDS_ID_LIMIT`, and the crate-private
  `RECORDS_ADDRESS_SHIFT` that only `records_address` read;
- `written_flag_offset`, `WRITTEN_FLAG_BYTES`;
- `BufferBinding::resolve_buffer`, `RegisteredBuffer` (+ `new`), `ResolvedBuffer`, `AddressError`;
- `CommandRecord::resolve_bindings`, `ResolvedBindings`, `BindingError` (tests/inheritance.rs
  tested only these and goes whole);
- `RenderDraws::PRIMITIVES` (its one user, a test, now spells the struct out);
- `RecordView::action`, `barrier`, `kernel_pipeline`, `buffer`, `writes`.
The fixed point inside the module adds `RecordError::Index`, which nothing constructs (its
Display arm alone named it; it was the error of `RecordField`'s indexed fields), and an empty
`impl CommandRecord {}`.

Kept, because a live path calls them inside the module (validation's `CommandBuffer::decode` and
`CommandDescriptor::validate_record`): `BufferStage::of` (descriptor.rs `validate_record`,
host.rs `decode`), `CommandDescriptor::holds` (`validate_record`), `validate_header` (`decode`),
and `RecordView` with the accessors `CommandRecord::decode` reads through `record_into`
(`pipeline`, `retained_pipeline`, `threadgroup_memory_length`, `stage_in_region`,
`imageblock_size`, `record`, `record_into`).

`Bindings::buffers` becomes private: only descriptor.rs and host.rs call it, and validation reads
a record's buffers through `buffers_mut` only. The build at the stack's tip answers whether
anything else used it (an error would mean a user). `BufferBinding`'s doc no longer links it.

Docs that named the deleted items or the deleted runtime say what is true now: the
`bind::indirect_commands` module docs (validation's case model and Metal executor use it),
host.rs's module docs, `BufferBinding::address`, `RecordError`, provenance.rs's
`object_handle_load`, and docs/API.md's indirect-command-buffer section.

Zeros, outside crates/metal2vulkan/src/indirect_commands* and the facade, at metal2vulkan
733b14ed24 and the consumer reims-vgpu d0a7c9614 (whose Cargo.toml pins metal2vulkan 0c9db49765):
- `git grep -nw <name> 733b14ed24 -- 'crates/*.rs' 'docs/*.md'` (the facade and
  tests/api_surface.rs excluded, comment-only lines dropped): 0 for RecordField,
  RECORDS_ADDRESS_BASE, RECORDS_ID_LIMIT, WRITTEN_FLAG_BYTES, resolve_buffer, RegisteredBuffer,
  ResolvedBuffer, AddressError, resolve_bindings, ResolvedBindings, BindingError.
  `records_address`: only other items of the name (metal2vulkan-air intrinsics/objects.rs:449, a
  predicate; provenance.rs:3251-3267, a local and that predicate) and provenance.rs:1831's
  comment, rewritten here. `written_flag_offset`: only docs/API.md:1352, rewritten here.
- `git grep -nF <path> 733b14ed24 -- 'crates/*.rs'` (same exclusions): 0 for
  `RenderDraws::PRIMITIVES`, `RecordView`, `RecordError::Index`.
- Consumer: `git grep -nw <name> d0a7c9614 -- '*.rs'` is 0 for every name above;
  `git grep -nE 'indirect_commands::' d0a7c9614 -- '*.rs'` is 0; `git grep -nE 'metal2vulkan::bind'
  d0a7c9614 -- '*.rs'` names only rt_platform/argument.rs and rt_platform/function_table.rs.

Tables: `scripts/api-signatures/signatures.py --bless` removed 47 rows and added none;
`scripts/refusal-surface/refusal_surface.py` leaves docs/REFUSALS.md unchanged. Build, clippy
and suites run at the stack's tip.
2026-11-25 12:22:04 -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 dd3f16a656 Conformance: Metal's answer for the compressed small-level copies, recorded with its times
What: the recordings of compressed-small-levels-bc1-rgba and compressed-small-levels-bc3-rgba.
Metal's times are kept in each. docs/CONFORMANCE-COVERAGE.md is regenerated: 188 case modules,
1335 recordings, compressed_small_levels 2 cases, every field compared. A new unit test,
the_recorded_copies_are_the_model, holds each recorded site to the case's model. program()'s doc
no longer links to the private `reads`, which rustdoc refused (job m3-max-73736).

Why: this is the recorded Metal answer the suite holds the runtime to, for the guest's 4 x 4 copy
of a level smaller than one block.

Verified:
- Job m3-max-73751 (Apple M3 Max, macOS 27.0.1, build 26A434), in the workspace job m3-max-73737
  built `conformance` in, release, at 7af2733ddc.
  - It ran `conformance record` of both cases: plain Metal 3 runs, one outcome, three command
    buffers Completed.
  - The validated leg stopped at the work, on the copy from a buffer: "(destinationOrigin.y +
    sourceSize.height)(4) must be <= height(2)".
  - It then ran `conformance times --runs 8 --write` of both.
- Every recorded byte site equals the case's model: levels 8 to 11 of the t2t, b2t and replace
  destinations, and the 64 bytes of t2b and get at levels 9, 10 and 11. I checked this with a
  Python decode of the recordings here. The new test checks the same and has not run yet.
- coverage.py --check: as derived.
2026-11-25 12:02:22 -08:00
Anees Iqbal 52c0ff331d Conformance: compressed copies of levels smaller than a block, at the block's size
What: the cases compressed-small-levels-bc1-rgba and compressed-small-levels-bc3-rgba
(cases/compressed_small_levels.rs). Each makes a 2048 x 1024 texture of 12 levels, Managed,
whose levels 8 to 11 hold the bytes of the probe compressed_copies_of_small_levels.m. It then
copies the one block of levels 9 (4 x 2 texels), 10 (2 x 1) and 11 (1 x 1) at 4 x 4 by every
call that names a region:
- copyFromTexture:...toTexture:... into a Private texture;
- copyFromBuffer:...toTexture:... into a Private texture;
- replaceRegion: into a Managed texture;
- copyFromTexture:...toBuffer:... into 64 bytes;
- getBytes: into 64 bytes.
Each destination texture's levels 8 to 11 are copied out at their own extent and read. Every
byte is a site.

Why: a guest's 4 x 4 copy at level 9 of a 2048 x 1024 BC3 texture of 12 levels, Managed into
Private, was refused as TextureRegion. The probe (job m3-max-73696) showed plain Metal copying
the whole block on every path. This case is the recorded Metal answer the suite holds the
runtime to. Its recordings are taken on the M3 next, and committed with Metal's times.

Verified: the_model_is_the_probe_s_bytes holds the case's model of each read to the probe's
FNV-1a hashes from job m3-max-73696; it has not run yet.
2026-11-25 12:02:22 -08:00
Anees Iqbal 5bde7c16ed Tests: the small-level device test's textures take indices; place() asks is_multiple_of
What: every_device_copies_a_level_smaller_than_a_block_at_the_block_s_size makes its textures
ShaderRead, and the runtime gives a ShaderRead texture an index, so the test now takes a grant
of 64 texture indices (19 textures a format) and hands each texture its own. place()'s whole-block
test reads `size.is_multiple_of(grid)`.

Why: job m3-max-73723 (the quick check of 1549e2e3a3) failed two ways. Clippy, in all three
configurations, flagged `size[axis] % grid == 0` as a manual is_multiple_of. On lavapipe the
device test stopped at its first texture: "a texture shaders read or write, or a colour render
target, takes an index, and none was given". The other 737 runtime tests passed there, the
unit tests of small_levels among them.

Verified: not yet; the next quick check runs at this commit's successor.
2026-11-25 12:02:22 -08:00
Anees Iqbal 9ddd0be2a4 Blit copies: whole blocks that end inside a compressed level's last block copy that block
What: place() takes a compressed region of whole blocks that ends past the level's edge inside
the level's last block, the block an edge of no whole blocks rounds up to (the one 4 x 4 block of
a level of 4 x 2 texels), and stops the placed size, so the copy command's extent, at the
level's edge. Every copy that places a region takes it: copy_from_texture, copy_from_buffer,
copy_from_texture_to_buffer, replace_region and get_bytes. A copy between textures whose two
places stop at different edges (the block of a level of 4 x 2 into the second block of a level
of 8 x 4, or the reverse) is Gap::TextureCopy, where it was Refusal::TextureRegion: one region's
one extent cannot stop at one image's edge alone. A size past the rounded edge stays
Refusal::TextureRegion.

Why: a guest's boot log (RTX 4070 Ti, NVIDIA 620.73.04, x86-64 macOS 26 guest) shows
copyFromTexture:...toTexture: of 4x4 texels at level 9 (4x2) of a 2048x1024 BC3_RGBA texture of
12 levels, Managed into Private, refused as TextureRegion three times. Apple's page for the copy
asks for the size clamped to the texture's edge; the probe measured what Metal does with the
whole block.

Metal: probe crates/metal2vulkan-conformance/probes/compressed_copies_of_small_levels.m, an Apple
M3 Max, macOS 27.0.1 (26A434), job m3-max-73696, one case a process, BC1_RGBA and BC3_RGBA alike:
- layer off: 4x4 at levels 9, 10 and 11 is taken and completes by every call (texture to texture
  Managed to Private and Private to Private, buffer to texture, texture to buffer, replaceRegion,
  getBytes) and lands exactly what the clamped size lands: the level's one block;
- layer on: the same, the layer bounding the region by the level rounded up to the block
  ("(origin.x + adjustedSize.width)(8) must be <= paddedWidth(4)"), but for buffer to texture,
  which it stops ("(destinationOrigin.y + sourceSize.height)(4) must be <= height(2)"); a guest's
  Metal runs without the layer, so the runtime does what plain Metal does;
- 8x4 at level 9 is stopped by the layer everywhere, and plain Metal's answers there disagree
  between calls, so it stays refused;
- 4x4 between level 9 or 10 and level 8's second block is taken with the layer and without and
  lands the block whole: the new Gap::TextureCopy, a known gap in the runtime's README.
Vulkan: an extent may stop at the subresource's edge where it is no whole blocks
(VUID-vkCmdCopyImage-srcImage-01728, VUID-vkCmdCopyBufferToImage-dstImage-00207,
VUID-vkCmdCopyImageToBuffer-srcImage-00207) and must not pass it
(VUID-vkCmdCopyImage-srcOffset-00144, -dstOffset-00150,
VUID-vkCmdCopyBufferToImage-imageSubresource-07971, VUID-vkCmdCopyImageToBuffer-imageSubresource-07971).

Tests: tests::small_levels (new): the places and the command's extent at levels 9, 10 and 11
between textures and between a buffer and a texture each way, the refused sizes, and the
between-level gap; under a device cfg,
every_device_copies_a_level_smaller_than_a_block_at_the_block_s_size: BC1 and BC3 2048x1024 of
12 levels, 4x4 at levels 9, 10 and 11 Managed into Private (the guest's shape), from a buffer,
into a buffer, by replace_region and by get_bytes, every byte of levels 8 to 11 of the
destination (or of the bytes read) the model's and its FNV-1a 64 the probe's.

Docs: place()'s, copy_from_texture's, copy_from_buffer's, replace_region's, Refusal::TextureRegion's
and Gap::TextureCopy's doc comments; the runtime README's region rules and its known gaps of
textures; the probe's header records what it measured. docs/REFUSALS.md does not change (the
generator's check passes): the variants' first sentences and bases are as before.

Verified: the jobs that build and run it follow this commit.
2026-11-25 12:02:22 -08:00
Anees Iqbal 1d3ed5965c Probe: compressed_copies_of_small_levels names its blocks-across helper across
What: the helper that counts a level's blocks across is `across`, not `wide`.

Why: MacTypes.h, which Foundation pulls in, defines a type `wide`, so the probe did not compile
(job m3-max-73675: "redefinition of 'wide' as different kind of symbol").

Verified: the run that measures the probe follows.
2026-11-25 12:02:22 -08:00
Anees Iqbal 188c575a72 Probe: compressed copies between a small level and a larger one
What: compressed_copies_of_small_levels.m gains, for its texture-to-texture kinds (Managed to
Private and Private to Private), copies between level 8 (8x4, its second block at (4,0)) and
levels 9 and 10 each way, at the whole block (4x4) and at the smaller level's extent: the
source's edge where the smaller level is the source (Apple's clamped form), the destination's
where it is the destination. A block such a copy moved reads back as `m`.

Why: the runtime places each side of a copy with one size, so a block-rounded size that the
runtime takes at one level and not the other needs Metal's answer for both directions before
the runtime decides what it does with them.

Verified: not yet run; the run that measures it follows.
2026-11-25 12:02:22 -08:00
Anees Iqbal d22b047755 Probe: a compressed copy of a level smaller than one block, at the whole block's size
What: probes/compressed_copies_of_small_levels.m, one case a process (--all runs each under
MTL_DEBUG_LAYER=1 and without it): BC1_RGBA and BC3_RGBA 2048x1024 textures with 12 levels,
levels 8 (8x4, the whole-block control), 9 (4x2), 10 (2x1) and 11 (1x1) copied at the level's
own extent, at the block-rounded 4x4, and at 8x4 of level 9 (past the rounding): texture to
texture Managed to Private and Private to Private, buffer to texture, texture to buffer,
replaceRegion and getBytes, reading back and naming every block that landed.

Why: a guest's boot log shows the runtime refusing a BC3 copy of 4x4 texels at level 9 (4x2) of
a 2048x1024 texture as TextureRegion. Apple's page for the copy asks for a size clamped to the
texture's edge; what Metal does with the unclamped block is unread, and the runtime follows
plain Metal (a guest's Metal runs without the layer).

Verified: not yet run; the run that measures it follows.
2026-11-25 12:02:22 -08:00
Anees Iqbal 733b14ed24 Census at 59480e2d48: the stencil form's authored cases compile without the export extension
The authored-compile census (corpus-triage --audit authored-compile --bless,
~/.cache/m2v-orch/census-job.sh on the M3, job m3-max-73690, census-exit=0) at
59480e2d48 moves 20 rows and the artifacts line, and adds or removes none: the
40 cells that were not_supported{device_capability_missing:StencilExport needs
Extension(ExtShaderStencilExport)} now compile, by the stencil output form
(5a722b5c3f: [[stencil]] drawn by bits where the extension is absent). The six
RasterSampleCount cells (FramebufferStencilSampleCount(2)) are unchanged.
2026-11-25 11:19:47 -08:00
Anees Iqbal 4fb7684a62 Runtime floor: a missing memory type's refusal names the types the device offers
A user's device was refused at creation with "it lacks a memory type with
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT |
VK_MEMORY_PROPERTY_HOST_CACHED_BIT for buffers", and the line said nothing of
what the device has, so the report could not be settled from it: the device's
memory types had to be read from the driver's source.

floor::Missing::MemoryType gains `offered`: every memory type the device offers
a buffer of the runtime's usage, as "type <index> with <flags>", joined by ", ",
or "no type". From PhysicalDevice::check it is every type the device lists
(Vulkan answers which types a buffer can use only for a created device); from
Device::new, the types the buffer's memoryTypeBits name. The refusal reads
"... for buffers (the device offers buffers: type 0 with ..., type 1 with ...)".
The flag names now cover every VkMemoryPropertyFlagBits Vulkan 1.3 and its
extensions define (lazily allocated, protected, AMD's device-coherent and
device-uncached, NVIDIA's RDMA), and a bit with no name prints as one
hexadecimal value, so a type is named whole.

The variant's field is a public change of metal2vulkan-runtime
(api_signatures.tsv blessed); reims-vgpu at f1c518d31 names no
floor::Missing variant (git grep 'Missing::', zero hits), it maps
Error::BelowFloor whole. docs/REFUSALS.md regenerated (unchanged: the
variant's first sentence is). README: the floor's memory types section says
what the refusal names.

Tests (crates/metal2vulkan-runtime/src/tests/floor.rs):
a_missing_memory_type_names_the_types_the_device_offers (the whole refusal
line for a device whose host-visible memory is all uncached, a type with no
flags and a type with an unnamed bit; on a created device only the usable
types; "no type"), each_missing_memory_type_is_named and
every_missing_item_is_named_at_once with the offered types,
memory_flags_are_named_as_vulkan_names_them with every flag and an unnamed
bit. Each fails without the change (the field and the text are new).
2026-11-25 11:15:54 -08:00
Anees Iqbal 59480e2d48 Bless at 88beca43a0: the stencil form's golden rows and engine inventory
The stencil output form (5a722b5c3f: a device without
VK_EXT_shader_stencil_export draws [[stencil]] by bits, SEMANTICS 2302) moved
14 golden hash rows and 13 rows of the engine inventory: the stencil-writing
fragment fixtures (fragment_depth_stencil, stx_stencil and stx_stencil_ms,
.ll and .air.ll) were refused as StencilExport in the four profile columns
without the extension and now translate there; the in-order (raster order
group) entry points keep a refusal in those columns.

Written by ~/.cache/m2v-orch/bless-job.sh (bless_engine_inventory,
bless_golden_hashes, bless_engine_goldens) at 88beca43a0 on the M3, job
m3-max-73671: inventory=0 golden=0 printouts=0. The suites of the same tree
(m3-max-73661) had failed exactly golden_hashes and three engine inventory
parts before this bless.
2026-11-25 11:07:04 -08:00
Anees Iqbal 84e7f23a54 Tests: the real-size float picture is also drawn by a pass that clears it to opaque black first
The 3840x2160 RGBA16Float cell (real_size_overs.rs) wrote its picture by a
render pass that loads it and by a kernel; a third writer is now a render pass
that clears it to (0, 0, 0, 1) and draws the float pattern over all of it, each
time copied out whole into a Shared buffer and into a host-memory import, every
texel exact. The cell had no pass that clears before it draws.

It ran on a run-tree branch (steelbrain/f8dbcells be6b73f5f1, at f8db87d844,
built in m3-max-73629) and was brought here alone; on development it has not
run yet: development's checks run it on lavapipe, and the next round runs it on
each card.
2026-11-25 11:04:44 -08:00
Anees Iqbal e195316c5a Tests: every thread of a 2D kernel's threadgroups runs at a picture conversion's shapes
A device test (wg_lattice.rs): a 960x1088 grid in 32x32 threadgroups (a
3840x2160 picture, 4x2 texels a thread), 64x64 in 16x16 and 16x16 in 8x8, by
dispatchThreads and by dispatchThreadgroups, for a kernel that reads its
threadgroup's position and size and for one that reads only its grid position.
Each thread writes its grid index plus 1 at that index over 0xff; a case prints
"every word right" or how many words are right and where.

It is the check that found a compiler fault on the lab 780M: under AMDVLK
v-2025.Q2.1 the tree at fd0771d944 ran one invocation a workgroup (32x32 cases:
one word per 32x32; the oblivious kernel: one per 64x4 grid tile), job
m3-max-73645, while RADV was right; at f8db87d844 every case was right under
both drivers (m3-max-73647). Those runs were on run-tree branches
(steelbrain/fd07cells 2ee6edaf7a, steelbrain/f8dbcells 8b6384d988) that carried
a validation-layer switch; this commit brings the test alone onto development,
where it has not run yet: development's checks run it on lavapipe, and the next
round runs it on each card.
2026-11-25 11:04:44 -08:00
Anees Iqbal 88beca43a0 Docs: CONFORMANCE-COVERAGE.md regenerated for the stencil form's four known-gap rows
The stencil form (5a722b5c3f) added four rows to the conformance known-gaps
ledger (stencil-output and stencil-output-loaded, two each: NVIDIA's drivers
list no VK_EXT_shader_stencil_export, and the refused draw's consequence) and
did not regenerate the document, so conformance_coverage's check failed in the
suites run of that tree (m3-max-73661: "docs/CONFORMANCE-COVERAGE.md is not
what the suite's sources and recordings derive"). Written by
scripts/conformance-coverage/coverage.py; its --check passes on this tree.
2026-11-25 10:58:27 -08:00
Anees Iqbal 5a722b5c3f Stencil output: a device without VK_EXT_shader_stencil_export draws it by bits, the owner's tenth form
A fragment function's [[stencil]] output is the reference of both faces' stencil test for its
fragment (MSL Table 5.7, 5.2.3.5). On a device without VK_EXT_shader_stencil_export it was refused
at creation (StencilExport). Under the owner's grant (rule 2's tenth form, chosen by that
extension's query alone), such a device now draws it by bits; a device with the extension is
unchanged (FragStencilRefEXT, no fact, no note, the draw issued once).

Translator: the function stores no reference; each return kills the fragment where the draw's new
push field PushField::StencilBit k is below 8 and bit k of the output's low 8 is 0, and keeps
every fragment at 8 or more (one module, no specialization). The function states
RuntimeFact::StencilBitDraws (Mechanism::PushConstant) and its fragment stage the static note
PrecisionNote::StencilOutputOverlap. Refused there, naming the extension (Unsupported
StencilExport): a function that also writes a colour (the colour would be written by every
repeat) or memory, one whose returns cannot kill (an interlocked body, a loop over its covered
samples), a mesh pipeline, and a render pipeline made for indirect command buffers. Where the
device also lacks the pixel interlock, a function writing memory in a raster order group meets
that refusal first (RasterOrderGroups). SEMANTICS_VERSION 2301 -> 2302, ARTIFACT_FORMAT_VERSION
595 -> 596 (new codec members).

Runtime (depth_stencil::BitDraws, render_encoder::draw): with w the low 8 bits of the write masks
of the faces having a Replace operation, a draw whose stencil test is on and w is not 0 is drawn
once with every fragment kept under the reference 0 (Replace zeroes w's bits, every other
operation runs once), then once per bit k of w keeping the fragments whose output holds bit k,
under the reference 255, write mask (1 << k) & mask, Replace kept and every other operation Keep,
and no depth write; where the state writes depth under a compare other than Always and Never, the
first draw writes none and a last draw writes it with stencil write masks of 0. Each draw records
only the dynamic state that differs from the last; the encoder's tests and reference are recorded
again at the next draw. Counted in Metrics::stencil_bit_draws (the draws beyond the first).
Refused at a draw, Gap::Draw of DrawKind::StencilOutput: a face compare other than Always or Never
(the output decides that test), and, where w is not 0, a draw inside a Counting visibility
segment (every draw would add its samples). A Boolean segment is drawn. Vulkan Appendix I: the
repeats change stencil reference, operations and write masks between draws of one pipeline,
which Rule 2 lists as required (write masks) and strongly suggested (stencil parameters) to be
invariant; the note records the one difference the repeats make.

The note (rule 1): fragments of one draw that overlap leave the OR of their values. Where two
fragments of one draw reach one sample under Replace, the sample stores the OR of their outputs'
low 8 bits within the write mask, where Metal stores the later fragment's value; under a depth
test that writes, each fragment's stencil operation is chosen against the depth from before the
draw. Measured on an RTX 3090 (NVIDIA 620.70.06) under the validation layer 1.4.363.0, job
m3-max-73635: two triangles of one draw outputting 0x35 then 0x4a store 0x7f on the 32 texels both
reach, where Metal stores 0x4a, and 0x35 on the 32 one reaches, in 8 bit draws; the 780M (RADV)
and the Iris Xe (ANV), which list the extension, store 0x4a with 0 bit draws.

AGENTS.md rule 2: "for nine only" becomes "for ten only", the list ending with fragment stencil
output (the planner's text, relayed by main, word for word).

Tests: the translator's engine_stencil (every committed profile: the extension or the draws by
bits, L3 both ways; refusals for colour, memory, mesh and indirect command buffers); rt's host test
of BitDraws::of; rt's device cells (stencil_export.rs): the stencil alone and the stencil with the
depth under Always and Less over a quad, exact, texels of stencil 0 among them; the overlap row;
the refusals; the route of a 4-sample Depth32Float_Stencil8 source read at sample 0 into a
single-sample target under Always/Replace 0xff and depth Always with write, beside colour 0
RGBA8 of write mask none; the codec round trip; the mechanism table.

Docs: docs/API.md (the stencil output passage and the catalogue entry
metal2vulkan-degrade-stencil-output-overlap), rt README known gap and floor row,
docs/REFUSALS.md regenerated, api_signatures blessed. The conformance degradation and the
validation allowance (unbounded) of the note. known-gaps-rt.tsv: stencil-output and
stencil-output-loaded on NVIDIA, refused at renderCommandEncoder (draw 3's back face Equal against
the output) and divergent at case/stencil as a result. runtime-sources.sha256: the guard's inputs
changed only by mechanism.rs gaining the new fact's arm, which no existing artifact states, so no
run of an existing artifact changes.

Golden rows and the engine inventory (22 cells) are re-blessed on development: 20 move from the
StencilExport refusal to a module (stx_stencil_by_pixel, stx_stencil_discard,
stx_stencil_with_depth, stx_stencil_ms_by_sample, fragment_depth_stencil on nvidia-pascal-linux,
nvidia-rtx50-linux, nvidia-rtx5080-laptop and runtime-floor), and the 2 cells
stx_stencil_in_order and stx_stencil_ms_in_order on runtime-floor move from StencilExport to
RasterOrderGroups, still refused. Why: the memory-write refusal now runs on the emitted module
(pipeline/compile.rs), after the body's own refusals, so on a profile without the pixel interlock
the raster order group these functions write memory in is refused first; at the base the plan's
entry refused every [[stencil]] output on such a device before any body was lowered.

Verified (this tree, or the rt archive of d6bd77d203 where named; the rt and translator sources
there differ from this tree in the translator's test and a doc comment alone):
- msi check, job m3-max-73648 (this tree): fmt, signatures, refusals, clippy -D warnings with all
  features plain, --cfg m2v_gpu and --cfg m2v_cpu_icd, Rustdoc, the rt nextest archive and the
  conformance binary built; rt's whole suite on lavapipe under the validation layer 1.4.363.0,
  738 tests run: 738 passed, 3 skipped; the lavapipe leg, 7 tests run: 7 passed: export enabled,
  the overlap row storing {4a}, bit draws 0 on every cell.
- RTX 3090 (NVIDIA 620.70.06, layer 1.4.363.0), job m3-max-73635 (d6bd77d203): 7 passed; the
  overlap row above, bit draws 8; the stencil alone and with depth under Always and Less, 64
  texels exact, bit draws [8, 8, 9]; the route exact, bit draws 8; refused a colour beside the
  stencil (StencilExport), Equal and a Counting segment (DrawKind::StencilOutput), a Boolean
  segment drawn. Conformance stencil-output and stencil-output-loaded: refused at
  renderCommandEncoder and divergent at case/stencil (4 elements, largest difference 80), the
  four known-gaps rows.
- RTX 5080 Laptop GPU (NVIDIA 615.71.09, layer 1.4.363.0), job m3-max-73652 (this tree): 7
  passed; overlap {7f} where both reach, {35} where one, bit draws 8; cells exact, bit draws
  [8, 8, 9]; the route exact, bit draws 8; the same refusals; conformance replay with this tree's
  binary matched the four NVIDIA rows (exit 0).
- Radeon 780M (RADV, Mesa 26.2.6), job m3-max-73636 (d6bd77d203), and Iris Xe (ANV, Mesa
  26.2.6), job m3-max-73650 (this tree): 7 passed each, export enabled, overlap {4a}, bit draws 0.
- States-only plays of recorded streams, base 0c9db49765 against d6bd77d203, every play in
  states-only mode, made and refused equal, refused 0: lavapipe, jobs m3-max-73632 and
  m3-max-73631 (two streams: render 10643 and 9014, compute 15299 and 221); the RTX 3090 with
  --device-type gpu, job m3-max-73638 (two streams: render 9834 and 10643, compute 214 and
  15299); the RTX 5080, job m3-max-73652 (two streams: render 9014 and 9645, compute 221 and
  250). Those two carry a library holding a [[stencil]] function that no recorded pipeline state
  uses; no stream on either NVIDIA node makes a [[stencil]] pipeline (job m3-max-73646 and
  m3-max-73652's scan).
- Owed: the translator and validation suites of this tree (the suites of d6bd77d203, job
  m3-max-73627, failed in the memory refusal's test on runtime-floor, the runtime guard's hash
  and the golden and inventory cells above; this tree fixes the first two).
2026-11-25 10:38:03 -08:00
Anees Iqbal d2e8ab2a85 Replay player: a colour attachment's depthPlane is played
What: the new-runtime player forwards a colour attachment setter's `depthPlane` into the
runtime's RenderPassColorAttachmentDescriptor::depth_plane, as it forwards resolveDepthPlane, and
no longer holds the pass for a plane but 0 ("Unheld(depthPlane)", the encoder skipped). A depth
or stencil attachment's depthPlane is not played and holds nothing: Metal reads it of a 3D
texture alone (Apple's page for depthPlane, as fetched: "If the texture isn't a 3D texture, then
Metal ignores this property."), and the runtime refuses a 3D texture's depth or stencil
attachment by its type (TextureType) whatever its plane, which the player counts as any gap.

Why: since 3c52ee1cf1 the runtime takes a colour attachment's depth plane of a 3D texture, and the
player still skipped every pass that set one, and every pass that set one of a 2D texture, which
Metal with its validation layer off renders as at 0 (probe resolve_depth_planes.m, case plane3,
job m3-max-73495).

Docs: docs/REPLAY-STREAM.md and the player's module doc list what a held pass holds now (the
"a resolve texture" there was stale too: only a skipped one is held).

Test: replay::rt_replay::a_colour_attachment_s_depth_plane_plays_on_the_new_runtime (device
cfgs): a stream clears plane 0 of a 4x4x4 RGBA8Unorm 3D texture green (no plane set), its plane 2
red (depthPlane 2), and a 2D texture red at depthPlane 2; blits copy planes 0 and 2 and the 2D
texture out, and the stream's three checks (green, red, red) match; no encoder, call or object
skipped.

Verified (run tree 44b2cc80bf, on development 3c52ee1cf1; its tree is this commit's but for
development's bless 0c9db49765 of opened_chains.txt):
- msi, job m3-max-73511: fmt, clippy (no cfg, m2v_gpu, m2v_cpu_icd) and rustdoc exit 0; the
  player's stream device tests (replay::rt_replay) on lavapipe (Mesa 26.2.4): 57 passed, the test
  among them; metal2vulkan-validation's suite: 1305 passed, 1 failed, 3 skipped, the one failure
  every_committed_profiles_context_enables_its_pinned_chain, development's own at 3c52ee1cf1
  (job m3-max-73486), which 0c9db49765, this commit's base, blesses.
- Without the fix (the player's render.rs of 3c52ee1cf1, lavapipe, job m3-max-73514): the test
  fails, "skipped render encoders Unheld(depthPlane) 2", and the plane-2 check differs.
2026-11-24 01:56:50 -08:00
Anees Iqbal 3025287cf4 Render pass: a resolve texture's depth plane is read of a 3D resolve texture alone
What: a resolve no longer refuses a `resolveDepthPlane` but 0 (Gap::RenderPass of
RenderPassKind::TextureType) on every resolve texture. Metal reads the plane of a 3D resolve
texture alone, and the runtime refuses a 3D resolve texture whatever its plane (its resolve
attachment, as before), so the plane is read of no texture it takes: ResolveInto loses its
depth_plane, and a colour, depth or stencil attachment resolving into a texture of another type
at a plane but 0 resolves as at 0.

Why: the check refused what Metal takes. slice3d (3c52ee1cf1) left it as the one place a
resolve's plane was read.

Metal: MTLRenderPass.h, resolveDepthPlane: "The texture depth plane of the resolve texture to be
used for multisample resolve. Defaults to zero." Apple's page for the property, as fetched: "If
the value of storeAction is set to multisampleResolve or storeAndMultisampleResolve, set this
property to point to a depth plane in the resolve texture." Neither says what a plane of a texture
that is not 3D does, so a probe (probes/resolve_depth_planes.m in the conformance crate, kept with
what it measured), Apple M3 Max, macOS 27.0.1, job m3-max-73495, one case a process, under
MTL_DEBUG_LAYER=1 and without:
- layer off: an 8x8 4-sample RGBA8Unorm colour cleared to (0.25, 0.5, 0.75, 1), a Depth32Float
  depth cleared to 0.25 and a Stencil8 stencil cleared to 0x5a, each resolved into a 2D texture
  at resolveDepthPlane 3, make their encoders, complete, and read exactly what plane 0 reads
  (texels FNV-1a 607aafd9f8dd4ba5, e02b8804d001b725, 9d1d83ba5bf55125 at both planes);
- layer on: plane 0 runs as with it off; plane 3 ends the process at the encoder: "depth plane is
  3, but the texture has a depth of 1 at mip level 0";
- a 3D resolve texture (8x8x4) at plane 3 is resolved into and read there, with the layer on or
  off: Metal's own form, still the runtime's TextureType gap.
A guest's Metal runs without the layer, so the runtime does what plain Metal does; the descriptor
docs and the README say both. The same probe's control, a colour attachment's depthPlane 3 of a
2D texture, is the layer's stop too ("depth plane index is 3") and plain Metal's clear of the
texture, which slice3d's "read of no other type" already does; its doc now says so.

Docs: RenderPassKind::TextureType's doc and the README's refusal list drop "a resolve's depth
plane but 0"; resolve_depth_plane's and depth_plane's docs state the measure. REFUSALS.md does
not change (its check passes): the resolve site still builds Gap::RenderPass.

Test: tests::resolve::every_device_resolves_into_a_2d_texture_at_a_depth_plane_as_at_plane_0
(device cfgs): a 4-sample RGBA8Unorm colour cleared to (0.25, 0.5, 0.75, 1) beside a 4-sample
Depth32Float depth cleared to 0.25, and in a pass of its own a 4-sample Stencil8 stencil cleared
to 0x5a where the device makes one, each resolved into a one-sample 2D texture (depth and stencil
by Sample0), at resolve_depth_plane 0 and then 3: the same resolve count and the same texels at
both, the clear (the colour within one code); a 3D resolve texture is TextureType at 0 and at 3.

Verified (run tree 44b2cc80bf, on development 3c52ee1cf1, whose tree is this commit's with the
next one's, but for development's bless 0c9db49765 of opened_chains.txt):
- msi, job m3-max-73511: fmt, clippy (no cfg, m2v_gpu, m2v_cpu_icd), rustdoc, the refusal,
  signature, Metal-coverage and conformance-coverage checks exit 0; the runtime's suite on
  lavapipe (Mesa 26.2.4) under the validation layer 1.4.363.0: 735 passed, 3 skipped, the cell
  among the passed.
- AMD Radeon 780M (RADV PHOENIX, Mesa 26.2.6), a nextest archive built on msi (job m3-max-73512),
  under the validation layer 1.4.363.0, jobs m3-max-73516 and m3-max-73517: the resolve and depth
  plane families, 10 passed; the cell printed that the colour, the depth and the stencil resolve
  at plane 3 read as at 0, the clear (73517).
- Without the fix (pass.rs of 3c52ee1cf1 under the same tests, lavapipe, job m3-max-73514): the
  cell fails at the plane-3 pass, "a render pass with TextureType is not built".
- The shared translator path (crates/metal2vulkan, crates/metal2vulkan-air) is untouched, so
  what Device::new makes, refuses and notes does not move.
2026-11-24 01:56:49 -08:00
Anees Iqbal 0c9db49765 Bless at 3c52ee1cf1: opened chains, MoltenVK's two contexts enable imageView2DOn3DImage
3c52ee1cf1 put imageView2DOn3DImage in floor::PORTABILITY, so a device that lists
VK_KHR_portability_subset enables it. The committed MoltenVK M3 profile is such a device: its
device and restricted contexts each enable one member more (77 and 75), which moved their
pinned chains, and every_committed_profiles_context_enables_its_pinned_chain failed on
development (job m3-max-73486, the one red of that suite run). No other profile lists the
portability subset, so no other row moved.

Verified: job m3-max-73498 (msi) ran bless_opened_chains at 3c52ee1cf1; its diff is these two
rows alone, and the pinned-chain test then passed.
2026-11-24 01:44:51 -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 6047a2d8b6 Runtime: whether a declaration covers a held attachment is settled as declarations and moves are made, and a draw tests it alone
What: Declarations::held answers whether a read declaration of the encoder covers an attachment
or resolve its pass holds out of its home layout (Pass::held). use_resource sets it for a read
of a held attachment's hazard id (the texture, a view of its image, or the buffer it lies over
in place), use_heap for a new heap a held attachment lies in, and the feedback moves for a
newly held attachment an earlier declaration covers. A draw counts in
Metrics::unslotted_attachment_reads where the answer is set and it may read beyond its slots
(its pipeline reads unbound, or an indirect command buffer's execution), testing the flag first,
in place of the walk of the pass's attachments against the declarations that every draw ran.
The answer only grows within an encoder: declarations are never withdrawn (a re-declaration
merges accesses), an attachment's layout leaves home only through the feedback moves and returns
only at the encoder's end, and a new pass is a new encoder with no declarations, so it equals
the walk's at every draw. The README's encoder-call contract says so.

Why: 78998777a2 moved the check into every draw and cost draw_2000 11.0 user-space instructions
a draw on the encoding thread, though no draw of it reads beyond its slots. Measured with a
probe harness (not landed) that counts the harness thread's instructions over each draw call
alone, 20 runs x 2 rounds per arm, order reversed in the second, RTX 5080 Laptop (NVIDIA
615.71.09, no layer), job m3-max-73399: ec9e2771d0 1,002.8 a draw (runs 1,002.8-1,003.0),
2c95b330e5 1,001.9 (3b76e461a2 alone does not build), 78998777a2 1,012.8, 205c8d2398 1,012.8,
205c8d2398 with 78998777a2 reverted 1,001.9; bind_2000 2,123.2 / 2,131.2 the same way. A
pipeline that reads beyond its slots paid the whole walk on every draw.

Budget: the test every_device_walks_no_attachment_at_a_draw_after_no_change counts the walks of
the pass's attachments (pass::TARGET_WALKS, test builds only) over 64 draws after the first since
a change: none for a pipeline that reads nothing beyond its slots, before and after the target is
declared read, and none for the argument-buffer pipeline, whose 65 draws each count one
unslotted attachment read. Without the change the last 64 draws walk 64 times.

How verified: the job ids of the check, the 5080 instruction arms and the AMD held_loop_reads leg
are in the lane's report to the lander.
2026-11-24 01:16:11 -08:00
Anees Iqbal 99293cc265 Conformance: Metal's times for the Depth32Float_Stencil8 copy case, kept in its recording
`conformance times --runs 8 --write depth-stencil-copies-d32s8`, built --release, was run on the
reference M3 Max (job m3-max-73405, at the case's tree plus the regenerated coverage doc). It
added one time record to the recording and changed nothing else, which a comparison of the JSON
keys before and after confirmed: the keys format, case, suite_version and answers are equal, and
times is the one key added, holding one record (native Metal, 8 rounds). Without it,
times::every_case_is_timed failed (job m3-max-73383).
2026-11-24 01:06:20 -08:00
Anees Iqbal 50a851487c Conformance: a copy between two Depth32Float_Stencil8 textures, recorded on Metal
What: the case depth-stencil-copies-d32s8 (cases/depth_stencil_copies.rs), its recording from the
M3, and docs/CONFORMANCE-COVERAGE.md regenerated with it. Two 8 x 4 Depth32Float_Stencil8 textures
of ShaderRead | RenderTarget | PixelFormatView usage, private. Each plane of each is written from a
buffer through the plane options, every texel a depth and a stencil of its own, the two textures'
apart. One copyFromTexture:...toTexture:... moves 5 x 2 texels from the source's (1, 1) to the
destination's (2, 2). Both planes of both textures are then copied out through the plane options
and read: four byte sites, laid out in the textures' rows.

Why: the runtime now copies such a texture whole, both aspects in each vkCmdCopyImage region,
because Metal's texture-to-texture copy takes no plane option. The case puts that to Metal and
holds the runtime to Metal's own bytes. The unit test the_recorded_copy_moved_both_planes holds
the recording to the host's model, so a release in which Metal moves one plane alone shows as a
failing test naming the site. The case declares the restricted-depth-upload notice allowance, as
format_copies does: the depth planes take their bytes from a buffer, and every depth written lies
in [0, 1], so the note moves no byte the case reads.

Verified:
- Job m3-max-73350 (Apple M3 Max, macOS 27.0.1) ran `conformance record
  depth-stencil-copies-d32s8`. Plain Metal: 3 runs, one outcome, status Completed. The
  destination's region holds the source's depth and stencil, every other texel of both textures
  is what was written. The validated leg ran. An earlier attempt, m3-max-73338, ended in its build
  (the compiler cache's daemon) before any Metal call.
- Job m3-max-73383 (msi, lavapipe, Khronos validation layer 1.4.363.0) at the case and its
  recording, the coverage doc regenerated in the job:
  - coverage.py wrote docs/CONFORMANCE-COVERAGE.md, the one committed here (187 case modules,
    1333 recordings, depth_stencil_copies one case, every field compared);
  - fmt; clippy of metal2vulkan-conformance plain, --cfg m2v_gpu and --cfg m2v_cpu_icd;
  - the case's three unit tests passed, the_recorded_copy_moved_both_planes among them;
  - rustdoc -D warnings; coverage.py --check;
  - `conformance replay --cpu depth-stencil-copies-d32s8` exited 0: verdict announced, every
    byte site Metal's, the one difference the restricted-depth-upload notice the case declares
    (its allowance fired);
  - the conformance suite on lavapipe under the validation layer: 1038 run, 1037 passed. The one
    failure was times::every_case_is_timed (the new recording held no timing), which the next
    commit, Metal's times for this case, answers.
2026-11-24 01:06:14 -08:00
Anees Iqbal 35fcaa9de4 Runtime README: the stencil-export known gap names the WebGL operation that reaches it
On a device without VK_EXT_shader_stencil_export (NVIDIA's 615 and 620 drivers on the cards run),
a fragment function's [[stencil]] output is refused at creation. A read of the public GL-on-Metal
layer's Metal back end shows a WebGL 2 page reaches that refusal: the layer copies stencil for
blitFramebuffer with STENCIL_BUFFER_BIT by a draw whose fragment function writes [[stencil]],
and it takes that path on a Metal device it does not take for an Intel or NVIDIA GPU. The known
gap now says so, where a user reads it. No behaviour changes; the refusal stays a known gap (a
second form chosen by that extension's query is not built).

Verified: cargo fmt; the docs check follows on development.
2026-11-24 00:54:42 -08:00
Anees Iqbal 205c8d2398 Tests: a rendered depth-and-stencil view copied into level 0 of a six-level texture, then sampled
What: tests::depth_stencil_route, a device cell (--cfg m2v_gpu or m2v_cpu_icd) of the guest route
that met Gap::TextureCopy, in the shape the consumer reported: a page's GL layer gives a drawn
Depth32Float_Stencil8 texture more levels by copying its level 0 into a new texture, then samples
it.

- A 32 x 32 Depth32Float_Stencil8 texture of one level, ShaderRead | RenderTarget |
  PixelFormatView, Private, and a view of it of the same format over level 0 and slice 0. One pass
  takes the view as its depth and its stencil attachment, Clear and Store: the stencil cleared to
  0x5a, and one draw of the owned depth_fill pair writing each quadrant's depth (0.2, 0.4, 0.6,
  0.8) under an always-passing depth test that writes.
- One blit encoder copies the view's level 0 into level 0 of a new six-level texture of the same
  usage and storage, then five never-written one-level textures, 16 x 16 down to 1 x 1, into
  levels 1 to 5, and reads level 0's two planes back through the plane options.
- A view of the six-level texture over its six levels, swizzled (R, 0, 0, 1), is sampled at each
  texel centre of level 0 by the owned rrp_mirror_clamp fixture: raw through texture2d<float>
  and a nearest sampler, and through depth2d<float> and a sampler comparing LessEqual at 0.5.

Every texel is exact: each depth bit for bit and the stencil 0x5a; each raw answer (depth, 0, 0,
1); each compared answer 1 where 0.5 <= depth and 0 elsewhere. tests::layouts records six
vkCmdCopyImage into the six-level texture, the first from the parent's image (the view's image is
asserted to be its parent's), the rest from the small ones, each TRANSFER_SRC_OPTIMAL to
TRANSFER_DST_OPTIMAL with one region of DEPTH | STENCIL on both sides. The run prints the formats,
aspects and layouts it recorded.

Why: the plain cell copies between textures made as such; the route copies from a view that is
an attachment of the pass before it, into one level of a mipmapped texture, and samples the
result through a swizzled view and a comparison sampler. A copy from a view needs nothing the
form lacks: a view's copy side is its parent's image at the view's base level and slice.

Verified: job m3-max-73322 (msi, lavapipe, Khronos validation layer 1.4.363.0) exited 0 at every
step: fmt; clippy of metal2vulkan-runtime plain, --cfg m2v_gpu and --cfg m2v_cpu_icd; rustdoc -D
warnings; refusal_surface.py --check; the rt suite on lavapipe under the validation layer, 732
passed, 3 skipped, this cell among them, no validation error; the lane's tests, 29 passed. The
per-vendor runs follow on the cards.
2026-11-24 00:36:40 -08:00
Anees Iqbal 95d350e606 Blit: a copy between textures of a format of depth and stencil both copies both aspects in each region
What: BlitCommandEncoder::copy_from_texture of Depth32Float_Stencil8 into Depth32Float_Stencil8
was Gap::TextureCopy. texture_copy refused a source with no copy unit, and copy_unit gives a
format of depth and stencil both none, since no buffer copy takes both aspects in one region.
Now a single-sample texture whose Metal aspects are depth and stencil copies in regions of
texels, each vkCmdCopyImage region naming DEPTH | STENCIL on both sides. The same structural rule
covers Depth24Unorm_Stencil8 where the device holds it (D24_UNORM_S8_UINT, its one made form).
copy_unit is unchanged: a buffer copy of such a format still takes a plane option.

Why: a guest route meets the refusal. A browser's GL layer re-makes a depth-and-stencil texture's
storage by copying level 0 into a new texture, and the refused copy left the new texture reading
0. Documented Metal copies the whole pixel: MTLBlitCommandEncoder.h's
copyFromTexture:...toTexture:... is "Copy a rectangle of pixels between textures" and takes no
option; Apple's page for MTLPixelFormat.depth32Float_stencil8 calls it "A 40-bit combined depth
and stencil pixel format"; MTLBlitOption.depthFromDepthStencil "copies the depth portion of a
combined depth and stencil texture to or from a buffer" and is listed for the two buffer copies
alone.

Vulkan (1.4.366, section 26.3): VkImageSubresourceLayers::aspectMask is "a combination of
VkImageAspectFlagBits, selecting the color, depth and/or stencil aspects to be copied". The two
masks match (VUID-vkCmdCopyImage-pRegions-12201), name aspects both images have (-00142, -00143),
and the formats are one (-01548). Every image the runtime makes has the transfer usages, which
its image format query checked (-06662, -06663). The layouts are TRANSFER_SRC_OPTIMAL and
TRANSFER_DST_OPTIMAL, or GENERAL within one subresource (-09460). The copy's barriers already name
every aspect of the image. Depth32Float_Stencil8 has one candidate format, D32_SFLOAT_S8_UINT, so
no usage gives two textures of it two formats: the refusal on the route was the missing unit, not
the gap's second condition.

A copy within one such texture takes the existing slab cut by texel shift, which needs no unit:
regions apart in one command in the general layout, overlapping regions in slabs, the far end of
the shift first. A texture in place over a buffer never has such a format (Buffer::new_texture
refuses a format of other than one color texel an element), so the in-place arm keeps the unit's
texel bytes. Still Gap::TextureCopy: a multisample texture, one pixel format in two Vulkan
formats, a 1D texture with another type, a texture buffer. error.rs's gap doc and the runtime
README's copy section say so. docs/REFUSALS.md does not change: its row quotes the gap's first
sentence, which stands, and refusal_surface.py --check passed.

Tests:
- tests::blit, a_format_of_depth_and_stencil_both_copies_both_aspects_in_each_region (host): a
  copy between two such textures and within one, regions apart and overlapping, each region of
  both aspects; Depth32Float_Stencil8 at 4 samples stays the gap.
- tests::depth_stencil_copy (device cfgs): Depth32Float_Stencil8 at 300 x 150, Private, render
  target and shader read. A pass clears both textures; blits write a region of the source's depth
  (i / 65536) and an overlapping region of its stencil (varied bytes). One encoder copies a
  region from the source into the destination, then a region of the destination into another
  apart from it, then a region onto itself shifted (1, 2). Both planes of both textures read back
  through the plane options are the host's model, every texel. The same at 4 x 150 for
  Depth24Unorm_Stencil8 where the device holds it, else SKIPPED with the format query's answers.
  Its depth is read through the owned depth_fill fixture's depth_fill_read before and after the
  copies, as no buffer copy takes it.
- tests::layouts records vkCmdClearDepthStencilImage, with which the runtime zeroes each placed
  depth-and-stencil image (it was on the unrecorded list, which panicked on it). It also keeps
  each vkCmdCopyImage's regions' aspects. The cell asserts the recorded aspects and layouts and
  prints them with the formats.

Verified:
- Job m3-max-73313 (msi, lavapipe, Khronos validation layer 1.4.363.0) ran the cell exact:
  - "Depth32FloatStencil8 in VK_FORMAT_D32_SFLOAT_S8_UINT ..., 300 x 150: 32 vkCmdCopyImage,
    every region VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT from and to; between the
    textures VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL to VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, within
    the destination VK_IMAGE_LAYOUT_GENERAL (apart 1 command, overlapping 30 in slabs); both
    planes of both textures exact, 45000 texels each";
  - Depth24Unorm_Stencil8 in VK_FORMAT_D24_UNORM_S8_UINT, 5 commands, 600 texels each exact.
  Its one red was clippy under the device cfgs (chunks_exact in the test), fixed here.
- Job m3-max-73314 (msi, this tree) exited 0 at every step:
  - fmt;
  - clippy plain, --cfg m2v_gpu and --cfg m2v_cpu_icd;
  - rustdoc -D warnings;
  - refusal_surface.py --check;
  - the rt suite on lavapipe under the validation layer: 731 passed, 3 skipped, 0 validation
    errors;
  - the lane's tests: 29 passed.
- The translator crates are untouched, so Device::new's modules, refusals and notes cannot change.
2026-11-24 00:32:28 -08:00