From 787fbbb061428cea50b7aa6295e3f7dc0522a364 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Wed, 2 Dec 2026 14:26:46 -0800 Subject: [PATCH] Translator docs: remove_dead's doc in 100 columns, and IndexType's and UnfixedLocation's docs say what their sites refuse Three doc nits from the audit lane's cold read of today's landings: - TypedModule::remove_dead's doc (spirv/ir/edit.rs) had one 120-column line since dead removal took any type; it is rewrapped within 100 columns, word for word. - AccessCause::IndexType said "an index of a type other than an integer". Its one site, index_form (lower/access/mod.rs), refuses every type but an integer of 1 to 64 bits: a 0-bit integer and an integer wider than 64 bits too. The doc now names them. - AccessCause::UnfixedLocation listed "a table's count". A threadgroup argument's count is checked in check_tables (memory/plan.rs), which names ArgumentTable for any count that is not a constant 1, a constant or not; the doc now says so and names an argument table's count alone. Docs only; no generated doc carries these comments (docs/REFUSALS.md, API.md and the coverage tables do not), and neither file is a runtime or classifier input of the validation crate. --- crates/metal2vulkan/src/error/mod.rs | 7 +++++-- crates/metal2vulkan/src/spirv/ir/edit.rs | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/crates/metal2vulkan/src/error/mod.rs b/crates/metal2vulkan/src/error/mod.rs index 11294e8ab..457d4665e 100644 --- a/crates/metal2vulkan/src/error/mod.rs +++ b/crates/metal2vulkan/src/error/mod.rs @@ -1099,7 +1099,8 @@ pub enum AccessCause { /// element that is neither a handle nor its word, a handle in memory other than device and /// constant memory, a handle parameter of no slot, or another instruction on a handle. HandleUse, - /// An index of a type other than an integer. + /// An index of a type other than an integer of 1 to 64 bits: a 0-bit integer, an integer + /// wider than 64 bits, or a type that is not an integer. IndexType, /// A constant initializer the translator does not write: one whose shape is not its type's, /// one of a type with no layout, or one holding a constant of no lowered form, of a private @@ -1168,7 +1169,9 @@ pub enum AccessCause { /// index a division by that size would not give. UnderAligned, /// An argument whose place the AIR's metadata does not fix as a constant: a buffer's, an - /// argument table's or a threadgroup argument's index, or a table's count. + /// argument table's or a threadgroup argument's index, or an argument table's count. A + /// threadgroup argument whose count is not a constant 1, a constant or not, is an + /// [`ArgumentTable`](AccessCause::ArgumentTable). UnfixedLocation, /// A volatile access of a form that has no volatile form: a payload word, a pointer or handle /// lookup, or another of the access family's forms. diff --git a/crates/metal2vulkan/src/spirv/ir/edit.rs b/crates/metal2vulkan/src/spirv/ir/edit.rs index 828ea756a..68bd0fd25 100644 --- a/crates/metal2vulkan/src/spirv/ir/edit.rs +++ b/crates/metal2vulkan/src/spirv/ir/edit.rs @@ -143,10 +143,10 @@ impl TypedModule { /// Replace each instruction of `copies` by `OpCopyObject` of its value, then remove the /// instructions at `insts`, the phis at `phis` (block, index), the declarations of the - /// constants `consts` and of the types `types`, and the functions `funcs`, each named once. A replaced instruction must be one - /// [`removable`](crate::spirv::dead::removable) names, with a result of the value's type, and - /// is not removed. Every removed instruction must have a result and be one - /// [`removable`](crate::spirv::dead::removable) names or a call of a function + /// constants `consts` and of the types `types`, and the functions `funcs`, each named once. A + /// replaced instruction must be one [`removable`](crate::spirv::dead::removable) names, with + /// a result of the value's type, and is not removed. Every removed instruction must have a + /// result and be one [`removable`](crate::spirv::dead::removable) names or a call of a function /// [`pure_functions`](crate::spirv::dead::pure_functions) names pure; every constant must be a /// declared one [`removable_const`](crate::spirv::dead::removable_const) names. A removed /// constant is no longer interned ([`Consts::forget`](crate::spirv::ir::Consts::forget)), so