6ae4d7dbaf478da0cc0e4c74fee95f5c73a1dd57
946
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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. |
||
|
|
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. |
||
|
|
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.
|
||
|
|
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
|
||
|
|
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
|
||
|
|
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
|
||
|
|
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. |
||
|
|
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 |
||
|
|
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. |
||
|
|
ed4b0ecd76 |
rt: storage textures written or read at a run-time level, through runs of set 1's level elements
What: under the identity domains a storage slot written, read or size-queried at a level other
than the constant 0 indexes a run of set 1's storage-image array instead of being refused as
Unsupported{IdentityDomains} ("an encoder value the function reads as TextureLevels(S)"). The
translator pushes the bound texture's level count (PushField::TextureLevels) and the run's first
element (the new PushField::TextureLevelBase, beside it), states no StorageTextureLevels or
StorageTextureLevelViews fact, and an access at level l takes element
first + min(l, max(n, 1) - 1) of the array, NonUniform, inside l < n. A texture of one level
pushes its own index, nil 0 with count 0.
The runtime's binding 1 grows by 65,536 level elements past its 65,536 textures, 4,096 runs of 16
(floor::LEVEL_ELEMENTS, floor::LEVEL_RUN). The first dispatch or draw that binds a texture of more
than one level to such a slot (the encoder's checks, compute and render stages alike) gives it a
run: a single-level storage view of each level, of its storage element's type (a cube's level as
the 2D array of its faces, a view's from its own first level), written at the run's elements. A
later bind takes the texture's lock and pushes the same two words: no Vulkan call. The run goes
back through the pool and reaper once the texture is released and its work retired: elements null,
views destroyed (Gauges::level_elements). Every run held, or a texture of more than 16 levels, is
the new Limit::LevelElements { max: 4096 }, and the dispatch or draw does not run. The floor's
storage-image limits and both totals rise by 65,536: storage 196,608, per-stage resources 327,688,
pools 351,680; every lab device's profile is far above (llvmpipe 1,015,808 storage, the least).
SEMANTICS_VERSION and ARTIFACT_FORMAT_VERSION bump in the branch's last commit (a new PushField).
Why: 17 guest kernels in 6 libraries were refused at state creation by this form.
Docs: REFUSALS.md and the signatures table regenerated, RESOURCE-ID.md (binding 1 past 65,536),
API.md (storage levels under identity), the runtime README (Set 1, the floor table, the known-gap
line replaced by the Limit), the runtime-floor profile's limits, and the conformance ledger's
level-sizes-storage row removed.
Checked by: engine_texture_levels' identity test and the runtime's storage_levels device tests
(red at 6ad1c33124: jobs m3-max-70886 and m3-max-70892 on lavapipe), engine_identity's
a_storage_slot_written_at_a_run_time_level_is_an_element_of_its_run; the lane's jobs report the
runs per card.
|
||
|
|
340cbf5591 |
Docs: HalfTexelConversion's recorded bound names the driver that keeps a 32-bit texel past 65504 at 65504
What: the half-texel-conversion note's recorded bound (PrecisionNote::HalfTexelConversion's doc and
docs/API.md's catalogue entry) now states both answers past +-65504 for a 32-bit float texel read into
`half`. Metal saturates a sample and takes a read to the infinity. The device's rounding takes both to the
infinity. AMD's open Linux driver (AMDVLK 2025.Q2.1, Radeon 780M) keeps both at +-65504, against the 16-bit
float controls the entry declares. Documentation only: no module, refusal or note changes.
Why: under AMDVLK, half-texel-nans-r32f/rg32f/rgba32f's read() sites answered 0x7bff for the largest finite
float texel where Metal answers 0x7c00 (42, 85 and 171 elements a site). The note's text named only the
mirror case (RADV's infinity where Metal saturates a sample), so the static note did not cover what that
driver answers.
How verified (gem10's Radeon 780M; probe branch steelbrain/amdvlkconf-probe, never lands):
- m3-max-71424, built on
|
||
|
|
30d426774d |
Translator: a kernel's floor tail folds into its pushed fields again (revert of the split)
The split ( |
||
|
|
3a4fe0d314 |
Translator: a kernel's floor tail returns at entry again; a render stage's folds into its other pushed fields
Since |
||
|
|
e59c621e48 |
rt: an observing kernel's whole grids, threadgroup dispatches and indirect dispatches run its plain module again; its partial-threadgroups variant runs ragged grids only
This restores 28e1026b3d's routing, in a new commit past four that changed it: - |
||
|
|
c6feccf773 |
Translator: a kernel that reads a stage-input region takes its partial-threadgroups variant
plan_partial_groups refused a kernel's partial-threadgroups variant wherever it had a stage-input descriptor, so rt refused every dispatchThreads grid that is not whole threadgroups of a kernel with a [[stage_in]] attribute (Gap::PartialThreadgroups at the translator's site). The probe over the 11,580 indexed kernels (m3-max-70807) counted 62 such kernels on amd-780m-radv, nvidia-rtx50-linux and intel-irisxe-anv alike; a consumer's first-time setup meets one of them. The refusal goes and nothing is added to any module: the fetch already stays inside the grid. An invocation past its threadgroup's threads returns in dispatch::emit_entry, which the entry runs before stage_io::emit_entry's fetch. Where the body holds a workgroup barrier the variant walks it predicated instead, so such an invocation does fetch, but its position in the threadgroup is lin unflattened over the threads left (local_pos), so along x and y, the only axes a step reads, it is inside the grid, and its element is one a Metal thread there fetches too; it runs none of the body. A kernel that does not observe its partition now takes the grid-tiles variant, whose invocations past the grid return before the fetch as well. SEMANTICS 2290: the variant of a stage-in kernel was a refusal and is now a module, under the same key. No plain module changes. The two tests of 9089b4eea2 turn green: the translator's interpreter run over a source buffer ending at the last thread's element and a region that clamps nothing traps on any fetch past the grid, and rt runs both kernels' partial threadgroup of 25 in 1,024. |
||
|
|
ac5c562a08 |
Translator: a deep kernel's WorkgroupSize parts are plain specialization constants, written with every other key its threadgroup decides from one call
AMD's open driver AMDVLK (2025.Q2.1, its LLPC compiler) sizes a compute workgroup from the WorkgroupSize composite's parts as declared, and reads an OpSpecConstantOp part as 1, while the body sees the right value: every Spec-form kernel, whose deep-threadgroup form made each part an OpSpecConstantOp Select over IMul products of LocalSize, ran one invocation per workgroup there. The Vulkan spec allows such a part (VUID-WorkgroupSize-WorkgroupSize-04426: a specialization constant or a constant), so this is the driver's bug; the form here is right on every device. - Such a kernel's WorkgroupSize parts are the plain specialization constants SpecKey::WorkgroupSize(axis) (codec member appended). - One public call, pipeline::threadgroup_constants(size), returns every key a kernel's threadgroup size decides: LocalSize on each axis, FlatLocalSize, DeepThreadgroup and the WorkgroupSize parts (the threadgroup, or one row of it deeper than DEEP_THREADGROUP). The runtime writes exactly those keys from it (Constant::Threadgroup, whose membership is the call's own key set), in place of four separate computations. docs/API.md section 3 names it. - The builder refuses an OpSpecConstantOp WorkgroupSize part (ConstRule::WorkgroupSizeOp), so no form can declare one again; serialize test a_workgroup_size_part_is_never_a_spec_constant_op covers the old deep shape and two others, and the deep engine test asserts the parts are the new keys. - rt test every_device_runs_every_thread_of_each_workgroup_deep_or_not: an owned kernel stores i + 1 at each linear thread index for a deep [1,1,96] threadgroup and two shallow ones. Evidence so far: rt's probe with the composite's op parts folded to plain constants (job m3-max-70461, the RX 7900 XTX; m3-max-70462, a Radeon 780M) cleared 66 of the 67 rt device tests that failed on AMDVLK; the 67th, quad_control's helper test, fails the same with and without, a fragment-stage defect of its own. |
||
|
|
4c438ca2c6 |
Translator: under the identity domains a command buffer's field is plain data
An argument buffer's command_buffer member holds, under the identity domains, its word: the
gpuResourceID the program or the host wrote there, the device address of the records
(lower::access::icb). The byte rule of memory::provenance::objects treated it as an opaque
object, so any access other than the exact handle load that might reach its 8 bytes was
Unsupported{ArgumentBufferObjects}: an index past the structure by a signed run-time index, whose
offsets run back to 0, and, once such a buffer's address escaped, every run-time dereference.
Metal lays a Tier 2 argument buffer out as the equivalent C structure (macOS 13 and later), into
whose member the host writes gpuResourceID ("Handle of the GPU resource suitable for storing in an
Argument Buffer", MTLIndirectCommandBuffer.h), and whose contents the GPU and the CPU may both
modify. A plain access of those bytes reads or writes that word, which is all Metal defines of
them. So under the identity domains a command buffer's field is not opaque for either rule
(ObjectLayouts::of takes `words`, from the profile's pointer domain); a pipeline state's field
stays opaque, and under the resident-table domains, the validation executor's, nothing changes.
Tests: the objects rule's unit test (a command buffer's field is opaque only without its word),
and engine_identity_icb's an_access_past_an_encoder_is_a_plain_access_of_its_command_buffers_word
over the owned fixture icb_encoder_tail: both entries compile and validate under the identity
domains on lavapipe and moltenvk-m3, and the resident tables still refuse them.
|
||
|
|
3c86a2a45f |
Translator: a vertex function's slice and viewport index are stored as it writes them
Metal requires the same [[render_target_array_index]] and [[viewport_array_index]] at every
vertex of a primitive ("If values differ, the behavior and value passed to the fragment function
are undefined.", the Metal Shading Language specification), and Vulkan asks the same of Layer and
ViewportIndex (VUID-VkPipelineShaderStageCreateInfo-stage-02596 and -02597). The translator stored
an index only where the function's structure showed it the same among a primitive's vertices
(uniform_varyings over the raw index varyings) and refused every other one,
NotImplemented(LayeredRendering), on every device. A program that keeps Metal's rule keeps
Vulkan's with the index stored as written, and one that breaks it has no Metal answer to match,
so plan::index_store now stores the index to its builtin wherever the device stores it from a
vertex function (shaderOutputLayer, shaderOutputViewportIndex, both in the floor), whatever the
structure shows; a device without the output is refused needing it, as before. The store keeps
index < count ? index : 0 against the pushed length and viewport count, and an index never written
is still stored as 0. uniform_varyings now lists user varyings alone (the raw index keys decided
nothing else), and uniform_index is gone.
Where a program breaks Metal's rule the layer or viewport is the device's choice: the runtime
README's layered line and docs/API.md (section 4 and section 10's accepted differences) say so in
one sentence, the viewport paragraph and set_viewports no longer name a geometry stage, and
docs/REFUSALS.md is regenerated (LayeredRendering is now a device refusal alone). The runtime's
layered device test draws rt6_per_primitive's three triangles into slices 1, 1 and 2 through
viewports 0, 1 and 1 of a 2D array, checking every texel, in place of the refusal it asserted.
SEMANTICS_VERSION 2283: modules for such functions instead of the refusal, and uniform outputs
without the raw index keys.
|
||
|
|
39498a602f |
Translator: a vertex function's slice or viewport index it never writes is stored as 0
A vertex function that declares [[render_target_array_index]] or [[viewport_array_index]] and never writes it returns the index undef (Apple's compiler inserts nothing into the returned struct's field). The translator took undef as divergent among a primitive's vertices (each use of OpUndef may read another value) and refused the function, NotImplemented(LayeredRendering). Metal gives such an index no value, so an index undef at every return (stage_io::returns_undefined: an undef or poison inserted there, a member of one, or a member no insertion writes into one) is stored as 0 wherever it is stored (PlannedOutput::unwritten: the Layer and ViewportIndex builtins and their raw varyings), the same at every vertex, as Vulkan asks (VUID-VkPipelineShaderStageCreateInfo-stage-02596 and -02597), and uniform_varyings lists it among the uniform outputs. The offset of a draw of one amplification and the count each index is held below apply as to any written index. The member walk returns_no_nan used is shared (returned_member); its answers are unchanged. SEMANTICS_VERSION 2282: modules for such functions instead of the refusal. |
||
|
|
82f0ceca53 |
Identity domains: a storage cube written or read by face is the 2D-array element of its faces
The translator declares every storage cube and cube array as the 2D array of its faces, at layer 6 * cube + face (cube_as_array). Under the resident-table domains the binder supplies that view. Under the identity domains no class held it, so a kernel that writes a cube by face was refused with "texture argument S: a type the identity arrays hold no element of". In the private corpus on runtime-floor that refusal covered 30 guest functions alone, and 6 more together with a sampled cube read by face. Now: - Translator: identity_class takes a storage declaration that views a cube as an array as the 2D-array storage class, and a storage cube states no ImageViewShape fact under the identity domains. A sampled cube read by face (access::read or access::sample) still has no class and stays refused. - Runtime: a cube's or cube array's storage element, for a texture and for a texture view, is a VK_IMAGE_VIEW_TYPE_2D_ARRAY view of its 6N layers (storage_view_type). Vulkan takes that view of any cube-compatible image, so every device gets the same form, at no copy and no cost. The sampled element stays the cube view. - docs/API.md states the storage element a consumer holds for a cube. The runtime README says what a cube's storage view is, and its identity-domain gap list keeps only sampled cubes read by face. - The same README list adds the refusal of a storage texture written at a run-time level, with what Metal does on Intel Macs: an owned kernel's writes at levels 1 and 2, read from a buffer, landed exactly on a Radeon Pro 5300M and a UHD 630 under macOS 26.7.1, with Metal's validation off, with API validation, and with shader validation (job m3-max-70040, probe built in m3-max-70037). Under the resident-table domains nothing changes: both translator changes apply only under the identity domains. |
||
|
|
059835018a |
Translator: the floor's tail folds into each other pushed field through a select, not a never-taken return
The floor's tail guard read the tail in the first block and returned where it held a value the consumer never pushes, so every stage that pushes more than one field ran its whole body under a never-taken branch. AMD's open driver (AMDVLK 2025.Q2.1, LLPC) dies in vkCreateGraphicsPipelines making a fragment stage of that shape whose loop holds convergent instructions under MaximallyReconvergesKHR (an implicit-LOD sample and an f32-f16-f32 round trip): the setup streams' render content 295d5723 ([65] RG16Float, 1 sample) died on the Radeon 780M, and the owner's Windows driver died making the same stream's states. Now the stage reads the tail in its first block, tests it as before (lower/push.rs tail_never_pushed), and each other field read from its push member is, as every use of it recalls it, its member's value where the test fails and the null of its type where it holds (fold_never_pushed, EmitCx::fold_tail): a select per field, no branch, no return. The tail's load lives while any other push read does, which is what the tail is for (a driver that uploads push bytes up to the highest one a stage reads). A tail field of the stage's own folds into the others alone. The fields read from their members load first, then the tail folds, then the spilled and derived fields, which may read through the folded parameter block's address. Same pushed bytes, same placement, no interface change. - lower/push.rs: emit_tail_guard becomes tail_never_pushed (the test) and fold_never_pushed. - lower/emit.rs: load_push_fields loads, folds (fold_tail), then loads the rest; emit_module no longer calls a guard. - SEMANTICS_VERSION 2280. - Test: the_floor_s_tail_folds_into_the_other_pushed_fields_with_no_branch (one select per other pushed field, no branch on the tail's test, one return), which fails on the guard. - Docs: lower/push.rs, PushField docs, docs/API.md section 5. |
||
|
|
a677cb74b3 |
docs/API.md: the bicubic catalogue's RGBA16Float figure names what lavapipe measured at the edges
What: the precision-note catalogue's largest RGBA16Float difference under the bicubic filter note now also gives 4.73e-4, measured on lavapipe in the authored bicubic edge cases (bicubic-edges-of-random-texels-in-a-12x10-rgba16-float, at values in [1, 2), where a half step is 9.77e-4), at normalized and at pixel coordinates alike. The conformance case's 3.74e-4 stays. Why: the catalogue changes with the behaviour it describes. The pixel-coordinate form beneath this commit put those cases through the runtime, and their largest RGBA16Float difference is above the listed figure. The normalized column of each case shows the same difference, so it is the note's arithmetic, not the pixel form. Verified: read from the bicpix lane's run m3-max-69926 on lavapipe at 86bea53a4e (the same tree as these commits before their rebase): all 7 cases NotedDifference, the pixel column equal to the normalized column on 64 of 64 lanes in the candidate and in Metal. |
||
|
|
12f8a9f06a |
Identity domains: a bicubic sample at pixel coordinates
The identity domains refused every function that samples a 2D texture through a bicubic
constexpr sampler at pixel coordinates ("a bicubic filter at pixel coordinates"), though its
lowering is the normalized sample's with no position step: a pixel coordinate is already in
texels, so the emulation reads the coordinate itself, the level-0 size by OpImageQuerySizeLod of
the bound image (which under the identity domains is the slot's set-1 element), and the format's
treatment from the slot's PushField::BicubicTexels, as at normalized coordinates. Nothing in it
reads state the identity domains do not source, so the refusal goes: SamplerPlan::bicubic_pixel
and BICUBIC_PIXEL_FORM are deleted. Metal's front end admits pixel coordinates only with clamping
modes (MSL 2.10), and a mirrored axis at pixel coordinates stays refused by bicubic::check, as on
the resident-table domains. A bicubic sample of a 1D texture keeps its own refusal.
The runtime README's known gaps and docs/API.md no longer list the form.
No SEMANTICS bump of its own: 2278, beside the shared bicubic switch fix, covers both.
Metal reads the two forms alike: in the committed M3 observations of the three bcu_address cases
(macOS 26.7 and 27.0.1), the clamp-to-edge and clamp-to-zero samples at pixel coordinates equal
the same samplers' samples of the same point at normalized coordinates, bit for bit, on 64 of 64
lanes each. The sample keeps PrecisionNote::BicubicFilterArithmetic, as at normalized
coordinates.
|
||
|
|
4551aa9f3c |
Float depth upload note: names what each measured device keeps
The note RestrictedDepthUpload and the runtime README's known-gap line now say what the upload kept on one card per vendor, under the validation layer 1.4.363.0, on a Private 4x4 Depth32Float filled by a blit's copy_from_buffer with 16 values: - NVIDIA 620.70.06 (RTX 3090, m3-max-69834) kept every value bit for bit and compared it unclamped, as Metal does. - RADV, Mesa 26.2.6 (Radeon 780M, m3-max-69832), and ANV, Mesa 26.2.6 (Iris Xe, m3-max-69833), clamped to [0, 1]. NaN of either sign, -inf, negatives, denormals and -0.0 became +0.0, and +inf with values above 1 became 1.0. Comparisons followed the stored value. - The validation layer reported none of these copies. The note's line "a value within [0, 1] is copied exactly" now excepts a denormal and -0.0, which RADV and ANV store as +0.0. Docs only: artifact.rs, the runtime's texture.rs, docs/API.md, the runtime README. |
||
|
|
aae58c6acb |
Runtime: an upload into a 32-bit float depth is the device's copy, under a static note
What: replace_region, upload_region and the blit's copy_from_buffer(_with_options) into a 32-bit float depth (Depth32Float, or Depth32Float_Stencil8's depth) no longer answer Gap::FloatDepthUpload, which is gone: each is the plain vkCmdCopyBufferToImage into the depth aspect, on every device, and carries Texture::FLOAT_DEPTH_UPLOAD_NOTE (PrecisionNote::RestrictedDepthUpload, metal2vulkan-degrade-restricted-depth-upload). A value within [0, 1] is copied exactly; one outside it is the device's, as VUID-vkCmdCopyBufferToImage-pRegions-07931 leaves it without VK_EXT_depth_range_unrestricted, which the runtime enables nowhere. No byte is read and no query chooses anything. Translator: the new note's variant, codec tag (ARTIFACT_FORMAT_VERSION 592), validation's allowance (unbounded), the conformance degradation (not native, as restricted-depth-range is not) and docs/API.md's catalogue; RestrictedDepthRange's docs name the upload note. Conformance: the rt side announces the note at each upload into a 32-bit float depth; the compare cases declare it; heap_sizes' round trip writes depths within [0, 1] for Depth32Float. |
||
|
|
de764fc389 |
Translator: a threadgroup atomic at a constant offset outside the arena writes nothing and yields zero
The sibling of the out-of-arena load and store. An unchecked threadgroup atomic at a constant offset outside the arena built an access chain past the arena's word array, which the builder's range rule rejects, an internal error. It now writes nothing and yields zero, as a contained atomic out of bounds does (`guarded`), decided by the same plain-constant test (`local::outside_arena`): an atomic inside the arena, or at an offset that is not a constant, is unchanged. Metal leaves the access undefined. docs/API.md's threadgroup bullet names the atomic too. No census row reaches it. |
||
|
|
0b1053f0cc |
Translator: a threadgroup load or store at a constant offset outside the arena is a zero load or no store
An unchecked threadgroup arena access whose offset is a plain constant outside the arena built an OpAccessChain into the arena's word array with a constant index past its length, which the SPIR-V builder rejects (OperandRule::Range), so the function failed with an internal error instead of translating or refusing. Such an access lies outside every threadgroup object, which Metal leaves undefined, so it is now decided at translation time as a contained arena's constant access is: a zero load, or no store. The decision reads the offset and the arena's size as plain constants and interns nothing, so every access inside the arena, and every module that built before, is unchanged; an arena whose size is a specialization constant is never decided this way (its word array has no constant length to break). The shape: Apple's compiler, knowing t == 0 in a branch, writes tg[t - 1u] of a static threadgroup array at arena offset 0 as element 0xFFFFFFFF, a wrapped arena offset of 0xFFFFFFFC. It is the whole of the translation census's internal errors at |
||
|
|
6adfe028d8 |
Translator: a half vector joined from read lanes keeps their bits; 20 NaN ledger rows
The RTX 5080 Laptop's replay at |
||
|
|
a1ca99880a |
Stage bound: a subgroup instruction weighs 64, the re-plan takes the lighter module, and a subgroup multiply-add's steps are one loop of paired shuffles
What:
- spirv::roll::bound_weight beside entry_weight: entry_weight with each subgroup instruction
(OpGroupNonUniform*) counted as SUBGROUP_WEIGHT, 64. Only the stage bound reads it
(stage_bound::emit); the roll keeps entry_weight as its trigger. ModuleStats::entry_weight
carries it, so the runtime's in-process or helper choice reads it.
- The re-plan holds both plans and compares them. A kernel past the bound only as the widest pin's
emulation is planned again keeping the pin: the re-plan takes the pinned module where it weighs
less than the emulated one by the stage weight; otherwise the emulated one goes on. The other
plan and module are dropped and their ledger share released.
- tile_mad on a subgroup tier: one vec2 shuffle carries a step's two b cells, one the a cells of
steps 2m and 2m + 1 (one owner lane: owner_bits keeps bit 0 of k out of the a owner), and the
dim / 2 step pairs are a DontUnroll loop, the sums in Function variables. Each step reads the
same cells and accumulates in the same Fma order. The emulated tier is unchanged.
- SEMANTICS_VERSION 2273 -> 2274.
Why: a driver's compile grows with a subgroup instruction far faster than with any other. A
kernel of entry weight 24,814 holding 3,772 subgroup instructions passed 6 GiB compiling on an
RTX 3090 (NVIDIA 620.70.06; job m3-max-67936), where the bound's 39,014 kernel grew 148 MiB. Under
the term it leaves the process; with the cut its module (22,238 instructions, 644 subgroup
instructions, bound weight 62,810) filled in the helper at 2,699 MiB of the consumer's 3,072 MiB
cap in 59 s (m3-max-67936): a thin margin. On the Iris Xe of RPL-P its pinned module, which the
re-plan took whatever it weighed, met the helper's memory (killed at 6,144 MiB, m3-max-67973);
now the emulated module (46,491, no subgroup instruction) goes on, against the pinned one's 56,163
with the cut, and filled at 792 MiB in 18.8 s (m3-max-67863).
Verified:
- Census, states-only (each play's MODE line read): the nine standard streams on the RTX 3090's
and the Iris Xe's profiles (m3-max-68045, 68047, 68087, 68100, 68101, 68132): 259 distinct
kernel modules a card, none holding a subgroup instruction, no re-plan, and no pass, render
stages included, that holds one; a recorded pass on the RX 7900 XTX (m3-max-68146): 819
compute states, none. The weigh tables of four staged kernels and a 63-kernel library on both
profiles, no driver compile (m3-max-68033, 68034): on the RTX 3090 two kernels cross, that of
24,814 and one of 7,470 (615 subgroup instructions, 46,215), which fills in the helper at
1,011 MiB (m3-max-67690); on the Iris Xe only the kernel of 24,814 re-plans. The library's ten
kernels past the bound today hold no subgroup instruction.
- Bit-equal and run time: the owned stage-bound fixture (512 multiply-adds a simdgroup, compiled
by Apple's metal) through the harness, before (development
|
||
|
|
a7dd2e846e |
Translator: the binder's plan goes, with everything only it reaches, and the TexelRows and YCbCrInPlace forms
The runtime never made a plan (it binds each draw and dispatch by the pipeline's interface), and since the census digests each pipeline's content alone (two commits back) nothing in the tree calls one. What only the plan reached goes with it: - bind: BindState, BindShape and their shapes, BindingPlan and its instantiation (DispatchCommands, DrawCommands, push, descriptor and root-table templates and writes), plan.rs and plan/ (compute, resources, slots), instantiate.rs, resident.rs, the neutral resources' plan side, the heap's member planning and table bytes, the mesh arguments pass (MeshArguments, MeshArgumentsForm, fold_object_grid, metal_object_grid), ExecutionStatus and StatusBits as public items, TextureShape::Buffer, IndirectRef with the four indirect call variants (Dispatch::ThreadgroupsIndirect, DrawCall::Indirect, PatchesIndirect, MeshThreadgroupsIndirect) and IndexBufferRef::fetch_end. Dispatch, DrawCall and IndexBufferRef stay: validation states its cases' calls with them. - error::BindError leaves the public surface; a crate-private BindError of three variants stays as the error of the heap's view derivation, which lower::texture::slot's storage-read check reads (bind::heap::tier_read_gaps). That check keeps only the storage view's format: the sampled-view branch and ImageViewDesc were reached by the plan alone. - vk::DrawCommand, the plan's draw output. - pipeline: ComputePipeline::plan, RenderPipeline::plan; cache: VariantKey::covers and large_buffer_form. - The TexelRows form (bind::texel_rows, LoweringInputs::texel_rows, RuntimeFact and PushField TexelRows) and the YCbCrInPlace form (bind::ycbcr_in_place, lower/sampler/in_place.rs, LoweringInputs::ycbcr_in_place and ycbcr_planes_sampled, RuntimeFact and PushField YCbCrInPlace, PrecisionNote FloatSampleFilter and HalfSampleFilter, Routine::Quad). Only the binder set those inputs. - The tests of the deleted items, and the plan halves of mixed tests. Of 6810 tests (`#[test]` functions in the workspace) 309 leave and 11 come in their place: the lowering halves of mixed tests, kept without the plan (the heap layout, the stage-in stride and region facts, the emulated-simdgroup and bicubic facts, the iris-xe storage classes), and the kept tests of the two renamed files. 50 others are edited to drop a plan half or a deleted item (the api_surface round trips; the simd_emulated, extended-range, recursion, dynamic-root, handles, heap-storage-read and mesh lowering cases). 6512 remain. engine_graphics_binder.rs and engine_heap_binder.rs keep one and two tests and are renamed engine_unattached_colors.rs and engine_heap_groups.rs. - The runtime guard test's list of files the runtime inputs reach without being inputs drops the seven no input reaches since the cut: cache/digest.rs, lower/simd/divergent.rs, lower/simd/workgroup.rs, pipeline/artifact.rs, pipeline/layout.rs, pipeline/stage_io.rs and pipeline/vertex.rs; three of its reasons that named the plan or the binder say what reaches the file now. 559 public items leave (api_signatures.tsv: 55 structs, 26 enums, 140 variants, 245 fields, 52 methods, 24 associated constants, 7 constants, 5 functions, 5 impls). Consumer search, the consumer's development at 92ffbed817, `git grep -w NAME` of each of the 112 removed names: 0 hits for 105; the others are the consumer's own items: TessellationFactors 4 (its Bound::TessellationFactors), YCbCrMatrix 3 (its own string and doc), texel_rows 2 (its own fn), ThreadgroupsIndirect 6 (its own Dispatch enums and rt::Dispatch::Indirect), DrawIndexed 1 (a doc naming MTLIndirectCommandType values), covers 109 and plan 105 (generic words; the `.covers(` calls are its Extent's, the `.plan(` calls its video encoder's rate.plan). Its one import of metal2vulkan::bind is the argument-buffer layout types, which stay. The forms' audit. A texture over a buffer: the runtime's tests::over::every_device_holds_a_texture_over_a_buffer_in_place. A two-plane YCbCr sample: no runtime test; the runtime makes no texture of a two-plane YCbCr format (Gap::TextureFormat, the runtime README's "A format is made where the translator's format table maps it" row), the conformance cases ycbcr_gathers and ycbcr_textures record Metal's answers, and known-gaps-rt.tsv lists the runtime's refusals (ycbcr-gathers-*, ycbcr-texel-reads-420v). Versions: - RUNTIME_VERSION 2550: it covers plan instantiation and the binder's run-time data. Nothing calls those since step 2: the runtime never used the binder, and the own-context executor is gone. A run of an unchanged artifact does nothing different, so the guard hash (runtime-sources.sha256) moves alone, and the RUNTIME_VERSION doc is rewritten to name what it still covers. - SEMANTICS_VERSION 2273: no output changes for any input that still exists. The TexelRows and YCbCrInPlace forms, their facts, push fields and the two notes were reachable only through LoweringInputs::ycbcr_in_place, ycbcr_planes_sampled and texel_rows. Only the binder set those; the runtime sets none. The function key appended each of them only when set, so every surviving key hashes the same bytes. Two type declarations stay where they were, so module words do not move: bool in the bicubic types, uvec4 in the bicubic routines. Byte-identical modules are expected, not verified here; the 252-row hash probe is the check. - ARTIFACT_FORMAT_VERSION 591: the codec tags enum variants by name. The removed RuntimeFact, PushField and PrecisionNote variants leave their tags unused, which cache/mod.rs's rule says needs no bump: an old entry holding one fails to decode, which is a miss. No codec_struct field is removed. That is why SamplerDesc.ycbcr stays. The guard hash (crates/metal2vulkan-validation/runtime-sources.sha256) moves for the bind/ sources this deletes and edits and for vk/draw.rs, which leaves its list. No run of an unchanged artifact changes: what stays in bind/ computes what it did (the heap's tier check takes the same storage format; its removed sampled branch had no caller). Docs: docs/API.md (section 5 is the interface; the binding and plan sections go), README.md, docs/ARCHITECTURE.md, docs/HOWTO.md, docs/VALIDATION.md, the runtime README's DrawInput and identity-domain rows, docs/REFUSALS.md (regenerated; the binder's section goes), api_reference.md, api_signatures.tsv (blessed: removals only), tests/api_surface.rs, the signatures floor (5000), the bind modules' own docs, and the public field docs of PushField, RuntimeFact and SpecKey that named BindState, BindShape or BindingPlan. AGENTS.md: the project table names pipelines and their interfaces, not binding plans; its "core lives in" line stays true (bind/ still holds what the lowering reads). Verified on 31692939d4, this commit's tree (steelbrain/cutbinder-probe-6): job m3-max-68107, fmt, signatures, refusal surface, clippy -D warnings (workspace plain, --cfg m2v_gpu, --cfg m2v_cpu_icd; the translator with no feature and with each alone; the AIR crate alone), workspace Rustdoc -D warnings, each crate's private intra-doc links at 0, api-docs; job m3-max-68109, the product, validation and conformance suites, doctests, and on lavapipe the validation and runtime suites under --cfg m2v_cpu_icd, the conformance replay and the public cases' qualification. |
||
|
|
d9077dfa0d |
Push window: each device's maxPushConstantsSize sizes it, up to 256 bytes (rule 2's ninth form)
What: the push window is one value per device, `DeviceProfile::push_window`, the description's
maxPushConstantsSize up to 256 bytes, decided in the profile `Device::from_queries` derives
(device/profile.rs:115). Every window reads it: push placement (`lower::push::window`, `place`,
`spills` and `check_floor` take its bytes; lower/select.rs, lower/access/mod.rs and
lower/access/table.rs pass it), and in the runtime the one pipeline layout's push range
(device.rs:688), the kernel and render pipelines' push checks (pipeline.rs:2119, render.rs:1043)
and the encoder's push bound (encoder.rs:1759). With W that value, a kernel pushes in [0, W), a
vertex function in [base, W - 8) and a fragment function in [base, W); object and mesh functions
keep 0..32 and 32..64. A stage's fields past its window spill to its parameter block, whose
address the window holds, as they did past 256. `from_queries` refuses a maxPushConstantsSize
below 128, Vulkan's least, only (`Unsupported{PushWindow}`, required 128), and the runtime's
floor no longer lists maxPushConstantsSize (floor.rs: its row and PUSH_CONSTANT_BYTES go; the
layout's range was a constant 256). There is no constant 128 path, no switch and no environment
gate: the limit query is the only input. Ported from the held branch steelbrain/amdfloor-window
(d6880ca16b) onto today's development, every line reference confirmed against this tree.
Why: the owner's word choosing option B. A device reporting 128 bytes was refused by the floor;
it now runs with a window of 128.
AGENTS.md rule 2 takes the owner's authorized text: "for eight only" becomes "for nine only",
and the push window joins the list after run-time texel offsets.
Known gap (runtime README, Known gaps of indirect command buffers): in a window of 128 bytes a
command reaches 9 vertex slots, and 8 where the vertex function spills, against 25 and 24 at 256
((W - 8 - 16 - 28) / 8; from code: lower::push's
an_indirect_draw_s_vertex_function_pushes_25_or_9_slot_words). A kernel pushes 8 buffer
addresses beside its dispatch region at 128 bytes against 24 at 256, the rest from its ring.
Caches: a device of 128 and one of 256 share no cached artifact and no pipeline. The profile's
fingerprint hashes every ProfileFields field by Debug (device/profile.rs:312, :327), the limits
included (:346, maxPushConstantsSize at :625); `function_key` hashes the fingerprint
(pipeline/compile/key.rs:182, :189; passed at pipeline/compile.rs:2973), as does
`queried_render_descriptor_key` (key.rs:546); a cached artifact or pipeline loads only under an
equal fingerprint (cache/artifacts.rs:71, :204, :238; cache/envelope.rs:142); and the runtime's
enables digest, which the stage keys check, hashes it (metal2vulkan-runtime/src/device.rs:1533).
SEMANTICS_VERSION stays 2273: no module changes under an unchanged key. Every device
`from_queries` accepted before reports 256 bytes or more (it refused below 256), so its window is
256 as before and its modules are the same bytes; a device of fewer bytes was refused, so it
holds no artifact to go stale, and its modules are new under its own fingerprint. The golden
test at this tree found 0 cells changed under an unchanged key over the 15 committed profiles,
and 1855 under a changed profile fingerprint, runtime-floor's column alone (m3-max-68089; the rows
whose assembler Linux lacks are not observed there).
Golden table: runtime-floor.json and its generator drop the floor block's maxPushConstantsSize
of 256, so the profile reads Vulkan 1.3's least, 128, and its fingerprint moves. Its cells are
re-blessed on development (the bless needs macOS's assembler).
Validation: runtime-sources.sha256 is rewritten (d4a8dbf2...), since device/derive.rs and
device/profile.rs are runtime inputs the guard hashes.
Docs: the runtime README (the floor's limits note and table, compute Parameters, the render push
range, the indirect command buffers' known gaps), docs/API.md section 5 and the from_queries
paragraph, PushWindow's doc, reach.tsv and docs/REFUSALS.md (regenerated; the PushWindow row
only), the device profiles' README, and api_signatures.tsv (DeviceProfile::push_window). The
api_surface table is unchanged: no public type is added.
Tests: lower::push's placement at 256 and 128; from_queries (each committed profile's window is
its limit up to 256, runtime-floor's 128; 128 derives, 64 is refused with required 128); the
tessellation control range, the engine identity and spill tests in each profile's window; and
the runtime's push_window, patch and indirect token tests in two arms each, the device's own
limit and the limit held at 128 by the tests' device shim (tests/command.rs push_window_128,
DeviceOptions::described).
Verified:
- m3-max-68088 (this tree): fmt, the signatures table, the refusal surface, clippy -D warnings
plain, --cfg m2v_gpu and --cfg m2v_cpu_icd, workspace Rustdoc -D warnings: each exit 0. The
runtime suite on lavapipe (--cfg m2v_cpu_icd): 647 passed, 3 skipped. Its push lines read
"push_window: the push window is 256 bytes", "push_window_128: the push window is 128 bytes",
"window 128, 12 buffers: 3 ring writes and 3 pushes over 3 dispatches", "icb_tokens: ... the
push window 256 bytes, 25 slot words", "icb_tokens_128: ... the push window 128 bytes, 9 slot
words", and draw_patches_full_range at 256 and _128 at 128.
- m3-max-68089 (this tree): the core crates 3881 of 3882 passed, 24 skipped; the one failure
is the golden table, stale under runtime-floor's moved fingerprint (1855 cells, one per row
observed on Linux, 0 new, 0 gone, 0 under a changed source, 0 changed under an unchanged key).
Validation 1314 passed, 3 skipped. The translator's push tests print each committed profile's
window: runtime-floor 128, the vertex function ending at 120, 9 inputs; the 14 others 256.
- m3-max-68067: the whole runtime suite on lavapipe at an earlier tree of this change
(a98af765ad, before the rebase onto
|
||
|
|
b5916b2f7b |
Translator: four public items nothing produces or names go: the replay fault report, the rate-map note, two rate-map errors and the rate-map axis
Four of the eight findings on the binder's public surface, the ones no plan reaches: - (3) `bind::ReplayFaults`, with `StatusReport::replay_fault` and `replay_faults`, `StatusBits::REPLAY_FAULT` and `StatusWord::ReplayFaults`: no module writes the word or the bit. `StatusWord::SeqCstFences` keeps index 3, so no module changes; word 2 is now one nothing writes. - (5) `PrecisionNote::RasterizationRateMap`: no module or runtime path records it (the decoder is Apple's arithmetic, and the runtime draws no rate-mapped pass). Its API.md catalogue entry goes, and so does conformance's `Degradation::RasterizationRateMap` with the notice allowances of the three rate-map families, whose runtime side refuses every rate-map call (`Unavailable`, known-gaps-rt.tsv), so the allowance never applied. Validation's c3 list of deferred near-equivalents drops it, and its tests use `SparseResidency` instead. The translator's rate-map tests drop their assertions that the note is absent. - (6) `RateMapError::NoLayers` and `LayerCount`: only the test support `from_layers` made them; it now panics on a count no test passes. - (7) `RateMapAxis`: in no public signature; now crate-private. The codec encodes a precision note by its name, so no other note's encoding moves. No refusal in docs/REFUSALS.md changes (refusal_surface.py --check passes as is). Consumer search at reims-vgpu development cae6d420df, `git -C ~/Projects/steelbrain/reims-vgpu grep -n -w ITEM development -- '*.rs'`: ReplayFaults 0, replay_faults 0, replay_fault 0, REPLAY_FAULT 0, StatusWord 0, RasterizationRateMap 0, Degradation 0, RateMapError 0, NoLayers 0, LayerCount 0, RateMapAxis 0. Left for later, with the census's re-record: two authored cases' rationales (shard_013, lines 33 and 34) still say the decoder's answers carry the note. (cherry picked from commit b68324630b4c8446d7fe730b3877b31727546d1c) |
||
|
|
b92c74e489 |
Translator: a render or mesh pipeline compiles only as the runtime compiles it; validation stops compiling for a bind shape
`Device::compile_render_variant` and `Device::compile_mesh_variant` leave the public API. The runtime renders under `VariantKey::new()` alone, and since the census compiles as the runtime does, the only callers left were validation's bind-shape compiles: the `PipelineRequest::BoundCompute` request, the `shape` of `VertexDraw` and `Draw`, and corpus-pipeline's `--pulled` sweep (its `Projection`). Those go with them. `compile_render_pipeline` and `compile_mesh_pipeline` compile under `VariantKey::new()` as before, and `compile_render_pipeline`'s doc now carries the call-stack sentence the variant's doc held. The crate's own tests keep a test-only `compile_render_variant`. In validation the kernel compile the census and L4 share (`variants::compile_kernel`) stays, with its partial-simdgroup test now comparing against explicit plain and emulated compiles. The binder's shape-compile loop moves under `#[cfg(test)]` (`variants::bound`) for the binder tests that still plan a kernel until the binder goes. The draw test helpers compile as the runtime does. The worker's bound-compute exchange test goes, and its linking test sends a `Kernel` request. Nothing here changes what plan_for is given or returns: the census's artifact digest still plans the same pipeline for the same shape. Consumer search at reims-vgpu development cae6d420df: git -C ~/Projects/steelbrain/reims-vgpu grep -n -w compile_render_variant development -- '*.rs': 0 git -C ~/Projects/steelbrain/reims-vgpu grep -n -w compile_mesh_variant development -- '*.rs': 0 api_signatures.tsv drops the two records. (cherry picked from commit 15766b53448bafc7cd16d9acd335dd3d4c45d734) |
||
|
|
0702b43baf |
Translator: a kernel's partial-threadgroups variant that cannot be made is refused as PartialThreadgroups
Every refusal of the partial-threadgroups variant (LoweringInputs::partial_threadgroups) named Feature::GpuEncodedIndirectCommands, the feature of indirect command buffers a kernel encodes, which none of them is. A new feature, Feature::PartialThreadgroups (NotImplemented), names them all: - lower/select.rs (finish): the kernel's simdgroups run on the emulated tier (its profile's subgroups, its lockstep order or its pinned widest mode give it that tier), whose exchanges are not walked past the grid. This is the one a SIMD-group or quad-group kernel meets on a device whose subgroups are narrower than 32 (lavapipe, and the Iris Xe in the equality test). - lower/simd/divergent.rs (barriers): a kernel whose uniform barriers need a vote word its stage's workgroup memory cannot hold beside its static arena. - lower/mesh/mod.rs (plan_partial_groups): a tile function, a kernel that reads a stage-input region, one with compute derivatives or a cooperative imageblock slice write. - pipeline/compile.rs (analyze_one): the input beside flat_grid, folded_groups, replay_bindings or emulated_simdgroups. Its condition was one with the folded and call-threadgroups combinations, which stay GpuEncodedIndirectCommands; it is split in two. Today the four sites build the same refusal with no symbol, so no text tells the causes apart, and none is added. The flat variant's refusal at lower/select.rs:1715 (flat_grid with call_threadgroups, on the emulated tier or with a workgroup synchronization) stays GpuEncodedIndirectCommands: it refuses the flat variant, not the partial-threadgroups one, with the flat variant's other refusals (lower/access/mod.rs plan_replay, pipeline/compile.rs analyze_one); the runtime never sets flat_grid (no hit in crates/metal2vulkan-runtime/src). The runtime's test of a refused variant (pipeline.rs, the non-observer's lowering) matches the new feature, so a variant refused now is still kept as a refusal and its state runs the plain module. A refusal kept in a device's cache directory before this commit still reads: the marker (cache.rs REFUSED) holds no feature, and it is found by the variant's key (function_compile_key), which this commit does not move. No version moves. No persisted outcome records the moved refusals' class: - the runtime's cache directory: the marker above, under an unchanged key; - the golden tables (golden_hashes.tsv, 77 GpuEncodedIndirectCommands cells; public_fixture_expectations_engine.tsv, 96): every subject compiles under no inputs, where partial_threadgroups is false, and every moved site is reached only under it; - the authored compile census (corpus/authored-compile.tsv): no GpuEncodedIndirectCommands cell; - the committed observations, cutover lists and conformance recordings: no hit (git grep -c over corpus/, cutover/ and crates/metal2vulkan-conformance). The runtime guard's inputs do not change: every file edited here is outside them or on the guard's list of compile-time files. The consumer: git grep -n 'GpuEncodedIndirectCommands' cae6d420df in its checkout gives 0 lines (and 0 for PartialThreadgroups). docs/REFUSALS.md is regenerated (scripts/refusal-surface/refusal_surface.py), with the new row's reach mark in reach.tsv (app: a dispatchThreads grid that is not whole threadgroups), and the signatures table (api_signatures.tsv) has the new variant (signatures.py --bless); the api_surface table lists Feature as an enum, not its variants, so it does not change. docs/API.md section 5 and the partial_threadgroups input's doc name the new feature. The translator's partial-threadgroups tests assert it. |
||
|
|
9a01f1e8ee |
rt: an observer's dispatch runs its partial-threadgroups variant only where the variant's threadgroup memory, its vote word included, is within the device's limit
|
||
|
|
f090d99c9a |
rt: an observing kernel's indirect dispatches run its partial-threadgroups variant too
decide() moved an observer's whole grids and threadgroup dispatches onto the partial-threadgroups variant but left its indirect dispatches on the plain module, so a state dispatched both ways made a second VkPipeline of the same size on the first indirect dispatch. By the translator's dispatch regions (lower::dispatch), an indirect dispatch states region[1].xyz = 0 and takes the single-region form, and the variant's partial answers sit only under region[1].w NONUNIFORM, which the encoder's indirect region never sets. So the variant runs it unflagged, every invocation live, as it runs a whole grid. decide() now drops the direct-only condition: one module and one VkPipeline a size run every dispatch of an observing kernel where the variant takes the threadgroup. Metrics::partial_variant_whole_grids counts the indirect ones with the whole grids. No key, version or translator file changes. Tests: the observing kernel's run table expects its indirect dispatch on the variant (one first-use wait fewer where it shares a size with a direct dispatch, and one more count); prepare_dispatch's table gains an indirect dispatch at the whole grid's size that finds the variant made (0 makes; 1 before this change); the variant-key table groups the indirect dispatch with the direct ones. The conformance case compute-indirect-threadgroup-grid dispatches region_k, an observer, indirectly; its dispatch-forms line is the check that the replay ran it on the variant. Checks to run on this commit: tests::translate and the conformance replay on a card per vendor. |
||
|
|
6453edbea7 |
rt: an observing kernel runs its whole grids on its partial-threadgroups variant, one VkPipeline a size for every direct dispatch
A kernel that observes its threadgroup partition made two VkPipelines for one threadgroup size: the plain module's for whole grids and threadgroup dispatches, and the partial-threadgroups variant's for ragged grids. The variant already runs a whole grid as the same regions unflagged (lower/dispatch.rs), so decide() now sends every direct dispatch the whole module would run to the variant where the variant is lowered and takes the threadgroup whole SIMD groups. Indirect dispatches, a refused or failed variant, and a threadgroup that is not whole SIMD groups of a kernel that runs only whole ones (the emulated route) keep today's module. A state with a declared bound or a required size makes one VkPipeline ahead instead of two. Metrics::partial_variant_whole_grids counts the whole grids that ran the variant; the player's executed counters and the conformance runner print it. Nothing re-keys: the translations are unchanged (the plain module is still lowered: its interface numbers the samplers, answers Metal's state and runs indirect dispatches), and no version moves (metal2vulkan-runtime is outside RUNTIME_VERSION's inputs). |
||
|
|
53dd17e008 |
Translator: delete VkFeature's RobustBufferAccess and RobustBufferAccess2, which nothing reads
The batch deleted the translator's choice between the driver's buffer robustness and the in-shader check: every buffer access is checked in the shader, and no lowering reads robustBufferAccess or robustBufferAccess2. The runtime enables neither (its floor table names neither; robustImageAccess, robustImageAccess2 and nullDescriptor are its robustness features, and robustImageAccess2 stays: memory::contain reads it for images). What still named the two was the enable-set vocabulary around them, so it goes with them: - VkFeature::RobustBufferAccess and VkFeature::RobustBufferAccess2, from the enum, its codec, the exposure table (Vulkan 1.0 core; VK_EXT_robustness2 keeps robustImageAccess2 and nullDescriptor), the Khronos reader's member table, the ash query's feature sources, and required_features (whose Vulkan 1.0 tier held robustBufferAccess alone and goes). - The co-enable rules only they took part in: robustBufferAccess2 needs robustBufferAccess (VUID-...-robustBufferAccess2-04000, a FEATURE_NEEDS row), and the update-after-bind features of buffer descriptor types beside robustBufferAccess without robustBufferAccessUpdateAfterBind (VUID-VkDeviceCreateInfo-robustBufferAccess-10247: device::enables' crate-private BUFFER_UPDATE_AFTER_BIND and BUFFER_UPDATE_AFTER_BIND_VUID, and its branches in co_enable_violation and co_enabled). The multiview rules stay. - DeviceDescription::robust_buffer_access_update_after_bind, which only that rule read, with its Khronos and ash readers and the Device's copy. So a recommendation now keeps every update-after-bind feature a device lists: runtime-floor's, which used to leave its two texel-buffer ones out beside robustBufferAccess, holds them, and a device made from it compiles texture buffers. docs/API.md's section 2 and the enable-set docs say that the recommendation names neither robustness feature, and that a consumer who enables robustBufferAccess itself keeps VUID 10247. The consumer's checkout (reims-vgpu development d80a432f3a, `git grep -n -w ITEM development -- '*.rs'`) names none of the deleted public items: RobustBufferAccess 0, RobustBufferAccess2 0, robust_buffer_access_update_after_bind 0 (BUFFER_UPDATE_AFTER_BIND 0 and BUFFER_UPDATE_AFTER_BIND_VUID 0, both crate-private). It names no VkFeature and no DeviceDescription at all, so no glob import or re-export hides a hit. No module changes: no lowering read either feature. Every committed profile's fingerprint moves (each listed robustBufferAccess, a Vulkan 1.0 requirement), so every golden cell and every key under one moves with it: bless-class, a changed fingerprint, no SEMANTICS bump. The codec names a variant by its tag, so no other feature's encoding moves; an artifact naming a deleted feature would sit under a fingerprint that no longer exists. The tests follow: those of the deleted rules go (recommendations_keep_robust_buffer_access_and_ vuid_10247, a_recommendation_keeps_vuid_10247, both robust_buffer_access_update_after_bind readers' tests); tests that ran every profile "with robustness and without" lose the leg that was the same profile (engine_access, _atomics, _binder, _buffer_table, _copy, _dynamic_roots, _gep_index, _index_words, _kernel_stage_in, _link, _pointer_memory, _pointer_values, _rate_map, _skeleton), and the out-of-bounds cases those tests ran only on the bare leg (short stage-in buffers, far rate-map coordinates, huge copy lengths, 8- and 16-byte leaves past the end) now run on every profile; image robustness lists keep their two image features. Validation maps the two members to no feature (registry names kept), its tier table's robustness-off leg removes the image features alone, and its tests check the two members unset in the chain. The runtime's tests stop naming them. profiles_both_encodings' second leg is now the profile unchanged; the next commit removes it. api_signatures.tsv re-blessed (3 records gone); refusal surface unchanged. |
||
|
|
8ed044f2e8 |
Translator: a replay variant under the identity domains is refused, typed
The commit before this one placed the RootTableAddress a device-replay variant
(VariantKey::replay_bindings) reads its buffer slots' addresses from, so under the identity
domains the variant no longer ends in the internal error "a strategy reads the unplaced push field
RootTableAddress". Its message said the variant then compiles there; it does not. With the field
placed, the plan reaches select::identity_admits, whose admitted push fields hold no
RootTableAddress: the identity domains read no root table, and the variant is refused,
Unsupported{IdentityDomains} (NotImplemented) naming "an encoder value the function reads as
RootTableAddress". That refusal is the true answer: only the binder (bind/replay, bind/dispatch,
bind/graphics) asks for a replay variant, and the runtime, the one consumer of the identity
domains, never sets replay_bindings (no hit in crates/metal2vulkan-runtime/src). The refusal
site and its row are the existing ones, so docs/REFUSALS.md does not change.
So the tests say the refusal:
- pipeline::compile::tests::a_replay_variant_under_the_identity_domains_is_refused_typed (was
..._reads_its_root_entries): icb_render_replay_template, icb_render_stride_template under the
pulled-vertex-buffer variant and icb_replay_template under the identity domains with replay
bindings are each refused, typed, with that feature, need and symbol.
- tests::engine_device_replay::
a_replay_variant_under_the_identity_domains_reads_its_slots_from_their_root_entries goes, with
its module-doc paragraph: no such module is made.
docs/API.md section 5 now says the variant is refused there, and slot_address_field's comment
names the admission that refuses it.
Verified: before this commit, on m3-max-66628 (the product suite at 84c6726dd8, a
card-free host build), both item tests failed with exactly this refusal at the three compile
calls and the engine kernel; without the placement, m3-max-66629 (probe branch
steelbrain/halfmoves-probe-nofix2) failed both with the internal error, so the new test fails
without the placement. This commit's own run is the next compile job.
|
||
|
|
46a9a57522 |
Docs: the runtime binds through no stage table; the validation executor sets its buffer ranges
docs/API.md section 5 said of StageTable::buffer_ranges "The runtime sets it on every table it reads." The runtime builds no StageTable and reads no BindState: crates/metal2vulkan-runtime names no StageTable, BindState, BufferRanges or buffer_ranges, and of the binder it takes only alpha_test_code, SamplerDescriptor and AstcDecode. The tables that set it are the validation executor's: every table its candidate engine builds for a compute, render or mesh case passes through candidate::engine::lengths_classed with BufferRanges::of its profile's limits. The sentence now says so. Verified: grep over crates/metal2vulkan-runtime/src for those four names (no hit) and for metal2vulkan::bind (the three items above); the validation builders read at candidate/engine.rs, engine/graphics.rs and engine/mesh.rs, the one other StageTable there (engine/variants.rs) inside a #[test]. Docs only. |
||
|
|
9df6908e36 |
Translator: a replay variant under the identity domains pushes the root table its slots are read from
Under the identity domains a device-replay variant (VariantKey::replay_bindings) ended in an internal error, "a strategy reads the unplaced push field RootTableAddress": a vertex function's buffer arguments, the attribute of the pulled-vertex-buffer variant and a kernel's buffers alike. The variant reads each buffer slot's address from its replayed command's root entry (access::replay_guest_base, which a replay variant's SlotGuestBase reads route to), and the translator already holds it so: the address is not biased in a replay variant (pointer::biased), and its accesses take no SlotBounds (access::identity_contained). But place_slots pushed every device-address slot's SlotGuestBase under the identity domains, whatever the variant, after plan_replay had replaced the selection's SlotGuestBase fields by RootTableAddress. So nothing pushed the root table's address the derived reads load. The field is placed: a device-address slot's push field is its own address only under the identity domains outside a replay variant (slot_address_field), in place_slots and in the census its spill decision reads, and the root table otherwise. No refusal changes, and no module of a compile that succeeded before changes: the combination never compiled. The branch's one SEMANTICS bump (2273, the half-move commit before this one) covers it. docs/API.md section 5 states where a replay variant's slot addresses come from under the identity domains. Verification: - pipeline::compile::tests::a_replay_variant_under_the_identity_domains_reads_its_root_entries, new: icb_render_replay_template, icb_render_stride_template under the pulled-vertex-buffer variant, and icb_replay_template compile under the identity domains with replay bindings, every buffer slot at its device address, RootTableAddress pushed and no SlotGuestBase or SlotBounds, every stage through L3. - tests::engine_device_replay:: a_replay_variant_under_the_identity_domains_reads_its_slots_from_their_root_entries, new: a kernel compiled so on every committed profile under the identity domains pushes RootTableAddress alone, and on the CPU interpreter reads and writes at the addresses its root entries name (guest plus bind_offset, 16 bytes into one buffer), above 4 GiB. |
||
|
|
4892518700 |
Translator: a half the lowering moves through a containment select or a candidate switch keeps its bits
A half moved without arithmetic must keep its 16 bits, a NaN's payload included: a move is not
the device's arithmetic, so no precision note covers it. bb44847705 fixed the contained load of
device memory. Four more moves the lowering makes itself lost the bits:
- the contained loads of the arenas (lower/access/local.rs) and of the constant blob (blob.rs)
selected the decoded f32 with no bits note;
- the switch-at-use over a pointer's candidate buffers (emit.rs: the device buffers' switch and
the blob-or-buffer switch) merged the arms' decoded f32 by a phi with no note.
A store of the moved half then re-encoded it by the device's narrowing. On the CPU interpreter
2045 of the 2048 all-ones-exponent patterns came back 0x7e00 (0x7c01 to 0x7e00, for example) at
each of the four, on every committed profile under the resident-table domains (job m3-max-66591,
the new test without this change).
One form for every move the lowering makes: the bits move beside the value and are noted for the
result, so a later narrow::to_bits returns them.
- A containment select is leaf::contained (bb44847705's narrow::select_zero) at every
containment select of a leaf: device views and addresses as before, the arenas, the constant
blob, and the pulled fetch's source read. The pulled fetch reads raw integer components and
decodes a half after the select, so its output does not change.
- A switch merge: each arm carries its value's parts and their bits (leaf::carried, the bits
from narrow::moved_bits: the bits noted for the value, else its to_bits), the merge's phis
carry both, and leaf::merged notes each part's bits phi for its value phi
(narrow::note_moved), chunk by chunk for a chunked vector.
Where the moved value is stored unchanged, the f32 select or phi and the decodes are dead and
leave the module; where it is computed with, the bits ones are.
Not changed: a leaf that is no narrow float (carried and merged pass its value alone); the
program's own select and phi of a half, which stay the device's moves under
PrecisionNote::NativeNanEncoding; typed objects, which hold a half widened.
SEMANTICS_VERSION 2272 to 2273 (2272 is lane irisvsimd's, landed first): a module that
stores a half moved through one of these paths changes.
Verification:
- tests::engine_half_moves::our_own_moves_keep_every_half_patterns_bits, new: four kernels move
the patterns through a contained private-arena load, a contained constant-blob load, the switch
over two device buffers (an eight-lane half vector, so chunked) and the switch over a constant
buffer or the blob, each module's path asserted (its census key, or its switch-at-use), on every
committed profile under the resident tables. Without this change it fails at all four (job
m3-max-66591: 2045 of 2048 changed, 5 distinct modules each); with it every pattern keeps its
bits (job m3-max-66584, 2 distinct modules each).
- Compile job m3-max-66584 at this tree: fmt, signatures, refusal surface, clippy plain,
--cfg m2v_gpu and --cfg m2v_cpu_icd, workspace rustdoc -D warnings, api-docs.
- The 252-row hash probe over the two app libraries on validation's runtime description: 252 ok,
0 of 252 module hashes move (job m3-max-66587 against m3-max-66590 at
|
||
|
|
4c21ead93c |
bind: the items nothing outside bind/'s own tests reached go, with the tests of them alone
What goes: every item of the translator's bind/ that no product code, no other crate of the
workspace and no consumer reaches, by rustc's own dead-code answer with bind/'s items made
crate-private (no table is trusted), and the tests that test only them. Six files go whole
(acceleration, chroma_decode, rate_map/regions, replay/rules, sample_interleave, tile_map), and
with them replay/draws, replay/generated, fan_out's tests, the device replay's preprocess and the
host replay (replay.rs keeps the merged draw's reads), the heap element and raw-form readers, the
resident set, the mesh arguments module, the rate-map regions, the sparse tile map, the chroma
decoders and the sample interleave modules. Also the empty `impl Device {}`, and the three Device
calls nothing in the tree made: render_descriptor_key, mesh_descriptor_key and
compile_function_with_report (compile_function keeps its body). The old-key test
(the_old_render_descriptor_key_keeps_its_value) goes with render_descriptor_key: one bless item
fewer at every pin.
What stays: what anything reaches. The consumer-reached ArgumentBufferLayout family, the merged
draw's reads (replay/merged and the helpers replay.rs keeps), ycbcr_convert's and
mesh_arguments' reached items, and every bind item validation, conformance, the runtime, the
harness or the examples name. A CPU oracle, accessor or constructor that only tests call, and
whose tests check kept behaviour, becomes #[cfg(test)] test support where it is (812 lines: the
argument layout's `argument`, the YCbCr read model, YCbCrPlanes and YCbCrInPlace's constructors
and accessors, the rate map's accessors and constructors, FunctionTableWords and the snapshot's
bytes, the ASTC and ETC texel formats and block values, heap_classes and image_classes). The
public types without a constructor (TexelRows, YCbCrInPlace, IndirectRef, ViewMapping,
TileThreadgroupMemory, TileThreadgroupArgument, ArgumentFunctionTable, ResidentRange,
BoundAccelerationStructure) stay: a public field or parameter of the library takes each.
Lines (from the batch's tip): product 9,219 removed and 728 added; test 7,758 removed and 381
added. 137 test functions or helpers outside the deleted ones are edited off a deleted item, the
largest by 22 lines. Validation, conformance, the harness and the runtime change only in doc
comments that named a deleted item.
Docs: docs/API.md says what is true now (no replay, no heap element reader, no has_shape, the
texel-buffer parts rule stated inline), docs/REFUSALS.md regenerated, api_signatures.tsv blessed
(522 records out), the api_surface table drops 79 bind names.
Consumer hits at its development (git grep -n -w ITEM development -- '*.rs'). The consumer
imports from metal2vulkan::bind only ArgumentBufferLayout, ArgumentDescriptor,
ArgumentLayoutError and ArgumentType, with no glob, and the runtime re-exports only
bind::SamplerDescriptor; every non-zero count below is a generic word whose hits are the
consumer's own items (none of their lines names metal2vulkan; its 22 `.argument(`/`.place(`
calls are on its own types).
Device::render_descriptor_key 0, Device::mesh_descriptor_key 0,
Device::compile_function_with_report 0.
Deleted public top-level items (93):
ARGUMENT_BYTES 0, bit_index 0, bit_set 0, ChromaDecode 0, draw_merge_module 0, draw_replay_draw 0,
draw_replay_indexed 0, draw_replay_merges 0, draw_replay_module 0, draw_replay_preprocess 0,
draw_replay_primitive_type 0, draw_replay_slots 0, draw_replay_state 0, draw_replay_vertex_layouts
0, DRAW_REPLAY_WRITES 0, DrawMergeModule 0, DrawReplay 0, DrawReplayLayout 0, DrawReplayModule 0,
DrawReplayPreprocess 0, DrawReplayRule 0, extent_of 0, FORMAT 5, GeneratedLayout 0, GeneratedReplay
0, GeneratedVariant 0, geometry_flags 0, GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION 0, GEOMETRY_OPAQUE
0, geometry_table_offset 0, handle_entry_flags 0, HANDLE_TABLE_CAPACITY 0, heap_element 0,
heap_raw_form 0, HeapElement 0, HeapElements 0, InheritedBytes 0, instance_record 0, InstanceRecord
0, interleave_merge_modules 0, interleave_split_module 0, InterleaveMergeModules 0,
InterleaveSplitModule 0, level_extent 0, MAX_DRAW_REPLAY_TYPES 0, MAX_REPLAY_DISPATCHES 0,
MAX_REPLAY_REGIONS 0, MAX_REPLAY_SLOTS 0, MAX_REPLAY_VARIANTS 0, MAX_SEGMENT_COMMANDS 0,
merge_fragment_typed_module 0, MERGED_CHUNK 0, MERGED_HEADER_BYTES 0, MergedLayout 0, MergePhase 0,
mesh_arguments_module 0, MeshArgumentsModule 0, MeshGridRule 0, MetalInstance 0,
NEUTRAL_HEAP_ELEMENT 0, NO_HOLE 0, PARAMS_BYTES 0, PlanesCopy 0, primitive_wrap 0, RateMapRegion 0,
RateMapRegions 0, REGION_BYTES 0, RegionError 0, RegionLimits 0, replay_preprocess 0,
replay_preprocess_generated 0, replay_preprocess_module 0, ReplayExecution 0, ReplayLayout 0,
ReplayPreprocess 0, ReplayPreprocessModule 0, ReplayVariant 0, resident_view 0, ResidentSet 0,
ResidentView 0, resolve 179, SCRATCH 0, SLOT_TABLE_BYTES 0, SOURCE 7, SparseTileMap 0,
split_typed_module 0, STATUS 42, TEMPLATE_HEAD_BYTES 0, texel_buffer_parts 0, TileMapError 0,
TileMapping 0, typed_module 0, VARIANT_BYTES 0
Deleted public methods and associated items (126; the count is of the member's name):
ArgumentFunctionTable::at_address 0, BindingPlan::heap_elements 0, BindingPlan::instantiate_replay
0, BindingPlan::relisted_sampler_tables 0, BindingPlan::sampler_tables 0,
BindingPlan::unit_axes_variant 0, BindState::has_shape 0, BindState::has_shape_beside_used 0,
BoundBuffer::same_shape 0, ChromaDecode::ALL 62, ChromaDecode::BLOCK_BYTES 0,
ChromaDecode::block_extent 0, ChromaDecode::decode 2087, ChromaDecode::decode_into 26,
ChromaDecode::of 20774, ChromaDecode::TEXEL_BYTES 0, ChromaDecode::texel_format 0,
DrawMergeModule::HEADER_PUSH 0, DrawMergeModule::LOCAL_SIZE 0, DrawMergeModule::PUSH_BYTES 0,
DrawMergeModule::push_constants 0, DrawMergeModule::STATUS_PUSH 0, DrawReplay::new 9170,
DrawReplayLayout::argument_offset 0, DrawReplayLayout::fragment_table_offset 0,
DrawReplayLayout::params_offset 0, DrawReplayLayout::vertex_table_offset 0,
DrawReplayModule::LOCAL_SIZE 0, DrawReplayModule::PUSH_BYTES 0, DrawReplayModule::RECORDS_PUSH 0,
DrawReplayModule::RESIDENT_PUSH 0, DrawReplayModule::STATUS_PUSH 0, EtcDecode::block_extent 0,
ExecutionStatus::WORDS 7, GeneratedLayout::count_offset 0, GeneratedLayout::dispatch_offset 0,
GeneratedLayout::INDEX_OFFSET 0, GeneratedLayout::max_sequences 0, GeneratedLayout::PUSH_OFFSET 0,
GeneratedLayout::sequence_offset 0, GeneratedVariant::new 9170, HeapElements::element 103,
ImageViewDesc::new 9170, InstanceRecord::bytes 7067, InstanceRecord::BYTES 29,
InterleaveMergeModules::SET 43, InterleaveMergeModules::WIDE_BINDING 0,
InterleaveSplitModule::LOCAL_SIZE 0, InterleaveSplitModule::SET 43,
InterleaveSplitModule::SOURCE_BINDING 0, InterleaveSplitModule::WIDE_BINDING 0,
MergedLayout::draw_offset 0, MergedLayout::group_count 0, MeshArguments::ARGUMENT_BYTES 0,
MeshArguments::new 9170, MeshArguments::OBJECT_RECORD 0, MeshArguments::scratch_bytes 0,
MeshArgumentsModule::PUSH_BYTES 0, MeshArgumentsModule::SCRATCH_BINDING 0, MeshArgumentsModule::SET
43, MeshArgumentsModule::SOURCE_BINDING 0, MeshArgumentsModule::STATUS_BINDING 0, MeshGridRule::of
20774, MetalInstance::new 9170, ObjectFold::bytes 7067, PlanesCopy::ALL 62, PlanesCopy::format 3896,
PvrtcDecode::BLOCK_BYTES 0, PvrtcDecode::block_extent 0, PvrtcDecode::decode 2087,
PvrtcDecode::decode_rows 0, PvrtcDecode::level_bytes 0, PvrtcDecode::linear 144,
PvrtcDecode::TEXEL_BYTES 0, PvrtcDecode::texel_format 0, RasterizationRateMap::regions 39,
RateMapRegion::scissor_extent 0, RateMapRegion::scissor_offset 0, RateMapRegion::viewport 45,
RateMapRegions::admits 17, RateMapRegions::admits_planned_layers 0, RateMapRegions::MAX_REGIONS 0,
RateMapRegions::physical_size 4, RateMapRegions::precision 24, RateMapRegions::regions 39,
RegionLimits::new 9170, ReplayExecution::new 9170, ReplayFaults::ACTION 4, ReplayFaults::BARRIER 2,
ReplayFaults::BUFFERS 0, ReplayFaults::ENCODING 0, ReplayFaults::GROUP_COUNT 0,
ReplayFaults::PIPELINE 11, ReplayFaults::RANGE 0, ReplayFaults::RECORD 15, ReplayFaults::REGIONS 0,
ReplayFaults::VARIANT 0, ReplayFaults::VERTICES 0, ReplayLayout::argument_offset 0,
ReplayLayout::params_offset 0, ReplayLayout::region_offset 83, ReplayLayout::table_offset 0,
ReplayPreprocessModule::PUSH_BYTES 0, ReplayPreprocessModule::RECORDS_PUSH 0,
ReplayPreprocessModule::RESIDENT_PUSH 0, ReplayPreprocessModule::STATUS_PUSH 0, ReplayVariant::flat
30, ReplayVariant::new 9170, ReplayVariant::with_imageblock_size 0, ResidentSet::bytes 7067,
ResidentSet::holds 3097, ResidentSet::is_empty 1066, ResidentSet::len 4763, ResidentSet::with 6328,
RootTable::resident_ranges 0, SparseTileMap::byte_len 0, SparseTileMap::is_mapped 4,
SparseTileMap::new 9170, SparseTileMap::tile 141, SparseTileMap::to_bytes 6, SparseTileMap::update
185, StatusWord::ALL 62, TexelRows::elements 50, TexelRows::new 9170, TexelRows::size 3417,
TypedModule::requirements 11
Out of the public API into #[cfg(test)] test support (41; the count is of the last name):
ArgumentBufferLayout::argument 298, ArgumentPlace 0, AstcDecode::block_values 0,
AstcDecode::texel_format 0, EtcDecode::ALL 62, EtcDecode::texel_format 0,
FunctionTableSnapshot::byte_len 0, FunctionTableSnapshot::bytes 7067, FunctionTableWords 0,
FunctionTableWords::byte_len 0, FunctionTableWords::new 9170, heap_classes 0, image_classes 0,
RasterizationRateMap::from_layers 0, RasterizationRateMap::layer 325,
RasterizationRateMap::parameter_data_size 0, RasterizationRateMap::physical_granularity 4,
RasterizationRateMap::physical_to_screen 4, RasterizationRateMap::shader_physical_to_screen 0,
RasterizationRateMap::shader_screen_to_physical 0, RasterizationRateMap::vertical 19,
RateMapAxis::from_tiles 0, RateMapAxis::granularity 24, RateMapAxis::screen_extent 0,
RateMapAxis::tiles 148, ycbcr_read 0, ycbcr_texel 0, YCbCrCodes::units 507, YCbCrInPlace::bits 940,
YCbCrInPlace::element_bytes 0, YCbCrInPlace::elements 50, YCbCrInPlace::format 3896,
YCbCrInPlace::of 20774, YCbCrInPlace::view_bytes 3, YCbCrInPlace::with_planes_image 0, YCbCrPlanes
0, YCbCrPlanes::new 9170, YCbCrPlanesSampler::bits 940, YCbCrPlanesSampler::format 3896,
YCbCrPlanesSampler::matrix 122, YCbCrPlanesSampler::range 1784
|
||
|
|
03e13a12c9 |
Docs: object and mesh SIMD-group functions are a recorded refusal; the vertex quad row says shuffles
- docs/API.md, "Mesh pipelines": an object or mesh function that calls a SIMD-group, quad-group or SIMD-group matrix function is refused on every device, including a device that lists the task and mesh stages in subgroupSupportedStages. The translator models no subgroup facts for those stages (device/subgroup.rs, UNMODELED_STAGE). [[thread_index_in_simdgroup]] alone compiles there (the Linear tier). Until now no doc recorded this open gap where a user reads it. Of the corpus index's 14 object and 32 mesh functions, none calls an air.simd* or air.quad* intrinsic. - fixtures/public/engine/README.md, gsm2_vertex_quad_permutes' row: it said the translation emits Vulkan's quad instructions where the vertex stage takes them. It lowers each one to a subgroup shuffle through the ballot of the live lanes, on every device: a group plan takes quad instructions only in a kernel, as tests::engine_simd's vertex_quad_permutes_shuffle_through_the_live_lanes asserts. The runtime-sources.sha256 move from 032b641117 (device/derive.rs and device/subgroup.rs are runtime inputs) is a hash-only re-pin at landing, with no RUNTIME_VERSION bump. A run's behaviour does not change: the device's enables and caps are the same, and only the translator's subgroup model loses a field. |
||
|
|
e3fbf2ca99 |
PrecisionNote::VertexSimdgroupGrouping: a vertex function's simdgroup and quad operations run over the device's grouping
A vertex function that runs a simdgroup or quad operation (any group operation or AGX multiply-add: the simd plan's observes_lanes) records PrecisionNote::VertexSimdgroupGrouping on every device (lower::simd::finish). Metal's shading language defines its SIMD-group and quad-group functions for kernel and fragment functions (MSL 4.1 sections 6.10.2 and 6.10.3) and names no lane among a vertex function's inputs (Table 5.2), so in a vertex function the groups are the device's own, as FragmentSimdgroupGrouping already says of fragment functions. Validation takes the note as unbounded (a difference is a noted difference) and C3 defers its rows (DEFERRED_NEAR_EQUIVALENTS), as it does the fragment note; conformance names it metal2vulkan-degrade-vertex-simdgroup-grouping; docs/API.md's catalogue states it. SEMANTICS 2272. Why: on the Iris Xe (RPL-P, Mesa 26.2.6) 8 authored vertex cases mismatched the M3 Max while the Radeon 780M and the RTX 3090 matched. A raw Vulkan probe outside the runtime (a SPIR-V 1.5 vertex shader over 64 rasterizer-discarded points, validation layer on, 0 messages; Iris Xe job m3-max-66302, Radeon 780M m3-max-66303, RTX 3090 m3-max-66304) read SubgroupSize 32 in every Iris vertex invocation with lane ids 0 to 7 only: 8 subgroups of 8, in each run of 16 vertices the even ones in one and the odd ones in another, every vote, sum, shuffle and quad broadcast exact over the driver's own groups. The 780M runs one 64-lane group in vertex order, the 3090 two 32-lane groups. Vulkan holds SubgroupSize to subgroupSize for a SPIR-V 1.5 module and promises full subgroups only to stages with workgroups, so the driver answers per its properties, and the translator's tier follows the stage's queries (Iris: vertex not in requiredSubgroupSizeStages, Direct at the API size 32). The 8 cases' outputs on the Iris (m3-max-66342) equal, word for word, Metal's semantics over the Iris's own groups with the partly-live rule's own-value read for a lane that takes no part (0 differing words in each of the 8; the grouping of the 40- and 42-point draws is inferred from the 64-point rule). |
||
|
|
54cd974bae |
Translator: a signalling float NaN constant records NativeNanEncoding
Observation: the RTX 3090 run of the authored case b315adcc (float-operations-decided-by-a-bound-constant-fast, fixture sfold_fast.ll, job m3-max-66255) differs from Metal at words 16-19 and 68-71. That is f[4] = fma(float4(k_snan), x, x) with k_snan bound to the signalling NaN 0x7f800321: Metal stores 0x7f800321 and the 3090 stores 0x7fc00321. The module recorded no precision note, so validation counted it as a mismatch. Cause: no fma reaches the module. canon::sccp's float_fold folds an fadd, fsub, fmul, fdiv or air.fma with a NaN operand beside operands only the run knows to that operand, unquieted, as Metal's compiler does once the constants are bound. So the module stores a float4 constant 0x7f800321, and the device's move of it as a float quiets it. No Vulkan rule forbids that, so the stored NaN's bits are the device's. AGENTS rule 1 counts a NaN's bits among the device's own answers and asks for a static note. Fix: nan::holds_signalling_float, called from the arith family's finish(), records PrecisionNote::NativeNanEncoding where the entry's module holds an f32 constant whose bits are a signalling NaN: every exponent bit set, the quiet bit clear and a nonzero payload (nan::signalling_f32). - The rule is decided from the constant's bits alone, never from a name or a case. - An entry's module holds exactly the constants its function reaches (canon::prune), so the note follows the entry, not its library. - It covers every operation of the fold family, because it keys on the stored constant, not on the operation, and it covers a signalling NaN the program wrote itself. - f32 only. A half constant moves as its bits (narrow::constant_bits): h[2] of the same case matches Metal. double is not measured and not claimed. - The scan ticks the meter once for the table's length. Validation reads the note from the module: the candidate takes the pipeline state's precision notes (candidate/platform/runtime.rs), and the comparison class is derived from them (observation_contract::comparison: NativeNanEncoding is Allowance::Unbounded). b315adcc's difference is therefore expected to count as a noted difference instead of a mismatch. That is expected, not yet run. Docs: docs/API.md's NativeNanEncoding entry and the note's doc comment gain the case. They claim only what was seen: the 3090 quiets an f32 constant on the move, the other cards in the runs so far kept its bits, half constants move as bits, and double is not measured. Test: engine_float_call_notes::a_signalling_float_nan_constant_records_the_devices_nan_encoding. A kernel storing the f32 constant 0x7f800321 records the note. One storing the quiet 0x7fc00321 does not, and neither does one storing the half 0x7c01. Without the finish() call the first assert fails. Bless class at the next pin, expected and not audited: authored compile-census rows of cases whose module keeps a bound signalling f32 NaN beside a run value (the sfold cases binding k_snan, b315adcc among them) gain NativeNanEncoding. The golden tables compile with function constants unbound and hold no NaN literal (no public fixture spells one), so they are expected unchanged. No SEMANTICS bump: the batch's last commit carries it. |
||
|
|
556707ed79 |
Translator: containment is the in-shader check on every profile; Robustness goes
The translator chose a containment form from the device's buffer robustness: with robustBufferAccess or robustBufferAccess2 enabled, a descriptor view's access carried no check and the device bounded it. The runtime enables neither feature (its floor's feature table names only nullDescriptor, robustImageAccess and robustImageAccess2), so that form never ran there; it ran only on validation's committed descriptions, as stated. It goes, with the choice: - Robustness (None, Rba, Rba2), DeviceProfile::robustness() and DeviceProfile::checks_buffers_in_shader(), and contain::encoding. A descriptor view's access is the in-shader check on every profile; Check::None remains only for a device-address access that nothing bounds (AccessPlan::psb_contained false). - A texel buffer is checked in the shader on every profile (it was the device's under robustBufferAccess2). Images keep their device form: device_reads_texels and device_drops_texel_writes still read robustImageAccess2 and robustImageAccess, which the runtime's floor requires. - Vertex input: outside the identity domains every attribute is pulled through a checked view; before, a device with robustBufferAccess fetched in fixed function. Under the identity domains nothing changes: fixed function, or the refusal of what it needs. - The loop hoist loses its robustness parameter and the speculative path only Rba and Rba2 reached: a load in the loop's entry run still moves, other loads stay. - Validation: of_compile states buffers as Unused or Checked, the out-of-bounds contract states Check::Shader for a descriptor view and a texel buffer and Unchecked for a fixed-function attribute. BufferEncoding::Robust and Check::Robust stay as stored vocabulary: committed observations hold them, and no compile states them now. Removed public items, each with 0 hits in the consumer's checkout at bd9d6ae85a and at ad28ebd881 (git grep -w -F over *.rs, *.toml, *.md): Robustness, Rba, Rba2, robustness, checks_buffers_in_shader (DeviceProfile, their owner, has 0 hits too). api_signatures.tsv and api_surface.rs are blessed here; docs/API.md (the bounds bullet, the profile facts list, vertex_input) and the runtime README's not-enabled row for robustBufferAccess change in this commit; docs/REFUSALS.md is regenerated and unchanged. No version moves: the batch's SEMANTICS and ARTIFACT_FORMAT_VERSION bumps are applied last, once for the batch. Tests: the hoist's a_guarded_uniform_load_at_a_fixed_word_leaves_its_loop goes with the speculative path; without_robust_access_only_a_load_every_entry_runs_leaves becomes only_a_load_every_entry_runs_leaves; robustness2_selects_the_rba2_encoding keeps its MoltenVK asserts as moltenvk_m3_derives_its_stride_and_format_usages; engine_texture_interp's contains_texel_buffers helper goes, its tests always running N+3 threads. Rewritten to the one form: engine_texture_oob's texel-buffer classes ([Class::Shader]), engine_texture_ulong, engine_graphics_binder's per-device assert, the coverage tier-table and containment tests, and the out-of-bounds contract's fixed-function test. None was the sole proof of a kept behaviour. Golden: the table's columns are validation's committed descriptions as stated, all with robustBufferAccess and 13 with robustBufferAccess2; no column is the runtime's. Every column's fingerprint moves (ProfileFields loses its robustness field). Bless items: 24 rows, 312 cells, 24 in each of the 13 columns that state robustBufferAccess2 and 0 in moltenvk-m3 and runtime-floor, every one hash to hash, in the 14 texel-buffer fixtures now checked in the shader. The .air.ll half (567 typed-pointer fixtures, which need metal-as) is unchecked per commit; the batch's golden bless on the M3 covers it. Verified: - On unshipped's tip before this rebase (96d953bb0b), the same change: compile job m3-max-66123 green (fmt, signatures, refusals, clippy plain, m2v_gpu and m2v_cpu_icd, workspace Rustdoc, api-docs). - At the batch's top on that base (all four commits, probe job m3-max-66130): the hash probe's 252 rows equal unshipped's arm at 4861c9863d (m3-max-65976); the golden probe's set without buffer robustness (the runtime's state) equals the base arm 96d953bb0b (m3-max-66128), 1855 of 1855 rows; the stated set moves exactly the 312 cells above. - Here: cargo fmt; signatures check; refusal surface regenerated. The compile job follows on the branch tip. |
||
|
|
5e3477e60a |
Translator: a buffer slot takes the storage view on every profile; the uniform view goes
A buffer slot took a uniform view only where containment was the device's (contain::encoding gave Check::None, under robustBufferAccess or robustBufferAccess2): the uniform arm of the slot's view choice and Profile F's per-stage storage-buffer fallback. The runtime enables neither feature, so no runtime module took one. The next commit deletes the robustness choice; memory, lower and spirv are crate-private, so its dead_code would fail that commit on its own. The uniform view goes first, with everything that only it reached: - the uniform forms of a view (UniformWords and UniformVec4) and their reads, and Profile F's fallback (fallback_view, fallback_rank). Profile F (runtime-floor without device addresses, below the runtime's floor) now refuses a stage past maxPerStageDescriptorStorageBuffers as DescriptorCount, where before it read its read-only slots through uniform views, under robust descriptors only; - SlotPlan::lane_read and its planner pass, and Uniformity::among_active_lanes, which only that pass ran; - the storage-view variant: LoweringInputs and VariantKey storage_view_slots, the binder's storage_view_variant and large_view_candidates; - RuntimeFact::UniformViewAliasing and UniformViewRange with UniformViewChoice, and the binder's aliasing check with its refusal BindError::UniformViewAliased (docs/REFUSALS.md regenerated: binder refusals 9 to 8); - SpecKey::RangeAtBindOffset (only uniform views declared it), BindState::view_base_alignment and uniform_views_at_residual, StageTable.at_bind_views and StageTable::class_alignment; BoundBuffer::shape, BoundBuffer::same_shape and StageTable::shape lose their view_base_alignment parameter; - BufferRanges.uniform: BufferRanges::length_class and the binder's offset alignment now read maxStorageBufferRange and minStorageBufferOffsetAlignment alone. Nothing in the runtime crate reads BufferRanges, BindState, BoundBuffer, StageTable or BindShape (git grep: 0 hits); it reaches validation's candidate engine only; - AccessClass::Uniform, DescriptorView (Storage, UniformWords, UniformVec4) and BufferForm::uniform_view; BufferForm::Descriptor loses its DescriptorView field. The loop hoist stays: the argument table's Uniform block (lower::access::table, the spilled push fields) still feeds it. Its docs no longer name a buffer slot's uniform view. Removed or changed public items and the types that own them, each with 0 hits in the consumer's checkout at bd9d6ae85a and at ad28ebd881 (git grep -w -F over *.rs, *.toml, *.md): DescriptorView, UniformWords, UniformVec4, UniformViewChoice, UniformViewRange, UniformViewAliasing, UniformViewAliased, RangeAtBindOffset, storage_view_slots, view_base_alignment, uniform_views_at_residual, at_bind_views, class_alignment, uniform_view, same_shape, AccessClass, BufferRanges, buffer_ranges, BufferForm, StageTable, BoundBuffer, BindState, VariantKey, LoweringInputs, RuntimeFact, SpecKey, BindError. crates/metal2vulkan/tests/api_signatures.tsv and api_surface.rs are blessed in this commit, and docs/API.md (the uniform-view form, the bind-offset key, BufferRanges) changes with it. Stored: VariantKey's storage_view_slots, and the codec tags of BufferForm::Descriptor (no field), SpecKey (RangeAtBindOffset gone), RuntimeFact (two variants gone) and DescriptorView (gone). The batch's ARTIFACT_FORMAT_VERSION bump (590 to 591), applied last once for the batch, covers them; no version moves here. Tests deleted whole, neither a containment proof: engine_storage_view_variant.rs (the variant's fixed point) and engine_lane_reads.rs (the uniform view's lane choice). Deleted with the forms they tested: the uniform-view cases of engine_access.rs and engine_binder.rs, the slots tests of the large-view candidates and the bind-offset range, the variant's cache round trip, and the active-lanes tests of lower/simd/uniform. The kept containment proof, a constant buffer shorter than its window, runs on the storage form (a_constant_buffer_shorter_than_its_window_is_contained_in_shader). Profile F's new refusal has its test (a_stage_past_the_storage_buffer_limit_without_device_addresses_is_refused). Golden: at the batch's top only the stated set's 24 texel-buffer rows moved, the 312 cells commit 2 alone moved before the rebase; no other row moved on either set. The .air.ll half (567 typed-pointer fixtures, which need metal-as) is unchecked per commit; the batch's golden bless on the M3 covers it. Verified: - On unshipped's tip before this rebase (96d953bb0b), the same change: compile job m3-max-66120 green (fmt, signatures, refusals, clippy plain, m2v_gpu and m2v_cpu_icd, workspace Rustdoc, api-docs). Before that rebase, this commit alone (hash probe job m3-max-65979) read 252 rows equal to its base's arm. - At the batch's top on 96d953bb0b (all four commits, probe job m3-max-66130): the hash probe's 252 rows equal unshipped's arm at 4861c9863d (m3-max-65976); the golden probe's set without buffer robustness (the runtime's state) equals the base arm 96d953bb0b (m3-max-66128), 1855 of 1855 rows. - The states-only play at the batch's top (render and compute states made and refused, pipelines_created, made_ahead_variants) is the coordinator's, run on the branch; it is not evidence here. - Here: cargo fmt; signatures check; refusal surface regenerated. The compile job follows on the branch tip. |