7d8d96f65efea8390af0fc31d2db567db6f4d04f
9479
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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. |
||
|
|
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 (
|
||
|
|
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. |
||
|
|
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. |
||
|
|
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. |
||
|
|
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. |
||
|
|
8f74582eb3 |
Docs: CONFORMANCE-COVERAGE.md regenerated for pass-sequence-aspect-actions' NVIDIA ledger row
|
||
|
|
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. |
||
|
|
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. |
||
|
|
b7ec03d37a |
Conformance ledger: pass-sequence-aspect-actions is refused on NVIDIA as on every other venue
Before the stencil form ( |
||
|
|
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
|
||
|
|
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 ( |
||
|
|
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. |
||
|
|
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. |
||
|
|
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. |
||
|
|
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. |
||
|
|
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). |
||
|
|
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. |
||
|
|
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). |
||
|
|
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. |
||
|
|
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 |
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 |
||
|
|
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. |
||
|
|
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 |
||
|
|
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
|
||
|
|
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
|
||
|
|
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.
|
||
|
|
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. |
||
|
|
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. |
||
|
|
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.
|
||
|
|
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. |
||
|
|
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. |
||
|
|
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. |
||
|
|
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 |
||
|
|
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). |
||
|
|
59480e2d48 |
Bless at 88beca43a0: the stencil form's golden rows and engine inventory
The stencil output form ( |
||
|
|
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
|
||
|
|
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 |
||
|
|
88beca43a0 |
Docs: CONFORMANCE-COVERAGE.md regenerated for the stencil form's four known-gap rows
The stencil form (
|
||
|
|
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
|
||
|
|
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
|
||
|
|
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 ( |
||
|
|
0c9db49765 |
Bless at 3c52ee1cf1: opened chains, MoltenVK's two contexts enable imageView2DOn3DImage
|
||
|
|
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 |
||
|
|
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: |
||
|
|
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). |
||
|
|
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.
|
||
|
|
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. |
||
|
|
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. |
||
|
|
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.
|