d5b2379d91bf169d36c486ce2a5fb9dee2a5bc1d
2228
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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. |
||
|
|
a38145f53c |
Translator: a flat grid's tangled instructions take the profile's reconvergence mode, as the partial-threadgroups variant's do
A flat-grid module (LoweringInputs::flat_grid) returns its invocations past the grid before the
body (lower::dispatch::emit_entry), and under call_threadgroups it admits SIMD-group operations
(select.rs's flat call-threadgroups check). lower::simd::together excluded only
partial_threadgroups, so such a module's SIMD-group operation in a block the workgroup uniformity
proves uniform was stated Guaranteed with no mode, which SPIR-V does not support.
The words, SPIR-V 1.6 Revision 8:
- A threadgroup barrier is OpControlBarrier at Workgroup scope (3.3.20): "When Execution is
Workgroup or larger, behavior is undefined unless all invocations within Execution execute the
same dynamic instance of this instruction." A module whose past-grid invocations return early
cannot hold one at all. The partial variant walks them predicated instead, and a flat
call-threadgroups module refuses one. So this kind is unaffected.
- A SIMD-group operation or simdgroup barrier (OpGroupNonUniform*, 3.3.24; OpControlBarrier at
Subgroup scope) acts on "the scope restricted tangle". Who is tangled is 2.2.5's rule:
"Invocations will continue to execute the same dynamic instances as long as they follow the same
control-flow path"; after a divergent branch, "Invocations may only resume executing the same
dynamic instances when all invocations reach the same static instruction", and the merge rule
("Uniform Control Flow") needs control flow "uniform upon entry", which no longer holds once some
invocations returned. Only SPV_KHR_maximal_reconvergence lets an invocation that ran OpReturn
escape reconvergence.
A predicate on the AIR ("no divergent construct passed since entry") is not enough to keep a
narrower set. The lowering adds selections of its own, whose condition differs between
invocations, before a tangled instruction: the bounds-checked load (lower/access/psb.rs:660), the
guarded store (lower/access/emit.rs:411), an atomic's (lower/access/atomic.rs:1064) and a copy's
(lower/access/copy.rs:1343). So a module that returns past-grid invocations early has no tangled
instruction reached together. The partial-threadgroups variant's exclusion is unchanged.
No runtime or consumer path makes a flat-grid module today. `grep -rn 'flat_grid\|call_threadgroups'
crates/metal2vulkan-runtime/src`, tests excluded, gives 0 hits at
|
||
|
|
d16eb39e8f |
Tests: METAL2VULKAN_TEST_UNVALIDATED=1 runs rt's device tests without the validation layer, and says so
Every rt device test opens its instance through tests/validation.rs instance(), which fails unless each device lists an active VK_LAYER_KHRONOS_validation. A Windows machine whose only Vulkan pieces are its GPU driver and the loader it ships therefore cannot run the device suite at all, and a machine of that kind is the only place some drivers are ever covered (AMD's proprietary Windows driver: the lab has no AMD card under Windows). The setting is test-only and off unless its value is 1; product code and the lab's runs, which never set it, are unchanged. Under it, instance() enables nothing and checks the opposite: every device lists no validation tool, so a run that says it is unvalidated is. No layer writes a log, so the guard checks none. Each test process writes "M2V-UNVALIDATED unvalidated run: ..." once to its standard error, past libtest's capture of a passing test's output, so the run's output says it whatever passes. The test of the layer's log itself (every_device_logs_a_deliberately_invalid_call_once) skips: without the layer its call is only invalid. The new device test the_setting_runs_the_device_tests_without_the_layer_and_says_so runs the test binary's unvalidated_child in a process of its own under the setting, with VK_INSTANCE_LAYERS and VK_LOADER_LAYERS_ENABLE removed, and requires it to pass and to print the line. Without this change the child opens a validated instance (the layer is on VK_LAYER_PATH in every lab job) and prints no such line, so the test fails; on a machine without the layer the child fails outright. Docs: the setting in tests/validation.rs's module doc, docs/VALIDATION.md (the layer section), CONTRIBUTING.md, and env_vars.rs's module doc, which now says the test suites' own METAL2VULKAN_TEST_* variables are not in REGISTRY. |
||
|
|
b4aeaab757 |
Tests: a partial-threadgroups variant may add DeviceReconvergence on a device without maximal reconvergence
The rt test every_device_s_observers_answer_the_same_on_their_variant failed on the UHD 630's Windows leg (job 72531) after |
||
|
|
1b9ea536f6 |
Translator: a threadgroup barrier, and a kernel's group operation in uniform control flow, state the reconvergence mode only in a re-entered loop
A program's threadgroup barrier, and a kernel's tangled instruction in a block the workgroup uniformity proves every thread of the threadgroup runs together, now count as fragreconv counts a fragment's derivatives: an entry whose tangled instructions are all such (or a fragment's derivatives) states no MaximallyReconvergesKHR (or SubgroupUniformControlFlowKHR), records Reconvergence::Guaranteed and no DeviceReconvergence, except where its emitted module holds a tangled instruction, itself or through a call, in the construct of a loop whose continue target two or more blocks of the construct branch to; there it takes the profile's mode and note as before. An entry whose every group operation stands in a block the pass proves uniform for the threadgroup, with no re-entered loop around it, states no mode and records Guaranteed. An entry with any other tangled instruction keeps the mode; a kernel compiled for partial threadgroups proves no block uniform, and the emulated tier keeps its own rule. Why: without a mode SPIR-V reconverges invocations at the merge of a construct they entered together and all leave by it (2.2.5, Uniform Control Flow), and an OpControlBarrier of Workgroup execution scope is defined where every invocation executes the same dynamic instance of it, which invocations resume only under those conditions (2.2.5, Dynamic Instance). Metal requires every thread of the threadgroup to reach a threadgroup barrier, and a group operation in a block every thread runs together sees every lane, so both are Metal's wherever SPIR-V reconverges, which is everywhere but a continue target entered from several blocks. On the 780M under AMDVLK the mode with the group operations of one kernel family costs 9.4-11.4x RADV on its own command buffers, and 2.8-3.0x without the mode (m3-max-72248, m3-max-72261). How: BarrierPlan::threadgroup records every threadgroup barrier; simd::finish defers an entry whose tangled instructions are all a fragment's derivatives, threadgroup barriers or a kernel's instructions in workgroup-uniform blocks (simd::together: partly_live's uniformity, or the same analysis where it computed none) to SimdPlan::reentry; lower::simd::reentry (quad_loop, renamed) settles it on the emitted module, its re-entered-loop test now over every tangled instruction (derivatives, implicit-LOD samples, LOD queries, control barriers, group operations). The emulated tier clears the deferral where it clears the mode. The simd module doc, the PrecisionNote and Reconvergence docs and docs/API.md's Precision sentence and catalogue entry say the same. SEMANTICS_VERSION 2300. Tests (src/tests/engine_reconvergence_together.rs): a threadgroup barrier alone states no mode on every committed profile; one in a loop two latches inside a selection re-enter keeps the mode; a shuffle in a counted loop states no mode; a shuffle after a merge inside a per-thread branch, and one in a loop with a per-thread exit, keep it. |
||
|
|
14c6cab653 |
Conformance coverage: regenerated with quad-helpers
scripts/conformance-coverage/coverage.py at |
||
|
|
7360a148bb |
Translator: a fragment's derivatives state the reconvergence mode only in a loop a back edge re-enters from inside a selection
A fragment entry whose only tangled instructions that depend on reconvergence take derivatives (dfdx, dfdy, fwidth, implicit-LOD samples, LOD queries) no longer states MaximallyReconvergesKHR (or SubgroupUniformControlFlowKHR), records Reconvergence::Guaranteed and carries no DeviceReconvergence, on every device, except where its emitted module holds such an instruction, itself or through a call, in the construct of a loop whose continue target two or more blocks of the construct branch to (a continue from inside a selection, or two latches). There it takes the mode the profile gives a tangled entry, and the note where the profile has no maximal reconvergence. Entries with group operations or barriers keep today's behaviour. Why: MSL 6.11.1.1 leaves derivatives undefined within nonuniform control flow, and an implicit level or LOD query is the derivative of its coordinate, so such an instruction is Metal's only where the quad reaches it together. Without a mode SPIR-V reconverges invocations at the merge of a construct they entered together and all leave by it (2.2.5, Uniform Control Flow); only the continue target of a loop entered from several blocks needs SPV_KHR_maximal_reconvergence to rejoin the quad for the next iteration. AMDVLK 2025.Q2.1 miscompiles a large fragment function under the mode (an 8x8-cell grid on the 780M, blockiness 9.15 against RADV's 2.87; the same play with the mode stripped reads 2.92, job m3-max-71921), and the note logged on every device without the feature for a case Metal leaves undefined. How: SelectCx::derivatives marks the derivative and implicit-LOD tangled values; simd::finish defers a fragment entry with only those to SimdPlan::quad_loops; lower::simd::quad_loop::settle decides on the emitted module, before verification, and declares the mode with TypedModule::declare_modes where it applies. The PrecisionNote and Reconvergence docs, the docs/API.md catalogue entry and its Precision sentence, and the simd module doc say the same. SEMANTICS_VERSION 2298. Verified: - Metal-defined reconvergence cases with the mode stripped equal them with it, and Metal, on the 780M under AMDVLK 2025.Q2.1 and RADV (m3-max-72068), the RTX 5080 (m3-max-72069), the RTX 3090 (m3-max-72071), the Iris Xe (m3-max-72070) and lavapipe (m3-max-72077): 0 of 4096 pixels differ from Metal either way. Each entry under this change reads one of the two. - The lettering play on the 780M under AMDVLK to frame 4016 (m3-max-72116, this change against its base |
||
|
|
62ab49b966 |
Conformance ledger: the reconvergence rows on the Iris Xe
The Iris Xe (RPL-P, Mesa ANV; job m3-max-72186) answers the four trilinear sites of reconvergence-handle-choices exactly as every AMD venue does: 1128, 1136, 2240 and 490 elements, each one step of a half, on the second source only. Everywhere else it matches Metal, so four rows are scoped to "Iris(R) Xe". The llvmpipe diagonal rows now list every GPU replayed that answers Metal's there. CONFORMANCE-COVERAGE.md regenerated. |
||
|
|
17802357be |
Conformance ledger: the AMD trilinear rows hold on every AMD venue
The four trilinear rows of reconvergence-handle-choices were scoped to the 780M. The RX 550 (POLARIS12, job m3-max-72170) and the RX 7900 XTX (NAVI31, job m3-max-72171) under RADV answer the same four sites with the same counts (1128, 1136, 2240 and 490 elements, each one step of a half) as the 780M under RADV and AMDVLK, and match Metal everywhere else. So the rows are now scoped to "AMD Radeon", which every one of those venue names holds. The RTX 2080 (job m3-max-72171) matches Metal on both cases. CONFORMANCE-COVERAGE.md regenerated. |
||
|
|
baae603de4 |
Conformance ledger: the llvmpipe diagonal rows say what differs, and point at nothing private
The two level-and-pair rows on llvmpipe (rc_loop, rc_break) pointed at a bug list outside the repository. Each now says, on its own, what differs: the fine pair along the full-screen triangle's diagonal x + y = 62 to 63, the same with and without MaximallyReconvergesKHR. It also says where it was measured (LLVM 23.1.1, 256 bits, AVX2) and which drivers answer Metal's. Only the text field changed, so neither row's identity (case, verdict, site, answer) moved. CONFORMANCE-COVERAGE.md, which quotes the rows, was regenerated. |
||
|
|
2a8cfdec04 |
Docs: CONFORMANCE-COVERAGE.md regenerated for the reconvergence ledger rows and declarations
The doc derives from the ledger and from each module's declarations as well as from the recordings. It went stale at dbcc0a89df (the reconvergence module stopped declaring notices: modules declaring a notice 43 -> 42) and at 853a406696 (18 ledger rows, 7969 -> 7987). 884a70ab0d's body says coverage.py --check still passed there. That is wrong: the check failed there, for these two causes. It passes at this commit. |
||
|
|
5216a5cde1 |
Conformance: Metal's answers for the reconvergence cases, recorded on the M3; coverage regenerated
reconvergence-constructs and reconvergence-handle-choices were recorded on the reference M3 Max (macOS 27.0.1, 26A434) by `conformance record` at a1ffe24d32 (job m3-max-72140, after the build m3-max-72139). Each case ran 3 times with 1 distinct outcome, and the validated leg ran. A script over the recordings checked Metal's nearest samples against the module's hash model, and rc_pick's fine pair too: every draw matches. That is 4096 pixels for each full-screen draw and 896 for rc_pick over the small triangles. The module's test makes the same check in Rust. docs/CONFORMANCE-COVERAGE.md was regenerated by scripts/conformance-coverage/coverage.py. |
||
|
|
932ef756df |
Lowering: a quad-only kernel takes its quads from the subgroup at the size the device gives below 32
The 32 lanes of a Metal simdgroup are needed only by operations that read outside a quad. A kernel whose every cross-lane operation is a quad operation (lower::simd::quad_only: some group operation, each of quad scope, and no simdgroup-scope operation, AGX or matrix multiply-add, or subgroup-scope barrier or fence) now takes the Direct tier with full subgroups and no required size where the kernel stage runs full subgroups of its operations and its narrowest subgroup is below 32 lanes (device::subgroup::quad_free, read from the stage's size range alone). Its requirement (quad_requirement) sets ALLOW_VARYING_SUBGROUP_SIZE where the stage can take a size, and a local size that is a multiple of the stage's largest size (VUID-VkPipelineShaderStageCreateInfo-flags-02758); a threadgroup that is not runs the emulated-simdgroups variant, as a pinned kernel's does. Such a kernel pins nothing, so the widest-pin rule does not weigh it. The pin to 32 stays where 32 is the device's narrowest size. Why it is exact: a quad is four subgroup lanes from a multiple of 4, all in one subgroup (Vulkan 9.27.9), and a compute dispatch runs one subgroup size (9.5.2); the kernel's simdgroup builtins derive from the linear index (SubgroupId * SubgroupSize + SubgroupLocalInvocationId, reading the SubgroupSize builtin where no size is pinned), and its quad operations from SubgroupLocalInvocationId & 3 and & ~3, so every size of 4 lanes or more gives Metal's quads. The guard min >= 4: a quad must be four lanes of one subgroup. A stage whose narrowest subgroup is 1 or 2 lanes could split a quad across subgroups, so such a stage keeps the tier its class takes. A kernel with compute derivatives keeps the tier its class takes: their quads need its two-dimensional local size, which the flattened tiers refuse (ComputeDerivativesWithSimd). Without this exclusion lavapipe's quad kernels with derivatives, which run emulated today, would be refused. Where it applies among the committed profiles: the four Intel ANV profiles (8 to 32: multiple 32, varying), lavapipe and gate-lavapipe-x86_64 (8: multiple 8) and gate-lavapipe (4: multiple 4). Not on NVIDIA (32), RDNA (32 to 64), moltenvk-m3 (its kernel stage takes no size, so it runs the API's 32 alone) or runtime-floor (no quad class). Measured on the Iris Xe (RPL-P, ANV), job m3-max-71702, the lane-only form of this change (E: the base at eda92e1207, Q: this form, E2: the base again; cold plays of the consumer's recording to frame 345): the regression row's kernel took Q in all 21 of its constant sets (15832 dispatches, 100%); per dispatch E 1.6018 ms, Q 0.7314 ms, E2 1.6006 ms (Q/E 45.7%); values E/Q and E/E2 0 differing of 261 buffers; translation 18 s and 0.92 GiB peak against 17 s and 0.92 GiB. The driver's executable statistics (job m3-max-71726): Q compiles at SIMD8 (SIMD16 for one state), 15 to 50% fewer instructions than the emulated form, against about 2800 spills a state when pinned to 32. SEMANTICS_VERSION 2297 (modules change on the profiles above); ARTIFACT_FORMAT_VERSION 595 (SubgroupRequirement gains `varying`). Tests: device::tests::subgroup (the predicate over size ranges, the guard, and the committed profiles it takes), engine_simd (a quad-only kernel's requirement on every committed profile, and the flattened kernels' constraint), engine_quad_ops (the quad fixture's kernels in the Direct tier at 8 on lavapipe and at 8, 16 and 32 on an Intel profile; the emulated variant on lavapipe), engine_dispatch (derivatives beside a quad keep lavapipe's emulated tier), and the runtime's every_device_runs_a_quad_only_kernel_at_the_size_it_gives under a device cfg. |
||
|
|
c54fa438a2 |
Player: a dump holds each texture a listed command buffer's compute encoders bind
--dump-command-buffers wrote every buffer a listed command buffer's encoders named and every colour attachment its render passes stored, so a texture a compute pass wrote showed only through a later pass that sampled it. A play that parts between two drivers in a render pass that samples a compute pass's textures could not say which of the two passes parted first. dumps::Stores now keeps the compute encoders made and not yet ended, and each texture such an encoder binds (setTexture:atIndex: and setTextures:withRange:, a nil one left out) is a part to dump: its first level and slice, read once the command buffer completed, as an attachment's parts are, into cbC-objT.bin with the cover "-". A texture both stored and bound holds each part once, in Part order. An argument encoder's setTexture:atIndex: is none: its receiver is no compute encoder. docs/REPLAY-STREAM.md and the module docs say what a dump holds. Test: a_listed_command_buffer_dumps_the_textures_its_compute_encoders_bind (one bound texture, a range with a nil, a texture bound twice, a render encoder's fragment texture and an unlisted command buffer's compute texture left out). Verified: clippy -D warnings over the workspace with all features, and the validation suite, the new test among them (job in the land line). |