Files
metal2vulkan/docs
Anees Iqbal 5db3215260 Rotated blends: every blend not exact by construction announces its rounding
The planner's ruling on the rotated blend: the note no longer follows a measured table. A blend
on an attachment held with its channels rotated (ARGB8Unorm) raises
PrecisionNote::RotatedBlendRounding unless it is exact by construction: a minimum or a maximum,
which takes no factor, or a blend whose chosen Vulkan factors are all ZERO or ONE, whose result
is the source, the destination, zero, or their sum or difference, a whole code half a code from
any tie. rotated_blend's MEASURED table and measured() go; unmeasured() becomes inexact(), which
reads the state rotated_blend() chooses: a Synthesized state (SRC1 factors) is inexact, and a
Direct one is inexact unless its four factors are ZERO or ONE.

Newly announced, the nine states of the old table that are not exact by construction, each
Metal's color pair and alpha pair under the one operation:
- DestinationColor over Zero, DestinationAlpha over Zero, Add;
- SourceColor over OneMinusSourceColor, SourceAlpha over OneMinusSourceAlpha, Add;
- BlendAlpha over OneMinusBlendAlpha for both, Add;
- the two straight-alpha pairs: SourceAlpha over OneMinusSourceAlpha with the alpha the same,
  and with the alpha One over OneMinusSourceAlpha, Add;
- One over OneMinusSourceAlpha for both, Add and Subtract;
- SourceAlpha over One with the alpha Zero over One, Add;
- SourceAlpha over One for both, ReverseSubtract.
One over Zero and One over One (Add) stay unannounced, now as exact by construction. Newly
unannounced: blends outside the old table whose Vulkan factors are all ZERO or ONE, which Metal
gives with one Zero or One factor for both its color and alpha sources and one for both its
destinations, under Add, Subtract or ReverseSubtract (One over One under ReverseSubtract, Zero
over One, and the like). Minimum and maximum stay unannounced.

StageIo::rotated_blends and LoweringInputs::rotated_blends stay: they are now the attachments
whose blend is not exact by construction. The stage raises the note from the latter, and
color_writes::check reads the former to refuse a fragment compiled for another set than the
pipeline's (NeedsInput(ColorWrites)), so the set still has a reader; its docs lose "measured".

The docs/API.md catalogue entry, PrecisionNote::RotatedBlendRounding's doc, LoweringInputs' and
StageIo's docs, rotated_blend's module doc, and validation's c3 deferral doc, its bound string and
comparison.rs's allowance doc state the one rule. The validation files use the note to defer a
row in C3 (c3.rs) and give it an unbounded allowance (comparison.rs); both follow the note, so
more rows on rotated attachments are deferred, by the note alone.

Tests: rotated_blend's measured-forms test becomes the_lane_s_blends_store_metal_s_rotated, over
the old table kept as test data (LANE): every state stores Metal's blend rotated alike on MoltenVK
and lavapipe, and all but one over zero and one over one are inexact.
inexact_blends_are_announced adds a difference by ones and a held destination, exact.
engine_rotated_colors expects the note on its product and its two second-output blends, and not
on its minimum or its reverse subtraction of ones.

SEMANTICS_VERSION 2237 (placeholder; main renumbers): the rotated blends' set, which the key
carries, and the stage's notes change for the same descriptor. ARTIFACT_FORMAT_VERSION and
RUNTIME_VERSION stay. api_signatures, docs/REFUSALS.md and the coverage are unchanged.

Consumer check: unmeasured and MEASURED were pub(crate); no public name changes.

Verified: m3-max-61259 at this tree (a5396ea291 before the colour commit's message was filled,
msi-laptop): fmt, clippy (all features, --cfg m2v_gpu and --cfg m2v_cpu_icd) and Rustdoc rc 0;
nextest over metal2vulkan and metal2vulkan-validation, 4719 run, 4718 passed, 23 skipped, 1
failed: the render key test (the_old_render_descriptor_key_keeps_its_value), left unpinned until
the next named pin.

Rebased onto development d10a14d5af: the SEMANTICS placeholder is one above its 2235 in stack order
(ARTIFACT_FORMAT_VERSION is already above its 574). The checks above ran at the old base acc706ca47;
the rebased stack's tip is checked by m3-max-61756 (msi-laptop), at the stack rebased on d6d56b8a7c
(tip 5c74fad38d, whose diff from its base is this stack's diff from d10a14d5af): fmt, clippy (all
features, --cfg m2v_gpu, --cfg m2v_cpu_icd) and Rustdoc green; nextest of metal2vulkan,
metal2vulkan-validation, metal2vulkan-conformance and metal2vulkan-runtime ran 5877 tests, 5870
passed. Of the 7 failures, the old render descriptor key's test is unpinned; golden_hashes and
engine inventory parts 4, 5, 7 and 8 are bless due (the profiles' fingerprints changed); and
metal::state's encoder_raster_state_needs_its_features fails the same way at development d10a14d5af
itself (m3-max-61802, where runtime-floor gained depthBiasClamp in a529fb658e), as inventory parts
3, 4, 5 and 8 do there. The stack as rebased on 72e1754218 (tip 090d544208: the same product
changes, without the test-only push sweep fix) played 36 distinct streams over 61 runs on five nodes
with 0 refused (player m3-max-61537; plays m3-max-61548, 61549, 61550, 61559 and 61569).
2026-11-20 22:07:18 -08:00
..