Deep threadgroups: positive() matches its operands by slice pattern; the old render key's pin under 2172

What: Consts::positive reads a product's and a select's operands through slice patterns, not
indexing (clippy::indexing_slicing, denied in spirv outside tests); an operand list of another
length is not known positive. the_old_render_descriptor_key_keeps_its_value pins the test
descriptor's key under SEMANTICS_VERSION 2172, which the old runtime's render descriptor key
hashes: its cache entries under 2171 are misses, as every semantics bump makes them.

Verified: check m3-max-45573 at a604f82f82 failed clippy at exactly these four indexes in all
three configurations, and the pinned-key test with this value on the left; the API tables, the
runtime guard and the rt lavapipe tests passed there.
This commit is contained in:
Anees Iqbal committed 2026-11-18 04:21:18 -08:00
1 parent e90079a61f
commit 328da5cc5e
2 files changed
+9 -3

No files matched your search

@@ -1266,7 +1266,7 @@ fn the_old_render_descriptor_key_keeps_its_value() {
let key = device("moltenvk-m3").render_descriptor_key(&d);
let hex: String = key.digest().iter().map(|b| format!("{b:02x}")).collect();
assert_eq!(
hex, "b0b8846d063ddd3f7860a19cd828e282f7dc439f03202ea6f5a63ca5f0097393",
hex, "de6480915472d44f206b8ff387592e96717602ad393e9562d4fa2a4dbd1aa216",
"the old runtime's key of the descriptor"
);
}
+8 -2
View File
@@ -441,11 +441,17 @@ impl Consts {
ConstKind::SpecOp {
op: SpecOp::IMul,
operands,
} => self.positive(operands[0])? && self.positive(operands[1])?,
} => match **operands {
[a, b] => self.positive(a)? && self.positive(b)?,
_ => false,
},
ConstKind::SpecOp {
op: SpecOp::Select,
operands,
} => self.positive(operands[1])? && self.positive(operands[2])?,
} => match **operands {
[_, a, b] => self.positive(a)? && self.positive(b)?,
_ => false,
},
_ => false,
})
}