development
10492
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8fd7fb5d9c |
Merge pull request #3 from liuyaxuan123457-ctrl/fix/host-batch-queue-recording
Allow host-owned copy batches to record before FIFO submission |
||
|
|
b8f9629ba8 |
Merge pull request #5 from yxc0915/steelbrain/batch-fixed-offset-draws
Batch fixed-offset draws with direct Vulkan commands |
||
|
|
1dd4e970c0 |
🐎 Batch fixed-offset draws with direct Vulkan commands
Reuse the ordinary draw state across a fixed binding without submitting indirect commands. RX 6500M timing showed the indirect command path still took 0.909 ms against 0.351 ms for the same direct workload, even with the ordinary shader. |
||
|
|
acb2f3756b |
🐎 Keep fixed-offset multi-draw on the ordinary pipeline
Combine repeated vertex bindings without uploading a draw table or switching the shader. Preserve the table path for changing offsets, and exclude modules that can observe DrawIndex. Add a pixel parity and pipeline reuse regression test. |
||
|
|
8edd5cd27a |
Merge pull request #4 from yxc0915/steelbrain/sync-metal2vulkan-865592b
Merge the upstream Vulkan runtime into development |
||
|
|
7b3aedb5fa |
Sync upstream metal2vulkan for the Reims runtime
Preserve GPU suspend and replay, Places allocation isolation, and multi-draw indirect. Use the upstream render-offset deltas, static attachment feedback, and 64-bit device-address arithmetic. |
||
|
|
865592b96b | Merge pull request #27 from celebratedfox9185/metal2vulkan-upstream-b | ||
|
|
de89bc41f2 | Merge pull request #26 from celebratedfox9185/metal2vulkan-upstream | ||
|
|
d70e728f4c |
Pin W bless: the golden cells and the census differences by the commit that moved them
The bless commit |
||
|
|
b4d134337b |
Pin W bless: golden hashes, engine inventory and the authored compile census at 458b5420d2
Re-blessed on the Apple M3 Max at
|
||
|
|
458b5420d2 |
Conformance probe: the viewport depth range's values row, Clamp mode, Depth16Unorm and the depth test
The probe takes a table of cases: each a range, a depth attachment (none, Depth32Float or Depth16Unorm), a fragment (plain, or one that writes [[depth(any)]] = [[position]].z), a depth clip mode, five quads' clip z, a clear depth and a compare function. Each column prints whether a fragment landed, the position.z and .w it read, and the stored depth. Recorded on the Apple M3 Max, macOS 27.0.1 (job m3-max-85617), plain and under API validation, byte for byte alike, in the probe's header: - Clip mode: position.z is never clamped; clip space's 0 <= z <= w holds whatever the range; Depth32Float, Depth16Unorm and a [[depth]] output store the z clamped to [0, 1]; the depth test compares that clamped value on both sides of 0 and of 1. - Clamp mode: no z clip; position.z is never clamped; the stored depth is clamped to the range's part in [0, 1] ([0.5, 2] stores 0.5 to 1). |
||
|
|
1d6054b189 |
Runtime: a viewport depth range past [0, 1] draws where nothing reads the depth
Metal and its API validation take a viewport whose znear and zfar lie past [0, 1] (OpenGL's [-1, 1]). The M3 Max (macOS 27.0.1, job m3-max-85541, the probe in the commit before) reads [[position]].z = znear + z * (zfar - znear) unclamped and stores that, and a [[depth]] output, clamped to [0, 1]. The runtime refused such a viewport at set_viewport wherever it covered a pixel, because VkViewport takes depths in [0, 1] alone without VK_EXT_depth_range_unrestricted, which the runtime does not enable. The cause is the depth range alone: clipping is in clip space on both APIs, so the range shows only where something reads the window z. That is a depth attachment, or a fragment function that reads [[position]]'s z or w. The fix takes the range everywhere else: - set_viewport and set_viewports keep the range; vk_viewport records it cut to [0, 1]. - Whether a range is past [0, 1] is found once, when the viewports are set (viewports_set). - Whether draws are refused is found when the viewports or the pipeline state are set (draws_refused, into the encoder's `refused` field). AttachmentFormats comes first, then Viewport where the pass has a depth attachment or the state's fragment function may read [[position]] z or w. - A draw reads that one Option<DrawKind> where it read the renders_into bool, so the usual path adds no per-draw instruction. The other draws under such a range are refused there (Gap::Draw, DrawKind::Viewport), not at the set. - metal2vulkan: CompiledFunction::reads_position_depth (the stage's position_depth with its FragCoord builtin), public, with its row in api_signatures.tsv. No encoding change. - metal2vulkan-runtime: RenderCompiled::reads_position_depth. DrawKind::Viewport's doc, set_viewport's, depth_stencil's note and the runtime README (the viewport paragraph, a known-gap paragraph for the range, and the Gap::Draw list) say what is taken and what is refused. docs/REFUSALS.md regenerated: no change (the refusal's sites are the same two functions). RUNTIME_VERSION 2571 (renumbered at landing): a run that refused at set_viewport now draws or refuses at the draw. The runtime-sources pin does not move (no listed input changed). Verified: see the READY's job lines (red at the commit before, this commit green, clippy in three configurations, rustdoc, the runtime suite on lavapipe). |
||
|
|
379d2414df |
Conformance probe: what Metal does with a viewport depth range past [0, 1]
A probe of setViewport: with znear -1, zfar 1 beside the control [0, 1]: five quads at clip z 0 to 1 into an RGBA32Float target, with and without a Depth32Float attachment, through a plain fragment and one that writes [[depth(any)]] = [[position]].z. Each prints the position.z and .w the fragment read and the depth the attachment stored, plain and under Metal's API validation layer. Recorded on the Apple M3 Max, macOS 27.0.1 (job m3-max-85541), in the probe's header: Metal and its validation take the range; position.z is znear + z * (zfar - znear) unclamped; the stored depth and a [[depth]] output are clamped to [0, 1]. |
||
|
|
948f47bfff |
Runtime tests: a viewport depth range past [0, 1] draws where nothing reads the depth (red)
Metal takes a viewport whose znear and zfar lie past [0, 1] (OpenGL's [-1, 1]); its API validation takes it too. The runtime refuses it at set_viewport wherever it covers a pixel (Gap::Draw, DrawKind::Viewport). The new device test sets [-1, 1] over the whole target and expects: - set_viewport and set_viewports take it; - a draw whose pass has no depth attachment and whose fragment function reads no [[position]] z or w draws, as Metal draws it (clipping is in clip space, so the range shows nowhere); - a draw whose fragment function reads [[position]].z is refused at the draw, alone or with the range as the second of two viewports, and draws once the range is in [0, 1]; - a draw into a Depth32Float attachment is refused at the draw, and draws once the range is in [0, 1]; - the refusal follows the state set: from the reading function to the plain one and back. Red here: set_viewport refuses the range. The fix follows. |
||
|
|
e9e52050d0 |
Runtime and translator: a compute encoder binds a buffer with its attribute stride, and a dynamic stage-in layout fetches at it
What:
- ComputeCommandEncoder gains three methods:
set_buffer_with_attribute_stride (setBuffer:offset:attributeStride:atIndex:;
setBuffers:offsets:attributeStrides:withRange: is a loop of it, as every
other range call of the runtime is), set_buffer_offset_with_attribute_stride
(setBufferOffset:attributeStride:atIndex:) and
set_bytes_with_attribute_stride (setBytes:length:attributeStride:atIndex:).
- Each buffer slot's binding (Slot::Buffer, Slot::Bytes) keeps the stride's
low 32 bits, so MTLAttributeStrideStatic is 2^32 - 1. A new
FieldValue::StageInStride(slot) pushes it. It is mapped from the
translator's PushField::StageInStride, and the interface accepts
RuntimeFact::StageInStride.
- set_buffer, set_buffer_offset and set_bytes bind a stride of 0, which
clears an earlier one. That includes set_buffer of the buffer and offset
the slot already holds, which used to return early.
- Translator: the identity domains accept PushField::StageInStride
(lower/select.rs), as they accept the vertex analogue
PushField::VertexBufferStride. Before, a dynamic layout was their typed
refusal, EncoderValue "StageInStride(1)". The translator test
a_fixed_layout_records_no_stride_and_a_dynamic_one_records_its_own now
makes the pipeline, which records RuntimeFact::StageInStride of layouts 1
and 2 and none for layout 3, the constant step.
- Deleted: StageInKind::DynamicStride, unbuilt_stage_in and its call at
state creation. Gap::StageIn now names only IndirectRegion.
- Conformance:
- The runtime side plays the four attributeStride steps and
setStageInRegion:.
- The four DynamicStride ledger rows of attribute-stride-buffer,
-buffer-offset, -inline-bytes and -plural-buffers are replaced by each
case's dispatchType row (case/outcome/dispatch_type, the consumer's own),
which every compute-pass case carries.
- CONFORMANCE-COVERAGE.md is regenerated.
- Regenerated:
- REFUSALS.md and error/basis.rs;
- METAL-COVERAGE.md and coverage.tsv (the four setters are implemented);
- api_signatures.tsv (three methods added, one variant removed).
- Docs:
- The runtime README's compute section and its known gaps.
- Validation's ToolingRequirement::DynamicStageInStride doc: the runtime
builds the layout, and the engine's candidate does not yet bind with the
stride form. Its classification is unchanged.
- Versions, renumbered at landing: RUNTIME_VERSION 2570 and
SEMANTICS_VERSION 2370, because the
translator's refusal becomes a pipeline. runtime-sources.sha256 does not
move: lower/select.rs, cache/mod.rs and the runtime crate are not among
its inputs.
Why: the planner ruled DynamicStride BUILD. The translator already lowered
the fetch at PushField::StageInStride. The runtime refused the state because
its compute encoder had no attributeStride setter and no field that pushed
the stride, and the identity domains refused that encoder value.
What a plain bind reads: Metal documents no answer for a plain bind of a
slot that a dynamic layout reads, and the debug layer answers differently.
Probe dynamic_stride_plain_binds.m, job m3-max-85456 (Apple M3 Max, macOS
27.0.1), read stride 0 for every plain bind, alone and after a stride bind
(setBuffer:offset:atIndex:, setBufferOffset:atIndex:,
setBytes:length:atIndex:). Its stride-8 control read stride 8. The planner
ruled to build that answer without pinning it against Metal: there is no
conformance row for it. The setter's doc says Metal documents no answer, and
the runtime device test below holds the runtime's own behaviour.
Consumer search (git grep -n -w DynamicStride in the consumer's checkout at
a34e93e4fa): 8 hits.
- Code that will no longer compile:
- rt_platform/diag.rs:3077 and :3085 name rt::StageInKind::DynamicStride
in a test.
- Tests that will fail:
- rt_platform/compute.rs:1394 expects the dynamic-stride state to be
refused (StageIn-DynamicStride).
- Docs and comments:
- rt_platform/compute.rs:18 and :1246.
- rt_platform/diag.rs:7 and :3081.
- docs/accuracy-ledger.md:129.
Per compute.rs:14, the consumer binds the attributeStride selectors as the
calls without them. It can now call these setters.
Tests: every_device_fetches_a_dynamic_stride_layout_at_the_stride_each_bind_gives
makes ten binds and dispatches:
- strides 40 and 80, 2^32 + 40 (reads at 40), and MTLAttributeStrideStatic
(thread 0's element, then zeros);
- set_buffer of the same buffer and offset after a stride bind (stride 0);
- set_buffer_offset after a stride bind (stride 0, one element on);
- set_buffer_offset_with_attribute_stride;
- set_bytes_with_attribute_stride;
- set_bytes after a bytes stride bind, and after a buffer stride bind
(stride 0).
Verified, at this tree (2f654e598c before the fold):
- Device tests, filtered test(stage_in) | test(dynamic_stride), 8 tests
each, every one passed; each card printed the dynamic-stride test's line:
- lavapipe, job m3-max-85611 (998 skipped);
- RX 7900 XTX (RADV, Mesa 26.2.6), job m3-max-85587, --cfg m2v_gpu;
- RTX 3090 (NVIDIA 620.70.06), job m3-max-85588, --cfg m2v_gpu;
- Iris Xe (ANV, Mesa 26.2.6), job m3-max-85601, --cfg m2v_gpu.
- Conformance replay of attribute-stride-buffer, -buffer-offset,
-inline-bytes and -plural-buffers on the same four devices, same jobs:
EXIT=0. Each case's one refusal is its dispatchType ledger row, with no
divergence, so every stride slot read the words the M3 recorded,
MTLAttributeStrideStatic and the 2^32-truncated strides included.
- Suites, job m3-max-85586:
- product: 3471 passed, 4 failed, 24 skipped. One failure is
golden_hashes_match_the_table (the SEMANTICS placeholder; golden tables
are re-blessed on development). The other three are the fixture tables
inventory_lists_every_fixture_in_order,
engine_fixtures_match_their_golden_printout and llvm_as::part_5_of_8.
All three fail on engine/dvw_depth_views, which development's
|
||
|
|
c41b6649d7 |
Runtime tests: a thread-position stage-in layout of a dynamic stride makes its state (red)
What: every_device_refuses_each_unbuilt_stage_in_form_by_its_kind no longer expects Gap::StageIn of DynamicStride for a [[stage_in]] attribute the kernel reads through a thread-position layout of MTLBufferLayoutStrideDynamic. That descriptor joins the constant step and the unread attribute in the list of descriptors whose state is made. The indirect stage-in region (IndirectRegion) stays refused at its call. Why: the planner ruled DynamicStride BUILD. The translator already fetches such a layout at the stride the binder pushes (PushField::StageInStride, RuntimeFact::StageInStride). The runtime refuses it at creation only because the compute encoder has no attributeStride setter and no field that pushes the stride. This commit is the red half; the fix adds the setters and the field. Verified: on lavapipe (llvmpipe, Mesa 26.2.4, LLVM 23.1.1), job m3-max-85611, this tree fails every_device_refuses_each_unbuilt_stage_in_form_by_its_kind with "a thread-position step of a dynamic layout: a kernel's stage input of a form not built yet: DynamicStride" (filtered test(stage_in) | test(dynamic_stride): 7 tests run, 6 passed, 1 failed, 998 skipped); with the fix it passes. |
||
|
|
9b7f8f983f |
Conformance probe: what a dynamic-stride stage-in reads when its buffer is bound without a stride
A kernel reads one uint [[stage_in]] attribute through a thread-position layout of MTLBufferLayoutStrideDynamic. Six rows bind its buffer: - plain setBuffer:offset:atIndex: alone; - setBuffer:offset:attributeStride:8 alone, the control; - the stride bind followed by a plain setBuffer, by a plain setBufferOffset, or by a plain setBytes; - plain setBytes alone. Each row prints the eight words its threads read and the stride those words imply. Metal's headers name the stride setters as the ones to call for such a layout and say nothing of what a plain bind reads, so the runtime's binding of a plain setter's stride follows this reading. Verified: the M3 oracle job that reads it follows. Here, xcrun clang -fsyntax-only only. |
||
|
|
34b4888fcf |
Translator: a pointer cell stores a constant getelementptr into a blob global as its blob offset
cell::constant, the form of a constant pointer stored into a pointer cell, took a blob global's address through blob::blob_ptr but matched Const::GlobalAddr alone. So it refused a constant getelementptr or cast of the global (ConstantOperand), which blob_ptr takes since the commit before last. It now matches Const::Expr too and stores the offset blob_ptr gives. a_stored_constant_getelementptr_into_a_blob_global_is_its_blob_offset passes with this commit. The SEMANTICS_VERSION placeholder of this series covers it. |
||
|
|
2850eda8f4 |
Translator tests: a constant getelementptr into a blob global stored in a pointer cell (red)
A slot is written with a constant getelementptr into the constant table @k on odd threads and with @k's address on even ones, then read back and indexed. @k is stored, so it is placed in the blob, and the slot holds a blob offset either way. Run on every committed profile, each thread reads its table word. This fails here: the cell's constant form (cell::constant) takes a blob global's address but refuses a constant getelementptr of one (ConstantOperand), the same defect as blob_ptr's before the previous commit. |
||
|
|
4aa0fe9388 |
Translator: a constant getelementptr into a blob global is its blob offset and displacement
blob_ptr is the operand form every blob strategy takes for a pointer: a getelementptr's base, a copy's source, a select's arms, a load's pointer, a memcpy endpoint, a pointer compare and a fat-pointer select's blob side. It took a blob global's address as the global's blob offset, but it refused a constant getelementptr or same-space cast of one (ConstantOperand). The arena family's local_ptr already takes those at their exact displacement from the memory plan. blob_ptr now does the same: the constant's addressed global (local::addressed_global, now visible to the access family) gives the blob offset, and the plan's exact offset of the constant is added. Like a getelementptr's constant, the sum wraps modulo 2^32, and a load through it is contained. This is the same defect as the select's: a blob global's address as an operand was not taken in the blob's operand form. a_constant_getelementptr_into_a_blob_global_is_its_blob_offset_and_ displacement (a select arm and a getelementptr base) passes with this commit. The SEMANTICS_VERSION placeholder of the previous commit covers it. |
||
|
|
b4f3ef18de |
Translator: a select of two blob pointers takes a constant arm as its blob offset
BlobStrategy::Select read its arms through operand(), which refuses any constant other than null. So a select between two constant globals' addresses was refused (ConstantOperand), even though both arms are blob addresses. The arms are now LocalPtrs taken through blob_ptr at selection and emitted through ptr_value, the same way the Gep base, the Copy source and the Load pointer already take theirs. A global's address is now its blob offset. That was the cause: the strategy did not take its pointer operands through the blob's operand form. This commit checks every other site that can take a blob global's address as an operand: - getelementptr base, bitcast/addrspacecast/freeze source, load pointer: blob_ptr (handled). - a fat-pointer select's blob side (access::select_side): blob_ptr (handled). - a memcpy endpoint (copy.rs) and a pointer stored as a value (cell.rs, which matches Const::GlobalAddr itself): blob_ptr (handled). - icmp of two blob pointers (pointer::compare): blob_ptr (handled). A blob pointer against null or a fat pointer is refused (PointerCompare), typed. - a store through a blob pointer: refused (ReadOnlyStore), typed. The blob is constant. - ptrtoint of a blob pointer: not the static form, so it goes to the dynamic family, as before. - a pointer phi with a constant incoming value: refused (ConstantOperand), typed and documented, as for the arena families (blob::lowered_pointer). - blob_ptr itself refuses a constant getelementptr or cast of a blob global, which the next commit takes. SEMANTICS_VERSION 2369 (renumbered at landing): a module refused before now compiles. a_select_of_blob_globals_selects_their_blob_offsets passes with this commit; a_constant_getelementptr_into_a_blob_global_is_its_blob_offset_and_displacement still fails here and passes with the next. |
||
|
|
cf5c952c6d |
Translator tests: a select of blob globals' addresses, and a constant getelementptr into one (red)
Two kernels read two constant globals, @a and @b. A select between their addresses merges them, so both are placed in the constant blob. The first test selects between the two globals' addresses. The second takes a constant getelementptr into one global, once as a select's arm and once as a dynamic getelementptr's base. Each test checks the census for the blob pointer select, then runs on every committed profile and checks every thread's two words on both runs. Both fail here: BlobStrategy::Select reads its arms as plain operands, which refuse a constant (ConstantOperand). blob_ptr takes a global's address as its blob offset but refuses a constant getelementptr or cast of it, while the arena family's local_ptr takes one at its exact displacement. |
||
|
|
03b5cff006 |
Runtime README: KosmicKrisp's answer for a texture over host memory with render-target usage
A texture over a buffer in host memory's import, on an integrated or CPU device, lies in place where the device's external image query for host memory's handle answers a linear image of the texture's format, usage and flags; otherwise it is the counted copy at each use. On the Apple M3 Max (KosmicKrisp, Mesa 26.3.1), the textures with render-target usage in a consumer's walk were the copy. The known gap of memory blocks said why in one clause (the Mac driver makes no linear colour attachment with or without a handle); it now names the query's answer and the shapes it was asked for, and says the copy is chosen by that query alone. The ruling: the copy is the device's form under rule 2 (a missing feature of the driver, not a bug), with no code change. The answer, asked of KosmicKrisp with the runtime's own parameters for each of the four kinds of texture with render-target usage the walk made over host memory (R8Unorm 1920 by 1080 and RG8Unorm 960 by 540, ShaderRead and RenderTarget; RGBA8Unorm at 18, 24, 36 and 48 pixels, ShaderRead, ShaderWrite and RenderTarget; RGBA16Float at 16 to 1024 pixels, ShaderRead and RenderTarget): vkGetPhysicalDeviceImageFormatProperties2 for linear tiling, usage transfer source and destination, sampled and colour attachment (and storage for the written one), mutable format with the sRGB sibling's format list where the format has one, and VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT answers VK_ERROR_FORMAT_NOT_SUPPORTED for each, and so it does without the handle and without the format list. Without colour-attachment usage (transfer source and destination and sampled), it answers each format importable, compatible (0x180), not dedicated-only, up to 16384 by 16384 and one layer; dropping sampled instead leaves it refused. The README's prose carries no lab job id (scripts/api-docs refuses one), so the job is cited here alone. runtime-sources.sha256 does not move: the README is not among its inputs. Verified: - m3-max-85644, the Apple M3 Max (KosmicKrisp, Mesa 26.3.1, Vulkan 1.4.363, an integrated device with VK_EXT_external_memory_host): a query program (no test) asked the answers above. - On the CPU with no device, at this commit: scripts/api-docs's prose check (its job-id grep over the runtime README, API.md, REPLAY-STREAM.md and VALIDATION.md) finds nothing; the runtime-sources hash computed from the validation build's input list equals the pinned one; the README's readers in the tests (its Floor section, its Enabled, not stated table, and its section of what the consumer implements) read sections this change does not touch. |
||
|
|
9d841ca7d4 |
Runtime: OPTIONAL_EXTENSIONS' doc links no private item
The public doc of OPTIONAL_EXTENSIONS linked the private EXTENDED_DYNAMIC_STATE, which rustdoc refuses under -D warnings (job m3-max-85463: STEP doc and privdoc_metal2vulkan-runtime EXIT=101; signatures and clippy in three configurations EXIT=0). The sentence now says what the extension adds in words. |
||
|
|
e9c39b1507 |
Runtime: VK_EXT_extended_dynamic_state enabled where listed, its feature where reported
Device creation enables VK_EXT_extended_dynamic_state where the device lists it, and extendedDynamicState where the device also reports it, and the translator's description states each that is enabled. This is a form that is right on every device, taken unconditionally: no vendor, driver or version is read, and nothing else changes. The runtime takes no state through it, because every render pipeline's dynamic state is Vulkan 1.3's. At Vulkan 1.3 the translator already counts extendedDynamicState as present, so no translation answer moves. The profile fingerprint does move on a device that lists the extension, since the description's enabled set is part of the profile: one cold compile per such device. The cause is in the driver. RADV in Mesa 26.3.1 (released 2026-11-18; 26.3.2 is not out, so no 26.3.x release has a fix) creates device->ps_epilogs only when graphicsPipelineLibrary, shaderObject, extendedDynamicState or one of five extendedDynamicState3 features is enabled (radv_device.c:1706-1715). A pipeline whose depth or stencil test enable is dynamic, and whose pass may have a depth or stencil attachment, marks a fragment shader's depth or stencil output as needing an epilog (radv_pipeline_graphics.c:1604-1611 and 1784-1789; radv_shader_info.c:882-888). At the draw, radv_before_draw goes through radv_emit_all_graphics_states and radv_bind_ps_epilog (radv_cmd_buffer.c:14148-14149) to lookup_ps_epilog and radv_shader_part_cache_get (radv_cmd_buffer.c:6832). That calls cache->ops->hash with ops still null (radv_shader.c:3312). Every render VkPipeline of the runtime takes DEPTH_TEST_ENABLE and STENCIL_TEST_ENABLE as dynamic state, so on that driver a fragment function writing [[depth]] or [[stencil]] into a pass with such an attachment faults at its first draw. Every RADV epilog goes through that one cache: colour outputs, depth, stencil, the sample mask and an unknown alpha-to-coverage (radv_shader_info.c:882-888). So enabling the feature covers all of them. The other shader-part cache, vs_prologs, is created only with vertexInputDynamicState, graphics pipeline libraries or shader objects (radv_device.c:1700-1705). It is reached only by a dynamic vertex input or a vertex stage without vertex input state (radv_pipeline_graphics.c:1637-1646), and the runtime makes neither. Mesa 26.2.6's RADV, the lab's, creates its epilog cache without the feature terms, and its epilogs serve colour outputs alone (radv_device.c:1679-1684, radv_shader_info.c:850), so it never takes this path. This was read in the release's source, not reproduced in the lab: no lab node carries RADV from Mesa 26.3.1. The README has the extension row and an "Extended dynamic state" section with its feature table, which the README test holds to EXTENDED_DYNAMIC_STATE. Under a device cfg, the every-device floor test prints whether each card was created with the extension and its feature. The signatures table takes OPTIONAL_EXTENSIONS' new entry. |
||
|
|
0a2519180f |
Runtime tests: a device that lists VK_EXT_extended_dynamic_state is given it, red
The floor reads VkPhysicalDeviceExtendedDynamicStateFeaturesEXT where the device lists VK_EXT_extended_dynamic_state, and device creation chains it where the extension is enabled; nothing enables either yet. The new floor test asks for the four combinations of listed and reported: the extension where listed, extendedDynamicState where also reported, and the translator told of each that is enabled. It fails here at "listed and reported", which the next commit makes pass. RADV in Mesa 26.3.1 creates its fragment-epilog cache only on a device that enables extendedDynamicState, graphics pipeline libraries, shader objects or one of five extended dynamic state 3 features (radv_device.c:1706-1715 in the release). Every render VkPipeline of the runtime takes Vulkan 1.3's dynamic depth and stencil test enables, under which RADV 26.3.1 draws a fragment function's depth or stencil output through such an epilog. With the cache missing, the draw's epilog lookup calls through a null pointer (radv_shader.c:3312). This was read in the release's source, not reproduced in the lab: the lab's RADV is Mesa 26.2.6, whose epilogs cover colour outputs alone. The signatures table takes the new public field of floor::Features. |
||
|
|
7c65d9875e |
Translator tests: the per-thread count's doc sits on its static
The doc comment above the thread_local! macro was an unused doc comment, which clippy refuses under -D warnings in every configuration (lint job m3-max-85529). It moves inside the macro, onto the static it describes. The runtime-sources pin moves with the file. |
||
|
|
c20024991d |
Translator tests: the profile fingerprint count is per thread
a_run_of_compiles_derives_no_profile_fingerprint reads a count of profile fingerprint derivations. The count was process-wide, so when cargo test ran another test as a thread of the same process and that test made a device between the two readings, this test failed. The count is now thread-local. The device's making and the compiles the test counts run on the test's own thread: compile_stage spawns no thread, and the translator's one scoped thread only hashes a large metallib's bytes. So the count still sees every derivation the test asks about. The change is in a cfg(test) item of device/profile.rs, so no run behaves differently. runtime-sources.sha256 takes the file's new hash. It was computed with the build's hashing over the working tree, which reproduced development's pin before the edit. |
||
|
|
0801320a59 |
Translator tests: a device made on another thread moves this thread's fingerprint count by nothing (red)
a_run_of_compiles_derives_no_profile_fingerprint reads a count of profile fingerprint derivations before and after a device's making and its compiles. The count is process-wide, so under a harness that runs tests as threads of one process (cargo test), a device another test makes between the two readings fails it. The new test makes a device on a spawned thread and asks that this thread's count not move, then makes one here and asks it to move by one. It fails here, where the count is the process's; the next commit makes it the thread's. |
||
|
|
2ec06b93e1 |
Translator: the sparse path goes
The translator kept a second form for a function that observes a texture's residency: a slot's
sparse arm (OpImageSparse* and OpImageSparseTexelsResident under shaderResourceResidency) or its
tile map (a storage buffer of tile bits the consumer would mirror from each mapping), selected by
SpecKey::SparseTexture from the bound texture's MTLTexture.isSparse, with Metal's measured
footprint rule for a sample or gather, writes dropped under the same constant, and
PrecisionNote::SparseResidency where the device answered. With the observed residency now the
constant resident word, nothing builds either form, and nothing can need one: the runtime has no
sparse heap or sparse texture API, and the consumer tells no guest it has sparse textures (every
Apple family's supportsFamily NO, sparseTileSizeInBytes 0, isSparse NO; a sparse heap refused at
newHeapWithDescriptor:). So the path is deleted (rule 4).
Public items deleted, each searched for in the consumer's checkout at 76e6c90369 (0 hits for every
name):
- RuntimeFact::SparseTexture { slot, sparse_arm, tile_map } and its mechanism; the 12-03 cleanup
ruling that kept it in the produced-then-refused group is reversed for it alone;
- SpecKey::SparseTexture;
- ResourceKind::TileMap and BindingSource::TileMap, with pipeline::tile_map, the map's format;
- PrecisionNote::SparseResidency (metal2vulkan-degrade-sparse-residency), with its API.md
catalogue entry, the conformance Degradation and validation's C3 deferred near-equivalent;
- error::Feature::SparseTexture, which nothing constructed;
- bind::TextureFacts::sparse and TextureShape::Texture's sparse, which no binder set.
Crate-internal, gone with them: the texture family's residency use flags, sparse_arm, tile_map and
sparse_writes on a slot plan, their spec constants and tile-map views, resident_access, the tile
decoding (TileLevel), the read's sparse and tile-map arms, the census's ".resident" suffix and
RESIDENCY_WORDS; the sampler's residency and footprint fields and lower::sampler::footprint (Metal's
measured footprint rule, read only to answer from a tile map), the sparse arm in sample, gather and
pixel fetch emission, and lower::texture::residency (every caller sits behind the texture family's
own refusal of a word with another bit observed). The SPIR-V layer loses what only those built:
the builder's sparse_sample, sparse_fetch, sparse_gather, sparse_dref_gather, sparse_read and
texels_resident, the sparse flag of SampleForm and of the fetch, gather and read instructions,
Inst::ImageSparseTexelsResident, its serialization, requirement (SparseResidency, and with it
shaderResourceResidency) and the interpreter's unmapped texels. VkFeature::ShaderResourceResidency
stays: profiles and the device queries name it.
Nothing compiled changes: no module held a sparse instruction or the constant since the previous
commit, so SEMANTICS_VERSION stays. ARTIFACT_FORMAT_VERSION 608 -> 609 (renumbered at landing):
the codec's ResourceKind, SpecKey, RuntimeFact, PrecisionNote and BindingSource lose variants,
which moves later tags. runtime-sources.sha256 moves for bind/state.rs, bind/heap.rs and the
deleted pipeline/tile_map.rs; no run of an unchanged artifact changes. docs/REFUSALS.md, the
runtime's error/basis.rs and tests/api_signatures.tsv are regenerated.
Tests deleted with what they tested: the serializer's sparse sweep, the builder's sparse read
under texel operands, the mechanism table's three SparseTexture rows (the variant indices close
up), C3's SparseResidency deferral (the deferred-row tests now use CubeGradientFootprint).
Verified, on the CPU with no device:
- m3-max-85203, at this change on
|
||
|
|
619e977d63 |
Translator: a texture's observed residency is the constant resident word
A sparse_sample, sparse_gather or sparse_read (and a sparse block read) whose function observes
bit 0 of its status word (sparse_color::resident()) was refused under the identity domains:
the observed residency made the slot's RuntimeFact::SparseTexture, a texture state the identity
domains do not source (Unsupported{IdentityDomains; NotImplemented}, IdentityCause::TextureState).
The golden table and the engine inventory held the refusal for engine/a2_sparse_status, and the
runtime's README listed it as a known gap.
Metal's answer over a texture that is not sparse, measured with this kernel plain and under
Metal's validation layer (which reported nothing): every residency resident on the Apple M3 Max
(macOS 27.0.1) and on the AMD Radeon Pro 5300M (macOS 26.7.1), not resident on the Intel UHD
Graphics 630 of the same MacBook (macOS 26.7.1), with the same colours on all three. Both answers
are Metal's. The runtime makes no sparse texture: it has no sparse heap or sparse texture API, and
the consumer tells no guest it has sparse textures (every Apple family's supportsFamily NO,
sparseTileSizeInBytes 0, isSparse NO, and a sparse heap refused at newHeapWithDescriptor:).
So the word is the M3 Max's and the 5300M's answer, a constant: an observed residency is 0,
resident, of a slot and a heap element alike, with no query, no precision note and no second
form. lower::texture::residency answers false wherever the word's other bits are not observed (a
word with another bit observed stays refused), so no access marks its slot's residency and no
slot states a SparseTexture fact. The extended-range sample, which refused an observed residency,
takes the constant word too.
Tests:
- engine_identity's a_sparse_access_of_a_texture_slot_is_resident compiles a2_sparse_status on
every identity profile and moltenvk-m3 without robustImageAccess2: L3 passes, the interface
states no specialization constant but the dispatch's, the plan no SparseTexture fact, and the
module holds no OpImageSparse* instruction.
- engine_texture_oob's block_reads_read_their_texels_as_reads_do runs br_sparse (a sparse block
read storing 2.0 where resident) on every profile and class, where it asserted the refusal:
its alpha lane reads 2.0 at every point, inside the texture and outside.
- The conformance case sparse-status-plain (cases/sparse_status.rs, the a2_sparse_status kernel
over two 4x4 RGBA32Float textures, 16 threads) records the M3 Max's colours and residencies,
and Metal's times; its module docs state all three Macs' answers.
Docs: the runtime README's known gap for this residency goes, with the sparse residency in the
list of texture state the identity domains do not source; API.md's texture paragraph says an
observed residency reads resident, with the Macs' answers, and PixelSamplerScaling's entry (here
and on PrecisionNote) loses its observed-residency case.
Engine inventory (public_fixture_expectations_engine.tsv): 147 .ll cells move from
Unsupported{IdentityDomains; NotImplemented} to ok, every profile's of a2_sparse_status,
kernel_block_read's br_sparse, sps2_residency_probes, spse_address_probes, spse_array_probes,
spse_level_probes and spse_volume_probes (15 each), and every profile's but runtime-floor's of
spse_write_probes, spse_write_barrier and a27_spse_write_barrier (14 each; runtime-floor's stays
Unsupported{IdentityDomains; NotImplemented}). Their .air.ll twins, which only macOS assembles,
move at the M3 bless.
SEMANTICS_VERSION 2367 -> 2368 (renumbered at landing): the residency-observing fixtures' golden
cells change from the refusal to modules. The golden table is blessed at the next pin.
Verified:
- m3-max-85059, on the CPU with no device, at this change on an earlier development
(004f68b48f; rebased since onto
|
||
|
|
5b68f2d05b |
Translator: an argument buffer's sampler's estimate and docs drop the cubic test it no longer emits
Since the resident core's deletion ( |
||
|
|
5e3d867358 |
Runtime tests: a partial-threadgroups cause without a cache marker fails the test
The runtime keeps each refusal of a kernel's partial-threadgroups variant under a marker of its cause in the cache directory (cache::REFUSALS), and refusal_marker answers the plain refused marker for a structure the table does not hold, which reads back as VariantRefusal::Translator: the cause is lost. The translator's PartialThreadgroupsCause is non_exhaustive, so no match in the runtime can name every cause, and a_variant_refusal_keeps_the_translator_s_cause listed the four structures by hand: a cause the translator adds without a marker passed it. The test now reads the enum's variants from the translator's source (error/mod.rs), as translator_fields reads the linked state's fields, and requires each to be kept under exactly one marker, the vote word's or its structure's, and the table's structures to be those causes but the vote word. Its other checks are unchanged, over the table's structures. Verified (m3-max-85468, on the CPU with no device): - green: the test passes at this commit (1 run, 1 passed); - red: with a sixth cause added to the translator's PartialThreadgroupsCause and no marker, it fails at that cause (kept under no marker: left 0, right 1); - the hole: development's hand-listed test with the same sixth cause passes; - fmt and clippy (plain, --cfg m2v_gpu, --cfg m2v_cpu_icd) pass. |
||
|
|
3758e468a7 |
Runtime: TextureCopyMismatch rests on Apple's documented rule, with the Macs' measured answers
Refusal::TextureCopyMismatch (BlitCommandEncoder::copy_from_texture between textures of two pixel
formats or two sample counts) stated a metal-measured basis: the probe blit_copy_format_pairs.m on
the M3 Max under Metal's validation layer alone, which stops every pair of two formats. A
consumer's probe on a MacBook's Radeon Pro 5300M (macOS 26.7.1) had Metal take ten pairs of one
texel size and copy their bytes, plainly and under the validation layer, so the basis was re-read
and measured on all three Macs.
Apple's page for the region copy says of the destination texture: "The pixel format is the same as
`sourceTexture`. The sample count is the same as `sourceTexture`." Outside that rule the Macs
answer apart (the probe, rewritten to run each pair plainly and under the validation layer, with
the bytes checked):
- Apple M3 Max, macOS 27.0.1, Shared and Private: plain Metal copies the bytes as they are; the
validation layer stops every pair of two formats ("[sourceTexture pixelFormat](...) must equal
[destinationTexture pixelFormat](...)") and two sample counts.
- AMD Radeon Pro 5300M, macOS 26.7.1, Private: Metal copies the bytes as they are, plainly and
under the validation layer, which takes the pairs of one texel or block size (depth and BC1
among them) and stops two texel sizes ("must be compatible with") and two sample counts.
- Intel UHD Graphics 630 of the same MacBook, macOS 26.7.1, Private: the copy completes, plainly
and under the validation layer, and leaves the destination unwritten; the layer answers as on
the 5300M.
So the refusal stays, and its basis is metal-documented, quoting the page; its doc carries the
rows above. Nothing it refuses changes.
The probe now holds every leg that ran: the ten pairs of one texel size and R32Uint into R32Float,
each with Shared and Private textures, plainly and under the layer, with the bytes compared; the
earlier depth, BC1 and sample-count cases and a pair of two texel sizes (the negative control)
under the layer alone, where plain Metal has no defined answer; a device index for a Mac of two
GPUs. Its header states what each Mac answered.
docs/REFUSALS.md and the runtime's error/basis.rs are regenerated (one Refusal moves from
metal-measured to metal-documented). The runtime README's blit paragraph names the documented
rule. The conformance rows whose refusals Justification::MetalValidation documents are unchanged.
Verified:
- m3-max-85147, the Apple M3 Max (macOS 27.0.1), and m3-max-85148, the MacBook Pro's Radeon Pro
5300M and UHD Graphics 630 (macOS 26.7.1): the probe as committed, every leg (the rows above).
- m3-max-85410, on the CPU with no device, at this commit: fmt, the workspace's Rustdoc, the
runtime's private Rustdoc, the refusal surface's check and scripts/api-docs pass; the runtime's
suite ran 230 tests, all passed, 2 skipped.
|
||
|
|
133c992dad | Merge pull request #25 from charlysound/contrib/native-mesh-runtime | ||
|
|
d2f8f386c0 |
Pin V bless: the golden cells and the census differences by the commit that moved them
The bless commit |
||
|
|
292331c613 |
Pin V bless: golden hashes, engine inventory and the authored compile census at 8f04734a97
Re-blessed on the Apple M3 Max at |
||
|
|
8f04734a97 |
Translator docs: slice_cells' link names the function slice(), not the primitive
The SSW doc comment on slice_cells linked [`slice`], which rustdoc resolves both to the function lower::texture::emit::slice and to the primitive type, so the private-items Rustdoc of metal2vulkan failed (merged check m3-max-85364, STEP privdoc: "`slice` is both a function and a primitive type"). The link now names the function. Docs only; runtime-sources.sha256 unchanged (pin-compute equal). |
||
|
|
5dc5ea3315 |
Translator: a seq_cst atomic operation takes the sequentially consistent fence
A seq_cst atomic operation on memory another thread reaches (an AIR 2.9 air.atomic.* buffer atomic of order 5, its success order for a compare-exchange; an LLVM atomic load, store, atomicrmw or cmpxchg of seq_cst) now takes the fence the landed seq_cst fence lowers to: an acquire-release memory barrier at the operation's scope over the memories its order applies to, then lower::sync::barrier's add of 1 on the device's fence word at Device scope with the barrier's semantics. A store, a read-modify-write and a compare-exchange take it after the operation; a load takes it before. Thread memory's atomics take none (no other invocation observes their order); texture atomics of any order but relaxed stay refused; relaxed, acquire, release and acq_rel operations are unchanged. The fence before a load, derived: the stores' fences alone order every pair of fenced stores and forbid store buffering and the R and 2+2W shapes, but two readers may still see two independent seq_cst stores in opposite orders (IRIW), since a reader's two acquire loads synchronize with nothing between them. MSL's single total order forbids that outcome. With an add on the one fence word before each load, the two readers' second adds are ordered on that word; the earlier reader's first load acquired its store, which then happens before the later reader's add and so its second load, which must see it. A fence after a load would order nothing more. Each such operation now costs one contended add on the device word: the runtime README's fence known-gap line says so (every non-explicit atomic of MSL 4.1 is one), read from the fence's measured rows. msl_4_1_orders_reach_spirv expects the fence's add after a27_wide_and_float's float add and after each of a27_fragment_atomics' three atomics. reach.tsv drops the SeqCstFence row, whose refusal no longer exists. The identity harness maps the device's fence word (with_fence_word: its 4 bytes past the zero range, the rest still unmapped), and engine_atomics' run_orders binds every kernel with it: the interpreter trapped on the fence's add in the two contention tests whose kernels hold LLVM seq_cst atomics. SEMANTICS_VERSION 2367 (renumbered at landing; 2363-2366 went to arm 9, the blob move, the 1D bicubic and the shared slice): a module holding a seq_cst atomic operation changes. Verified: - red 389e7cf44e, job m3-max-85066: a_seq_cst_atomic_operation_takes_the_fence fails at "a fence's barrier" (no add follows the store); the fence tests and msl_4_1_orders_reach_spirv pass. Green there: 4 passed. - the product suite at the fix without the harness's fence word (85066): 3495 passed, 3 failed, 24 skipped. The failures were golden_hashes_match_the_table (re-blessed on development) and engine_atomics' llvm_ and narrow_atomics_are_exact_under_contention, whose interpreter trapped on the unmapped fence word. With it (85271): engine_atomics, engine_seq_cst and engine_air_2_9 28 passed. - validation 1344 passed, 2 skipped; conformance 1053 passed, 0 skipped; doctests EXIT=0 (85066). - clippy plain 85270, m2v_gpu 85269 and m2v_cpu_icd 85268 EXIT=0 at this tree. Rustdoc and api-docs 85093 EXIT=0 at the fix without the harness change, which adds test code only. |
||
|
|
7463025bc2 |
Translator tests: a seq_cst atomic operation takes the sequentially consistent fence (red)
The planner ruled a seq_cst atomic operation a bug to build on the landed fence (owner order 3406). MSL 4.1, section 6.16 read whole: Table 6.26 gives memory_order_seq_cst as "Same as memory_order_acq_rel, plus a single total order exists in which all threads observe all modifications in the same order." (All OS: Metal 4 and later); 6.16.1 says "In Metal 4.1 and later, you can specify memory_order values for atomic operations, atomic_thread_fence, threadgroup_barrier, and simdgroup_barrier." (before it, "For atomic operations other than atomic_thread_fence, memory_order_relaxed is the only enumeration value."); and 6.16.1.3 says "Atomic operations that use memory_order_seq_cst order memory the same way as release-acquire ordering — everything that happened before a store operation in one thread becomes visible to the thread that performed the load. They also establish a single total modification order of all atomic operations." Apple's compiler gives MSL 4.1's non-explicit atomics (atomic_store, atomic_load, atomic_fetch_add) order 5, seq_cst, over every memory (mem_flags 31): our fixture a27_memory_order, compiled at metal4.1. Today such an operation lowers to its acquire-release half alone, which Vulkan does not order totally. Count (structural: the order immediate of each air.atomic.* buffer atomic, load, store, read-modify-write and compare-exchange success and failure, each texture atomic, and each LLVM atomic load, store, atomicrmw and cmpxchg, in the functions each entry reaches by direct calls): - the kept streams (the replay streams' blobs and two recordings; 659 distinct libraries, their 17831 functions through llvm-dis): 0 functions with a seq_cst operation (job m3-max-84869); - the other kept streams (369 distinct libraries, 14758 functions): 0 (job m3-max-84888); - the census's corpus (its local/sources and local/library-modules shards: 15378 and 14068 entries): 0 entries with a seq_cst operation, the positive control finding them in a27_memory_order's three kernels (job m3-max-85277). a_seq_cst_atomic_operation_takes_the_fence: on every committed profile, the store-buffering litmus kernel with its store (or exchange) and its load in AIR 2.9's ordered form on device memory. A seq_cst store or exchange is followed by the fence (a Device-scope memory barrier of acquire-release semantics over the operation's memory, then a Device-scope add of 1 with those semantics on the device's fence word, the function reading PushField::ZeroAddress); a seq_cst load is preceded by it. Store-side fences alone forbid store buffering, but not two readers that see two independent stores in opposite orders (IRIW), which the single total order forbids; the fence before each load puts an add on the one fence word between a reader's two loads, so the two readers' adds are ordered and the first reader's acquired stores happen before the second reader's later load. A relaxed, release, acquire or acq_rel operation takes no fence and reads no zero range. Every module passes L3. Red at this commit: each case with a seq_cst operation has no fence. Verified: the red/green job of the fix commit. |
||
|
|
c57492c129 |
Translator docs: the cooperative slice's zero past the grid names its conformance case
A comment only: cooperative.rs's paragraph on a partial threadgroup's shared slice now names the case that carries the M3's recording (compute-imageblock-slice-past-the-grid) beside the probe. The runtime sources hash is unchanged (cooperative.rs is not one of its inputs). |
||
|
|
0ae54b7ec4 |
Conformance: the M3's recording of the imageblock slice past the grid
Recorded on the Apple M3 Max (macOS 27.0.1) by job m3-max-85134 (record, three runs, one outcome, the validated leg ran without a stop; times --runs 8 --write). Every grid thread's texel holds its own value, (1 + x + 8y) / 64 and three zeros, and every one of the 22 cells past the grid holds zero, neither the -1 sentinel nor any thread's value: the answer the case's test pins, read from these bytes. docs/CONFORMANCE-COVERAGE.md regenerated (coverage.py) for the case and its dispatchThreads step. |
||
|
|
6cd358bafb |
Conformance: a partial threadgroup's imageblock slice, past the grid
A compute pass can now state dispatchThreads:threadsPerThreadgroup: as a step (ComputeStep::DispatchThreads), on both sides: the runtime's dispatch_threads and Metal's own call. The fixed Side::dispatch_threads sets no imageblock size, so a kernel with an explicit imageblock could not run a non-uniform grid through it. The case compute-imageblock-slice-past-the-grid runs the owned fixture tib_imageblock_slices's tib_slot_half_slice over a 6 by 7 grid in 4 by 4 threadgroups with a 4 by 4 imageblock, so three of its four threadgroups are partial (x, y and the corner), and compares the whole 8 by 8 RGBA16Float texture, made holding -1 in every channel, with Metal's. Metal's documentation says nothing of a slice's cells past the grid; the case carries what the M3 records and claims no more. Its test pins that recording to the grid threads' own values and zero past the grid. The ledger row for the encoder's dispatchType is the one every compute pass case holds (the runtime keeps no getter). The recording follows in the next commit, from one record job on the M3. Verified: - the recording (next commit): M3 job m3-max-85134. - replay, job m3-max-85149: on llvmpipe (Mesa 26.2.6, LLVM 23.1.4) and on the RX 7900 XTX (RADV), the case's texels equal the M3's. Its one ledger row (dispatchType) holds on both, as compute-imageblock-sizes' does. - conformance suite 1055 passed, 0 skipped (m3-max-85298); clippy x3 and rustdoc as the change before it. - macOS: the M3 job's release build of the Metal side compiled without a warning. Clippy was not run on macOS, since pd sends no build to the Macs. |
||
|
|
ddfc3a6da4 |
Translator and runtime: a kernel's partial threadgroup writes its shared slice among Metal's threads
The partial-threadgroups variant refused a kernel with an imageblock slice write every
invocation shares (texture::cooperative), as SharedSliceWrite. The walk guarded the shared
write like any other instruction, so its trailing workgroup barrier stood under `if live`,
and the walked invocations past Metal's threads skipped their shares. It now takes the shared
slice as one of the walk's synchronizations, on every tier (texture::shared_slice, in
SyncSet::WorkgroupBarriers and divergent::is_sync):
- every invocation reaches the slice's barrier;
- the invocations live at the slice write the slice's cells among them. In a partial
threadgroup those are Metal's threads: the first EmitCx::entry_threads invocations by lin.
The step of the shared loop is now that count rather than the workgroup's size, so Metal's
threads write every cell;
- a cell no thread of Metal's stored holds zero, the threadgroup arena's null initializer;
- the walked invocations store nothing in their cells before the barrier (the predicated walk).
The M3 Max recorded the same for Metal's own partial threadgroup, so this matches the
measurement rather than any documented rule. Probe imageblock_slice_past_the_grid, job
m3-max-85078: each cell of a thread past the grid lands zero, in two runs of two dispatches.
No MSL or Metal text says what such a cell holds, and the docs claim nothing beyond the
recording.
The shared slice is never by itself a reason to walk. Its guard's branch, at a
workgroup-uniform point, is taken by every invocation, so a kernel whose only non-uniform
synchronization is a shared slice keeps its unwalked module. Outside a walk the shared loop is
unchanged.
- error: PartialThreadgroupsCause::SharedSliceWrite goes, since nothing else raises it.
mesh::plan_partial_groups no longer refuses the variant for it. Feature::PartialThreadgroups'
and LoweringInputs::partial_threadgroups' docs drop it and say what the slice writes.
- runtime: its cache's refusal markers drop m2v-refused-slice (cache::REFUSALS has 5 entries).
PartialThreadgroupsSite::Structure's doc and the README's gap paragraph drop the slice.
Caches::refused now reads a variant's translation file in one lookup (the planner's
read-back of the cause table). It asked the store once per marker, and each Store::holds
opened the file in young and then old, and read it whole where its length was the marker's.
Three markers are 16 bytes, so one 16-byte file was read up to three times. Store::holds_one
takes the markers with their tags, opens the file once a generation, reads it only where its
length is a marker's, and matches the bytes against each. Store::holds is holds_one of one
marker. A hit in old still moves into young. Lookups count their opens under the tests
(Store::file_opens).
- tests:
- the red test turns green;
- each_structure_the_variant_does_not_take_names_its_cause keeps compute derivatives and
the tile function;
- the runtime's marker test drops the cause;
- api_signatures.tsv loses the two variant rows. REFUSALS.md and basis.rs regenerate
unchanged.
- a_variant_refusal_is_read_back_in_one_lookup_of_its_file writes each marker of REFUSALS
under a key of its own and reads each back with exactly one open. A missing key opens at
most twice, and a lowering of a marker's length is no refusal.
- SEMANTICS_VERSION 2366 (renumbered at landing: 2363-2365 went to arm 9, the blob move and the 1D bicubic): a partial-threadgroups
variant with a shared slice now compiles. RUNTIME_VERSION stays: no run of an unchanged
artifact differs, and the runtime-source fingerprint's inputs are untouched.
Verified:
- red d1d4b5cc9c, job m3-max-85298: a_partial_threadgroup_s_shared_slice_holds_zero_past_its_threads
fails at its compile ("unsupported: PartialThreadgroups: SharedSliceWrite"), and the filter's
other 20 tests pass. With Caches::refused asking once per marker, as before, the same job's
a_variant_refusal_is_read_back_in_one_lookup_of_its_file fails at 2 opens for
Structure(ComputeDerivatives). Green: 23 passed.
- suites (85298): product 3498 passed, 1 failed (golden_hashes_match_the_table, re-blessed on
development), 24 skipped; validation 1344 passed, 2 skipped; conformance 1055 passed,
0 skipped; doctests EXIT=0.
- clippy plain 85194, m2v_gpu 85193 and m2v_cpu_icd 85197 EXIT=0; rustdoc and api-docs 85195
EXIT=0, all at the tree of this change and the case that follows it.
- the guest's kernels, job m3-max-85164 (release, a Ryzen 7 7840HS): the two kernels this
refusal held in a recording's libraries lower and pass spirv-val on all 15 committed profiles,
under the plain module and both partial-threadgroups variants. The slowest row is moltenvk-m3's
emulated variant at 0.017 s, and the peak resident set is 32.6 MiB a process. Before this
change both variants were refused as SharedSliceWrite (job m3-max-85052).
- Metal's own answer, in the conformance case that follows (compute-imageblock-slice-past-the-
grid): recorded on the M3 (m3-max-85134), and equal on llvmpipe and on the RX 7900 XTX
(m3-max-85149).
|
||
|
|
7e1ca1af89 |
Translator tests: a partial threadgroup's shared slice holds zero past its threads (red)
The planner ruled the shared slice write in a partial threadgroup built (owner order 3406): the walk's guest library 5ba5f694ad0576ff refuses the partial-threadgroups variant of kernels #81 and #83 as SharedSliceWrite. The M3 Max recorded what Metal does (the probe imageblock_slice_past_the_grid, job m3-max-85078, two runs of two dispatches each): the slice write in a partial threadgroup writes every cell of the imageblock, and the cells of threads past the grid land zero in every run. a_partial_threadgroup_s_shared_slice_holds_zero_past_its_threads runs engine_imageblock's shared_slice (4x4 threadgroups, a 4x4 imageblock, each thread storing (x, y, 7, 9) in its cell before the barrier, the slice written by local id 0 at its threadgroup's origin) as the partial-threadgroups variant over a 6x7 grid. Of its 2x2 threadgroups, one is partial in x, one in y and one in the corner. The test uses the interpreter with the region flagged NONUNIFORM, on every committed profile that lowers the plain kernel, in both scheduling orders. Each cell of a Metal thread must land its (x, y, 7, 9), and every other cell of the slice must land zero. That pins the reason as well as the result: an invocation past Metal's threads would store a nonzero cell if the walk let it. engine_imageblock's texel helpers become visible to the test. Red at this commit: the variant is refused Unsupported{PartialThreadgroups} SharedSliceWrite. Verified: job m3-max-85298 fails it at its compile with that refusal, on the first committed profile (amd-780m-hawkpoint-radv). |
||
|
|
15d6344523 |
Conformance probe: what a slice write holds for the cells past a partial threadgroup's grid
A kernel with an explicit imageblock stores each thread's grid position in its cell, takes a threadgroup barrier on imageblock memory, and writes the slice from the thread at local (0, 0), the shape the translator's cooperative slice write takes. It is dispatched with dispatchThreads on a 21 by 13 grid of 8 by 8 threadgroups, so threadgroups at the x edge, the y edge and the corner are partial. The probe prints, for each kind of edge, what the texels of the cells past the grid hold after the write (the sentinel set before, a stored pattern, zero or other) and a hash of them, over two dispatches a run. It is the reading the partial-threadgroups variant's SharedSliceWrite form is checked against. What it measured, job m3-max-85078 (the Apple M3 Max, macOS 27.0.1; two runs of two dispatches, sentinels -1 and -2): every cell past the grid holds zero, 24 at the x edge, 48 at the y edge and 39 in the corner, with no sentinel, no as-if-ran value and no other thread's value; every grid thread's texel holds its own value; each command buffer completed, and the hashes are equal across the runs and sentinels. |
||
|
|
7d1dba5df0 |
RUNTIME_VERSION 2569: a sampler of Metal's undeclared filter 2 is made and filters as nearest
A Cubic sampler state is now made where the runtime refused it, so RUNTIME_VERSION moves 2568 -> 2569 at landing. SEMANTICS_VERSION stays at 2365: no module's words change. runtime-sources.sha256 is unchanged (cache/mod.rs is not one of its inputs; pin-compute equal). |
||
|
|
6706d5b97f |
rt and translator: a sampler of Metal's undeclared filter 2 is made and filters as nearest
MTLSamplerMinMagFilter's raw value 2 (SamplerMinMagFilter::Cubic) is declared by no SDK header, Apple page or Metal Shading Language text, and nothing a program asks tells it about the value, so it is undocumented Metal and is not emulated. Metal makes the state on every Mac measured. An Apple M3 Max filters it over a footprint wider than one texel, and a Radeon Pro 5300M and an Intel UHD Graphics 630 read the nearest texel (the conformance case's own inputs: jobs m3-max-85003 and m3-max-85004). The runtime now makes such a state and filters it as nearest on every device: no shader arm, no second pipeline, no query, no note. - rt Device::new_sampler_state no longer refuses a Cubic min or mag filter. Nothing raises Gap::CubicSampler now; the variant stays, documented so, because the consumer names it. - translator: SamplerWord::of sets no bit for a Cubic filter, so its word is the nearest filter's. SamplerWord::CUBIC (bit 30) is deleted (its one reader, the anisotropic word path, is gone on development). SamplerWord::FIELDS is now (1 << 30) - 1. unnormalized_reads compares the two filters as the device's (a Cubic filter's is NEAREST) rather than refusing Cubic. vk_sampler already made NEAREST of Cubic. - SamplerMinMagFilter::Cubic stays, because the consumer converts a guest's raw 2 to it. It is documented through regen_metal_enums.py's PRIVATE_DOCS as Metal's undeclared raw value 2, which the M3 Max filters and the x86 Macs read as nearest, and whose device sampler and word here are the nearest filter's. generated.rs is regenerated against the macOS 27.2 SDK. - docs: the runtime README's sampler line, RESOURCE-ID.md (the word's bit 30 is now 0, and the consumer makes a Cubic state as nearest), resource_words.tsv's three Cubic lines (bit 30 cleared: 0x40000000 -> 0x00000000 twice, 0x58f6ab53 -> 0x18f6ab53), and the comments in select.rs and extended.rs that said the runtime makes no cubic sampler. - reach.tsv's SamplerBicubicFilter row no longer names a runtime cubic sampler as its reach. REFUSALS.md and error/basis.rs regenerated (refusal_surface.py: Gap::CubicSampler has no raise site); api_signatures.tsv blessed (SamplerWord::CUBIC removed, FIELDS changed). - RUNTIME_VERSION: a Cubic state is made where it was refused, so it takes a bump, set at staging (left at development's 2568 here). SEMANTICS_VERSION stays, since no module's words change. runtime-sources.sha256 re-pinned. Consumer search (reims-vgpu development 1913fcbc15 and the steelbrain/* refs from the last day): Gap::CubicSampler, 2 hits (development crates/reims-vgpu-vulkan/src/rt_platform/diag.rs:3071 and :3109, a test that counts the gap's name), kept. SamplerWord::CUBIC, SamplerWord::FIELDS and SamplerMinMagFilter::Cubic by name: 0 hits. The consumer's rt_platform::state::tests::states_on_vulkan, which expects None for min_filter 2, now gets a sampler. |
||
|
|
c43c130d1a |
Tests: a sampler of Metal's undeclared filter 2 is made and filters as nearest (red)
MTLSamplerMinMagFilter's raw value 2 (MTLSamplerMinMagFilterCubic) is declared by no SDK header, by Apple's page, or by the Metal Shading Language, and nothing a program can ask tells it about the value. Metal makes a sampler state of it on every Mac measured. The case's own inputs read a footprint wider than one texel on an Apple M3 Max (macOS 27.0.1, job m3-max-85004) and the nearest texel on a Radeon Pro 5300M and an Intel UHD Graphics 630 (macOS 26.7.1, job m3-max-85003). Undocumented Metal is not emulated, so the runtime is to make the state and filter it as nearest, the x86 Macs' answer, on every device. The tests that hold that: - rt every_device_shares_sampler_states_device_samplers: a state with a Cubic min and mag filter is made (no Gap::CubicSampler), its word is the nearest state's, and it takes no device sampler of its own. - translator a_cubic_filter_is_the_nearest_filters: a Cubic min filter, mag filter or both is the nearest filter's word, device sampler of each use, and unnormalized reading, at normalized and pixel coordinates; and a_sampler_word_holds_each_field_at_its_bits: a Cubic filter's word is 0. - conformance sampler-cubic-filter: its ledger row (refused on every venue) goes. The case drops its bicubic-filter-arithmetic declaration and lets each lane's runtime red hold its own texel where the M3 Max's recording differs (every lane but lane 0), under the new accepted difference in docs/API.md. the_cubic_allowances_are_the_lanes_nearest_moves pins those lanes to the recording. docs/CONFORMANCE-COVERAGE.md regenerated (coverage.py): one ledger row fewer, one tolerance more. |
||
|
|
48a22a206f |
Runtime tests: the early member's fed run is checked exactly, not by a wall-clock ratio
every_device_feeds_an_early_members_run_to_its_queue_as_the_last_retires asserted l_run * 3 < a_run: that after A's handler the expected run fell by more than a third. The run falls by the GPU runs it takes (QueueInner::ran halves it toward each shorter one, queue::next_run), so the bound held only while A's and L's timestamped fill runs stayed short beside the run A's handler saw. Alone on lavapipe at 256 bits the ratio is about 4 (125M ns at A's handler, 31M at L's). It failed once in a full-suite run of the merged-tree check (m3-max-85067, llvmpipe LLVM 23.1.1 at 256 bits, the test 0.94 s there against 0.11 s alone), where the CPU ICD's fills ran long. The check is now exact: from the run A's handler saw, the run L's handler sees is next_run of A's GPU run, then of L's, each its command buffer's gpu_end_time minus gpu_start_time. Those are the spans the runtime fed (complete.rs feeds an early member's deferred span, and command.rs L's own, from the same placed times it stores). Nothing in it depends on how long the runs took. With the retirement count's +2 between the handlers, it says the queue took exactly A's run and then L's after A's handler. The bound is not widened; the ratio is gone. |