77ec1b3bb69cdfb61dd4d44c55ea2539dcebbc75
2278
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e93d7e6b1b |
Docs: a fragment's primitive id behind tessellation is the patch's position without a patch index buffer
The evaluation stage's varying carries Metal's patch index, which is the patch's position in its draw only where no patch index buffer is bound. With one, Metal's [[primitive_id]] stays the patch's position while its patch index is the buffer's entry (an Apple M3 Max, job m3-max-80366), so the docs now say which draws the varying's value is Metal's for, and that the runtime records no patch draw through a patch index buffer (DrawKind::PatchIndexBuffer stays refused). The translator module docs, lower_inputs, the tessellation link module, docs/API.md and the runtime README say so; no code changes. Doc lines past 100 columns in stage_io/plan.rs, lower_inputs.rs, the tessellation link module and the engine_device_arena and engine_draw_bases tests are rewrapped, and the patch test's println is shortened under the limit. |
||
|
|
5689683788 |
Translator: a fragment function's primitive id behind a post-tessellation function is the patch's position
Behind an evaluation stage, Metal's [[primitive_id]] is the patch's position in its draw, patch start included, the same in every instance and for every triangle the tessellator makes of the patch (an Apple M3 Max, job m3-max-80266: draws of two patches from patch 0 over two instances read 0 and 1 in both instances; two patches from patch 2 read 2 and 3). Vulkan's PrimitiveId there counts the draw's patches from 0 and restarts in each instance (the specification's PrimitiveId: "The index of the first primitive generated by a drawing command is zero ... reset to zero between each instance drawn ... In a fragment shader, it will contain ... the value that would have been presented as input to the geometry shader had it been present"), so it differs once patchStart is not 0. The translator refused such a pipeline at link, NotImplemented(Tessellation), which a walk's pipeline met behind its post-tessellation [[base_instance]]. The fragment function now reads it through the primitive ID's flat varying (IoRole::PrimitiveId), on every device, one form: a post-tessellation vertex function compiled under LoweringInputs::primitive_id_varying writes Metal's patch index, its patch input at PATCH_INDEX_LOCATION, to that varying at each return (stage_io::PrimitiveIdStore::Patch). Without a patch index buffer the patch index is the patch's position; the runtime draws no patches through one (DrawKind::PatchIndexBuffer stays refused), and the docs state the value for draws without one. The same value reaches every vertex of the patch, so the provoking vertex does not matter. Device::compile_render_pipeline and the render keys decide the varying for a post-tessellation vertex stage as they do on a device without a fragment PrimitiveId; the library answers that without decoding the function (a metallib function's TESS tag, a module entry's air.patch), and a compiled stage from its interface. Link refuses a fragment function compiled to read Vulkan's PrimitiveId behind an evaluation stage as NeedsInput(PrimitiveId), where it refused every such fragment as NotImplemented(Tessellation); docs/REFUSALS.md is regenerated. The varying takes a location as any other: the evaluation stage's outputs are held to maxTessellationEvaluationOutputComponents when it is planned, and link numbers the fragment's inputs below maxFragmentInputComponents / 4, each a typed InterfaceComponents limit refusal past it. Tests: a_fragment_primitive_id_behind_tessellation_is_the_patch_index_varying (MoltenVK's and RADV's profiles: the evaluation stage reads the patch-index input, the fragment stage one flat input and no PrimitiveId, L3), the link test of a fragment that reads Vulkan's PrimitiveId, and the runtime test every_device_reads_a_patch_s_position_as_its_fragments_primitive_id, green on lavapipe (llvmpipe), job m3-max-80338. |
||
|
|
a992aa6929 |
Translator: a GEP into an array field of a thread variable stays inside its array
A thread struct that holds pointers or heap handles beside an array field indexed at run time was open to pointer forwarding: provenance made the offset of any run-time index unknown, so the data access could overlap a pointer slot. A heap handle stored into such a struct then fell to the handle family's catch-all, Lowering(Access). That is the refusal of a post-tessellation vertex function a walk met (two render pipeline states refused). The Metal Shading Language leaves an index past an array undefined. So a thread-space getelementptr whose first index is a constant, each of whose run-time indices steps over an array its own type path names, and whose every use is a load or store address, is a GEP into an array field (provenance::array_geps). Over a base whose roots are stack allocations at constant offsets, its offsets are its displacement plus at most (len - 1) * stride per run-time index. These keep unknown offsets: a flattened offset (a run-time pointer index), a run-time vector lane, an address another GEP offsets or that is merged or stored, a base that may be null, and memory outside the thread space. A run-time index at a struct level has no IR form. Lowering holds every run to the bound. In the private arena, where objects lie side by side, such a GEP takes each run-time index as min(index, len - 1) (access.private.gep.array). A typed object's access already never leaves its levels. docs/API.md records the accepted difference: an index past the end of an array field of a local struct does not reach its neighbouring fields; it is undefined in MSL. The struct then closes as a forwarding cell, and its heap-handle stores that no load reads take the cell's unread store (the previous commit). Verified: - red: m3-max-80079, b9d9dfc9ba (parked_heap_handles refused at its handle store, block 0 instruction 11). - green: gate m3-max-80143 at the same tree on a scratch branch (lavapipe tests 47 passed; validation 1315 passed, 3 skipped; conformance 1047 passed; the translator suite's only failures are the tables development re-blesses: the engine inventory with four new parked_heap_handles rows, the golden printout, and 315 golden hash cells under SEMANTICS_VERSION 2319). - L0: a_gep_into_an_array_field_is_bounded_to_the_array (the bound, and each disqualifying shape staying unknown). - read-back, whole-struct copy (a memcpy) and a stepped address stay Lowering(Access). - the walk's two metallibs on the XTX node (m3-max-80156): the handle store's refusal is gone; the vertex function next met the two refusals the following commits remove. Cost: one UMin per run-time index into a private-arena array, the bound itself. The device-arena budget test's word bounds move by one each (13 for a word load, 12 for a word store, 24 for a float4 load). SEMANTICS_VERSION 2320 (development holds 2319). |
||
|
|
4fe41c795d |
rt: a blit copy with a texture buffer on either side copies its buffer's bytes
Metal makes copyFromTexture:...toTexture: with a texture buffer as the source or the destination.
copy_from_texture refused it as Gap::TextureCopy ("A texture buffer's texels are its buffer's
bytes, which no image copy reaches"). Under the rule that a refusal of what Metal makes is built,
it now copies a texture buffer's texels as the bytes of its buffer (texel_texture_copy):
- Checked as Metal checks any copy: one pixel format and one sample count
(Refusal::TextureCopyMismatch), and each region inside its texture's level and slice (`place`,
Refusal::TextureRegion), sizes of 0 taken as copy_from_texture takes them.
- Between two texture buffers: the region's bytes copied between their buffers by
copy_from_buffer_to_buffer, from each one's offset plus origin.x texels. The same bytes copy
nothing, as the same region of one image does, and bytes that meet are
Refusal::BufferCopyOverlap, as that call refuses them.
- Between a texture buffer and another texture: copy_from_buffer into the texture from the texture
buffer's row in its buffer, or copy_from_texture_to_buffer out of it into that row. That is one
vkCmdCopyBufferToImage or vkCmdCopyImageToBuffer region, checked and ordered as those calls are.
The command buffer keeps both textures. Gap::TextureCopy's doc drops the texture buffer case, and
docs/REFUSALS.md is regenerated. Buffer::new_texture's doc, copy_from_texture's doc and the runtime
README's texture buffer contract say what such a copy does. The texture buffer refusal test no
longer expects the gap from a copy of one into itself; that copy of the same bytes now copies
nothing.
|
||
|
|
c55fd4603c |
Validation: a video picture landed is the surface's mark of the other API's writes, not an acquire
The play calls Surface::external_writes_done once a picture lands on a video surface's pages. That call records no acquire: each submission part that uses the planes acquires and releases them itself, and the call marks the other API's writes on the host side. videos.rs' module doc already said so, but its counter and report line still named the call an acquire, as did docs/REPLAY-STREAM.md (the `m2v.externalWriteDone` row in section 4, and the video surface paragraph and its counters in section 10) and the replay test's doc. The executed counter video_surface_acquires is now video_surface_writes_done, and the report's `video surfaces` line says "N writes marked done" for "N acquires". Its one reader in the tree is rt_replay.rs' a_video_surface_is_waited_for_at_its_ready_point_once, updated; no script in the tree names it (grep for surface_acquires over *.rs, *.md, *.py and *.sh). The count is unchanged: one a picture landed in a surface. Wording and naming only; no behaviour changes. |
||
|
|
772441372c |
rt: a blit between a buffer and a texture buffer copies the region's bytes between the two buffers
A guest's 3D model window stayed blank: it fills an RGBA8Unorm texture buffer placed in a heap by
copyFromBuffer:...toTexture:, which BlitCommandEncoder::buffer_copy refused as Gap::TextureBytes
("A texture buffer's texels are its buffer's bytes, which no image copy reaches"). A texture
buffer has no image: its texels are its buffer's bytes from its offset. So a copy between it and a
buffer, in either direction (copy_from_buffer into it, copy_from_texture_to_buffer out of it), is
now checked as any texture's copy is, by the same checker (`buffer_copy`: the region inside its one
row, level 0 and slice 0, Refusal::TextureRegion past it; Metal's measured layout rules,
Refusal::BufferCopyLayout), and then the region's bytes (origin.x and width in texels times the
texel's bytes, at the texture buffer's offset) are copied between the two buffers by
copy_from_buffer_to_buffer. That path keeps both buffers, takes the Managed copies and the heap
places, and orders the copy as any copy between buffers. A texture buffer's uses take its buffer's
id in the hazard sets, so a later kernel's read is ordered after it. The command buffer also keeps
the texture. Two parts of the generic check don't apply: an image's rows or memory meeting the
region (it has none), and a copy command's offset alignment (vkCmdCopyBuffer takes any). The check
runs without them. Bytes of the texture buffer that meet the other buffer's region are
Refusal::BufferCopyOverlap, as copy_from_buffer_to_buffer refuses them.
Gap::TextureBytes's doc drops the texture buffer case and its basis line ("nor a texture buffer's
copy as a buffer copy; no recorded stream copies a texture buffer"), and docs/REFUSALS.md is
regenerated. Buffer::new_texture's doc, copy_from_buffer's and copy_from_texture_to_buffer's docs
and the runtime README's texture buffer contract now say what a blit with a buffer does. The
texture buffer refusal test no longer expects the gap from copy_from_buffer_with_options. A copy
between a texture buffer and a texture (Gap::TextureCopy) is left as it is.
|
||
|
|
f4f5cc33da |
rt docs: Metal's validation asks ShaderRead and ShaderWrite at every read_write slot; the runtime asks less where the function only writes
The runtime README's rule (Textures: Texture slots and usage), pipeline::slot_usage's doc and RESOURCE-ID.md's sentence on slot usage said the runtime asks a texture's usage at a slot as Metal's validation asks it, ShaderWrite alone at a read_write slot the function does not read. Metal's validation asks both at every read_write slot, by the declared access, whatever the function does there. Measured on an Apple M3 Max, macOS 27.0.1 (job m3-max-80068, a scratch probe of runtime-compiled MSL, R32Float 4x4): - a read_write slot the function only writes, of a ShaderWrite-alone texture, asserts "Compute Function(k_rw_write): reads texture (t[0]) whose usage (0x02) doesn't specify MTLTextureUsageShaderRead (0x01)"; - one the function only asks the width of asserts the same of 0x02 and the write of 0x01; - one it only reads asserts the write of 0x01 and the read of 0x02; - both usages run. Plain Metal runs every case, and the written one writes its texels. The runtime keeps its rule: such a slot asks ShaderWrite alone, as its write reaches the texture through its storage element alone, so a ShaderWrite-alone texture runs there as plain Metal runs it. The three texts now say what Metal's validation asks and what the runtime asks. They also name a texture atomic's slot as one that reads. Metal's validation asks both there: a 0x21 texture asserts the write and a 0x22 one the read; 0x03 runs without ShaderAtomic. Docs only; no behaviour changes. Verified: cargo fmt. Rustdoc runs as a job. |
||
|
|
59d00cd865 |
Validation: the play's own buffers take each copy-form surface's buffer over its exported block
A surface in the copy form holds a buffer of the runtime's over its exported block (`Device::copy_form`), which its planes, textures over it, hold too. The play's count of its own buffers (`NewRuntime::play_holds`) took none of them, so each copy-form surface the program made between frames 100 and 200 moved `buffers_excess`. The copy-form merge leg's RX 550 (m3-max-79613) and a rerun on the RTX 5080 Laptop GPU (m3-max-79696, at 2361470bff) failed the_play_s_own_textures_take_its_video_and_exported_surface_planes on `buffers`: excess 1 at frame 100 and 2 at 200, with both video surfaces copied (Tiling) and both exported surfaces in place. No leak: the growth is the second video surface's buffer, freed with the surface. The play now holds one buffer for each video surface in the copy form while the player keeps it (`Videos::held_buffers`), and one for each exported surface in the copy form while it or a plane of it the stream holds lives (`Exported::held_buffers`), as the textures term counts their planes. The test's first exported surface is a dma-buf's, which NVIDIA's dma-buf takes in the copy form, so the exported term with a plane outliving its surface runs there too. |
||
|
|
f124b1489f |
Translator: an access refusal names the structure it met
Feature::Lowering(LowerFamily::Access) with Needs::NotImplemented covered
about 235 refusal sites behind one name, so a walk's log line could not say
which without the AIR. Unsupported gains `cause: Option<Cause>`; an access
refusal carries Cause::Access(AccessCause), one variant per structure the
sites refuse: the access's shape, the type it moves or the memory it
reaches. Sites that refuse the same structure share a variant, wherever
they are; none is named by a file, a line or a string of its own.
The five helpers that build the refusal (lower/access/mod.rs refuse() and
memory/{alloca,leaf,plan,provenance}.rs not_lowered()) take the cause, so
the compiler makes every site name one; the three direct constructions in
memory/handles.rs and lower/access/handle.rs do too, through
Unsupported::access. Feature stays Lowering(Access), so validation's
outcome key (feature_key, the Debug of the feature) and the census are
unchanged. Display prints the cause after the feature:
"Lowering(Access): PointerStore; needs NotImplemented at ...".
Storage: nothing stores the cause. Validation keys a refusal by
feature_key(&u.feature) (engine.rs); a FALLBACK repro bundle keeps the
failure as text (repro.rs, whose only serde record is the device); the
runtime's cache marks a refused translation with fixed bytes. No version
bump.
A buffer argument of a count other than one outside an argument table
names BufferArray, apart from an index or count the metadata does not fix
(UnfixedLocation).
Tests: the error module's Display test of an access refusal; the plan's
table gaps assert ArgumentTable, and its typed-depth, initializer and
buffer-array refusals PrivateType, Initializer and BufferArray.
runtime-sources.sha256 rewritten: memory/handles.rs's two refusals name
their cause, and no run behaves otherwise. api_signatures blessed (Cause,
AccessCause, Unsupported.cause), api_surface lists the two enums,
REFUSALS.md regenerated (the access refusals are built in error/mod.rs),
docs/API.md's error table names the field.
Consumer uses (consumer-uses.sh, read-only, plus git grep, over the
consumer's development 22cfe51a54 and its lane tips of the last day): no
struct literal or exhaustive destructuring of the translator's Unsupported
("Unsupported {" hits only its video crate's own Unsupported(String),
codec/encode.rs:494-502). Its rt platform builds refusals in tests with
Unsupported::not_implemented (rt_platform/diag.rs:3076, 3078, 3490;
rt_platform/unbuilt.rs:1203, 1293), whose cause is None, so their keys
("Translation-Lowering") hold. It reads u.feature where it names a refusal
(rt_platform/diag.rs:1082) and where it says one (rt_platform/unbuilt.rs:
507); each shows the cause once it reads u.cause too.
|
||
|
|
c1f999eb06 |
rt: pipeline states answer Metal's allocatedSize as their translated SPIR-V's bytes
ComputePipelineState::allocated_size and RenderPipelineState::allocated_size answer MTLAllocation's allocatedSize, which both Metal pipeline states adopt. The answer is our code's size, not the driver's compiled binary, which the runtime does not measure. A compute state answers its kernel's module, the one its interface is read from. A render state answers its stages' modules, summed. Both numbers are taken from the translation when the content is made and kept as a u64 in the content (a compute content's Answers, a field of RenderCompiled); no module is kept for them. Every device takes the same form. No variant counts: not the emulated-SIMD-group or partial-threadgroups variant lowered with a compute state, not one made at a dispatch (the emulated-partial variant), and not a render content made later for a pass. So the answer never changes once a state is made, and two states of one content answer one size. docs/API.md's accepted differences (Heaps and memory) gets the entry. MTLAllocation.allocatedSize stays missing in the coverage ledger: buffers, textures and heaps still lack it. Its note now names the pipeline states' answers, and docs/METAL-COVERAGE.md is regenerated. api_signatures.tsv is blessed with the two methods. Tests: - state_answers: a new test. block_scan (plain module) and sample_down (partial-threadgroups variant) answer non-zero. Each equals the bytes of the module the state keeps (a test-only Kernel::module_bytes). The render state of first_texel_fragment answers the sum of the translator's compile_render_pipeline stages' SPIR-V lengths. Two states of one content answer one size. - translate.rs: the ragged-grid test on emulated SIMD groups now also checks that a state's answer is the same after the dispatches that make the variant later. Verified: job m3-max-79929 on lavapipe, a check of this tree. - signatures --check, coverage --check, clippy (plain, m2v_gpu, m2v_cpu_icd), workspace doc and the runtime's private doc: all 0. - The runtime suite: 928 passed, 3 skipped. - The two tests rerun with output: both pass. On lavapipe the variant already emulates its SIMD groups, so the ragged test makes nothing at a dispatch there. No card run yet. |
||
|
|
06d2d22bf7 |
Translator: a library keeps each module in an allocation of its own, and a function keeps its module, not its library
A pipeline state keeps its descriptor's functions to lower its later variants from, and a function held its whole library through an Arc: a guest that made a state of one function of a metallib of many, then released the library, kept every module of it alive as long as the state lived. At load, a library now splits the one copy it makes of the loaded bytes: each module (each run of bytes one or more functions' bitcode covers, so functions over one module, as a Core Image kernel library's or a dynamic library's exported functions, share one) in an allocation of its own, and every other byte (header, function list, metadata, other sections, padding) in one more. A function holds its library's function table (rows, content hash, type, install name, dependencies), its own module's allocation and its index, and the library weakly. So a state keeps exactly its functions' modules whether the library lives or not: while it lives, the same allocations the library holds, each module once; nothing is copied at a state's make. Public changes (api_signatures.tsv, docs/API.md, the doc comments): - Library::bytes() returns an owned Vec<u8>, assembled from the allocations, equal byte for byte to the loaded bytes (of a universal file, its AIR slice, as before); content_hash() is their SHA-256, computed at load as before. - Function::library() returns Option<Library>: the library while a Library value of it lives, None after; MTLFunction names no library either. - Function::library_content_hash() (new): the library's content hash, kept with the table. - Function::bitcode() (now public, infallible): the function's own module (a metallib function's wrapped module, a bare module's whole module, a dynamic library's one module); its doc says the bytes are the guest's shader, never committed or sent anywhere. - Function's PartialEq and Eq: equal tables (each holding its library's content hash) and indices. The translator's own uses of a function's library read the table (compile.rs's dependency order and EntryNotFound's count); linked_sources no longer fails. The consumer's call sites (reims-vgpu development 53e7385993, read only; search: git grep -n -E '\.(bytes|library)\(\)' over crates/reims-vgpu-vulkan and crates/reims-vgpu, and \.library\(\) over the whole tree; every other hit is a string's, a NAL's, a staging buffer's or graphics().library()): crates/reims-vgpu-vulkan/src/rt_platform/diag.rs:1860 and :1863 (the kept-AIR bundle: the container while the library lives, else the function's own module through bitcode(), the line naming which), diag.rs:1934 (FunctionName::of: library_content_hash()), diag.rs:3495 (test; unchanged, the bytes compare equal) and unbuilt.rs:653 (test; a function keeps bitcode().len()). Tests: the red test's two states (lavapipe; their test accessors now read a kept function's library where it lives, else its own module); a_live_library_and_its_states_hold_each_module_once (two compute states and a render state share the library's own allocations); tests/library_modules.rs: bytes() equals the loaded input for a plain metallib, a Core Image kernel library (shared module), a dynamic library, each universal header and a bare module, the content hash their SHA-256; a function holds its module (one allocation per module, shared over a shared module), names no library once it is released, keeps the content hash and compiles under the same keys to the same words. The runtime's README says what a state keeps. |
||
|
|
e0f63843c4 |
replay: the longest translation at encode is an end line, not a frame's counter
translation_at_encode_max_nanos is a maximum since the device was made, so a frame's difference of it means nothing: the report gives it once, as `translation at encode longest N ns` beside the commit lock's, and keeps translations_at_encode among the executed counters. |
||
|
|
ac220d6f52 |
rt: the heap size query answers every storage mode alike; a Shared heap's texture is refused at its placement where the image takes no Shared type
On the RTX 2080 (NVIDIA 620.70.06, job m3-max-79682) the device's optimal images take no Shared memory type. Two things followed from that: - The parent commits' size query, which checked a Shared descriptor against the Shared type, refused Shared descriptors there. heap.rs's two Private-block tests size Shared descriptors, and both failed at their size query. - A guest that sizes a texture with a Shared descriptor would have lost an answer it had before. The size query now checks the Private type for every descriptor, as it did before this series. Its answer does not depend on the storage mode. The Shared type is checked where the texture is placed in a Shared block, and the placement is Gap::HeapTexture where the image does not take it. Follow-on changes: - The Shared-heap device test expects the size query to answer on every device and the placement to be refused exactly where `Device::heap_image_fits` says the image does not take the Shared type. - The conformance side holds a Shared query to the placement and read-back steps in a Shared heap, and to step 1 where that placement is Gap::HeapTexture (docs/API.md section 10 says so). - churn_rest finds out once, by placing a texture for views in a Shared block and releasing it, whether the device places its Shared heap texture. Where it does not, the row leaves the kind out, naming it with the reason. - The rt README's known gaps of textures name where a Shared heap's texture is placed: lavapipe and the Radeon 780M take it (jobs m3-max-79654 and m3-max-79685); the RTX 2080 does not. The Gap::HeapTexture doc says the same. Ledger: the five rows of the RGB10A8_2P_XR10 heap cases (texture-fills-550, texture-fills-551, texture-fills-heap-run-550-b5, texture-fills-heap-run-551-b5 and two-plane-heap-blits) take the Err the replay at 1e1c3f39b8 pasted (lavapipe, job m3-max-79680). Their Shared heap no longer refuses first, so the format's own Gap::TextureFormat answers. Their venue stays *, since the format check comes before the placement on every device, and their justification already names Gap::TextureFormat. CONFORMANCE-COVERAGE.md is regenerated and unchanged. |
||
|
|
13951e8daf |
rt: a texture is placed in a Shared heap as in a Private one, where the device's image takes the Shared type
Metal places textures in a Shared heap: the M3 Max makes them, in automatic and placement heaps (job m3-max-79576). The runtime refused every texture in a Shared block as Gap::HeapTexture. Now new_heap_texture and new_heap_texture_for_views bind the device's optimal image in a Shared block's memory exactly as in a Private block's. That is one form, with no linear image and no copy. - heap_source refuses an exported block alone, whose memory is dedicated to its buffer. - heap_fit takes the heap's memory class. At the placement, the class is the block's (Bind::Heap carries it). At heap_texture_size_and_align, it is the class the descriptor's storage mode names: Shared for Shared, Private for any other, as before. - Gap::HeapTexture stays typed for an image the device requires an allocation of its own for, or whose memoryTypeBits leave out the heap's type, at the size query and at the placement. The consumer counts it. The host reaches such a texture as any texture's, through replace_region and get_bytes. Their copies go through the GPU and flush or invalidate only their staging bytes. The block's mapping over the image holds the device's own layout, so the image's range needs no flush or invalidate of its own. A command buffer that uses the heap (use_heap) flushes and invalidates its whole Shared block, as it did for the heap's buffers. Nothing in the runtime asks which Mac the guest has. Whether a guest may make a Shared heap at all is the consumer's decision; the runtime has no heap object and hands a Shared block to any take. Docs: - the rt README's heap paragraph covers Shared heaps; - the Gap::HeapTexture doc is updated, and REFUSALS.md regenerated; - docs/API.md's heap-size entry: a Shared descriptor is now held to the placement and read-back steps in a heap of a Shared block, as the conformance side's heap_sizes::hold now does; - the known-gap sentence of the UHD 630 Windows texel-buffer refusal gains its trigger: a second device above the floor whose formats lack those buffer features, or a walk that meets the refusal. The test is the parent commit's. Verification is to follow in the handover: lavapipe red then green, one card per vendor, the gate, and the conformance replay. |
||
|
|
86386c4873 |
Refusal surface: --check compares the totals, and REFUSALS.md counts Refusal::TextureUsageAtSlot
docs/REFUSALS.md listed 89 runtime Refusal variants but its two totals tables still counted 88 (and 24 metal-measured where there are 25). A union of two branches' rows keeps every variant row and one side's totals, and --check compared only the variant rows, so it passed. The totals count variants alone (no sites, no line numbers), so they are structural: --check now compares them too. Verified locally (plain script, no build): with the old REFUSALS.md, --check exits 1 naming the two stale Refusal totals rows; after regeneration it exits 0. The regeneration changes only those two rows; basis.rs is unchanged. |
||
|
|
b723c90272 |
rt: Device::default_sample_positions answers getDefaultSamplePositions:count:
The runtime answered no default positions (its README's known gap). Device::default_sample_positions answers a count with the positions a pass of that many samples that sets none rasterizes at: Vulkan's standard sample locations, which the floor's standardSampleLocations makes every such pass take, and which are plain Metal's answers at 1, 2 and 4 samples on an Apple M3 Max, macOS 27.0.1 (probes/default_sample_positions.m, m3-max-78953). supports_texture_sample_count answers at most 1, 2 and 4, so no other count is answered. A count it does not answer is Refusal::DefaultSamplePositions (basis metal-measured: plain Metal asserts "count (n) is not supported on this device." and ends the process, at 0, 3, 5, 6, 8, 16, 17, 32 and 33 on the M3). README (the device's answers; the sample-positions gap sentence), coverage.tsv (I), and the generated REFUSALS.md, basis.rs, api_signatures.tsv, METAL-COVERAGE.md and CONFORMANCE-COVERAGE.md. Verified on lavapipe, job m3-max-79650: clippy, doc and private doc EXIT=0; the runtime suite 923 passed, 3 skipped. Metal's answers: m3-max-78953 (Apple M3 Max). |
||
|
|
a3a91a10f2 |
Conformance ledger: the Accumulate cases' rows as the replay of the Reset answer gives them
The rows of visibility-boolean-accumulate, visibility-counting-accumulate (both),
visibility-counting-accumulate-one-command-buffer and visibility-counting-accumulate-revisit
named the Gap::Draw{AccumulatedVisibilityResults} refusal, which is gone. The conformance
replay on lavapipe at efa04c576a (job m3-max-79548) read those five rows as fixed and gave
six in their place, pasted as it printed them with the venue widened to every venue, as the
rows they replace were:
- divergent at case/pass-0/words and case/pass-1/words of the Boolean and the Counting
shapes, and at case/pass-1/words of the one-command-buffer shape: Metal on the M3 Max adds
into the words, the runtime writes each result in place of its word;
- refused at case/pass-0/calls/0-render of the revisit shape: its first mode is now taken,
so the second mode at the same offset meets Refusal::VisibilityResultOffsetTaken, the
refusal of visibility-counting-revisit's row, whose text it takes.
No other row moved in that run. docs/CONFORMANCE-COVERAGE.md regenerated.
|
||
|
|
ce471296d5 |
rt: an Accumulate pass writes its visibility results as a Reset pass does, on every device
set_visibility_result_mode refused Boolean and Counting in a pass whose
visibilityResultType is Accumulate (Gap::Draw{AccumulatedVisibilityResults}, counted in
Metrics::accumulated_visibility_refused). MTLRenderPass.h documents Accumulate in one
sentence, "Accumulate visibility results data across multiple render passes." Measured
(the conformance recordings, values.rs VisibilityResultType): Metal on an Apple M3 Max
(macOS 27.0.1) adds a Counting result into the word's low 32 bits and ORs a Boolean one,
while Metal on a Radeon Pro 5300M and a UHD Graphics 630 (macOS 26.7.1) writes it in
place of the word, as Reset does. The documented sum needs an add of a query's count into
a buffer word: a scratch copy of the query results and a kernel of the runtime's own after
the rendering, which is not built. The planner ruled that the runtime answers Accumulate
as Reset on every device until that sum is built, which then replaces it everywhere.
So the setter takes every mode in an Accumulate pass as in a Reset pass, and the
encoder no longer keeps the pass's visibilityResultType, which nothing reads now.
Removed public items: DrawKind::AccumulatedVisibilityResults and
Metrics::accumulated_visibility_refused (the consumer's checkout names neither in code;
two doc comments and one test of its rt platform describe the refusal:
rt_platform/render.rs:76 and its test at :2299, rt_platform/descriptor.rs:21).
DrawKind::VisibilityResultInterrupt stays refused, its doc now saying why: its answer
needs the same add. docs/API.md's accepted differences records the measured answers; the
rt README, VisibilityResultType's doc, the validation replay's docs and
docs/REPLAY-STREAM.md follow. The validation replay test of an Accumulate stream now
holds that its modes write as a Reset pass's, nothing skipped. REFUSALS.md regenerated
(Gap::Draw loses one site); api_signatures blessed (the two removed records).
|
||
|
|
2dc8b1c002 |
rt: the triangle fill mode of raw value 2 draws as Fill on every device
set_triangle_fill_mode refused TriangleFillMode::Points, the raw value 2 that no SDK
header declares (MTLRenderCommandEncoder.h declares Fill and Lines alone), as
Gap::Draw{FillMode} on every device. Apple's OpenGL renderer sends it for
glPolygonMode(GL_POINT). Metal refuses it on no Mac measured, and the Macs disagree: an
Apple M3 Max and an Intel UHD Graphics 630 draw a triangle's vertices as points, an AMD
Radeon Pro 5300M fills the triangle. The planner ruled that the runtime takes the Fill
answer, which needs no device feature, no pipeline of its own and no precision note.
The setter now takes Points as Fill. DrawKind::FillMode keeps one case, Lines on a
device without fillModeNonSolid. docs/API.md's accepted differences records the
measured answers and that a points form waits for a guest's report that the points
answer matters; the rt README's fill modes and known gaps say the same. REFUSALS.md
regenerated, unchanged (it lists no DrawKind text).
Verified: tests::raster::on_device::every_device_draws_the_fill_mode_of_raw_value_2_as_fill
on lavapipe, red at the test's commit (the setter refused), green here.
|
||
|
|
8209b0d83b |
Harness: two churn rows make and release every kind of their group in each of 200 iterations, their gauges read at 100, 200 and the drop
The thirteen gauge kinds no replay judges and no harness workload recorded now each have a loop, grouped as the planner ranked them. `churn_all_day` (OwnRow::ChurnAllDay) makes, uses and releases in each iteration: a host memory import with a buffer over it; an exported block with a buffer over it; a video surface of each decoder route the device exports (a dma-buf at the VA-API layout, the host's opaque handle at NVIDIA's), as the replay player makes them, with a view of each plane at an index, its buffer in place, and plane 0 kept past the surface's release; the runtime device tests' plane stand-in surface (two RGBA8Unorm planes of the opaque handle) whose plane 0 a pass renders beside another colour attachment; two render pipeline states; and a Private target and a target over a Shared buffer, each drawn into, then read through a texture after a memory barrier. `churn_rest` (OwnRow::ChurnRest) makes a compute state of one of 40 contents in turn (past the 32 stage entries kept), a draw under a Counting visibility mode into 4 samples resolved into a texture over a Shared buffer, a texture over an exported block read by a blit, and an indirect command buffer. Each row reads the device's gauges once it settles (no release waiting, no command buffer unretired, two reads 20 ms apart equal) after the 100th and the 200th iterations, and once more after its device dropped (own::run, through the counters that outlive it), and the command prints them as `M2V-MATRIX gauge harness-<runtime>/<row>/<gauge>@100|@200|@drop`: the harness's gauges and the eleven kinds they left out (imports, exports, surface imports and buffers, plane stand-ins, shadows, stage entries, resolve images, textures copied over, occlusion pools, indirect command buffers). The matrix judges them as every gauge. A kind the device does not make is left out with its reason on the row's lines; the first line gives each of the group's kinds live in the first iteration before its release. No kind needed a consumer-side object: the host import's memory is the row's own, as in the runtime's import tests. The device tests churn_all_day_holds_every_gauge_still_and_frees_all_at_the_drop and churn_rest_holds_every_gauge_still_and_frees_all_at_the_drop hold the matrix's rule on the report. |
||
|
|
d9054b5164 |
Validation: a play's gauge records are the runtime's objects past the play's own, of each kind the program makes one at a time
A play's frames 100 and 200 are not one loop's iterations: the program makes and releases objects between them (glbench-3090-r4 holds 62 textures at frame 100 and 690 at 200), so a runtime gauge held flat there judged the program. The matrix's records of a play are now, for buffers, textures, samplers and events, the runtime's live objects of the kind less the play's own (`KIND_excess`): the stream's live objects the backend made, and the backend's own that stand for them (two-copy Managed buffers' CPU copies and the released ones a commit still copies, the asides, the guest RAM scratches; the planes' shapes, one texture a plane and shape that the plane's surface textures and views are views of; the video and exported surfaces' planes). The settled end lines at frames 100 and 200 carry the play's count of each kind as KIND_held. An excess below zero is written as it is, which results.py takes for no count. The runtime's other kinds follow the program's objects and work, not one object each: they are not replay records (the harness's loops hold those its workloads reach), and every kind stays held at zero at the device's drop. Verified: in the hand-over. |
||
|
|
f4eb47d792 |
Validation: a play's gauges at frames 100 and 200 go out as the matrix's records, every kind on its end lines
What: - The runtime backend's end lines (`Backend::live`) carry every count of an object kind the runtime keeps live: samplers, LOD clamp variants, level elements, kernel variants and entries, render contents, attachment views, descriptor slots, device samplers, shadows, resolve images, plane stand-ins, buffer set pools, surface buffers, indirect command buffers, releases waiting and handles out join them, and the pipeline cache's bytes. - At the ends of frames 100 and 200 (GAUGE_FRAMES) the player reads them once they hold still (Backend::settled_live): the runtime backend reads them every 10 ms until no release waits and two reads in a row agree on every recorded kind, for at most 2 s, a wait no frame's time holds. What the program released goes on the runtime's block-maker and reaper threads after the work before it retired, so a read straight after the frame's waits could differ between two plays. - command-replay prints, where the play ended frame 200 and skipped nothing by then, `M2V-MATRIX gauge replay-rt/STEM/GAUGE@100` and `@200` for each kind of GAUGED (gauge_records). scripts/matrix/results.py judges them as it judges the harness's: equal at 100 and 200, blocks no higher at 200. - Left out, and why: handles_out (1 while the play holds the device), releases_waiting (lowered by the block-maker thread whenever it runs), private_units (a layout of memory that follows the bytes the program holds), and every byte and age gauge, which follows the program's content and the pool's idle clock: the pipeline cache's data (bound 128 MiB), the translator's entries' bytes (bound 64 MiB), the staging bytes, the pool's allocated, idle, reserved, reused, taken and block bytes, and the shadows', resolve images' and stand-ins' bytes, whose counts are recorded. Why: the matrix's leak rule (live gauges per resource kind flat between iterations 100 and 200) reached only the harness's compute workloads. The kinds only draws and passes make (render contents, attachment views, shadows, resolve images, stand-ins, the samplers draws reach) had no such check, and a play's end lines lacked 17 of the kinds. Docs: REPLAY-STREAM.md section 10 (the end line's gauges, the settled read, the records), VALIDATION.md's gauge row, command-replay's module doc. Tests: replay::tests the_player_settles_the_gauges_at_frames_100_and_200_alone and the_gauge_records_are_the_counted_kinds_at_frames_100_and_200; replay::rt_replay the_end_lines_carry_every_gauge_the_gauge_records_carry (device); test_results.py test_a_plays_gauges_at_frames_100_and_200_are_held_flat_as_the_harness_s. Verified: in the hand-over. |
||
|
|
fcdcffea07 |
Docs: REFUSALS.md regenerated after the slot-usage refusal met the word-bound draw
The draw now refuses a missing pipeline state at two sites, one from the word-bound content's path ( |
||
|
|
c25a5b238a |
rt: a view made with a swizzle keeps its texture's usage at a slot, as its known gap rules
8811dd6790 checked a texture slot against the usage Metal answers, and answered a view made with a swizzle as ShaderRead and PixelFormatView alone, so a kernel's write through such a view became Refusal::TextureUsageAtSlot. That reversed the runtime's recorded known gap of swizzles (README, Known gaps of textures: a view's descriptor reports its base texture's usage, so a draw into such a view and a kernel's write through it run, the write stored unswizzled; docs/API.md's accepted differences), on which OpenCL mode stands: Apple's OpenCL binds an image of most channel orders as a swizzled view and writes it (tests/opencl_swizzles.rs, job m3-max-16336). The runtime suite on lavapipe at b28f70e076 (job m3-max-78531) failed three tests on it: opencl_mode_queries_of_a_swizzled_write_only_image_answer_the_view, opencl_mode_writes_through_a_swizzled_image_store_the_value_as_written and every_device_reads_through_a_view_s_swizzle_and_writes_past_it, each "the Kernel function uses texture slot 0, whose texture's usage MTLTextureUsageShaderRead | MTLTextureUsagePixelFormatView lacks what its access there asks". The slot check now takes the texture's descriptor usage (TextureObject::metal_usage: Metal's unknown usage as 0x17, a view's its texture's, a swizzled view's included). The known-gap text and new_texture_view_with_swizzle's doc are as before 8811dd6790; the refusal's doc, the README's Texture slots and usage and RESOURCE-ID.md say a view's usage is its texture's, a swizzled one included. The slot_usage test's swizzled destination is now a case that runs and stores the texel as written. The same run failed every_device_gives_an_index_to_the_texture_placed_there_last, whose dispatch wrote through A, a texture of ShaderRead usage alone, at sample_down's written slot: that is the refusal Metal's validation gives, and the test's point is that A's placement empties D's storage element. It now writes through D's ID, the same index, which D's ShaderWrite usage lets the slot check pass, and D still keeps its texels. Verified: cargo fmt; refusal_surface.py --check (REFUSALS.md unchanged). The suite run of this commit follows as a job. The other 865 tests of job m3-max-78531 passed (3 skipped). |
||
|
|
da03093c0c |
rt: TextureUsageAtSlot's basis quotes Metal's (t[0]) as code, which rustdoc read as a link
Rustdoc with -D warnings refused the basis line of Refusal::TextureUsageAtSlot: the quoted Metal
validation text "reads texture (t[0]) whose usage ..." holds t[0], which rustdoc reads as an
intra-doc link to an item named 0 ("unresolved link to `0`", error.rs, three times, in both the
public and the private-items build). The three t[0] are now code spans and the lines reflowed
under 100 columns; REFUSALS.md regenerated (the row's text; basis.rs is unchanged).
Verified: the failure is job m3-max-78486's rustdoc steps (doc and privdoc EXIT=101; fmt, clippy
over the workspace and under --cfg m2v_cpu_icd and --cfg m2v_gpu, refusal_surface --check and
the signatures check passed there). Here: cargo fmt and refusal_surface.py --check; the rustdoc
run of this commit follows as a job.
|
||
|
|
73bb5eb204 |
rt: a dispatch or draw whose texture lacks the usage its slot's access asks is TextureUsageAtSlot
A function's texture slot bound to a texture whose usage lacks what the function's access there
asks reached no element of the texture's and ran: it read element 0 of set 1 (nil's null
descriptor) or a null element as zeros and dropped its writes, with no refusal and no count. The
textures: one no shader reaches (no index: a Depth32Float target of RenderTarget usage alone, a
texture of PixelFormatView usage alone), a colour target of RenderTarget usage alone (null
elements), a texture not made for shader writes at a written slot (no storage element), and a
view made with a swizzle at a written slot (written unswizzled, where plain Metal writes through
the swizzle).
Each dispatch and draw now checks, once after the pipeline state or a binding changes and before
it records anything, each texture its functions' slots reach against the usage Metal's validation
asks by the access the function declares there (pipeline::slot_usage): ShaderRead for a sample or
read slot, a size query alone included; ShaderWrite for a write or read_write slot; both for a
read_write slot it reads. The texture's usage is Metal's answer (TextureObject::metal_usage):
the descriptor's, Metal's unknown usage as 0x17, and a texture reading through a swizzle other
than the identity ShaderRead and PixelFormatView alone. A texture short of it refuses the command,
Refusal::TextureUsageAtSlot { stage, index, usage }, binding and recording nothing. The binds take
every texture, as Metal's do. Gap::SwizzledReadWrite stays checked first for a read_write slot it
reads. The check reads facts the interface and the texture already hold; nothing runs per draw.
Basis (the previous commit's measurement, an Apple M3 Max, macOS 27.0.1, jobs m3-max-78392 and
m3-max-78422): plain Metal reads and writes the texels; Metal's validation asserts "Compute
Function(k_read): reads texture (t[0]) whose usage (0x04) doesn't specify
MTLTextureUsageShaderRead (0x01)", "writes texture (t[0]) whose usage (0x01) doesn't specify
MTLTextureUsageShaderWrite (0x02)" (an access::write argument asked only its width included), and
"Fragment Function(f_first): Shader reads texture (t[0]) whose usage (0x04) doesn't specify
MTLTextureUsageShaderRead (0x01)".
Docs: REFUSALS.md regenerated (the refusal's site); the runtime README's Textures section states
the rule (Texture slots and usage) and its compute encoder, render encoder and swizzle entries
name the refusal; RESOURCE-ID.md's sentence that a slot binding a colour target of neither usage
reads nil now says what a runtime refuses; the doc comments of set_texture, set_vertex_texture,
dispatch_threadgroups, draw_primitives, gpu_resource_id and new_texture_view_with_swizzle name it.
The test literals of the kernel interface and of a content's draws (tests/compute.rs,
tests/indirect.rs) take the new field.
Verified: cargo fmt. The red and green runs, clippy and the runtime suite on lavapipe follow as
jobs.
|
||
|
|
9ad296c6cd |
rt: Refusal::TextureUsageAtSlot, and a test of slots whose texture lacks the usage they ask (red)
A texture slot a function uses, bound to a texture whose usage lacks what the function's access
there asks, reaches no element of the texture's, and nothing refuses it: the slot reads element 0
of set 1 (nil's null descriptor) as zeros and its writes are dropped. A texture no shader reaches
(a Depth32Float target of RenderTarget usage alone, a texture of PixelFormatView usage alone) has
no index; a colour target of RenderTarget usage alone has an index whose elements are null; a
texture not made for shader writes has no storage element. This is the index-free direct bind of
the consumer's row 194 that is still open after
|
||
|
|
15e53e4209 |
Translator: the emulated simdgroup tier takes the partial-threadgroups variant
select.rs refused a kernel's partial-threadgroups variant in the
Emulated tier (Unsupported{PartialThreadgroups}), which the runtime
reports for a ragged grid as Gap::PartialThreadgroups{Translator}. The
tier is lavapipe's for every SIMD-group kernel (its compute subgroups
are below 32), Intel's for a large kernel the widest-pin rule sends
there, and the emulated variant's on every device.
The variant now walks the tier's synchronizations as the subgroup tiers
walk their barriers. workgroup::check plans the predicated walk for a
kernel of partial threadgroups with any of the tier's synchronizations
(an exchange or a threadgroup barrier), with Predication::partial_groups
set, so emit_entry starts `live` from Metal's threads (lin < n) and the
invocations past them reach each exchange's barriers never live, storing
nothing. The exchanges take Metal's thread count as the threadgroup's
N: KernelDecl::live also answers that count, emit_entry keeps it as
EmitCx::entry_threads, and Emu::n is it in place of the local-size
constant. Every existing rule below N then answers Metal's partial
threadgroup: a read of a lane past it reads the calling lane, folds,
votes, ballots and quad masks take only the lanes below it. The scratch
stays sized from the local size, so every invocation has its slot.
Docs: LoweringInputs::partial_threadgroups, the divergent and workgroup
module docs, PartialThreadgroupsSite::Translator, the runtime README's
partial-threadgroups gap, and docs/REFUSALS.md regenerated.
SEMANTICS_VERSION 2316 -> 2317.
|
||
|
|
7a1da6cb22 |
rt: a draw through buffers bound at a multiple of 4 below their alignment draws the state's word-bound content
Row L97 (the draw residual). A dispatch of a function's kernel whose buffer
argument of 8 or 16 is bound at a multiple of 4 below that alignment runs a
variant of its kernel that holds the slot to 4 (8 where a 64-bit atomic may
reach it). A draw refused such a bind (Refusal::BufferOffsetAlignment). It
now draws the same way.
- RenderPipelineState::for_words(device, words) makes the state's content
with LoweringInputs::word_bound_buffers set for its vertex function (bits
0..31) and fragment function (bits 32..63). The device's map of contents
keeps it under the state's key with that mask (KernelKey.words widens to
u64). Like a pass's 2D-array content, it has no cache record of its own.
Its samplers are numbered at the state's indices; a mismatch is
Gap::KernelInput (ConstexprSampler).
- RenderCommandEncoder keeps the state set (`base`) apart from the state it
draws through (`pipeline`). Where a draw's facts are not held (a bind or
the state changed), bind_words reads the base's buffer address fields. A
slot of mask 7 or 15 whose bound address is a multiple of 4 but not of
its alignment sets its bit. The mask is ANDed with the slots the state
lowers from AIR (word_slots: a function the consumer compiled has none,
and its bind stays refused). A new mask switches `pipeline` to that
content, or back to `base`. An execution of an indirect command buffer
draws through `base`.
- The draw's own checks then hold each slot to the content's alignment: an
address off a multiple of 4 is still refused, as is one off 8 that a
64-bit atomic may reach.
Cost: a draw bound aligned keeps the state it was set with, and the scan of
its address fields runs only where the draw's facts are found again
(expected from the code, not measured). The first draw of a new mask lowers
both functions again and makes the content's VkPipeline (a first-use wait),
as the compute variant does. A later draw of that mask finds the content.
Docs: the runtime README (Render encoders: the draw bullet; Compute
encoders: the variant's paragraph); error.rs's BufferOffsetAlignment;
docs/API.md section 1 and its accepted differences. REFUSALS.md unchanged
(refusal_surface --check 0); api signatures --check 0.
Verified:
- Green on lavapipe, m3-max-79015 (at this commit's tree before its rebase
onto
|
||
|
|
212d7b2d8e |
rt: blit copies whose rows meet go a row at a time where no one axis orders them, and a surface's plane lies in its buffer
Row L212. Metal leaves overlapping copies undefined; an Apple M3 Max reads the source whole before it writes, which the runtime gives as slabs, and no Vulkan copy command may read bytes it writes (VUID-vkCmdCopyImage-pRegions-00124, VUID-vkCmdCopyBufferToImage-pRegions-00173, VUID-vkCmdCopyImageToBuffer-pRegions-00184). Form (blit.rs): - Slabs becomes an enum: Across (the existing single-axis cut) and Rows (RowSlabs). Where cut() finds no axis, row_by_row() takes the rows one at a time. Each row goes before every row whose source its destination lies on: descending where every destination row lies on a source row after its own (meeting()'s y shifts all positive), ascending where all are negative. - Within a row, the shift from the destination row to its own source row (the first row's, plus the pitch difference per row) decides the cut. Zero: the row is its own bytes and copies nothing. Less than the row: slabs of |shift| in whole texels, the far end first. Otherwise: one command. - Slabs::of yields each slab's 3D start, which ImageCopy::regions and BufferCopy::slabs add to the other side's origin and to the buffer offset. - An execution barrier still separates two commands. Every hazard between them is a write after a read, as no row reads bytes an earlier row wrote. - Still refused (Gap::OverlappingCopy): rows of two pitches that cross, where one destination row lies on a source row before its own and another on one after its own. Surface (texture.rs, buffer.rs, surface.rs, d3d11.rs): - An exported surface's plane image keeps its PlaneLayout (Under::Surface laid, from SurfaceImage). - TextureObject::rows_in(buffer) answers the plane's rows in a buffer on the surface's memory: BufferObject::surface_range matches the buffer's block aliases to the plane's (Arc::ptr_eq) and maps the plane's offset through the block's memory range. - A copy between a buffer and a texture takes those rows where the texture has none of its own. A texture over the surface's buffer is always the copied form (OverCause::Surface), so a copy between it and a plane shares no bytes in Vulkan, and is left as it was. - The surface's buffer and planes are aliases that read alike in the general layout. Surface::buffer's doc quotes the section. Docs: - blit.rs and the copy methods' docs; error.rs's OverlappingCopy (REFUSALS.md regenerated). - The runtime README: Blit encoders, their known gaps (only crossing pitches remain refused), and the surface's buffer. Verified: - Green, on lavapipe, m3-max-78902 (at 70c887a155, before the rebase): the blit module, 26 of 26 passed (865 skipped). The plane is in place (OpaqueFd); into it and out of it go a row at a time. - Cards, the blit module at 02421a08a9, 26 of 26 passed (867 skipped) on each. That tree differs from this one only by a branch for a texture in place over a surface's buffer, now deleted: no device laid one in place, and each printed "copied". - Radeon 780M (RADV, Mesa 26.2.6), m3-max-78888. - Iris Xe (ANV, Mesa 26.2.6), m3-max-78889. - RTX 3090 (NVIDIA 620.70.06), m3-max-78896. On each, the textures over one buffer are in place: whole rows go a row at a time (16 slabs; 256 on the Iris, whose memory alignment is 4), and two pitches go a row at a time. The surface's plane is in place (OpaqueFd), into it and out of it a row at a time. - m3-max-78906 at 70c887a155: workspace clippy (all targets, all features, -D warnings) EXIT=0 in all three configurations (plain, --cfg m2v_cpu_icd, --cfg m2v_gpu). Rustdoc and the runtime's private Rustdoc EXIT=0. The runtime suite on lavapipe: 888 tests run, 888 passed, 3 skipped. - refusal_surface.py --check: 0 at this commit. |
||
|
|
9c375eb504 |
Conformance ledger: the sample-positions cases answer on the runtime, so their seventeen refused rows go
The rt side of the suite now hands a pass's positions to the runtime's RenderPassDescriptor
instead of answering `setSamplePositions:count:` Unavailable, so the answer those rows expect,
`Err(Unavailable({call: "setSamplePositions:count:"}))`, can no longer occur on any venue. The
fourteen `*` rows (custom-left, custom-mixed, custom-right, the three fewer-, high, off-grid,
off-grid-low and the five rounded- cases) and the three venue rows of sample-positions-custom-2x
(Iris(R) Xe, RADV, NVIDIA) are dropped. A venue without VK_EXT_sample_locations, or whose
properties fall short of the answer, would answer at the same site with
`Refusal::SamplePositions` of `Unsupported` or `Gap::RenderPass`, which its replay would print as
unlisted; no venue run here does. docs/CONFORMANCE-COVERAGE.md is regenerated (7979 ledger rows to
7962); docs/METAL-COVERAGE.md is unchanged.
Verified: `conformance replay` of the 19 sample-positions cases and pass-sample-positions at
33865b2a57, before this edit, on each venue: every one of them listed exactly these rows as no
longer held ("now matches: 15", 14 on the Apple M3 Max, which has no custom-2x row) and nothing
unlisted; the custom and rounded cases read announced (justified by notices) on each.
- RX 7900 XTX, RADV NAVI31, Mesa 26.2.6: m3-max-78702
- Radeon 780M, RADV PHOENIX, Mesa 26.2.6: m3-max-78710
- RX 550, RADV POLARIS12, Mesa 26.2.6: m3-max-78713
- RTX 2080, NVIDIA 620.70.06: m3-max-78703
- RTX 3090, NVIDIA 620.70.06: m3-max-78711
- Iris Xe (RPL-P), Mesa 26.2.6: m3-max-78704
- Apple M3 Max, KosmicKrisp Mesa 26.3.1 (VK_EXT_sample_locations revision 1): m3-max-78722
lavapipe's replay with this ledger runs in the green job. Not run: the RTX 5080 Laptop GPU and the
Windows host's UHD Graphics 630.
|
||
|
|
1c307b4608 |
Runtime: a pass rasterizes at the sample positions its descriptor sets, through VK_EXT_sample_locations
L168: a pass's custom sample positions were dropped while the guest could be told they are supported, so a non-default set rendered at the standard positions with no refusal. What changed: - VK_EXT_sample_locations joins the floor's OPTIONAL_EXTENSIONS (enabled where listed; it has no feature). Device::programmable_sample_positions_supported (programmableSamplePositionsSupported) is true where the device lists it with locations at every sample count above 1 it renders, a 1 x 1 grid, every sixteenth from 0 to 15/16 and variableSampleLocations; false elsewhere. No second form: a device that answers no refuses positions other than the defaults. - RenderPassDescriptor::sample_positions is checked as the pass begins (crate::positions): each coordinate is taken to the nearest sixteenth, a tie up, at most 15/16, and each sample past the positions given at the pixel's corner, as the conformance suite's sample_positions rows measured an Apple M4. A set that comes to Vulkan's standard locations (Metal's defaults at 1, 2 and 4 samples) rasterizes as an empty one on every device. - Refusal::SamplePositions (Count, Coordinate, OneSample, Unsupported) where Metal's validation stops the descriptor or the device answers no. Gap::RenderPass of SamplePositions for other positions beside a depth attachment (Vulkan needs a sample-locations-compatible depth image whose layout transitions name the last locations) or at a count the device's locations lack. Gap::Draw of SamplePositions for a draw in such a pass whose fragment module uses InterpolateAtSample (VUID-01524), read from the translator's GraphicsState. - A draw in such a pass takes a VkPipeline of its class made with sampleLocationsEnable and the locations as dynamic state (Raster::positions), one pipeline for every set; the encoder records vkCmdSetSampleLocationsEXT before the pass's first draw. Every coordinate handed to Vulkan is a sixteenth in [0, 15/16], which Vulkan's required 4 sub-pixel bits hold exactly, so no precision note. - The translator's description of a device that enables the extension states it (floor::shader_extension), as for every extension creation enables that the translator names; the translator reads none of its properties. tests::translator_fields gives GraphicsState::interpolates_at_sample its verdict (refused at custom positions). - The conformance rt side passes a case's positions to the runtime; the replay player sets them on the runtime's descriptor and drops its count of passes at other positions (docs/REPLAY-STREAM.md says so). - README (floor table, the device's answers, the known gap rewritten), REFUSALS.md and basis.rs, api_signatures.tsv, METAL-COVERAGE.md and CONFORMANCE-COVERAGE.md regenerated. Tests: the device test every_device_rasterizes_a_pass_at_its_sample_positions now gates on the device's answer and holds the answer to the extension's properties; new device tests every_device_refuses_the_positions_metal_refuses and a_draw_that_interpolates_at_a_sample_is_refused_at_custom_positions; new device-free tests (placed::) of the answer's gates (each count above 1 the device renders in sampleLocationSampleCounts, a 1 x 1 grid, a range holding 15/16, 4 sub-pixel bits, variable locations) and of the placement (every coordinate in [0, 1) on a sixteenth from 0 to 15/16, refusals, the corner, the standard sets, the count and depth gaps); the replay device test sample_positions_play_through_the_runtime_s_descriptor. Verification: the lane's jobs, named in the ledger commit that follows. |
||
|
|
6750442c22 |
rt: a draw reads its target over a buffer in place through the feedback loop, or through its shadow
Row L291: a texture over a buffer laid in place (a linear image on the
buffer's memory, rule 3's form) took neither the feedback usage nor a shadow,
so a draw that read it as an attachment of its own pass, through a texture or
by a fetch, was Gap::Draw (AttachmentRead, FetchedAttachment) on every device.
Metal reads any render target this way.
Form (the ruled one: rule 2's attachment feedback loop form, with the counted
shadow copy where it is not available, a known gap):
- Plan::linear_loop. check_over sets it where the plan reads attachments, the
device has the feedback loop, the format's linear tiling features sample it,
and the linear image query makes the image with the sampled and feedback
usages at the texture's extent (asked with the dma-buf handle for a dma-buf's
import). Plan::linear_usage then adds both usages.
- If the linear image with those usages does not lie as the texture's bytes do
(Unmade::Unfit), it is made again in place without them, and a draw reads it
through its shadow where the device makes one (Plan::shadow_offered), as a
device without the loop does. Only after that does a texture fall back to the
copied form, as before.
- The pass moves the image from the general layout to the feedback layout and
back, through the same moves a surface plane takes. Once it is back in
general, the image and the buffer are again aliases that read their bytes
alike. vkspec, memory aliasing: "Buffers, linear tensors, and linear image
subresources are considered host-accessible subresources when they are in
any of these layouts: VK_IMAGE_LAYOUT_PREINITIALIZED, VK_IMAGE_LAYOUT_GENERAL,
VK_IMAGE_LAYOUT_ZERO_INITIALIZED_EXT" and "If two aliases are both
host-accessible, then they interpret the contents of the memory in
consistent ways, and data written to one alias can be read by the other
alias."
Docs: the runtime README says where the image leaves the general layout
(Memory blocks and buffers) and how a draw reads it (Render encoders). Its
known gaps of render encoders gain the shadow for an in-place target whose
linear image takes no feedback usage, and drop the refusal. error.rs's
AttachmentRead doc is updated, and REFUSALS.md is regenerated (unchanged).
known-gaps-rt.tsv drops the 15 rows the change fixes, each of which the replay
printed as "the gap looks fixed" once the draw read its target in place:
- pass-start-barrier-over-buffer-{read, sample, barrier-read, barrier-sample,
draw-barrier-read} on llvmpipe and the Iris Xe (10 rows): their targets are
in place on these two, and the reading draw was refused; it now reads its
target in place. The 780M, the RX 7900 XTX and the RX 550 had no rows for
these cases; their replays report "differed, justified" (the case's
accepted difference).
- pass-start-barrier-new-texture-chain on llvmpipe, the Iris Xe, the 780M, the
RX 7900 XTX and the RX 550 (5 rows): its new texture over a buffer is in
place on all five (the refusal arose only there), and its reading draw was
refused the same way; it now reads its target in place.
CONFORMANCE-COVERAGE.md is regenerated.
Verified:
- Green, on lavapipe, m3-max-78715 (at 60d2af3017, this change before the
ledger and layouts edits): 12 of 12 passed (876 skipped). Both forms read
in place through the feedback loop.
- Cards, at 921a33a894, running over_reads, fetch-over and the layouts
in-place test, 3 of 3 passed on each:
- Radeon 780M (RADV, Mesa 26.2.6), m3-max-78784: in place, through the loop.
- Iris Xe (ANV, Mesa 26.2.6), m3-max-78819: in place, through the loop.
- RTX 3090 (NVIDIA 620.70.06), m3-max-78785: its linear tiling lays these
targets in the copied form, so the in-place path did not run there.
- The shadow form for an in-place target (a linear query that refuses the
feedback usage) ran on no lab device: unaudited.
- Conformance replay (the case selection, or every case for lavapipe) with
the 15 rows dropped, EXIT=0 with no surprise either way:
- llvmpipe, m3-max-78743 (at 580fecacb7, every case);
- RX 7900 XTX, m3-max-78749; RX 550, m3-max-78750; Radeon 780M,
m3-max-78751; Iris Xe, m3-max-78760 (each at f9f3178302).
The trees differ from 921a33a894 only in other venues' rows and the
layouts test.
- m3-max-78783 at 921a33a894: workspace clippy (all targets, all features,
-D warnings) EXIT=0 in all three configurations (plain, --cfg m2v_cpu_icd,
--cfg m2v_gpu); Rustdoc EXIT=0. The runtime suite on lavapipe: 885 tests
run, 885 passed, 3 skipped.
- m3-max-78757 at f9f3178302: private Rustdoc of the runtime EXIT=0. The
conformance crate's suite: 1047 of 1047 passed, 0 skipped.
|
||
|
|
5d6ac696d0 |
Runtime and translator: a framebuffer fetch from the first slice of a 2D array that its pass renders alone
Row L223: a fragment function's fetch ([[color(n)]]) of a one-slice 2D array
attachment of a layered pass was refused (Gap::Draw FetchedAttachment), where
Metal reads the attachment at the fragment's pixel. The fetch reads the
texture's second element, which for a 2D array texture holds a 2D_ARRAY view.
Vulkan reads such a view only through an arrayed image (vkspec, image view
validation). The function read every element as a 2D image.
Form (ruled B, the per-state variant, as L97's compute variant):
- Translator: LoweringInputs::arrayed_fetches names the colours read through
such an element. The fragment function declares that element's class arrayed
and fetches it at (x, y, 0). The key takes the field only when it is set,
so every existing function keeps its key and its bytes. No SEMANTICS bump.
- Runtime: set_render_pipeline_state binds, for a pass whose fetched attachment
is a 2D array texture (a multisample one too), the state's content lowered
with those colours (RenderPipelineState::for_pass, which also makes the
content without colours past the pass's last attachment, as before). The
content is kept in the device's bounded map of contents under the
descriptor's key and its colour mask (KernelKey::arrays). The cache
directory's render record is neither read nor kept for it. A failed variant
leaves the state itself, whose fetching draws are then refused.
- attachment_reads accepts a 2D array texture whose first level and slice the
pass renders, one layer, where the bound content fetches that colour
arrayed.
Still refused (README, error.rs): an array whose pass renders more than one
layer, a slice past an array's first, and a view whose first slice is not the
rendered one.
REFUSALS.md and the api_signatures table are regenerated (the new
LoweringInputs field). API.md and the runtime README are updated.
Verified:
- Red, lavapipe, m3-max-78542: the test commit alone fails at fetch.rs:396
(FetchedAttachment): 10 tests run, 9 passed, 1 failed.
- Green, lavapipe, m3-max-78570: 45 of 45 passed (832 skipped); the one-slice
array is fetched exactly through the feedback loop.
- Radeon 780M (RADV), m3-max-78604; RTX 3090 (NVIDIA 620.70.06), m3-max-78609;
Iris Xe (ANV, Mesa 26.2.6), m3-max-78649: the fetch and unattached-colour
tests, 6 of 6 each, the array fetched exactly through the feedback loop.
- States-only play, m3-max-78602, lavapipe, this change against
|
||
|
|
2f16658ac2 |
Translator, runtime: an OpenCL-mode kernel's 1D images read their 2D textures under the identity domains
L61. A kernel of OpenCL mode that takes a 1D image stated RuntimeFact::OpenClLineTexture for each
such slot. That fact marks the variant in which the table domains read a 1D texture bound there,
as a Radeon Pro 5300M answers. The identity domains source no such fact, so every such kernel's
pipeline was Unsupported{IdentityDomains} when made, whatever else it did.
Apple's OpenCL binds a 2D texture of height 1 for an image1d_t and a 2D array of that height for an
image1d_array_t, and never a 1D texture. The kernel already reads its 1D images as those 2D textures
at row 0 (canon::opencl_1d), as the M3 Max and the 5300M answer. A 1D texture bound there is
outside documented Metal, and the Macs disagree on it: the M3 Max reads texel 0 at every
coordinate, the 5300M the 1D texture's texels, a UHD Graphics 630 layer 0 of an array.
- Translator: under the identity domains a kernel states no OpenClLineTexture and has no such
variant; it reads the 2D textures. The table domains keep the fact and the variant.
identity_unsourced no longer names a fact the identity domains never state.
- Runtime: a state records whether its kernel is of OpenCL mode (RuntimeFact::OpenClMode). A
dispatch of one with a 1D or 1D array texture bound at any of its texture slots is the new
typed Gap::OpenClLineTexture { slot }, not a read: Apple's OpenCL binds none, and Metal defines
no reading of one. It is checked where the swizzle and bicubic checks run, when the state or a
binding changes. Its doc ends in "Basis: ours".
- Docs: the runtime README's known gap is rewritten for the dispatch's refusal. API.md and the
fact's doc say what the identity domains do. docs/REFUSALS.md and error/basis.rs are regenerated
(Gap 30 to 31), and api_signatures.tsv is blessed (one variant).
- The runtime test opencl_lines now also binds a 1D texture at each of the kernel's three slots in
turn. Each dispatch answers Gap::OpenClLineTexture naming that slot and writes nothing.
A refusal becomes a module, so SEMANTICS_VERSION 2316. The translator's refusal sites are
unchanged.
|
||
|
|
5806b10c13 |
Translator: a sampled cube read by face samples its cube element under the identity domains
L215 (a). A texturecube or texturecube_array read by face was declared as the binder's 2D-array
view of its faces (RuntimeFact::ImageViewShape), since SPIR-V's OpImageFetch takes no cube. The
identity domains hold a sampled cube's element as its cube view and source no such fact, so
every such read was Unsupported{IdentityDomains}.
Under the identity domains a sampled cube (not a depth cube) that is read is now declared as its
cube element, and the read samples it. It goes through element 0 of its numeric type's sampler
array (binding 2, or 4 for an integer texture), which no ID reaches: the default sampler. It
samples at the direction of the read texel's centre on its face, with the read's level as the
explicit Lod.
- On face f the centre is (sc, tc) = ((2x + 1 - w) / w, (2y + 1 - h) / h), whose numerator is an
exact integer.
- The direction is Vulkan's cube map face selection read backwards, the table Metal's faces share.
With m the face's sign, it is (m, -tc, -m*sc), (sc, m, m*tc) or (m*sc, -tc, m).
- Its major axis is the face's, at magnitude 1, so (s, t) on that face is the texel's centre, half
a texel inside its cell, and nearest reads that texel. Integer Lod l under nearest mip selects
level l.
- A sample clamps every operand, so the read is checked in the shader on every device
(ReadCheck::Shader). x and y are tested against the extent at the level, the face against 6, the
cube index against the cube count, and the level against the level count, with Metal's
out-of-bounds texel outside (its alpha from the ID's word).
- slot::samples_cube_element is the one rule the declaration and the read's check share.
SlotPlan::face_sampler gives the sampler use the sampler family declares.
- A depth cube read by face, and a cube whose faces an emulated filter fetches, keep the 2D-array
view and stay refused under the identity domains. The table domains are unchanged.
The runtime's default samplers now reach every level (maxLod VK_LOD_CLAMP_NONE, was 0), so an
explicit level past 0 reads that level. A sampler element nobody owns holds the default, as do
nil, freed and out-of-range sampler IDs. Their samples could reach only level 0 before; they now
reach the level they ask for.
Existing tests that cover the default samplers:
- tests::arrays' set_1_is_filled_at_creation (both live with set 1);
- tests::device's gauge check (set 1's two default samplers and nothing else);
- tests::argument_sampling's argument_sampler_edges (an argument buffer's sampler against the
default's answer).
RESOURCE-ID.md states the default sampler and the cube read's contract for a consumer that lays
the arrays out itself. API.md and the runtime README say so too; the README's known gap now names
only the depth cube read.
A refusal becomes a module, so SEMANTICS_VERSION 2315. The golden table's cube_faces cells
change from the refusal, a bless at the next pin. No refusal site was added or removed:
docs/REFUSALS.md regenerates unchanged.
|
||
|
|
a3cfe0be7c |
rt: a pool allocation the device places off a multiple of 16 is refused as Limit::AllocationAddress
What: make_allocation reads the allocation's device address and, where it is not a multiple of
16, frees the allocation and returns the new Limit::AllocationAddress { class, address }. A take
that no free range fits returns it; an allocation made ahead of need (Device::new's stock, the
block-maker thread) is not kept, so the next take makes its own and gets the refusal.
Why: Vulkan places a buffer's address at a multiple of the largest of its memory requirements'
alignment and its usages' minimum offset alignments (vkGetBufferDeviceAddress), none of which has
a lower bound of 16. Metal's offset rule for a device buffer (offset aligned to the data type's
size, at most 16) asks a base at a multiple of 16, which the translator's accesses take. A block's
buffers take the allocation's address as their base and its images sit beside them in the same
allocation, so no offset serves both; an allocation off 16 cannot keep Metal's alignment, and it
now fails visibly instead of handing out blocks the translated kernels misread (L84).
Docs: the variant's doc names Metal's counterpart and what differs; take_block's errors; the
runtime README's block contract; docs/REFUSALS.md, src/error/basis.rs (Basis: device) and
api_signatures.tsv regenerated (refusal_surface.py, signatures.py --bless).
Verified: the test every_device_hands_out_no_block_at_an_address_off_16 (red at the previous
commit) is the check; jobs in the hand-over.
|
||
|
|
edee7b22ec |
Replay: the stand-in makes no import Vulkan forbids: no dedicated opaque fd import, no memory type its buffer lacks
The audit lane read the stand-in cold (standin.rs:262, 288-290 at cc3188c3da): - An opaque fd's import named the stand-in's buffer in VkMemoryDedicatedAllocateInfo wherever the driver keeps that buffer to a dedicated allocation. Such an import must name a buffer identical to the exporter's (VUID-VkMemoryDedicatedAllocateInfo-buffer-01879), and the runtime's export is dedicated to its own buffer, of other usage, whose create info the export does not give. That case is now an import the stand-in cannot make, counted with that reason; an opaque fd's import is dedicated to no buffer. - The import bound memory of the export's type without checking that the stand-in's buffer lists it (VUID-vkBindBufferMemory-memory-01035). A type the buffer does not list is now an import failure with that reason, before the allocation. docs/REPLAY-STREAM.md section 10 says both. |
||
|
|
23847fe2ae |
Runtime: a pass that mixes a marked surface plane with another attachment renders it through a stand-in
A surface plane in place whose format's LINEAR tiling renders only through VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV (VK_NV_linear_color_attachment: such a format renders "as long as all the color attachments in the render pass instance have VK_IMAGE_TILING_LINEAR tiling") was refused in any pass that set something beside it, Gap::LinearPlanePass. A guest met it: a view of an exported 1920x1080 surface's R8 luma plane as colour 0 beside an ordinary RG8 texture as colour 1, both loaded and stored. Red on the RTX 5080 Laptop GPU (job m3-max-78092) and the RTX 3090 (job m3-max-78106, NVIDIA 620.70.06). The planner's ruling, form (ii): in a pass that mixes a marked plane with another attachment (a colour attachment that is not one, a depth or stencil attachment, or a multisample attachment resolving into it; decided by the format query's mark and the pass's attachments alone, pass::mixes_linear), each marked colour attachment and each marked resolve target renders into its stand-in, an optimal image of the runtime's of the plane's format and size (TextureObject::stand_in). The pass's begin moves the stand-in from undefined and, where the plane's Vulkan load op is LOAD, copies the render area of the plane into it; its end copies the stand-in's render area into the plane where its store op is STORE or the pass resolves into it. The plane stays general. A pass of marked planes alone still renders them in place; a device whose LINEAR tiling offers the format as a colour attachment renders the plane in place in every pass. Counted: Metrics::plane_copies_in, plane_copy_in_bytes, plane_copies_out, plane_copy_out_bytes (in bytes_copied too). The guest's pass pays both: its luma plane is loaded and stored, so each run copies 2,073,600 bytes in and 2,073,600 bytes out. The stand-ins are bounded by structure, one per (plane image, format), made at the first mixed pass and freed with the plane (StandIns, Free::StandIn), counted in Gauges::plane_stand_ins and plane_stand_in_bytes, which each_device checks are zero at the device's drop. A draw of such a pass that reads the plane through a texture, or fetches it, stays refused: Gap::Draw of AttachmentRead or FetchedAttachment (the plane holds what the pass rendered only after its end); a read of another plane of the same surface is not. Gap::LinearPlanePass and LinearPlanePassKind are gone: every kind (OtherColor, DepthStencil, Resolve) renders. AGENTS.md's rule 2 grows to thirteen forms with the mixed-pass entry; the runtime README's exported surfaces, floor and render encoder known gaps say the form and its cost; docs/REFUSALS.md and the signatures table are regenerated. Tests: the plane tests assert the plane copies (none in place; one out for a cleared plane beside a colour or resolved into; one in and one out for the loaded plane beside a depth attachment and the guest's pass), and a new test runs eight mixed passes over one plane: one stand-in where it is marked, none elsewhere, freed when the surface drops. The unit test of mixes_linear replaces linear_shape's. Device runs follow in the lane's report. |
||
|
|
cbd5423458 | Replay device tests: the layer guard is LayerOn, apart from the profiles layer's Layered; the test device constant is the device tests' hosts' | ||
|
|
909739e23f |
Replay device tests: every device a test opens runs under the validation layer, as VALIDATION.md says
VALIDATION.md's GPU-leg row says the replay player's device tests (replay::rt_replay) run under the validation layer, but only the exported-surface test enabled it: the jobs put the layer on the loader's path and nothing in the validation crate turned it on. Each test's pipeline cache directory (ScratchCache), which every rt_replay test holds longer than its devices, now puts the layer over the process's instances through candidate::Layered (the candidate runs' helper, which validated now uses too): rt_device asserts the device lists the layer as an active tool, and the cache's drop fails the test on any message the layer logged. The exported-surface test no longer wraps itself. rt_replay, and places' device test that shares its helpers, are Linux's and macOS's, where the candidate's platform gives the layer. Cost (job m3-max-78137 at edc3bfa01b, lavapipe on msi, LP_NUM_THREADS=1): ID:rt's device filter 94.9 s; replay::rt_replay alone 1.4 s bare, 1.5 s with the layer enabled through the same variables, no layer message. Unverified here: the run with this commit follows. |
||
|
|
ca370da605 |
Replay: the stand-in for the other API is Linux's and macOS's; the validation crate's clippy for Windows passes
The validation crate builds for x86_64-pc-windows-gnullvm (with llvm-mingw for the bundled SQLite, as win-cross.sh builds command-replay for the Windows play), and its clippy there (job m3-max-78094 at abf7b8f873, plain and under --cfg m2v_gpu) reported the stand-in: its writes wait under the crate's bounded fence waits (gpu::wait::vulkan), which the crate keeps to Linux and macOS, and its empty extension list for an NT handle did not type-check. Rather than a Windows form of the fence wait, the stand-in is Linux's and macOS's alone: its import is fd-only, and on any other host StandIn::new says why it is absent, so each landing is counted unwritten with that reason and the play goes on (the S1 ruling's handling of a stand-in that cannot be made). The NT-handle import, which no build compiled, is gone, and so is the device test's Windows arm: the test, under the layer through candidate::validated, is Linux's and macOS's. A plane's rows are the caller's tuple. The same clippy reported lib-test code that predates the exported surfaces and never compiled for Windows: build_support_tests.rs hex-encoded through crate::hash (not on Windows; now sha2's own lower-hex), and gpu/wait.rs's tests of the fence and Metal waits' own endings, which Windows lacks (now gated as those variants are). docs/REPLAY-STREAM.md section 10 says the stand-in is Linux's and macOS's and what Windows counts. |
||
|
|
edc657331a |
Replay: the exported-surface device test plays under the validation layer; the format doc's exported-surface records
The device test of the exported-surface snippet ran with the layer on the loader's path but not enabled: the validation crate's replay tests make their instance with no layer. Each of its plays now runs under the Khronos validation layer as the candidate runs do (candidate::validated, made reachable from the replay tests): the device must list the layer as an active tool, and any message the layer logs fails the test, the stand-in's device's included, since it lives on the runtime's instance. docs/REPLAY-STREAM.md: section 4 points at the records, section 7 gives them (m2v.newExportedSurface, m2v.surfacePlane, m2v.exportSurface, m2v.surfaceWritesDone, release), and section 10 says what the player does at each, the stand-in for the other API, what a player cannot reproduce, the runtime's hand-overs with its Metrics docs as the contract, the hand-over and exported-surfaces report lines and counters, --video-handle's override, and `command-replay snippet video-surfaces`. Verified before this commit (job m3-max-78051, f58ff0a2b3, lavapipe on msi, layer on the path but not enabled): dma-buf in place and opaque-fd in the copy form each play 3 frames that agree with the contract (acquires 2, releases 3 in frame 0 and 2 after) and 6 checks that match. |
||
|
|
d0a424060a |
Runtime: each submission that uses memory another API shares hands it over; the release calls are gone
A consumer's video path showed green frames. Its paths call external_writes_done before each picture and a release only in their encode fills, so every acquire of an exported block or surface after the first had no release of the runtime's to match (VUID-vkQueueSubmit2-commandBuffer-03879), and whether memory another API wrote was acquired, or discarded, depended on the order the consumer's calls arrived in. f6fe21431c's test shows it: no submission released the surface. Now one form serves every kind of memory another API shares, the form Direct3D 11 planes already took (crate::handed): each vkQueueSubmit2 part whose command buffers or uploads use an exported block, an exported surface's planes in place or its buffer, or a Direct3D 11 plane acquires all of it from the other API's queue family in one barrier, in a runtime command buffer at the part's head after a global barrier, and releases it in one barrier in another at the part's end, which takes the part's last signals. Per such part: 3 barriers and 2 runtime command buffers; no submission, VkSubmitInfo2 or semaphore wait is added. The uploads' copies into textures over a buffer in an exported block go with the first part, which hands that block over too. Exported memory is the runtime's until its making (Work::create): an exported block's buffer is released, and an exported surface's planes in place move out of the undefined layout and are released in the same barrier, in a runtime command buffer at the head of the submission that takes the make's upload, ahead of any acquire. The upload owes the making by weak reference, so a surface or block dropped first owes nothing and holds nothing. The making's submission is the ready point: Surface::wait_until_ready waits for it in both forms (the copy form's is its block's), and the new Block::wait_until_ready is its twin (Metal counterpart none; refuses a block that is not exported; has the submission go at once, so it returns with no command buffer committed). One barrier at the making, nothing per frame beyond the per-part hand-over. external_writes_done keeps only its host-side mark: on a block (and a copy-form surface) the textures over it take its bytes again; in place and on a Direct3D 11 import it records nothing. Surface::buffer records nothing at its make. A block that is not exported is still refused. Deleted, with no replacement: BlitCommandEncoder::release_to_external and BlitCommandEncoder::release_surface_to_external, and Building::release_command, which only they used. Consumer uses (the consumer's checkout, searched for main): release_to_external at vaapi/fill.rs:599 and nvidia/encode/fill.rs:289, each followed by EndEncoding, commit and the consumer's CPU wait; its wrapper trait method BlitEncoder::release_to_external (core/platform/blit.rs:395, a cfg(unix) no-op default) and the RtPlatform impl (rt_platform/blit.rs:992-999); doc mentions at rt_platform/export.rs:33, vaapi/fill.rs:30 and nvidia/encode/fill.rs:18. release_surface_to_external: zero uses. The consumer drops them all in the pin that takes this commit. The guard the planner asked for: a plane's image in place takes its tiling from InPlaceTiling alone, whose values are LINEAR and the DRM_FORMAT_MOD_LINEAR modifier, never OPTIMAL; the device-free test no_plane_in_place_takes_the_optimal_tiling pins it. The order test every_device_completes_a_surface_s_making_before_its_ready_wait_returns checks that each plane owes its move at the make and none once the wait returns, with the device's completed progress at or past the ready point. The export, surface and Direct3D 11 tests now count one acquire and one release per submission and one release at the making, with no release call. The runtime README states the contract (The hand-over contract): nothing another API writes may be handed memory of ours before that memory's ready point; the other API's next write must not begin before the submissions that used the memory have completed; who waits by kind and what a reader gets where no write landed; no optimal image in memory another API writes in place (section 12.11), the Direct3D 11 import being the documented case (section 12.10.1, Table 17). Its known gaps carry the planner's line on host-pointer memory. docs/REFUSALS.md is regenerated and the signature table blessed (one added, two removed). Checked before this commit: clippy of the runtime, all targets, plain and under --cfg m2v_cpu_icd, on this commit's code less its doc changes (job m3-max-77874). The device runs at this commit (lavapipe, the Radeon 780M, the UHD 630) follow and are reported with the lane's tip. The dma-buf import half is not built. |
||
|
|
0bb092f8ff |
API docs: a kernel's write through a channel-permuting swizzled view is stored as written
Section 10's Kernels gains the accepted difference: the runtime stores a kernel's write
through a texture view whose swizzle permutes its format's channels as written, where the
M3 Max stores it through the swizzle (an RGBA8Unorm (Blue, Green, Red, Alpha) view's write
of (0x33, 0x66, 0xb3, 0xcc) leaves (0xb3, 0x66, 0x33, 0xcc); swizzled_view_stores.m, job
m3-max-76829) and Metal's validation refuses the write, the view reporting no ShaderWrite
usage. The OpenCL images paragraph said a write stores the value with the swizzle undone,
which is the M3's answer, not the runtime's; it now states the runtime's rule and points
to the entry.
Docs only; the rule is the runtime's README's ("A swizzle reaches a texture's sampled
element alone") and the lane's write test asserts it.
|
||
|
|
1a4310899a |
Runtime tests: OpenGL mode's depth output without a depth attachment, and the void vertex refusal
The old runtime's OpenGL-mode device tests went with it on 11-20 and were never ported, so the private render state the guest's GL renderer sets on every pipeline lost its guard. This ports them onto the new runtime's device-test helpers, with the M3 Max's answers as they stood (probe conformance/probes/opengl_mode.m, macOS 27.0.1): - opengl_mode_makes_a_depth_output_without_a_depth_attachment: with the mode, a fragment function writing depth without a depth attachment makes a state whose colors are those it draws with a depth attachment. The old test's other half, the refusal without the mode, is not ported: only the M3 Max's driver refuses it and no Metal document states it (MTLRenderPipeline.h, Apple's pages for depthAttachmentPixelFormat and makeRenderPipelineState(descriptor:), the MSL spec's depth output), so on the planner's ruling the runtime makes the state, recorded in docs/API.md's accepted differences. - without_opengl_mode_a_rasterizing_void_vertex_function_is_refused: the refusal half of the old void-vertex test, as the translator's typed DescriptorError::RasterizedVoidVertex; Metal's text stays in the module doc, as the runtime's errors carry none. The module doc names the nine deleted tests not ported and why: point_size_notices' per-draw notice is gone (the note is the state's), and private_properties' eight tests test Apple's private device properties, which the consumer answers and the runtime holds none of. Verified: to run on lavapipe at the branch tip (a CPU job), reported to main with its job. |
||
|
|
cb77b3f60d |
Translator: an OpenCL-mode barrier's flags are OpenCL's cl_mem_fence_flags
OpenCL C's barrier(flags) takes cl_mem_fence_flags, which Apple's cl_kernel.h (OpenCL.framework, "5.9.7 - Synchronization") defines as CLK_LOCAL_MEM_FENCE = 1U << 0 and CLK_GLOBAL_MEM_FENCE = 1U << 1, and Apple's OpenCL compiler passes them to air.wg.barrier unconverted (an internal function passing its parameter on as the barrier's flags). Metal's mem_flags read the same bits as mem_device (1) and mem_threadgroup (2), and decode reads every barrier as Metal's, so in a kernel linked for OpenCL mode barrier(CLK_LOCAL_MEM_FENCE) lowered to OpControlBarrier(Workgroup, Workgroup, AcquireRelease | UniformMemory): nothing ordered the __local tiles, and RADV reordered them (a tiled multiply's outputs wrong on the RX 550, the RX 7900 XTX and the 780M). CLK_GLOBAL_MEM_FENCE likewise ordered threadgroup memory and left device memory unfenced. Specialization now reads each air.wg.barrier's flags again as OpenCL's in a kernel of OpenCL mode (canon::opencl::barriers, from the SpecRequest::open_cl_mode fact), after the last SCCP, so an out-of-line barrier has its own call site's flags: CLK_LOCAL_MEM_FENCE is mem_threadgroup and CLK_GLOBAL_MEM_FENCE mem_device (MemFlags::from_cl_mem_fence_flags). It rewrites the call's decoded operation in the entry's body, which lowering, the lockstep analysis, the partial-threadgroups variant and the strategy census all read. A flag outside the two leaves the call an unknown intrinsic, which the post-check refuses (Unsupported, UnknownIntrinsic, naming air.wg.barrier), as one outside Metal's mem_flags is. Nothing keys on a function name. Metal-mode kernels, air.simdgroup.barrier (the header declares no work_group_barrier or sub_group_barrier) and air.atomic.fence (mem_fence's flags, which Apple's compiler converts itself through llvm.bitreverse.i2) keep Metal's reading. SEMANTICS_VERSION 2308. canon::opencl's module doc, docs/API.md (OpenCL mode) and docs/ARCHITECTURE.md say what the flags mean and on what that rests. docs/REFUSALS.md regenerates unchanged: the refusal is the existing UnknownIntrinsic site. Tests (tests::engine_opencl_mode): - an_opencl_mode_barrier_orders_the_memory_its_opencl_flags_name: a kernel of barriers 1, 2 and 3 by four routes (air.wg.barrier with the constant, the wrapper of two operands, of three, and a parameter each of three call sites binds), compiled as a pipeline on every committed profile under the runtime's policy: in OpenCL mode WorkgroupMemory alone, UniformMemory alone, both; without the mode UniformMemory, WorkgroupMemory, both. - an_opencl_mode_barrier_of_a_flag_opencl_does_not_name_is_refused: flags 4, inline and through the wrapper, refused in OpenCL mode and ImageMemory without it. A job at this tip runs them, and once more with this commit's sources in canon and intrinsics reverted to its parent, where the first fails. |
||
|
|
8ac09ba43e |
Replay compare-dumps: a differing buffer's line names its first word in each play
compare-dumps said which word of a buffer differed first outside every cover, but not what either play held there, so telling a NaN from a rounding step or a stale word meant reading both dumps by hand. A Difference now carries that word in each play's dump (first_values, little-endian; a short end's bytes with zeros above them, none past a dump's end), and its line prints them after the word's index: "the first word W (a 0x........, b 0x........)". The stream doc says so. The three compare tests take the values in their expected lines and Differences, and a new unit test compares three buffers whose second word differs in b, ends 2 bytes into it, or ends before it. |
||
|
|
866a8dd2f2 |
Replay player: a compute pipeline state takes the stream's openClMode
The player refused a compute descriptor whose openClMode was true, so a stream that makes an OpenCL-mode pipeline (a guest running OpenCL C on Metal) stopped at its first one. The runtime's descriptor carries the mode (open_cl_mode_enabled), and the translator links the kernel for it: the three hidden buffers ahead of the kernel's own, its buffer indices 3 on, get_global_id with the dispatch's offset. The player now gives the stream's value to the descriptor, off where absent, and the stream doc says so. The previous commit's test is its check on lavapipe: red before this commit, green with it. |
||
|
|
1b3bd24aba |
Runtime: a Direct3D 11 plane past its import's maxExtent is Limit::TextureSize
A plane's extent was checked only against the image format query without the handle type (plane_plan's prepare). VUID-VkImageCreateInfo-extent-02252 bounds an image's extent by imageCreateMaxExtent, which for an image made with VkExternalMemoryImageCreateInfo is the query's answer with VkPhysicalDeviceExternalImageFormatInfo naming the handle type: a device may make an imported image smaller than a plain one, and a plane between the two would be created past the limit. The import query (d3d11::import_query) now answers the image's properties with the handle too, and d3d11_plane_form checks the plane's extent against them once its usage and format list are final: past it, Limit::TextureSize carries the import's maxExtent. The existing kind has the same meaning (an extent past what the device makes of the image), so no new variant; its doc and basis name the import's query, and docs/REFUSALS.md is regenerated (a second NoImport site, the query failing at the final form, which the earlier checks make unreachable on a conforming driver). The extent check itself is one function now (texture::size_within), the plain path's included, unchanged there. The Windows refusal test asks for a luma one texel wider than the import query's maxExtent and expects TextureSize at that answer or the plain query's below it, printing both. On a device whose two answers are equal the plain check refuses first, so that run does not show the import check firing on its own. |