Files
metal2vulkan/docs
Anees Iqbal 96b6f3d12b Note the device's fixed-function vertex conversions where the pipeline links
One work packet, landed as 4 commits (0e348c4f85..2fc5327329 on archive/development-linear-2026-10-28), in order:

* Note the device's fixed-function vertex conversions where the pipeline links

A normalized vertex attribute has been the device's fixed-function UNORM or
SNORM conversion since the exact division went (9c0bdbe0d2), but nothing
recorded it: llvmpipe reads 127/255 one f32 ulp high (0x3EFEFF00 against
Metal's 0x3EFEFEFF) and the run announced nothing, against rule 2. And the
narrow-float NaN note rode in the vertex compile key
(VertexFetch::FixedFunction { narrow_float }), so one function used with a
half format and any other format translated twice for one module.

The design: the module of a fixed-function attribute names no part of its
format, so neither note belongs to the module. Link knows the vertex
descriptor and which attributes the stage reads as float, so
link::vertex::fixed_function_notes decides both there, from the stage's
fixed-function attributes and the descriptor's formats, and the compile API
adds them to the vertex StageModule's precision_notes (as color_writes'
pipeline notes are added). The runtime announces stage notes already, so
it needs only the new kind. A StageSource::Compiled stage gets the same
notes, since link recomputes them.

- PrecisionNote::DeviceVertexConversion (device-vertex-conversion): a
  normalized format fixed-function input fetches, whatever width the
  function reads it at. Recorded on every device; MoltenVK measured
  Metal's, but no measured property says so yet.
- PrecisionNote::DeviceNanEncoding for a narrow float read as float now
  comes from link too; lowering records nothing for a fixed-function
  attribute.
- VertexFetch::FixedFunction is a unit variant; IoRole::Attribute loses
  narrow_float; narrow_float_of_f32_reads goes; declared_attributes keeps
  only the numeric class. Encoding::is_normalized names the formats.
- Runtime Degradation::DeviceVertexConversion, the codec tag, docs/API.md's
  catalogue entry, a FAST-PATHS device-gap row (no switch), validation's
  comparison class (unbounded, as DeviceTexelConversion).
- Versions: SEMANTICS_VERSION 1884 (notes and vertex keys move),
  ARTIFACT_FORMAT_VERSION 467 (VertexFetch, IoRole, the new tag),
  RUNTIME_VERSION 1666 (a new announced kind); runtime-sources.sha256
  re-pinned for degradation.rs. api_signatures re-blessed.

Tests: engine_vertex_variants' new
a_pipeline_notes_what_the_device_converts_from_one_translation compiles
the float4 and half4 sweeps as render pipelines on moltenvk-m3, lavapipe
and amd-780m-radv: each normalized format's vertex stage notes the
conversion, each narrow float read as float the NaN, others neither, and
every fixed-function creation of an entry has one vertex compile key and
one module (two keys before). The float4 sweep is now 1 projection and 1
module (was 2 and 1); the constant-step counts follow.

Verified: cargo clippy --workspace --all-targets --all-features -D
warnings, plain and with --cfg m2v_gpu; RUSTDOCFLAGS='-D warnings' cargo
doc -p metal2vulkan -p metal2vulkan-runtime; nextest of the touched
metal2vulkan modules (343 passed), api_surface, api_signatures,
refusal_surface, golden_hashes and the public fixture tables (pass, no
hash moved); runtime degradation tests (17), validation
observation_contract, c3 and the runtime-sources guard. No device test.

* Hold a render state's vertex conversion notices and its one translation on a device

A device test (m2v_gpu, m2v_cpu_icd) of the runtime side of the link-time
vertex notes: four states of dsx_int_attributes' int_attribute_to_float4
whose vertex descriptors differ only in attribute 0's format
(UChar4Normalized, Half4, Float4, Short2Normalized). The three after the
first must translate nothing (WorkCounts::functions_translated, the
function shared once each), and each draw of one point over a record of
0x7f bytes must announce exactly its format's kinds: device-vertex-conversion
for the normalized formats, device-nan-encoding for Half4 (whose 0x7F7F is a
NaN read as float), neither for Float4. The stored words are printed, so a
run shows the device's own conversion of 127/255 and of the NaN.

Verified: clippy -p metal2vulkan-runtime --all-targets --all-features -D
warnings under --cfg m2v_gpu; the runtime-sources guard still passes (test
modules are not runtime inputs). Not run here: it needs a device.

* Say that a pipeline's stage adds its state's notes to its function's

CompiledFunction::precision_notes said its notes were the linked stage's,
which a fragment stage's attachment-write notes already broke and the
vertex stage's link-time conversion notes break too. The doc and
docs/API.md's compile-API paragraph now say the stage adds those of the
pipeline's own state. Docs only.

* Drop a known-gaps clause that points at a ledger row no longer there

The conformance-replay paragraph said its runs were at a tip before "the narrow-float widening
above" was canonicalized; that row is gone and the clause was history. Docs only.
2026-10-28 17:24:21 +02:00
..