Validation: a threadgroup target is checked nowhere, so its case is refused before it runs
What: executor_contract::out_of_bounds::containment() reports a threadgroup target as the arena
unchecked (Check::Unchecked), on every profile and under either domains. out_of_bounds_run then
refuses the case before anything is made, as not_supported{uncontained:unchecked threadgroup},
as it refuses a loaded pointer under the identity domains. The read rule's in-shader arm no
longer names the arena. The module docs, the Unchecked variant, ContainmentForm::Threadgroup,
the coverage note on which accesses the encodings govern, and docs/VALIDATION.md say so.
ENGINE_EXECUTOR_ABI moves to vulkan-engine-v214: the executor records a refusal for a case it
ran before.
Why: since 990328afe1 no profile checks a threadgroup access (lower::access::local::contained;
docs/API.md, "Threadgroup memory": one past the memory is undefined, as in Metal; the runtime
README states it too). The contract still reported the arena as checked in the shader, so the
candidate ran the only authored case with a threadgroup target, tg-twice (7efae163,
loads-and-stores-past-a-threadgroup-allocation), and read what the device held past the
allocation. On the Radeon 780M (RADV, Mesa 26.2.6) job m3-max-82582 ran it 10 times at
f606e43b30 and got 10 different output hashes: word 6, a load of tg[40], which no thread
writes, held a different value each run. The kernel's SimdgroupAccessOrder note made the failed
zero rule a NotedDifference. Vulkan does not define an access past a Workgroup array either, so
no part of that run is evidence.
What else moves: no other authored case declares a threadgroup target (all case shards
searched for "form":"threadgroup": one hit), so only tg-twice moves from noted_difference to a
refusal. The case, its AIR and its Metal row are unchanged. No classifier input changes
(executor_contract/out_of_bounds.rs, coverage.rs and case/out_of_bounds.rs are not in
build.rs's classifier list), and the authored compile census compiles the case as before
(case_compile reads no containment), so neither census version moves.
Verified: see the green job named with this commit's READY.
This commit is contained in:
1 parent
576d9384ec
commit
b3d7464945
6 files changed
+29
-18
No files matched your search
@@ -94,7 +94,7 @@ pub mod variants;
|
||||
/// how it decides a match. A change no recorded row can observe (a case kind no earlier executor
|
||||
/// ran, or one it refused) needs no bump; its commit says why. The commit that bumps it says what
|
||||
/// changed; this comment keeps no history.
|
||||
pub const ENGINE_EXECUTOR_ABI: &str = "vulkan-engine-v213";
|
||||
pub const ENGINE_EXECUTOR_ABI: &str = "vulkan-engine-v214";
|
||||
|
||||
/// One kernel case in the terms the runtime route takes: what this executor supports of an
|
||||
/// [`AuthoredCase`] (buffers, device buffer arrays, argument-buffer buffers and textures,
|
||||
|
||||
@@ -155,7 +155,9 @@ pub enum ContainmentForm {
|
||||
/// Accesses to a `device` buffer argument the product reaches by its device address (a
|
||||
/// `BufferForm::Psb` slot: a typed atomic or a wide pointer reaches it).
|
||||
DeviceAddress,
|
||||
/// Accesses to a `[[threadgroup(n)]]` buffer, in the threadgroup arena.
|
||||
/// Accesses to a `[[threadgroup(n)]]` buffer, in the threadgroup arena, which no profile
|
||||
/// checks: the candidate refuses a case of it before it runs
|
||||
/// (`executor_contract::out_of_bounds`).
|
||||
Threadgroup,
|
||||
/// Reads and writes of a `texture_buffer`.
|
||||
TexelBuffer,
|
||||
|
||||
@@ -96,10 +96,11 @@ pub enum ImageEncoding {
|
||||
/// reads (the access targets' checks, `lower::texture::slot`).
|
||||
///
|
||||
/// Census names do not all show the encoding they compiled under, so the report keys its rows by
|
||||
/// this, taken from the compile, not by the names. An access by device address (a `BufferForm::Psb`
|
||||
/// slot or a wide pointer) or to an arena is checked in the shader whatever the profile; the census
|
||||
/// names it apart from a descriptor access of the same strategy, so the name, not the module, says
|
||||
/// which accesses these encodings apply to.
|
||||
/// this, taken from the compile, not by the names. These encodings do not govern an access by
|
||||
/// device address (a `BufferForm::Psb` slot or a wide pointer) or to the private arena, which is
|
||||
/// checked in the shader whatever the profile, nor one to the threadgroup arena, which no profile
|
||||
/// checks; the census names each apart from a descriptor access of the same strategy, so the name,
|
||||
/// not the module, says which accesses these encodings apply to.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
|
||||
#[serde(from = "ContainmentRecord")]
|
||||
pub struct Containment {
|
||||
|
||||
@@ -7,9 +7,8 @@
|
||||
//!
|
||||
//! - **The form and mechanism** of each target are what its compiled module does with it, never
|
||||
//! only what the case says ([`containment`]): a buffer is a storage buffer through its
|
||||
//! descriptor, or a device address; a buffer slot the product reaches through a descriptor view,
|
||||
//! a slot reached by its device address and the threadgroup arena are checked in the shader in
|
||||
//! every leg, except that a kernel whose buffer arguments are bound as storage buffers of set 0
|
||||
//! descriptor, or a device address; a buffer slot the product reaches through a descriptor view
|
||||
//! and a slot reached by its device address are checked in the shader in every leg, except that a kernel whose buffer arguments are bound as storage buffers of set 0
|
||||
//! (`ModuleFacts::robust_views`) leaves its views' loads and stores to its pipeline's
|
||||
//! `robustBufferAccess2` and checks only their atomics in the shader; a texel buffer and an image follow the product's texel containment
|
||||
//! (`DeviceProfile::device_reads_texels` and `device_drops_texel_writes`): a texel buffer is
|
||||
@@ -17,7 +16,10 @@
|
||||
//! `robustImageAccess` at either level, each otherwise checked in the shader. A buffer reached through a pointer loaded from an argument buffer is a
|
||||
//! device address the resident set resolves, a thread-local array a typed object whose index is
|
||||
//! checked against its length, and an argument buffer's texture array a handle table the loaded
|
||||
//! resource id is looked up in: each checked in the shader in every leg. Under the identity
|
||||
//! resource id is looked up in: each checked in the shader in every leg. The threadgroup arena is
|
||||
//! checked nowhere: no profile checks a threadgroup access, and one past the memory is undefined,
|
||||
//! as in Metal (docs/API.md, "Threadgroup memory"), so the candidate does not run a case reaching
|
||||
//! past it ([`Check::Unchecked`]). Under the identity
|
||||
//! domains (`DevicePolicy`) a loaded pointer is the address it holds, which nothing checks, so
|
||||
//! the candidate does not run the case ([`Check::Unchecked`]), and a loaded resource id's index
|
||||
//! is masked onto the descriptor arrays, whose elements no live texture owns are null
|
||||
@@ -119,8 +121,9 @@ pub enum Check {
|
||||
Padded,
|
||||
/// Nothing checks the access: neither the shader nor the device's robustness bounds it (a
|
||||
/// pointer loaded from memory under the identity pointer domain, `PointerDomain::Identity`,
|
||||
/// is the device address it holds, used as given, and fixed-function vertex input on a device
|
||||
/// without buffer robustness fetches past its buffer what the device gives). A run would reach
|
||||
/// is the device address it holds, used as given; fixed-function vertex input on a device
|
||||
/// without buffer robustness fetches past its buffer what the device gives; and no profile
|
||||
/// checks a threadgroup access). A run would reach
|
||||
/// memory no binding gave the case, so the candidate refuses the case before it makes the
|
||||
/// pipeline (`NotSupported::Uncontained`).
|
||||
Unchecked,
|
||||
@@ -235,9 +238,9 @@ pub fn read_rule(form: ContainmentForm, mechanism: Mechanism, written: bool) ->
|
||||
// (its checker rule), so none reaches a byte the in-range indices do not, and the declared
|
||||
// read bytes, which only a vertex id outside the buffer's indices reaches, stay zero.
|
||||
(Medium::IndexBuffer, _) | (_, Check::Binder | Check::Padded) => ReadRule::Zero,
|
||||
// An in-shader check yields zero for a load and for a skipped atomic; a device address, the
|
||||
// arena, and a typed object take it in every leg.
|
||||
(Medium::DeviceAddress | Medium::Arena | Medium::TypedObject, _)
|
||||
// An in-shader check yields zero for a load and for a skipped atomic; a device address and
|
||||
// a typed object take it in every leg.
|
||||
(Medium::DeviceAddress | Medium::TypedObject, _)
|
||||
| (_, Check::Shader | Check::ShaderReads) => ReadRule::Zero,
|
||||
// Robust buffer access 2: a load returns zero, an atomic an undefined value.
|
||||
(_, Check::Robust2) if form == ContainmentForm::BufferAtomic => ReadRule::Any,
|
||||
@@ -470,10 +473,13 @@ pub fn containment(
|
||||
}
|
||||
_ => Err(format!("{} is not a buffer slot", target.resource.label())),
|
||||
},
|
||||
// No profile checks a threadgroup access, the arena's or a typed threadgroup object's
|
||||
// index: one past the memory is undefined, as in Metal (docs/API.md, "Threadgroup
|
||||
// memory"), and reads what the device holds there.
|
||||
OutOfBoundsResource::ThreadgroupMemory { .. } => made(
|
||||
ContainmentForm::Threadgroup,
|
||||
Medium::Arena,
|
||||
Check::Shader,
|
||||
Check::Unchecked,
|
||||
true,
|
||||
),
|
||||
OutOfBoundsResource::ArgumentBufferBuffer { buffer_binding, .. } => {
|
||||
|
||||
@@ -111,7 +111,7 @@ fn the_read_rule_follows_the_mechanism_not_the_case() {
|
||||
assert_eq!(rule(form, medium, Check::Shader, true), ReadRule::Zero);
|
||||
}
|
||||
}
|
||||
// A device address and the arena are checked in the shader whatever the leg.
|
||||
// A device address is checked in the shader whatever the leg.
|
||||
assert_eq!(
|
||||
rule(F::BufferAtomic, Medium::DeviceAddress, Check::Robust2, true),
|
||||
ReadRule::Zero
|
||||
|
||||
+3
-1
@@ -537,7 +537,9 @@ cargo run -p metal2vulkan-validation --release --bin corpus-vulkan -- \
|
||||
`not_supported{uncontained:variant ...}` naming the one that differs. The facts are the identity
|
||||
domains' (`DevicePolicy`): a buffer reached through a pointer loaded from an argument buffer is
|
||||
the address the pointer holds, which nothing checks (the runtime's README states it), so such a
|
||||
case is refused as `not_supported{uncontained:unchecked loaded_pointer}`, and an argument
|
||||
case is refused as `not_supported{uncontained:unchecked loaded_pointer}`; threadgroup memory,
|
||||
whose accesses no profile checks (one past it is undefined, as in Metal), is refused the same
|
||||
way as `not_supported{uncontained:unchecked threadgroup}`; and an argument
|
||||
buffer's texture array is the descriptor arrays its resource ids' masked indices read
|
||||
(`resource-id:shader`), a read past it a texel of a bound texture or zero. Each buffer target,
|
||||
and the buffer a texture-buffer target is made over, sits between guards of its declared reach
|
||||
|
||||
Reference in new issue
Block a user