Files
metal2vulkan/docs
Anees Iqbal 159154d5a9 PrecisionNote::CappedLodBias: a sampler state's capped or withheld lodBias carries a static note
Where the presented GPU adds a sampler descriptor's lodBias to every sample's level
(SamplerUse::lod_bias), vk_sampler hands the device device_lod_bias's answer: past the device's
maxSamplerLodBias it adds that limit, and a NaN, or any bias where a portability subset withholds
samplerMipLodBias, adds none. Only the old runtime said so (Degradation::CappedLodBias, announced as
it makes the state); the translator's vocabulary had no note for it, so a runtime built on the
translator alone could not report it. The lab's own reports put the limit at 15 on the 2080 and
both 3090s and 16 on the other target devices.

The translator now states it as PrecisionNote::CappedLodBias, which DeviceLodBias::note gives for
every variant but Exact. It is fixed by the state's bias and the device's limit; no pipeline stage
records it, so translation output does not change (no SEMANTICS_VERSION bump).

Classed where every note is: the artifact codec, tests::fast_paths (Elsewhere: docs/API.md section
9 states it), validation's comparison allowance (unbounded). The old runtime's degradations! macro
maps the note to its existing runtime kind CappedLodBias with one hand-written from_precision_note
arm. That change is mechanical, with no behaviour change: the kind keeps its code, category, cost
and announcement site, and its precision_note() stays None, so the site tests' rule (a kind with a
note is a stage's) still holds. docs/API.md: section 9's intro, the capped-lod-bias catalogue entry
and the accepted difference name the note. api_signatures.tsv re-blessed; refusal_surface.py
--check passes, REFUSALS unchanged.

Test: metal::sampler::tests::the_device_lod_bias_carries_its_note_where_it_is_not_the_bias, over
every committed device: no note for 0, -0 or a bias within the limit, the note past it, at the
infinities and for a NaN, and for every nonzero bias where samplerMipLodBias is withheld.

Verified: cargo fmt; signatures.py --bless; refusal_surface.py --check. Lints and tests follow as
potluck jobs.
2026-11-17 09:14:26 -08:00
..