a4a9d232c8d3d2b112ebe63d53137d45da6df958
2241
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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. |
||
|
|
d5b2379d91 |
Conformance: the between case declares its interpolation notice, and its refusal is a ledger row
`conformance replay --cpu` of both unattached-colour cases on lavapipe (job m3-max-75983,
at
|
||
|
|
981d1c0d81 |
Runtime docs: a state drawn without the colours past its pass's last attachment, and its costs
README, Render encoders: a pipeline state that names colours past its pass's last colour attachment, the rest of its formats and its sample count the pass's, is drawn as plain Metal draws it (pass-pipeline-color-unattached, Apple M3 Max, macOS 27.0.1, job m3-max-75903), through the state of its descriptor without those colours. The costs, each from a run: - the first such set and draw: about 3.3 ms once per state and pass shape on an RTX 5080 Laptop card, from a proxy (a state of the same functions with colour 0 alone; jobs m3-max-75918 and m3-max-75925); - each later such set: about 14,500 user-space instructions on lavapipe (job m3-max-75974, release, five runs, 14,510 to 14,517), where a set of a state that renders into its pass is 140; - the descriptor each render state keeps: in states-only plays of two recorded replay streams on lavapipe it kept no library alive that was not alive without it (jobs m3-max-75968 and m3-max-75969: the bytes of released libraries still alive, at each change, equal at this tree and at its base, 29 and 140 changes). The between shape stays refused (job m3-max-75934). The Gap::Draw list's "a pipeline state whose formats are not the pass's attachments'" now excepts the shape drawn, and the first-use list names that state's pipeline under first_use_unfinished_waits. docs/REFUSALS.md is regenerated (refusal_surface.py): Gap::Draw gains its site in render.rs (without_colors). |
||
|
|
8006d54fbb |
Runtime tests: six more Managed-form tests run in both forms
The tests of upload, import, spill, sites, gpu_span and resolve that read a Managed buffer's form (Device::has_unified_memory, or a Managed buffer they make) ran each device in its own form only, so lavapipe and the integrated cards never took their two-copy arm. Each now runs through tests::command::on_device::each_device_in_both_forms, which runs a one-copy device once more through the two-copy view: - upload: every_device_counts_and_times_its_own_command_buffers - import: every_device_releases_an_import_under_a_managed_buffer_dropped_before_any_commit - spill: every_device_spills_private_memory_out_of_device_memory - gpu_span: every_device_leaves_a_copy_in_out_of_the_gpu_span_it_goes_ahead_of - resolve: every_device_resolves_a_loaded_pass_into_a_shader_read_texture_over_a_buffer - sites: every_device_counts_each_allocation_site_apart, through the new each_device_in_both_forms_with, which opens both runs with the test's own options (MakerTest::Fail here); each_device_in_both_forms is it with the default options. docs/VALIDATION.md names the six modules among those that run both forms. Test-only: no product source changes. Verification (lavapipe two-copy runs counted per test, lint) is in the landing line. |
||
|
|
0cd1618247 |
Runtime tests: the two-copy view runs a Managed buffer's device-copy form on one-copy devices
No device in CI kept a device copy of a Managed buffer: lavapipe is a CPU device, so Core::unified_memory() (rule 2's unified-memory form, decided by Vulkan's device type alone) is true there, and every device test of the two-copy form returned at its unified-memory check or took the one-copy arm. every_device_synchronizes_a_texture_over_a_managed_buffer passed vacuously on lavapipe while the runtime recorded nothing for that synchronize on discrete cards (fixed in |
||
|
|
f6aa8dbdf1 |
Runtime: a dma-buf import is refused where the Shared type is not host-coherent
What: the dma-buf rule (import.rs, dma_buf_type) now takes the device's Shared
coherence, keyed by the query that already decides it (the Shared type's
HOST_COHERENT flag; the device holds a coherence state exactly where it lacks
it). On a device that holds one, every dma-buf is refused with the new
Limit::ImportCoherence { handle }, whatever the fd's query offers, before any
allocation: Device::import_dma_buf and Device::import_dma_bufs (each fd's rule;
the sparse buffer is destroyed, as for Limit::ImportType). Basis: device. The
pointer import (import_host_memory) is unchanged, so the consumer's fallback
imports those pages by pointer. No new route: the refusal sits inside the
existing rule.
Why: on a Meteor Lake GPU under Mesa's Intel driver and the i915 kernel driver
(no LLC), the fd's query offers type 0 (device-local, host-visible,
host-coherent, write-combined) first, so the rule took the import, and the
runtime never flushes an import because its type is host-coherent. That flag
speaks only for mappings Vulkan makes; the consumer writes the pages through
its own cached mapping. In Linux v7.3, i915_gem_prime_import
(drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c:281-337) makes the object with
i915_gem_object_alloc (kmem_cache_zalloc, gem/i915_gem_object.c) and never calls
i915_gem_object_set_cache_coherency, so pat_index 0 and cache_coherent 0; the
only CPU-cache work is one wbinvd_on_all_cpus at get_pages where !HAS_LLC &&
!IS_DG1 (i915_gem_dmabuf.c:249-261, whose comment says only DG1 "still snoops
transactions even with CACHE_NONE"); on MTL PAT 0 is WB with no coherency. So
the GPU reads DRAM without the guest's lines still in the CPU cache: text and
images missing. The pointer import (userptr, I915_CACHE_LLC, PAT 3) snoops.
No Vulkan query says whether a driver's GPU mapping of a foreign dma-buf sees
the CPU's caches, so the Shared type's flag is a proxy that errs to the safe
side: where it refuses, the pointer route is coherent by its type's flag.
Docs: import.rs's header and both dma-buf calls' doc comments; coherence.rs on
imports; the runtime README's Shared memory's coherence ("Imported blocks take
no call"), Imported blocks (the rule, the proxy and its limit) and its known
gaps; docs/VALIDATION.md on the shared view; docs/REFUSALS.md regenerated; the
api_signatures table blessed (one variant added).
Tests: a_dma_buf_is_refused_where_the_shared_type_is_not_host_coherent (pure,
over Meteor Lake's i915 type list and the Iris Xe's);
every_device_under_the_view_refuses_a_dma_buf_and_imports_host_memory (device,
through the refused device's view); the existing dma-buf device tests take the
new refusal. Verified at this commit: cargo fmt only; the build, the pure
tests and the device run are in the jobs the lane reports.
|
||
|
|
b443508375 |
Runtime, translator docs and validation: the bound form's contract, its README floor entry, and the suites' pins
docs/API.md: section 1's bound kernel buffers (the query's features and every limit set 0's layout reaches, the four kinds of slot that keep their address by structure), section 5's SlotBindOffset view, and the accepted difference of a bound buffer's out-of-bounds reach: up to 15 bytes before a buffer off 16 and up to 3 past a length off 4 where robustStorageBufferAccessSizeAlignment is 4 (none on NVIDIA), reads and writes landing in the same process's memory, its own or shared with it by name, and past a buffer the consumer placed by heap_buffer_size_and_align the block's padding (zero or the same device's earlier bytes, never another device's). The runtime README: the extension row, the Bound kernel buffers floor entry with its feature table (pool_reach's runs: Iris Xe, 780M, XTX and RTX 3090 bound, jobs m3-max-75037..75040; the 780M under AMDVLK, which lists no VK_EXT_pipeline_robustness at the runtime's Vulkan 1.3, in the address form, m3-max-75041/75042), the counters, and the check's known gap. The placement comments at encoder::view and HEAP_BUFFER_ALIGNMENT. Suite pins (m3-max-75036): the stage helper's version 3 for its robust compute chain; the validation runtime-sources pin (RUNTIME_VERSION is already bumped in this change); the profile subset rules for robust_buffer_access2, robust_buffer_access_update_after_bind (implications) and robust_storage_buffer_access_size_alignment (a minimum); the enable test's device with room for set 0's 31 storage buffers; the README floor test's pipeline-robustness feature table. |
||
|
|
cf270fa34e |
Harness and replay player: count dispatches by the form their kernel reaches its buffers in
The harness's matrix counts gain bound_dispatches and address_dispatches, and the replay player's executed counters gain those two with buffer_sets_written and buffer_sets_held, so a run shows which form its dispatches took. Built only; the harness run is the Iris read that follows. |
||
|
|
5b260257e0 |
Runtime and replay player: count each dispatch barrier in one source, and print the device's buffer alignment
What: Metrics::dispatch_hazard_barriers is now the sum of nine sources, each such barrier in exactly one: dispatch_after_write_barriers and dispatch_write_after_read_barriers (the dispatch's own dependencies), then dispatch_encoder_end_barriers, dispatch_pass_end_barriers, dispatch_indirect_barriers, dispatch_unbound_barriers, dispatch_arena_piece_barriers, dispatch_heap_barriers and dispatch_other_barriers. The replay player prints the nine on each frame line's executed counters and in the report's totals. The tally's bit mask is a u128 (69 metrics). The rule for a barrier with several causes: it counts under the dispatch's own dependency where it has one, first a write (it reads or writes a resource a command since the last barrier wrote), then a write after a read (it writes one that was only read), both by the resource's own id; otherwise under the first source in this order: an encoder that wrote ended; a render pass moved nothing home (or copied a resolve into a buffer); an indirect dispatch after a write since the last barrier that reached argument reads, whatever buffer was written; an access outside every resource (a read after a write, a write after any access, or the barrier such a write owes); a Private-arena piece after the first; a conflict through a heap's one id alone (an exported surface's buffer and planes, which share one id, count here too); anything else (a memory barrier call, a release to another API, a concurrent encoder after commands that touched anything). An owed barrier keeps the first of its causes in that order. In a concurrent encoder the dependency is read only where a barrier is owed, as Metal orders nothing else there. Two buffers of one heap over the same bytes count under the heap: at buffer level they are two resources. How: a heap's resources are marked in the hazard sets by the heap's id, as before, and also by their own ids in a second table of the sets that places no barrier and only tells a dependency on the resource from a conflict through the heap's id. Building::owe takes its cause and no longer starts the sets again; the command that pays the owed barrier does, after reading them: Building::command clears them after paying, and dispatch_hazards takes its command buffer without paying (current_command) and pays the owed barrier itself, counted by every cause it has. Where barriers go is unchanged: each path that paid an owed barrier records the one barrier it recorded before, and the sets start again at the same barriers. Rider: Device::buffer_alignment (no Metal counterpart) returns the alignment Vulkan's memory requirements gave the runtime's buffers, which the pool read at the device's making. The replay player's device line prints it (`device NAME runtime rt buffer alignment N`), and the device test prints it and checks it is a power of two. The runtime prints no line of its own at a device's making, so a consumer's log shows it only by reading this accessor. Why: the planner's reading of the dispatch-hazard barriers: whether the sources that are not the guest's own dependencies reach a quarter of a frame's barriers on any stream. The buffer alignment goes into every lab log because the ring and the zero address assume a multiple of 16 with no query behind it. Tests: every_device_counts_each_dispatch_barrier_in_one_source checks the write after a read, two encoders' ends (the second's dispatch reading the write before it counts as that dependency), a render pass's end that moved nothing home, an indirect dispatch after a write of another buffer, a read outside every resource and a memory barrier in a concurrent encoder, each in its one source with the sources summing to the dispatch barriers; every_device_places_barriers_at_hazards_only checks the dependent and concurrent encoders' in the write dependency and none for independent dispatches; every_device_orders_a_heap_s_resources_as_one checks the heap's source, and the write dependency for one buffer of a heap used twice; the arena test checks its pieces' barriers in the arena source; the hazard sets' unit tests check the own-id table. The signatures table is blessed (9 fields, 1 method). Verified: nothing yet in this commit; the gate (fmt, clippy in three configurations, Rustdoc, the runtime suite on lavapipe and the validation suite) runs on it next. |
||
|
|
0b7d408201 |
Runtime and replay player: count barriers by cause, the guest's blits and buffer binds, and over-copy bytes by frame
What: - Metrics counts every barrier in one of seven causes, whose sum Metrics::barriers now is: pass_start_barriers (a render pass's first), pass_home_barriers (the move of its attachments home at its end), blit_barriers, dispatch_hazard_barriers (a dispatch's own, at a hazard or paying one owed), segment_end_barriers, upload_barriers (the uploads' and Managed copy-ins' barriers, the over copies they carry among them) and other_barriers (inside a pass, over copies in a command buffer, heap moves ahead of a command or segment, releases). Metric::Barriers is gone: each site that records a barrier counts its cause, and the shared helpers (Building::barrier, alias::record, over::record_side) take the cause from their caller. - The replay player's executed counters carry the seven, so each frame line prints them. - The player's stream counts (the guest's, fixed by the stream) add blits, an encoder's copy, fill, mipmap, synchronize, reset and optimize commands, and the buffer slots the set-buffer calls set on render and on compute encoders, each split into buffer changes (another buffer than the slot held, or its first set) and offset-only changes (replay/binds.rs). - The runtime backend's report adds an `over copies by frame` line: over-copy bytes a frame, mean and largest frame, by memory class (Private, Shared) and by cause (pitch, dma-buf, host memory, every other cause as own_image), and the number of textures in an image of their own the largest frame's calls named (new_runtime/over_frames.rs), from counters the runtime keeps. - docs/REPLAY-STREAM.md and the runtime README name them; the signatures table blessed (7 fields). Why: the planner's reading of round d9b644bae7's plays: whether pass-boundary and blit barriers are half or more of a frame's barriers (the two pass forms), and whether over copies of Private buffers reach 1 MB or 5% of a frame's copied bytes (the third form), needs the barrier split and the over-copy split a frame, beside what the guest asked for; the guest's buffer binds per draw and per dispatch size the descriptor work. Tests: every_barrier_rt_records_is_counted adds a pass over a texture whose home is shader-read and checks each cause's count against the barrier commands recorded (pass start 1, pass home 1, blit 2, dispatch hazard 0, segment end 1, upload 6 or more, other 0); every_device_places_barriers_at_hazards_only checks the dispatch-hazard and segment-end counts on dependent, independent and concurrent encoders; every_device_reads_its_attachment_through_a_texture_after_a_memory_barrier checks the causes on the feedback-loop and the copy path; the player's the_stream_fixes_its_calls_commits_encoders_draws_dispatches_blits_and_binds checks blits and every bind count; over_copies_by_frame_give_the_mean_and_the_largest_frame checks the line. |
||
|
|
8c3bffc079 |
Runtime: count over-copy bytes by the buffer's memory class, and the renderings an encoder ends and begins again
What: two counters, so reach is counted rather than guessed. - Metrics::over_copy_bytes_private and Metrics::over_copy_bytes_shared split over_copy_bytes by the memory class the bytes shaders reach are in (MemoryClass of the buffer's block; a Managed buffer's device copy counts in neither). OverCopy carries the class; Counters::over_copied takes it. - Metrics::rendering_interrupts counts each vkCmdEndRendering and new vkCmdBeginRendering inside one render encoder (RenderCommandEncoder::interrupt, its one site): barriers, copies a draw or a visibility result mode needs first, feedback and heap moves, an execution's count kernel. The passes counter counts encoders and cannot show these. - The replay player's executed counters carry the three, so every play's frame lines print them; docs/REPLAY-STREAM.md and the runtime README name them; the signatures table blessed (3 fields). Why: the per-frame counts of round d9b644bae7's plays put over-copy bytes at 4.87 MB a frame on the desktop stream (5080) and 34.5% of bytes copied on the 780M recording (Iris), with no way to tell how much lies over Private buffers, whose bytes no host write reaches; and no counter shows how often a render encoder's rendering is cut. Tests: each_memory_class_counts_its_copies_bytes_alone (device-free); the device test every_device_counts_each_textures_copies_under_its_cause checks the class split for each copy and adds a texture over a Private buffer (pitch cause on lavapipe); every_device_reads_its_attachment_through_a_texture_after_a_memory_barrier holds the count at 2 on both the feedback-loop and the copy path. |
||
|
|
1af54e162d |
Conformance and runtime README: the UHD 630's rows for the read-write and sRGB storage cases
What: the known-gaps ledger's 14 rows for Intel's Windows driver 101.2145 on the UHD Graphics 630
in srgb-storage-writes, read-write-tier-held and read-write-tier-round-trip-float, which that venue
had not run before. Two entries in the runtime README's known gaps of textures. Coverage
regenerated. No product code.
- srgb-storage-writes RGBA8Unorm_sRGB fpv_srgb_write/dispatch, refused: the driver makes no
extended image for an 8-bit sRGB texture made for shader writes, so there is no UNORM twin and
the write at a slot is Gap::StorageElement (Absent). README entry: the image format query rt
makes for the extended image (R8G8B8A8_SRGB, optimal, MUTABLE_FORMAT | EXTENDED_USAGE, the format
list with R8G8B8A8_UNORM, the plain usage with STORAGE) answers no. That is read from
tests::storage_element's every_device_writes_an_srgb_texture_through_its_unorm_view, which
asserts the image is extended exactly where that query takes it and passed there (m3-max-74877),
and from the case (m3-max-74873). Not probed apart; the README says the resolve usage's part
was not asked.
- read-write-tier-held RGBA8/BGRA8 sRGB stored-bytes and texels: the same cause through the
argument buffer, in the A8Unorm "*" rows' words (an undeclared write to a texture with no
storage element is dropped; the read answers zeros).
- BGR10A2Unorm (held stored-bytes and texels, round-trip refused) and A8Unorm (round-trip
refused): no storage image by the device's format queries, in the NVIDIA, llvmpipe and RX 550
rows' words (vulkaninfo of that card lists no STORAGE_IMAGE bit for A2R10G10B10).
- R8Unorm tier2, RG8Unorm beyond and RGBA8Unorm tier2 texels, one ulp: rule 1, the reciprocal
product, in llvmpipe's words.
- BGRA8Unorm beyond texels (held 256 elements, round-trip 1,024): the driver lists
VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT for B8G8R8A8_UNORM while
shaderStorageImageReadWithoutFormat is false; rt follows the per-format bit on every device
(VUID-vkCmdDispatch-OpTypeImage-07028), and the reads differed from Metal's (the largest
difference is what a read of zero gives). BGRA8Unorm is outside Metal's read-write tiers. A
known gap at rung 4 by the planner's ruling, with a README entry; not reproduced outside the
runtime.
Verified: every row is one of the 14 lines conformance leg m3-max-74873 printed as unlisted
(Windows UHD 630, pin
|
||
|
|
d9b644bae7 |
Conformance: Metal's recording of vector-word-phases-vec16-4-8, taken on the M3 Max
Recorded on an Apple M3 Max, macOS 27.0.1 (26A434), by `conformance record` and
`conformance times --runs 8 --write` in job m3-max-74565 (build m3-max-74559), three runs, one
outcome. Plain Metal ran the pass to completion; its API validation stopped it ("Compute
Function(vwp_vec16): the offset into the buffer a that is bound at Buffer index 0 must be a
multiple of 16 but was set to 4", and the same for b at 8), which the recording keeps as its
validated fact. The case's tests hold plain Metal's four buffers equal to answer_at (every
access at its own address) and the validated words to those two messages.
docs/CONFORMANCE-COVERAGE.md regenerated (scripts/conformance-coverage/coverage.py).
(cherry picked from commit 944d20922983e7932a591b6c3d0e1090dc5f3300)
|
||
|
|
b42ef61b9b |
Runtime: a buffer bound at a multiple of 4 below its argument's alignment runs the state's variant that holds it to 4
What: a dispatch's alignment check (check_alignments) no longer refuses a buffer whose argument's alignment is 8 or 16 (mask past 3) bound at a multiple of 4 below it: it answers the mask of those slots, bit i slot i. A non-empty mask picks the state's variant (PipelineInner::variant, srgbwrite's sRGB variant generalised to both masks): Compiled::of lowers the state's function with those slots in LoweringInputs::word_bound_buffers, kept in the device's bounded map of contents under KernelKey's new words mask (1,024 entries), held by the command buffer that dispatched it. The dispatch then checks the variant's own alignments strictly, so a buffer a 64-bit atomic may reach, which the variant holds to 8, is refused off a multiple of 8. A kernel the consumer compiled has no variant: its own module's strict check refuses the bind as before. One bit per slot: a second class (8 at a multiple of 8) would need a second mask in the key and the input. Still refused: an address off a multiple of 4 (off 2 for an alignment of 2), a 64-bit atomic's buffer off a multiple of 8, every draw's (render_encoder keeps the strict check_alignment: the draw side would need the render path's variant key), and a consumer-compiled kernel's. Refusal::BufferOffsetAlignment's doc says so; its message and `alignment` now name the alignment the function holds the address to, as the variant's 8 for a 16-aligned argument is not the argument's. The buffer-bind-off-alignment ledger row carries the new message; docs/CONFORMANCE-COVERAGE.md regenerated (unchanged); REFUSALS.md regenerated (unchanged: its row takes the doc's first words). Why: a guest's system texture-decode kernel (library db82b13f114fbeef #0) binds buffer 0 at offset 1871700 (4 mod 16) under a 16-byte argument alignment and met the refusal 60 and 72 times in two sessions; plain Metal runs it with each element at its own address. Only such a dispatch runs the variant: an empty mask keeps the state's key, hash and module. Tests (not yet run): translate.rs every_device_places_each_vector_access_at_its_own_address runs vwp_vec16 at VEC16_AT_WORDS too, holds Metal's words, and asserts a variant lowered exactly at the runs off a multiple of 16; every_device_keeps_a_word_bound_variant_in_the_bounded_map_of_contents (cap 2: one variant a mask, kept, the map at its cap, a forgotten one lowered again); an_argument_bound_off_its_alignment_is_refused binds vwp_vec16 2 and 3 bytes off (alignment 16). compute.rs's for_test kernel still refuses all 17 binds (no variant to lower). Docs: the runtime README's compute-encoder rule and a known gap of pipeline states (the relaxed form, with the unconditional build's 3090 constant_* rows), docs/API.md sections 1 and 10. |
||
|
|
4fadeef846 |
Conformance: the ledger's 8-bit sRGB rows after the twin form
What, from the whole replay at
|
||
|
|
5bcb3c3253 |
Conformance: srgb-storage-writes' Metal recording, from the M3 Max
What: conformance record and times --runs 8 --write srgb-storage-writes on the Apple M3 Max, macOS 27.0.1 (26A434), job m3-max-74594 at 121122cd7f; the recording copied out of its workspace. docs/CONFORMANCE-COVERAGE.md regenerated (the case module now holds 1 case, its Metal leg reaching 39 items). What Metal stored, read off the recording: in every one of the four sweeps (RGBA8Unorm_sRGB and BGRA8Unorm_sRGB, float and half) each row-0 texel holds codes (i, 255 - i, (i * 37) & 255, i) in the format's channel order, 0 mismatches of 256; row 1's values past either end clamp to 0 and 255 before the encode, alpha linear. |
||
|
|
71388e89d7 |
Conformance: srgb-storage-writes, what access::write stores into an 8-bit sRGB texture
What: a case over the owned fixture fpv_srgb_storage's fpv_srgb_write and fpv_srgb_write_half, each writing a 256 by 2 RGBA8Unorm_sRGB texture and a BGRA8Unorm_sRGB one from buffer 0 and recording the texture's bytes, one code a channel. The values are the linear values each code decodes to (every code in red, green and blue, each in its own order, alpha i / 255), and row 1 starts with values past either end, which Metal clamps. A unit test checks each value encodes within a hundredth of a code of its code in float and a twentieth through its half, so no side's encode meets a value between two codes. half_bits is extended_range_targets'. Why: Metal promises write access to both formats on every device (8.7.7: the write encodes, alpha linear); the runtime now stores them through the UNORM twin with the encode in the kernel. read_write is not in any read-write tier for an sRGB format, so the case writes only. Verified: not yet run; the recording on the M3 follows. docs/CONFORMANCE-COVERAGE.md regenerated. |
||
|
|
b6a57f7958 |
Translator: LoweringInputs::srgb_storage writes an 8-bit sRGB texture through its UNORM twin
What: a new LoweringInputs field, srgb_storage, names texture slots whose texture is an 8-bit sRGB texture held for storage through its UNORM twin's view. Such a slot, where storage_images names no choice for it and its image class is float, declares its storage image without a format, of class SrgbEncode: a write encodes red, green and blue by the MSL transfer (8.7.7) through the device's conversion and keeps alpha linear, recording PrecisionNote::DevicePackConversion, and a read decodes. A device that cannot write or read storage without a format refuses it as Feature::Format. Under the identity domains the slot's element is the storage array's element of its declaration's class, as an Unknown-format storage slot of class SrgbEncode now is. Why: a guest dispatch writes a write-only BGRA8Unorm_sRGB storage texture hundreds of times a session, and no device the runtime runs on stores an sRGB format; the runtime refused it (Gap::StorageElement). The runtime's kernels compile from LoweringInputs, not VariantKey, so the resident-table domain's srgb_textures and storage_images (another meaning) are not reused. The compile key appends srgb_storage only when it is non-empty, so no existing key moves and no version is bumped; with the field empty nothing a translation emits changes. Verified: not yet built; the lane's quick check and suites run next. api_signatures.tsv is blessed (one record) and docs/REFUSALS.md regenerated (one Feature::Format site more). |
||
|
|
aa2b0fc670 |
Translator: delete the one-row and unit-axes kernel variants, and the unit-axes relief
VariantKey::one_row and VariantKey::unit_axes had no product setter: every
product path builds VariantKey::new() (the runtime's render_variant_key call,
compile_render_pipeline, compile_mesh_pipeline, render_pipeline_key, the stage
entries), and the runtime's kernel route builds its LoweringInputs through
kernel_inputs_read and kernel_variant, which set neither. Their forms ran only
under tests.
Deleted with them:
- LoweringInputs::one_row and ::unit_axes, their key tags ("one-row",
"unit-axes", appended only when set, so no product key moves);
- RuntimeFact::OneRow (emitted only under the variant) and the one-row
branches of the lockstep order (OrderKey::one_row, the cleared-rows
retain); a device's profile now fixes the whole OrderKey, so a stage entry
keeps one ordered entry (KEPT_ORDERS 2 -> 1);
- RuntimeFact::UnitAxes and its computation (divergent::unit_relief, the
relief at workgroup.rs and divergent.rs, up to seven uniformity analyses a
predicated kernel), and the unit-axes support of the uniformity analysis
(Uniformity::with_unit_axes, the `unit` parameter). Readers checked: the
runtime ignored it (pipeline.rs, `UnitAxes { axes: 0, .. } => {}`, gone);
validation, the harness and the conformance suite name it nowhere; the
CLI's --emit-meta writes every dependency generically, so the fact leaves
that JSON and nothing there reads it; docs/API.md's paragraph is rewritten.
- Tests of the variants: the one-row halves of
engine_simd_emulated (now a_row_tile_keeps_its_lockstep_barriers_and_records_row_lockstep),
engine_simd_lockstep (now ..._clears_a_tree_reduction_in_rows, which asserts
RowLockstep on the plain pipeline and its absence for the mixed guard), the
harness's cells test, and the runtime test's relief check (now
every_device_runs_a_kernel_whose_walk_diverges_by_row, which still runs the
predicated walk and checks Metal's sums).
ARTIFACT_FORMAT_VERSION 597 -> 598: the codec loses RuntimeFact::OneRow and
::UnitAxes (and, in the next commits, VertexInputState::variant_pulled).
SEMANTICS_VERSION unchanged: no product output changes under a kept key.
Consumer search: consumer-uses.sh at the consumer's 19b32575f (development
and 9 steelbrain/* refs younger than a day): 0 code hits for one_row,
unit_axes, OneRow, UnitAxes, VariantKey, LoweringInputs, RuntimeFact.
In-tree grep after the change: no one_row, unit_axes, OneRow or UnitAxes
outside unrelated locals (dispatch.rs's DeepThreadgroup `one_row` spec value,
conformance locals).
Checked by the lane tip's jobs (quick check, suites, golden diff, states-only
play), named in the lane report.
|
||
|
|
6db36df158 |
Tests: the refused device's memory view has three doors, and a device opens through it only by the floor's choice
What: cached_types_incoherent moves from tests/mod.rs into tests::command::on_device and is no
longer crate-visible. The tests reach it through three doors alone:
- each_device_under_the_view, the one way a test opens a device through the view; the floor's
choice over the viewed types decides the arm, and a refused make is asserted and printed;
- viewed, which returns a device's memory properties read through the view (the coherence test's
read of the types a device under m2v_shared_view reads); it takes and returns a value, so it is
no DeviceOptions::memory;
- suite_view, compiled only under m2v_shared_view, the suite-wide hook in Device::new that gives
every device the view where the test gives none.
The doc mentions of the old path (coherence.rs, floor.rs, the settle test, docs/VALIDATION.md)
name the new one.
Why: the planner's ask after the second red of this class today. kkview (
|
||
|
|
e9484b7d03 |
Replay dumps: a texture the cover rule holds covered is dumped with a whole-texture cover
A heap texture that another placement's texture wrote over after its last write was reported by compare-dumps as a difference: the dump loop passed no cover for a texture (dumps.rs: "always `-` for a texture"), so the bytes Metal leaves undefined there were compared. Each texture a listed command buffer stores or binds is now dumped, when the dump reads it (after the wait that saw the command buffer complete, the moment a buffer's ranges are taken), with the cover 0..N, N its dump's length, where the cover rule holds any byte of it covered (Covers::covered), and `-` otherwise. A texture's ranges in the rule are its bytes in its heap, which the dump's parts are not laid out as, so a covered texture is covered whole. The compare then leaves its words out as it leaves out a covered buffer word. dumps.rs and docs/REPLAY-STREAM.md section 10 say so. Test: the_dump_compare_leaves_out_a_covered_texture_and_reports_one_outside_every_cover (no device; Kept reads a texture part's first word from a per-texture word where it holds one). Of three textures placed in a heap, #5 and #6 over each other and #7 apart, two dispatches of a state that writes slot 0 write #5 then #6, which covers #5; the second play reads #5 and #7 otherwise. #5's cover is 0..32 and its differing word is counted covered; #7, covered by nothing, is the one difference reported. Verified at this commit: nothing yet; the lane's jobs follow. |
||
|
|
f6b1adf204 |
Replay player: a layered pass plays as the runtime builds it, and its dump holds each slice
The player marked a pass whose renderTargetArrayLength is 2 or more as one the runtime's descriptor does not hold (Unheld(renderTargetArrayLength)) and skipped its encoder, though RenderPassDescriptor::render_target_array_length takes it: the runtime renders that many slices from each attachment's slice, refuses an attachment with fewer slices (AttachmentPlace) and answers a length past maxFramebufferLayers with Gap::RenderPass of ArrayLength. The player now sets render_target_array_length from the recorded value (narrowed to u32 as the other counts are) and lets the runtime decide: a gap is a skipped encoder counted by the gap, and a refusal stays the play's error. The attachments already carry slice and resolveSlice into the runtime's descriptor; no other field is dropped for a layered pass. The dump's stores read a layered pass's attachment as its first slice alone. They now keep each pass descriptor's renderTargetArrayLength from its m2v.setPass record and store that many slices from the attachment's slice (or the resolve's), through the MTLStoreActionUnknown path too. dumps.rs and docs/REPLAY-STREAM.md (sections 10's skipped encoders and the dump) say so. Tests: a_layered_pass_plays_and_its_draw_renders_the_layer_it_selects (device cfg; a stream of a 2D array of two slices, R32Uint, renderTargetArrayLength 2, cleared to 7, and rt6_layered's triangle selecting layer 1: no encoder or draw skipped, the blit's check of both slices matches 7 then 0x101, and the dump of the command buffer holds both slices) and a_layered_pass_s_dump_holds_each_slice_it_renders (no device; Kept: length 3 stores slices 1 to 3 of a Store attachment and 0 to 2 of an Unknown one, length 1 the slice alone). Verified at this commit: nothing yet; the lane's lavapipe job and the quick check follow. |
||
|
|
c43f1a5447 |
Replay player: setSamplePositions:count: plays on a pass descriptor, and passes at other positions are counted
The runtime player refused setSamplePositions:count: on a render pass
descriptor ("not played on a render pass descriptor"), so every play of a
stream whose 2D renderer sets positions on its 4-sample pass stopped before
that pass.
It now plays the call as the runtime treats it: the runtime's descriptor has
no field for the positions and every multisample pass rasterizes at Vulkan's
standard sample locations, so nothing is set and nothing is refused. The pass
keeps the positions its last call set, and each render encoder the runtime
makes of a pass whose positions differ from Metal's defaults for the pass's
sample count (its attachments', or defaultRasterSampleCount with none) is
counted on a report line, with the first one's frame and call:
"passes at sample positions other than Metal's defaults N: rasterized at the
defaults, Vulkan's standard locations; the first at frame F, call C".
Metal's defaults are taken as Vulkan's standard locations at 1, 2 and 4
samples (the spec's Standard Sample Locations table; the runtime's floor row
standardSampleLocations and its known gap name them Metal's defaults at those
counts; the conformance rows sample-positions-default-4x/-2x). No other
count's defaults are held, so a set at any other count counts as differing;
an empty list (count 0) is the defaults.
Tests: rt_replay's sample_positions_play_and_a_pass_at_other_positions_is_counted
writes its own stream, two passes over a 4-sample target, one at the 4x
defaults and one at four others; it plays through with nothing skipped and
the line counts only the second (call 12). Without the fix the play stops
refused at call 5. new_runtime's
sample_positions_differ_from_metal_s_defaults_of_the_pass_s_count checks the
comparison (defaults, one coordinate off, reordered, fewer positions than
samples, Vulkan's 8x locations) and the line at zero, without a device.
Docs: docs/REPLAY-STREAM.md lists the call among the pass descriptor's
setters and says how the backend plays and counts it.
|
||
|
|
e6df09cddd |
Docs: under m2v_shared_view a card that offers imports only cached types refuses every import
What: VALIDATION.md's m2v_shared_view entry gains the planner's sentence: under the view a card whose host-pointer and dma-buf queries offer only its cached types refuses every import; run it with the import families filtered. Why: on the RX 7900 XTX (RADV) the host-pointer query offers type 5 alone (0x20) and the dma-buf query types 5 and 10 (0x420); the view leaves neither coherent, so import.rs's rules refuse every import there: 17 tests of the view's suite failed on that alone (job m3-max-73943). The planner's ruling keeps the view and import.rs unchanged and filters those tests in the leg's command line. Verified: docs only. |
||
|
|
6c1eb0e77c |
Runtime tests: m2v_shared_view runs the device suite through the refused device's view
What: a test-only cfg, m2v_shared_view, declared in metal2vulkan-runtime's check-cfg list beside m2v_gpu_hazards and added to docs/VALIDATION.md's cfg table. Under it, Device::open gives every device the tests make with no memory view of its own the refused device's view through the landed seam: options.memory.or(Some(crate::tests::cached_types_incoherent)), which takes HOST_COHERENT from every host-visible, host-coherent, host-cached type. A test that sets its own view keeps it. The existing device suite then runs, unchanged, with Shared in a cached type that reads not coherent, so it runs Shared memory's flushes and invalidates on memory that is coherent in fact, which Vulkan allows. tests::coherence's every-device test asserts, under the cfg, that every device builds the coherence state, and prints the Shared type and the calls. Why: the planner's condition for A-narrow's proof on lab cards, which have no cached type that is not coherent: a test that sets the option, no second suite, no env var. Verified: not yet run (cargo fmt only). |
||
|
|
db3a88526b |
Validation: the stencil rule's Counting clause has nothing to read in the case schema
The runtime's BitDraws rule refuses a draw through a [[stencil]] output drawn by bits in two places: a face whose compare is other than Always and Never (DrawDepthStencil:: stencil_reference_face reads it), and, where the state replaces a stencil bit, a draw inside a Counting visibility result's segment. The second needs a visibility result mode, and the case schema has no way to state one: - crates/metal2vulkan-validation/src/case.rs:19-21, AuthoredCase: #[serde(deny_unknown_fields)], and none of its fields is a visibility result mode, offset or buffer; - src/case.rs:1819-1821, Draw (primitive, vertex_start, vertex_count, instance_count, index_buffer, base_vertex, base_instance): deny_unknown_fields, no visibility field; - src/case.rs:1388-1390, DepthStencilResource, and src/case.rs:1406-1408, DepthStencilStateLiteral: deny_unknown_fields, no visibility field; - neither executor sets a mode or gives its pass a visibility result buffer: no "visibility" in src/metal/ or src/candidate/ (grep -rni visibility), and runtime_render.rs's Targets::pass (line 661) builds the pass from its attachments, array length and default size alone. A manifest naming such a field is refused at parse, so no case's draw is in a segment and the classifier carries no clause for it. When the schema grows a visibility result mode, the clause belongs beside the compare rule, with its own classification test. The doc comment of stencil_reference_face and docs/VALIDATION.md now say this instead of "a case sets no mode". Verified at this commit: cargo fmt; doc comment and docs only, no code changed. |
||
|
|
5517e2df1b |
Validation: a stencil output whose test it decides needs VK_EXT_shader_stencil_export on a device without it
What: the engine's render route through the runtime now reads, from the case's own structure, the
draws the runtime refuses on a device without VK_EXT_shader_stencil_export, and records them as the
device's refusal (NotSupported::NotEnabled, not_supported{not_enabled}, class device) naming the
extension, the face and its compare function, instead of drawing them and failing on the runtime's
Gap::Draw { kind: StencilOutput }.
- RenderCase::stencil_output: the case's own fragment function writes a live [[stencil]] output,
read from its AIR outputs' roles (executor_contract::depth_stencil_test), false for a vertex case.
- DrawDepthStencil::stencil_reference_face (executor_contract/depth_stencil.rs): the first face
whose stencil test the output decides. It is the runtime's rule, depth_stencil::BitDraws::of, on
the same Vulkan state (metal::state::depth_stencil_state of the same descriptor): None where the
stencil test is off; otherwise a face whose compare op is other than ALWAYS and NEVER, whatever
its operations and masks (BitDraws::of returns None before it reads the replaced bits).
- runtime_render::run: once the state is made, a case with a stencil output, on a device whose
translator profile lacks fragment.stencil_export (the bit the translator chose the bit-draws form
by), under a state with such a face, is NotEnabled. After the make, so the product's own refusals
at creation (a colour beside the output: StencilExport) keep their records.
The runtime's second refusal, a draw that replaces a bit inside a Counting visibility segment,
meets no authored case: the case schema and the executor set no visibility result mode, so no
draw is in a segment. The doc comment and docs/VALIDATION.md say so.
Why this form and not the runtime limit: a ToolingRequirement with Limit::Runtime stops the engine
on every device, and lavapipe, RADV and ANV list the extension and run and match these cases. The
refusal holds only on a device without the extension, which is what a device's NotEnabled records.
Before the stencil form (
|
||
|
|
31b3470a3e |
Bitcode: read the pre-LLVM-4 metadata and typed-pointer records of AIR 1.8
A game launcher's metallib (AIR 1.8, language 1.1) parses since the container fix, but each of its 7 functions stopped in the bitcode reader at METADATA_STRING_OLD. A structure-only census of its 7 modules (job m3-max-73828) found six refused forms in all and nothing else unknown: METADATA_STRING_OLD, METADATA_KIND inside the METADATA block, METADATA_OLD_NODE, FUNC_INBOUNDS_GEP_OLD, LOAD without its type, and CALL without the explicit-type flag. Each is now read as LLVM's reader reads it at llvmorg-23.1.2: - STRING_OLD (MetadataLoader.cpp:2424-2433): one MDString of the operands as bytes, the next metadata id. Its llvm.vectorizer. loop-key upgrade (AutoUpgrade.cpp:6979-7026) renames keys the IR keeps in neither spelling, so the decoded loop hints are unchanged. - KIND in the METADATA block (2457, parseMetadataKindRecord 2631-2643): the METADATA_KIND block's record. Both places now refuse a record with fewer than 2 operands and a kind id stated twice, as LLVM does. - OLD_NODE (1401-1428): a uniqued node of (type, value) pairs. A metadata-typed operand is a metadata id, a void one is null, and any other is the module value of that type and id, as ValueAsMetadata. LLVM numbers no id for such a value; the arena keeps one Md::Value entry per value after the block's own ids, and MdIds moves every id LLVM numbers later (later module blocks, function blocks, attachments, call operands) past them. - INBOUNDS_GEP_OLD (BitcodeReader.cpp:5383-5450), LOAD (6418-6436) and CALL (6886-6964) without their types: the source element, loaded or function type is the pointer operand's contained type. The reader follows LLVM's type ids (getContainedTypeID, 1510; getVirtualTypeID, 1532) for every value: TypeIds keeps the virtual ids for pointers made by alloca, GEP and the module's globals and functions, shuffles and cmpxchg; each instruction's result takes the id LLVM's reader gives it. Still refused, by name: METADATA_OLD_FN_NODE; KIND and OLD_NODE in a function's block; an OLD_NODE value in a module block after one whose old nodes kept values; a load atomic without its type; GEP_OLD (not inbounds) and STORE_OLD. None is in the file. A typed-pointer load, call or GEP whose operand has no contained type (an opaque pointer, a non-pointer) is BadType or a malformed record. Tests: typed_pointer_records_without_their_types_read_as_with_them decodes one typed-pointer module in both spellings (a struct field, an array element, a loaded pointer, a cast, an argument, and a function whose record names a pointer to its type) and asserts the tables are equal, plus the refusals. legacy_metadata_records_read_as_their_modern_twins decodes the function-test module with its metadata in the old records, asserts the body equals the modern twin's, the arena's layout, and the shifted ids in a second module block and in a function block, plus each refusal. Both fail without the fix: the old records were refused. The tests that asserted those refusals now assert the remaining ones (OLD_FN_NODE). docs/REFUSALS.md regenerated. Not yet run at this commit: the suite job follows. |
||
|
|
8f74582eb3 |
Docs: CONFORMANCE-COVERAGE.md regenerated for pass-sequence-aspect-actions' NVIDIA ledger row
|
||
|
|
a1b955eec9 |
indirect_commands: the plumbing only the deleted runtime drove goes
`bind::indirect_commands` kept entry points that the removed in-crate runtime used to execute
indirect command buffers. Nothing calls them now: not the runtime crate, not the command line,
not validation, conformance, harness, devtools or the translator, and not the consumer. Deleted,
each with its own tests, its re-export, its api_surface row, its api_signatures rows and its
docs/API.md sentence:
- `RecordField` (referenced by nothing at all);
- `records_address`, `RECORDS_ADDRESS_BASE`, `RECORDS_ID_LIMIT`, and the crate-private
`RECORDS_ADDRESS_SHIFT` that only `records_address` read;
- `written_flag_offset`, `WRITTEN_FLAG_BYTES`;
- `BufferBinding::resolve_buffer`, `RegisteredBuffer` (+ `new`), `ResolvedBuffer`, `AddressError`;
- `CommandRecord::resolve_bindings`, `ResolvedBindings`, `BindingError` (tests/inheritance.rs
tested only these and goes whole);
- `RenderDraws::PRIMITIVES` (its one user, a test, now spells the struct out);
- `RecordView::action`, `barrier`, `kernel_pipeline`, `buffer`, `writes`.
The fixed point inside the module adds `RecordError::Index`, which nothing constructs (its
Display arm alone named it; it was the error of `RecordField`'s indexed fields), and an empty
`impl CommandRecord {}`.
Kept, because a live path calls them inside the module (validation's `CommandBuffer::decode` and
`CommandDescriptor::validate_record`): `BufferStage::of` (descriptor.rs `validate_record`,
host.rs `decode`), `CommandDescriptor::holds` (`validate_record`), `validate_header` (`decode`),
and `RecordView` with the accessors `CommandRecord::decode` reads through `record_into`
(`pipeline`, `retained_pipeline`, `threadgroup_memory_length`, `stage_in_region`,
`imageblock_size`, `record`, `record_into`).
`Bindings::buffers` becomes private: only descriptor.rs and host.rs call it, and validation reads
a record's buffers through `buffers_mut` only. The build at the stack's tip answers whether
anything else used it (an error would mean a user). `BufferBinding`'s doc no longer links it.
Docs that named the deleted items or the deleted runtime say what is true now: the
`bind::indirect_commands` module docs (validation's case model and Metal executor use it),
host.rs's module docs, `BufferBinding::address`, `RecordError`, provenance.rs's
`object_handle_load`, and docs/API.md's indirect-command-buffer section.
Zeros, outside crates/metal2vulkan/src/indirect_commands* and the facade, at metal2vulkan
|
||
|
|
dd3f16a656 |
Conformance: Metal's answer for the compressed small-level copies, recorded with its times
What: the recordings of compressed-small-levels-bc1-rgba and compressed-small-levels-bc3-rgba.
Metal's times are kept in each. docs/CONFORMANCE-COVERAGE.md is regenerated: 188 case modules,
1335 recordings, compressed_small_levels 2 cases, every field compared. A new unit test,
the_recorded_copies_are_the_model, holds each recorded site to the case's model. program()'s doc
no longer links to the private `reads`, which rustdoc refused (job m3-max-73736).
Why: this is the recorded Metal answer the suite holds the runtime to, for the guest's 4 x 4 copy
of a level smaller than one block.
Verified:
- Job m3-max-73751 (Apple M3 Max, macOS 27.0.1, build 26A434), in the workspace job m3-max-73737
built `conformance` in, release, at 7af2733ddc.
- It ran `conformance record` of both cases: plain Metal 3 runs, one outcome, three command
buffers Completed.
- The validated leg stopped at the work, on the copy from a buffer: "(destinationOrigin.y +
sourceSize.height)(4) must be <= height(2)".
- It then ran `conformance times --runs 8 --write` of both.
- Every recorded byte site equals the case's model: levels 8 to 11 of the t2t, b2t and replace
destinations, and the 64 bytes of t2b and get at levels 9, 10 and 11. I checked this with a
Python decode of the recordings here. The new test checks the same and has not run yet.
- coverage.py --check: as derived.
|
||
|
|
88beca43a0 |
Docs: CONFORMANCE-COVERAGE.md regenerated for the stencil form's four known-gap rows
The stencil form (
|
||
|
|
5a722b5c3f |
Stencil output: a device without VK_EXT_shader_stencil_export draws it by bits, the owner's tenth form
A fragment function's [[stencil]] output is the reference of both faces' stencil test for its
fragment (MSL Table 5.7, 5.2.3.5). On a device without VK_EXT_shader_stencil_export it was refused
at creation (StencilExport). Under the owner's grant (rule 2's tenth form, chosen by that
extension's query alone), such a device now draws it by bits; a device with the extension is
unchanged (FragStencilRefEXT, no fact, no note, the draw issued once).
Translator: the function stores no reference; each return kills the fragment where the draw's new
push field PushField::StencilBit k is below 8 and bit k of the output's low 8 is 0, and keeps
every fragment at 8 or more (one module, no specialization). The function states
RuntimeFact::StencilBitDraws (Mechanism::PushConstant) and its fragment stage the static note
PrecisionNote::StencilOutputOverlap. Refused there, naming the extension (Unsupported
StencilExport): a function that also writes a colour (the colour would be written by every
repeat) or memory, one whose returns cannot kill (an interlocked body, a loop over its covered
samples), a mesh pipeline, and a render pipeline made for indirect command buffers. Where the
device also lacks the pixel interlock, a function writing memory in a raster order group meets
that refusal first (RasterOrderGroups). SEMANTICS_VERSION 2301 -> 2302, ARTIFACT_FORMAT_VERSION
595 -> 596 (new codec members).
Runtime (depth_stencil::BitDraws, render_encoder::draw): with w the low 8 bits of the write masks
of the faces having a Replace operation, a draw whose stencil test is on and w is not 0 is drawn
once with every fragment kept under the reference 0 (Replace zeroes w's bits, every other
operation runs once), then once per bit k of w keeping the fragments whose output holds bit k,
under the reference 255, write mask (1 << k) & mask, Replace kept and every other operation Keep,
and no depth write; where the state writes depth under a compare other than Always and Never, the
first draw writes none and a last draw writes it with stencil write masks of 0. Each draw records
only the dynamic state that differs from the last; the encoder's tests and reference are recorded
again at the next draw. Counted in Metrics::stencil_bit_draws (the draws beyond the first).
Refused at a draw, Gap::Draw of DrawKind::StencilOutput: a face compare other than Always or Never
(the output decides that test), and, where w is not 0, a draw inside a Counting visibility
segment (every draw would add its samples). A Boolean segment is drawn. Vulkan Appendix I: the
repeats change stencil reference, operations and write masks between draws of one pipeline,
which Rule 2 lists as required (write masks) and strongly suggested (stencil parameters) to be
invariant; the note records the one difference the repeats make.
The note (rule 1): fragments of one draw that overlap leave the OR of their values. Where two
fragments of one draw reach one sample under Replace, the sample stores the OR of their outputs'
low 8 bits within the write mask, where Metal stores the later fragment's value; under a depth
test that writes, each fragment's stencil operation is chosen against the depth from before the
draw. Measured on an RTX 3090 (NVIDIA 620.70.06) under the validation layer 1.4.363.0, job
m3-max-73635: two triangles of one draw outputting 0x35 then 0x4a store 0x7f on the 32 texels both
reach, where Metal stores 0x4a, and 0x35 on the 32 one reaches, in 8 bit draws; the 780M (RADV)
and the Iris Xe (ANV), which list the extension, store 0x4a with 0 bit draws.
AGENTS.md rule 2: "for nine only" becomes "for ten only", the list ending with fragment stencil
output (the planner's text, relayed by main, word for word).
Tests: the translator's engine_stencil (every committed profile: the extension or the draws by
bits, L3 both ways; refusals for colour, memory, mesh and indirect command buffers); rt's host test
of BitDraws::of; rt's device cells (stencil_export.rs): the stencil alone and the stencil with the
depth under Always and Less over a quad, exact, texels of stencil 0 among them; the overlap row;
the refusals; the route of a 4-sample Depth32Float_Stencil8 source read at sample 0 into a
single-sample target under Always/Replace 0xff and depth Always with write, beside colour 0
RGBA8 of write mask none; the codec round trip; the mechanism table.
Docs: docs/API.md (the stencil output passage and the catalogue entry
metal2vulkan-degrade-stencil-output-overlap), rt README known gap and floor row,
docs/REFUSALS.md regenerated, api_signatures blessed. The conformance degradation and the
validation allowance (unbounded) of the note. known-gaps-rt.tsv: stencil-output and
stencil-output-loaded on NVIDIA, refused at renderCommandEncoder (draw 3's back face Equal against
the output) and divergent at case/stencil as a result. runtime-sources.sha256: the guard's inputs
changed only by mechanism.rs gaining the new fact's arm, which no existing artifact states, so no
run of an existing artifact changes.
Golden rows and the engine inventory (22 cells) are re-blessed on development: 20 move from the
StencilExport refusal to a module (stx_stencil_by_pixel, stx_stencil_discard,
stx_stencil_with_depth, stx_stencil_ms_by_sample, fragment_depth_stencil on nvidia-pascal-linux,
nvidia-rtx50-linux, nvidia-rtx5080-laptop and runtime-floor), and the 2 cells
stx_stencil_in_order and stx_stencil_ms_in_order on runtime-floor move from StencilExport to
RasterOrderGroups, still refused. Why: the memory-write refusal now runs on the emitted module
(pipeline/compile.rs), after the body's own refusals, so on a profile without the pixel interlock
the raster order group these functions write memory in is refused first; at the base the plan's
entry refused every [[stencil]] output on such a device before any body was lowered.
Verified (this tree, or the rt archive of d6bd77d203 where named; the rt and translator sources
there differ from this tree in the translator's test and a doc comment alone):
- msi check, job m3-max-73648 (this tree): fmt, signatures, refusals, clippy -D warnings with all
features plain, --cfg m2v_gpu and --cfg m2v_cpu_icd, Rustdoc, the rt nextest archive and the
conformance binary built; rt's whole suite on lavapipe under the validation layer 1.4.363.0,
738 tests run: 738 passed, 3 skipped; the lavapipe leg, 7 tests run: 7 passed: export enabled,
the overlap row storing {4a}, bit draws 0 on every cell.
- RTX 3090 (NVIDIA 620.70.06, layer 1.4.363.0), job m3-max-73635 (d6bd77d203): 7 passed; the
overlap row above, bit draws 8; the stencil alone and with depth under Always and Less, 64
texels exact, bit draws [8, 8, 9]; the route exact, bit draws 8; refused a colour beside the
stencil (StencilExport), Equal and a Counting segment (DrawKind::StencilOutput), a Boolean
segment drawn. Conformance stencil-output and stencil-output-loaded: refused at
renderCommandEncoder and divergent at case/stencil (4 elements, largest difference 80), the
four known-gaps rows.
- RTX 5080 Laptop GPU (NVIDIA 615.71.09, layer 1.4.363.0), job m3-max-73652 (this tree): 7
passed; overlap {7f} where both reach, {35} where one, bit draws 8; cells exact, bit draws
[8, 8, 9]; the route exact, bit draws 8; the same refusals; conformance replay with this tree's
binary matched the four NVIDIA rows (exit 0).
- Radeon 780M (RADV, Mesa 26.2.6), job m3-max-73636 (d6bd77d203), and Iris Xe (ANV, Mesa
26.2.6), job m3-max-73650 (this tree): 7 passed each, export enabled, overlap {4a}, bit draws 0.
- States-only plays of recorded streams, base
|
||
|
|
d2e8ab2a85 |
Replay player: a colour attachment's depthPlane is played
What: the new-runtime player forwards a colour attachment setter's `depthPlane` into the
runtime's RenderPassColorAttachmentDescriptor::depth_plane, as it forwards resolveDepthPlane, and
no longer holds the pass for a plane but 0 ("Unheld(depthPlane)", the encoder skipped). A depth
or stencil attachment's depthPlane is not played and holds nothing: Metal reads it of a 3D
texture alone (Apple's page for depthPlane, as fetched: "If the texture isn't a 3D texture, then
Metal ignores this property."), and the runtime refuses a 3D texture's depth or stencil
attachment by its type (TextureType) whatever its plane, which the player counts as any gap.
Why: since
|
||
|
|
3c52ee1cf1 |
Render pass: a colour attachment renders one depth plane of a 3D texture's level
What: RenderPassColorAttachmentDescriptor takes `depth_plane` (Metal's `depthPlane`). A 3D texture of RenderTarget usage is made 2D-array-compatible (VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT, in its image format query too: Plan::flags, from the image's type and its colour attachment usage, no query). attachment_view then takes the plane of a 3D texture's level as a 2D view of that one layer (base layer = depthPlane, at the level), checked against the level's depth (Refusal::AttachmentPlace past it). Every barrier on a 3D texture's image (its attachment's, its copies' and its moves', texture::barrier_layers) names the image's layers as 0 and VK_REMAINING_ARRAY_LAYERS, so each moves every plane of the level it names. Before, every such pass was Gap::RenderPass of RenderPassKind::TextureType. Still TextureType: a 3D texture in a layered pass (renderTargetArrayLength 2 or more), a depth or stencil attachment of a 3D texture, a 3D resolve texture, and a resolve's depth plane but 0. A draw that reads, through a shadow (a device without the attachment feedback loop), a 3D texture whose plane its pass renders is Gap::Draw of DrawKind::AttachmentRead: a shadow's copies are of layers. The floor asks a device that lists VK_KHR_portability_subset for imageView2DOn3DImage too (VUID-VkImageCreateInfo-imageView2DOn3DImage-04459), as it asks multisampleArrayImage. Why: a guest route meets the refusal. A browser's GL layer clears every 3D texture of an RGB-family format (RGB8, RGB16F) at creation through a pass on each plane, to set the alpha it emulates; it also renders into a plane for framebufferTextureLayer(TEXTURE_3D, k) then a clear or a draw, for a level sampled before a full upload, and for copyTexSubImage3D. The consumer's route showed the key at |
||
|
|
50a851487c |
Conformance: a copy between two Depth32Float_Stencil8 textures, recorded on Metal
What: the case depth-stencil-copies-d32s8 (cases/depth_stencil_copies.rs), its recording from the
M3, and docs/CONFORMANCE-COVERAGE.md regenerated with it. Two 8 x 4 Depth32Float_Stencil8 textures
of ShaderRead | RenderTarget | PixelFormatView usage, private. Each plane of each is written from a
buffer through the plane options, every texel a depth and a stencil of its own, the two textures'
apart. One copyFromTexture:...toTexture:... moves 5 x 2 texels from the source's (1, 1) to the
destination's (2, 2). Both planes of both textures are then copied out through the plane options
and read: four byte sites, laid out in the textures' rows.
Why: the runtime now copies such a texture whole, both aspects in each vkCmdCopyImage region,
because Metal's texture-to-texture copy takes no plane option. The case puts that to Metal and
holds the runtime to Metal's own bytes. The unit test the_recorded_copy_moved_both_planes holds
the recording to the host's model, so a release in which Metal moves one plane alone shows as a
failing test naming the site. The case declares the restricted-depth-upload notice allowance, as
format_copies does: the depth planes take their bytes from a buffer, and every depth written lies
in [0, 1], so the note moves no byte the case reads.
Verified:
- Job m3-max-73350 (Apple M3 Max, macOS 27.0.1) ran `conformance record
depth-stencil-copies-d32s8`. Plain Metal: 3 runs, one outcome, status Completed. The
destination's region holds the source's depth and stencil, every other texel of both textures
is what was written. The validated leg ran. An earlier attempt, m3-max-73338, ended in its build
(the compiler cache's daemon) before any Metal call.
- Job m3-max-73383 (msi, lavapipe, Khronos validation layer 1.4.363.0) at the case and its
recording, the coverage doc regenerated in the job:
- coverage.py wrote docs/CONFORMANCE-COVERAGE.md, the one committed here (187 case modules,
1333 recordings, depth_stencil_copies one case, every field compared);
- fmt; clippy of metal2vulkan-conformance plain, --cfg m2v_gpu and --cfg m2v_cpu_icd;
- the case's three unit tests passed, the_recorded_copy_moved_both_planes among them;
- rustdoc -D warnings; coverage.py --check;
- `conformance replay --cpu depth-stencil-copies-d32s8` exited 0: verdict announced, every
byte site Metal's, the one difference the restricted-depth-upload notice the case declares
(its allowance fired);
- the conformance suite on lavapipe under the validation layer: 1038 run, 1037 passed. The one
failure was times::every_case_is_timed (the new recording held no timing), which the next
commit, Metal's times for this case, answers.
|
||
|
|
b573e68c11 |
rt: a Direct3D 11 plane's texture is made by one function of an explicit usage and format list
What: import_d3d11_surface derives every plane's usage and list first (d3d11_plane_form, from the bind flags and the descriptor, its refusals before any plane is made), then makes each plane's texture through d3d11_plane_texture(plane, usage, list, unit): the image of the plane's format with that usage, mutable over that list where it is not empty, imported, bound, and the texture over it under the plane's descriptor at its index. A plane's error drops the textures made before it, which frees their images. A test can call the same function with other values, so a cell can make an image the old way over the same Direct3D 11 texture and read it beside the import's, with nothing of the old form in product code. docs/REFUSALS.md names the new site functions. Docs: a plane is viewed in place in the image's own format, the descriptor's and the descriptor's sRGB sibling. A view in another format has no in-place form on the import (Gap::TextureView of SurfacePixelFormat), and the consumer takes the copy form of the same call for it, a counted copy of the plane: the README's plane paragraph and a new entry in the known gaps of memory blocks say so. Correction to d310504408: it says the import never receives a view in another format. The consumer does view a drawn plane (PixelFormatView) on the import itself in any format the guest asks (surface_shapes.rs:233 and 247-257), so the narrow list does refuse views a guest reaches. The ruling: the narrow list stays, and the consumer routes a texture over a drawn plane viewed in another format to its counted copy shape. Still owed on the same principle: the chroma's uint/unorm pair (R16_UINT under RG8Unorm, R32_UINT under RG16Unorm) is the one reliance left past the texture Direct3D 11 made, besides the sRGB sibling and the feedback usage. It is its own row, behind the diagnostic, and goes once the consumer makes chroma R8G8_UNORM or R16G16_UNORM. How verified: refusal_surface.py --check passes here. The Windows cross-build, the runtime's checks, and the device run on the lab's Windows host (red at the parent, green here) are reported with their job ids to the lander. |
||
|
|
737906832c |
Runtime: a compute pipeline's module reaches the driver with every specialization constant fixed, its workgroup size the entry point's LocalSize literals
Every compute VkPipeline rt makes is now created from a shader module of its own, made of the kernel's words with each specialization constant the plain constant of its value and destroyed once the create returns; the create names no VkSpecializationInfo. Vulkan defines specialization as exactly this conversion (VUID-VkPipelineShaderStageCreateInfo-pSpecializationInfo-06849), so what a kernel computes is unchanged; what changes is that no driver is handed a specialization constant to size a workgroup or an array from. - Translator: pipeline::specialize(words, values) (spirv::specialize). OpSpecConstant, OpSpecConstantTrue/False become OpConstant/OpConstantTrue/False of the given value or the default; each OpSpecConstantOp becomes the constant it computes (SpecOp::eval, now product code, and SpecOp::opcode, which the serializer shares); OpSpecConstantComposite becomes OpConstantComposite; the SpecId decorations go; a WorkgroupSize composite loses its BuiltIn decoration and the entry point takes its values as OpExecutionMode LocalSize. The translator's output is unchanged (no SEMANTICS_VERSION bump). - rt: Kernel holds its words (Code::Module(Arc<[u32]>)) instead of a VkShaderModule made at Kernel::new; Kernel::make specializes per variant and makes, uses and destroys the module. Heavy kernels specialize the same way: the stage request carries the specialized words and no ids or data (WIRE_VERSION 3), and the helper compiles them as they are (HELPER_VERSION 2). Lowered::Failed and Unmade go: nothing creates a shader module at Kernel::new now. - Tests: serializer tests specialize (a deep kernel's spec constants, its bool, two Workgroup arrays sized by OpSpecConstantOps: values given and defaults, spirv-val under Vulkan 1.2 and 1.3); rt deep_threadgroups a_kernel_reaches_the_driver_with_its_workgroup_size_as_literals. - Docs: API.md (section 3), rt README. |