From 722b046c854eb8a2d63f7a9c4c3bf236ff4bcd32 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Thu, 12 Nov 2026 16:53:38 -0800 Subject: [PATCH] SEMANTICS_VERSION 2067, ARTIFACT_FORMAT_VERSION 511: a rate-mapped draw's fan-out variant The five commits before this one. A rate-mapped pass draws each command once per region it touches, running the vertex stage once per region (85-90% of the sample's GPU time on the 780M). The translator now has the variant VariantKey::region_fan_out {Draw, Probe}: its triangle-class geometry stage runs the vertex function once and emits one copy per region a triangle touches, up to K copies (K from maxGeometryTotalOutputComponents, at most 16), each through one full-target viewport with four clip distances standing in for the region's scissor. The probe emits nothing: per command it writes a flag (a triangle crossing w=0, or touching more than K regions with its bounds widened by 1/8 px) and an atomic count of the copies the draw would emit, from which a fanned-out draw's piece work is forecast. The bind layer's BindState.region_fan_out (mode, probe index) selects it; the plan admits only a vertex pipeline with no tessellation, mesh, amplification, views, compensation, band, synthesized geometry of its own, or chosen slice or viewport; it binds WriteSource::RateMapRegions (and RateMapFlags and a pushed index for a probe). The fan-out state, its synthetic bindings and push field are encoded (artifact codec). bind::fan_out is a public submodule (FanOutState, RegionFanOut). Nothing in the runtime selects the variant yet. Verified (on the branch at 0e1d7d87ae, msi): clippy of the translator and the runtime, all targets and features, and rustdoc -D warnings (m3-max-23313); translator suite 3510/3511 (m3-max-23314): the link tests (each class's module valid on lavapipe, Iris and Pascal; EmitVertex = 3 x copies for a draw, 0 for a probe; the probe's 4-byte GEOMETRY push; the refusals) and the engine test (the plan states the variant and NeedsVariant on the base; the variant compiles L3-valid on lavapipe, Iris and Pascal; its plan settles on itself; RateMapRegions, RateMapFlags and the pushed index written; an amplified pipeline keeps the plain variant). The one failure is golden_hashes, the same 852 cells that fail at the development base itself (m3-max-23331), re-blessed on development; no fan-out row moves. --- crates/metal2vulkan/src/cache/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/metal2vulkan/src/cache/mod.rs b/crates/metal2vulkan/src/cache/mod.rs index 764c571b6..4871bf4c4 100644 --- a/crates/metal2vulkan/src/cache/mod.rs +++ b/crates/metal2vulkan/src/cache/mod.rs @@ -60,7 +60,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 = 2066; +pub const SEMANTICS_VERSION: u32 = 2067; /// The byte-layout version of encoded artifacts (`CompiledFunction::to_bytes` and the /// [`PipelineArtifact`] encodings). Every encoded artifact carries it, and a decode under another @@ -70,7 +70,7 @@ pub const SEMANTICS_VERSION: u32 = 2066; /// re-typed in an encoded type, its `codec` body or its `envelope`. A variant removed while its tag /// stays unused needs no bump: an entry holding it fails to decode, which is a miss. The commit that /// bumps it says what changed; this comment keeps no history. -pub const ARTIFACT_FORMAT_VERSION: u32 = 510; +pub const ARTIFACT_FORMAT_VERSION: u32 = 511; /// The version of what this crate's runtime does with a compiled pipeline: instantiating a binding /// plan (`BindingPlan::instantiate_*`: descriptor ranges, push bytes, root, argument, and handle