diff --git a/crates/metal2vulkan-conformance/src/cases/astc_textures.rs b/crates/metal2vulkan-conformance/src/cases/astc_textures.rs index 962e71cc6..381add96e 100644 --- a/crates/metal2vulkan-conformance/src/cases/astc_textures.rs +++ b/crates/metal2vulkan-conformance/src/cases/astc_textures.rs @@ -123,6 +123,12 @@ const ROUNDS: [&str; 2] = ["zero-blocks", "seeded-blocks"]; /// rather than being re-fitted to whatever a device answers. const LEDGERS_COMPACT_BOUND: f64 = 1.0 / 510.0; +/// The most a linear channel of the device's own decode of an ASTC LDR block may be off Metal's +/// value, as the `compressed-texel-decode` catalogue entry states it (docs/API.md): 1/2048, the +/// largest difference measured over the fourteen footprints' random blocks, plus the `float` +/// rounding of both values. It is the entry's number, so a run past it is the note's claim failing. +const DEVICE_DECODE_BOUND: f64 = 1.0 / 2048.0 + f32::EPSILON as f64 / 2.0; + /// An LDR void-extent block of red, green, blue and alpha `0x4000`, `0x8000`, `0xc000` and /// `0xffff`: every texel of the block that colour. The lane's own, since the seeded stream puts its /// first eight bytes in every fourth block. @@ -499,8 +505,9 @@ impl Case for AstcTextures { // a device without unified memory announces it. // Where the device holds the format's block itself, `metal2vulkan-rt` keeps the blocks in // an image of it and reads the device's decode of them, the static note it announces as - // `compressed-texel-decode` for every block-compressed texture it makes. A declaration - // and not a tolerance: no ASTC bound is stated, so every texel still compares exactly. + // `compressed-texel-decode` for every block-compressed texture it makes. Here it is a + // declaration; a linear form's texels also take the entry's bound (below), and an sRGB or + // HDR form's compare exactly. let mut all = vec![ crate::replay::shared_memory_notice(), crate::replay::notice_allowance(Degradation::CarriedDecodedTwin.code()), @@ -524,6 +531,17 @@ impl Case for AstcTextures { Justification::notice(Degradation::DecodedTexelPrecision), )); } + // `metal2vulkan-rt` keeps no twin: where the device holds the format's block, a + // linear channel is the device's decode of it, the static note + // `compressed-texel-decode`, whose catalogue entry bounds an ASTC LDR channel at + // 1/2048. On the old runtime's run it holds nowhere and faults nothing. + for round in ROUNDS { + all.push(Allowance::new( + format!("case/{round}/texels"), + Loosening::Absolute(DEVICE_DECODE_BOUND), + Justification::new_runtime_notice(Degradation::CompressedTexelDecode), + )); + } } all } diff --git a/docs/API.md b/docs/API.md index df4230d77..14faa978f 100644 --- a/docs/API.md +++ b/docs/API.md @@ -4123,16 +4123,19 @@ bound. largest differences from Metal's texels measured on random blocks of every format; a driver not named is unmeasured. Validation derives no tolerance from them; the conformance suite's BC1 to BC5 decode cases hold each texel to its family's largest bound on any driver (an sRGB form's to - the sRGB decode's largest step over 4/255), plus both values' rounding to `float`, justified by - the notice alone, on `metal2vulkan-rt`'s run; on the old runtime's they loosen nothing, and a - texel its device moves is that venue's known-gaps row. + the sRGB decode's largest step over 4/255), and its ASTC cases each linear (`_LDR`) texel to + 1/2048, plus both values' rounding to `float`, justified by the notice alone, on + `metal2vulkan-rt`'s run; on the old runtime's they loosen nothing, and a texel its device moves + is that venue's known-gaps row. Cost: a read, sample or gather of its texels answers the device's decode of its blocks (an sRGB form's code through the device's sRGB decode), where Metal interpolates with 6-bit weights: a BC1 to BC3 channel up to 4/255 off Metal's on NVIDIA (615.71.09, the RTX 3090 and RTX 5080 Laptop GPU; BC3's alpha 6/255), 3/255 on lavapipe, 1/255 on ANV; a BC4 or BC5 channel up to 7.4/255 (signed 0.065) on NVIDIA, 1.3/255 (signed 0.013) on ANV, 2.4/255 (signed 0.022) on lavapipe, and on RADV (Mesa 26.2.4, the Radeon 780M) a signed texel with an endpoint of -128 up to 1.7/255; a BC7 - channel a `float` ulp on lavapipe; its blocks' bytes, copies and sizes are Metal's. Measured + channel a `float` ulp on lavapipe; an ASTC LDR channel up to 1/2048 on ANV (Mesa 26.2.6, the Iris + Xe of Raptor Lake-P), over the fourteen footprints; its blocks' bytes, copies and sizes are + Metal's. Measured on more drivers: NVIDIA's 620.70.06 (the RTX 2080) a BC1 to BC3 channel 3/255 (BC3's alpha 6/255) and a BC4 or BC5 channel 7.33/255 (signed 0.064); ANV (the Iris Xe of Raptor Lake-P) and Intel's Windows driver (the UHD 630) BC3's alpha 2/255 and a BC4 or BC5 channel 1.4/255 (signed