From cbcf4e7888c9fff5cd93a9dd2f13d86e3940d431 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Fri, 13 Nov 2026 08:32:31 -0800 Subject: [PATCH] SEMANTICS_VERSION 2090: a shader's uint2 rasterization-rate map overloads compile to Metal's decoder The two commits before this one: canon compiles the uint2 overloads of map_screen_to_physical_ coordinates and map_physical_to_screen_coordinates beside the float2 ones, reusing the float2 decoder. Screen to physical is the float2 answer at the pixel's centre, converted to uint (saturating, NaN 0); physical to screen is the bits of the float (0 - offset) * reciprocal of the entry of granule c >> 5, as an Apple M3 Max answers (the coordinate's place inside its granule is not read). The maths is the device's float (owner rule 1), under the existing denormals note. A table entry's boundary byte is compared on its low seven bits, as Metal does, for float2 too. Until now a fragment or kernel using the uint2 forms was refused Unsupported{RasterizationRateMap, NotImplemented}, where Metal makes it (the consumer's Modern Rendering sample's light-heatmap pipeline). Translator output changes (SEMANTICS); docs/REFUSALS.md is regenerated. Verified by heapchunk's runs: the M3 probe rate_map_integer_overloads (m3-max-25539, macOS 27.0.1): 20,114 coordinates over 4 maps, at each map's layers and two past them, every one matching both formulas; 1,561 of those answers kept as test vectors (Metal's answers to our probe on our maps). At 247e8b66b2 (25640): metal2vulkan-air rate_map 7/7, metal2vulkan 54/54 (bind::rate_map, engine_rate_map with the integer tests, public_fixtures_engine::llvm_as, engine_refused_families, refusal_surface); the translated kernel in the interpreter equals the M3's recorded answers at all 587 points on the maps' own layers on 4 profiles. Negative control: without the seven-bit mask 2 of the 1,561 answers differ. clippy plain, m2v_gpu and m2v_cpu_icd and rustdoc clean (25607, the same diff before the rebase). Release: the uint2 kernel 0.24 s cold, about 32 MiB, on moltenvk-m3. The fixture's two .air.ll rows (macOS-only metal-as) run at the next pin's checks. --- crates/metal2vulkan/src/cache/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/metal2vulkan/src/cache/mod.rs b/crates/metal2vulkan/src/cache/mod.rs index df3d3d945..c43e4b169 100644 --- a/crates/metal2vulkan/src/cache/mod.rs +++ b/crates/metal2vulkan/src/cache/mod.rs @@ -61,7 +61,7 @@ mod tests; /// unchanged version, and its bless records the version. Independent of the crate's version and of /// [`ARTIFACT_FORMAT_VERSION`]. The commit that bumps it says what changed; this comment keeps no /// history. -pub const SEMANTICS_VERSION: u32 = 2089; +pub const SEMANTICS_VERSION: u32 = 2090; /// The byte-layout version of encoded artifacts (`CompiledFunction::to_bytes` and the /// [`PipelineArtifact`] encodings). Every encoded artifact carries it, and a decode under another