Files
metal2vulkan/docs
Anees Iqbal 9a5aa02725 docs: the API guide's extended-range paragraph says the decode selects without a branch
What: docs/API.md's BGR10_XR / BGRA10_XR paragraph describes the straight-line decode of 14d30efdfe:
every lane mapped and selected where the word names one of the formats, no branch; the sum alone
decorated NoContraction; a slot's test, flags and constants made once per binding in the function's
first block; a robustness-bounded read testing its operands at every such read. No code changes.

Evidence for 14d30efdfe (generated code identical at 7459e4d8ba and here):

Words, runtime-floor, the largest variant 3f4cca857dfa (m3-max-86685, .json sidecars included):
W 162,351; pin X's per-site branch at dc3e7e5add 211,959; 14d30efdfe 176,844, about 175,630
without sidecars against W's 161,140 (+9.0%, under the 177,254 bar). The decode costs 14,493 words
over W where the branch cost 49,608, about 46 words a site over its 318 sites, the per-binding
decodes included. On the other 14 profiles: 170,128 (the RADV and ANV ones), 170,112 (the two
RTX 50), 170,100 (the three lavapipe), 176,880 (Pascal), 197,547 (moltenvk-m3). Small rows:
54f0489eefb5 1,692 (dc3e7e5add 1,680), 2a423fb525e7 2,394 (2,403).

GPU time of a float texture that is not extended-range, the harness's sampling (sample_down, a
runtime sampler), constexpr_sampling (sample_up) and texture_read (texels_out, a read the device's
robustness bounds, which now pays its in-range test at every read), base dc3e7e5add against
14d30efdfe: four rounds, the arms' order alternated each round, 200 timed runs each, the median of
the four GPU p50s in microseconds, the four's range in brackets:
- RX 7900 XTX, RADV (m3-max-86672): sampling 16.05 (16.00-16.10) -> 16.10 (16.10-16.40), +0.3%;
  constexpr_sampling 29.95 (29.90-30.30) -> 30.75 (30.40-30.90), +2.7%; texture_read
  45.40 (45.40-45.40) -> 45.75 (45.70-45.80), +0.8%.
- Iris Xe, ANV (m3-max-86676): sampling 394.90 (393.70-395.70) -> 396.90 (394.70-398.60), +0.5%;
  constexpr_sampling 820.60 (818.60-821.80) -> 831.45 (827.70-837.40), +1.3%; texture_read
  1564.25 (1561.70-1566.30) -> 1561.10 (1557.20-1566.40), -0.2%.
- RTX 3090, NVIDIA's driver (m3-max-86692): sampling 61.80 (61.70-61.80) -> 61.85 (61.80-61.90),
  +0.1%; constexpr_sampling 65.90 (65.80-66.00) -> 66.45 (66.30-66.60), +0.8%; texture_read
  134.65 (134.60-134.70) -> 134.65 (134.60-134.70), +0.0%.
Every workload is within 3% on each card; the XTX's constexpr_sampling, +2.7%, is the closest.

Check m3-max-86665 at 14d30efdfe: 3907 passed, 1387 skipped. Lint m3-max-86683 at 7459e4d8ba:
fmt, clippy plain, m2v_gpu and m2v_cpu_icd, rustdoc all clean.
2026-12-04 12:11:12 -08:00
..