Translator: an access refusal names the structure it met
Feature::Lowering(LowerFamily::Access) with Needs::NotImplemented covered
about 235 refusal sites behind one name, so a walk's log line could not say
which without the AIR. Unsupported gains `cause: Option<Cause>`; an access
refusal carries Cause::Access(AccessCause), one variant per structure the
sites refuse: the access's shape, the type it moves or the memory it
reaches. Sites that refuse the same structure share a variant, wherever
they are; none is named by a file, a line or a string of its own.
The five helpers that build the refusal (lower/access/mod.rs refuse() and
memory/{alloca,leaf,plan,provenance}.rs not_lowered()) take the cause, so
the compiler makes every site name one; the three direct constructions in
memory/handles.rs and lower/access/handle.rs do too, through
Unsupported::access. Feature stays Lowering(Access), so validation's
outcome key (feature_key, the Debug of the feature) and the census are
unchanged. Display prints the cause after the feature:
"Lowering(Access): PointerStore; needs NotImplemented at ...".
Storage: nothing stores the cause. Validation keys a refusal by
feature_key(&u.feature) (engine.rs); a FALLBACK repro bundle keeps the
failure as text (repro.rs, whose only serde record is the device); the
runtime's cache marks a refused translation with fixed bytes. No version
bump.
A buffer argument of a count other than one outside an argument table
names BufferArray, apart from an index or count the metadata does not fix
(UnfixedLocation).
Tests: the error module's Display test of an access refusal; the plan's
table gaps assert ArgumentTable, and its typed-depth, initializer and
buffer-array refusals PrivateType, Initializer and BufferArray.
runtime-sources.sha256 rewritten: memory/handles.rs's two refusals name
their cause, and no run behaves otherwise. api_signatures blessed (Cause,
AccessCause, Unsupported.cause), api_surface lists the two enums,
REFUSALS.md regenerated (the access refusals are built in error/mod.rs),
docs/API.md's error table names the field.
Consumer uses (consumer-uses.sh, read-only, plus git grep, over the
consumer's development 22cfe51a54 and its lane tips of the last day): no
struct literal or exhaustive destructuring of the translator's Unsupported
("Unsupported {" hits only its video crate's own Unsupported(String),
codec/encode.rs:494-502). Its rt platform builds refusals in tests with
Unsupported::not_implemented (rt_platform/diag.rs:3076, 3078, 3490;
rt_platform/unbuilt.rs:1203, 1293), whose cause is None, so their keys
("Translation-Lowering") hold. It reads u.feature where it names a refusal
(rt_platform/diag.rs:1082) and where it says one (rt_platform/unbuilt.rs:
507); each shows the cause once it reads u.cause too.
This commit is contained in:
1 parent
8cbec0d80b
commit
f124b1489f
27 files changed
+630
-277
No files matched your search
+2
-2
@@ -144,7 +144,7 @@ Columns:
|
||||
| `SubgroupOperations` | Simdgroup operations of a class the stage's subgroups do not support (the stage is not in `subgroupSupportedStages`, or an operation class is... | devices without VkFeature::ShaderQuadControl; devices without VkFeature::ShaderSubgroupExtendedTypes | `device` | 2: `crates/metal2vulkan/src/lower/simd/mod.rs (full_quads)`, `crates/metal2vulkan/src/lower/simd/mod.rs (select_group)` | `app`: simdgroup functions in a stage a device's subgroups do not support |
|
||||
| `DirectCall` | A call to a defined function the inliner cannot take | every device (not implemented) | `ours` | 1: `crates/metal2vulkan-air/src/canon/mod.rs (post_check)` | `rare`: variadic or byval calls the inliner cannot take |
|
||||
| `WideSwitchLiteral` | A switch case literal wider than 32 bits | every device (not implemented) | `ours` | 1: `crates/metal2vulkan/src/structurize/emit.rs (check_tree)` | `rare`: 64-bit switch literals |
|
||||
| `Lowering` | An instruction, intrinsic, or interface element of a lowering family whose lowering has not landed yet (each family narrows its refusals as it lands) | devices without VkFeature::ShaderDemoteToHelperInvocation; every device (not implemented) | `ours` | 35: `crates/metal2vulkan/src/lower/access/handle.rs (domain_kind)`, `crates/metal2vulkan/src/lower/access/handle.rs (sampler_target)` (+32) | `system`: the catch-all of lowering families not landed: any shader can meet one |
|
||||
| `Lowering` | An instruction, intrinsic, or interface element of a lowering family whose lowering has not landed yet (each family narrows its refusals as it lands) | devices without VkFeature::ShaderDemoteToHelperInvocation; every device (not implemented) | `ours` | 31: `crates/metal2vulkan/src/error/mod.rs (access)`, `crates/metal2vulkan/src/lower/access/handle.rs (sampler_target)` (+28) | `system`: the catch-all of lowering families not landed: any shader can meet one |
|
||||
| `SamplerAddressMode` | A sampler address mode the device lacks (`MirrorClampToEdge`) | devices without VkFeature::SamplerMirrorClampToEdge; every device (not implemented) | `ours` | 2: `crates/metal2vulkan/src/lower/sampler/constexpr.rs`, `crates/metal2vulkan/src/metal/sampler.rs (check_sampler)` | `app`: mirror-clamp-to-edge on a device without it |
|
||||
| `AlphaToOne` | `alphaToOneEnabled` on a device without Vulkan's `alphaToOne` feature, the exact counterpart... | devices without VkFeature::AlphaToOne | `device` | 1: `crates/metal2vulkan/src/pipeline/link/graphics.rs (graphics_state)` | `rare`: alphaToOneEnabled on a device without alphaToOne |
|
||||
| `StageStoresAndAtomics` | Buffer or image stores or atomics in a vertex or fragment function without the stage's store feature (`vertexPipelineStoresAndAtomics`,... | devices without VkFeature::FragmentStoresAndAtomics | `device` | 1: `crates/metal2vulkan/src/lower/access/tile_memory.rs (written)` | `app`: stores or atomics in vertex or fragment functions on a device without the feature |
|
||||
@@ -472,7 +472,7 @@ Each refusal's sites, with the function that builds it.
|
||||
- `feature::SubgroupOperations`: `crates/metal2vulkan/src/lower/simd/mod.rs (full_quads)`; `crates/metal2vulkan/src/lower/simd/mod.rs (select_group)`
|
||||
- `feature::DirectCall`: `crates/metal2vulkan-air/src/canon/mod.rs (post_check)`
|
||||
- `feature::WideSwitchLiteral`: `crates/metal2vulkan/src/structurize/emit.rs (check_tree)`
|
||||
- `feature::Lowering`: `crates/metal2vulkan/src/lower/access/handle.rs (domain_kind)`; `crates/metal2vulkan/src/lower/access/handle.rs (sampler_target)`; `crates/metal2vulkan/src/lower/access/handle.rs (texture_target)`; `crates/metal2vulkan/src/lower/access/imageblock.rs (operand)`; `crates/metal2vulkan/src/lower/access/mod.rs (not_lowered)`; `crates/metal2vulkan/src/lower/access/pulled.rs (share)`; `crates/metal2vulkan/src/lower/arith/legal.rs (not_lowered)`; `crates/metal2vulkan/src/lower/dispatch.rs (not_lowered)`; `crates/metal2vulkan/src/lower/fragment/discard.rs (not_lowered)`; `crates/metal2vulkan/src/lower/fragment/discard.rs (plan)`; `crates/metal2vulkan/src/lower/fragment/mod.rs (not_lowered)`; `crates/metal2vulkan/src/lower/mesh/mod.rs (not_lowered)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs (not_lowered)`; `crates/metal2vulkan/src/lower/sampler/mod.rs (refuse)`; `crates/metal2vulkan/src/lower/sampler/select.rs (refuse)`; `crates/metal2vulkan/src/lower/select.rs (not_lowered)`; `crates/metal2vulkan/src/lower/select.rs (route_air, 2 sites)`; `crates/metal2vulkan/src/lower/simd/mod.rs (not_lowered)`; `crates/metal2vulkan/src/lower/simd/mod.rs (select_param)`; `crates/metal2vulkan/src/lower/simd/workgroup.rs (check)`; `crates/metal2vulkan/src/lower/stage_io/fetch.rs (not_lowered)`; `crates/metal2vulkan/src/lower/stage_io/mod.rs (not_lowered)`; `crates/metal2vulkan/src/lower/sync/barrier.rs (not_lowered)`; `crates/metal2vulkan/src/lower/sync/memory_model.rs (not_implemented)`; `crates/metal2vulkan/src/lower/sync/memory_model.rs (select)`; `crates/metal2vulkan/src/lower/tessellation/mod.rs (not_lowered)`; `crates/metal2vulkan/src/lower/texture/mod.rs (refuse)`; `crates/metal2vulkan/src/lower/texture/mod.rs (select_through)`; `crates/metal2vulkan/src/lower/texture/mod.rs (select_write)`; `crates/metal2vulkan/src/memory/alloca.rs (not_lowered)`; `crates/metal2vulkan/src/memory/leaf.rs (not_lowered)`; `crates/metal2vulkan/src/memory/plan.rs (not_lowered)`; `crates/metal2vulkan/src/memory/provenance.rs (not_lowered)`; `crates/metal2vulkan/src/pipeline/link/tessellation/mod.rs (patch_fetch_projection)`
|
||||
- `feature::Lowering`: `crates/metal2vulkan/src/error/mod.rs (access)`; `crates/metal2vulkan/src/lower/access/handle.rs (sampler_target)`; `crates/metal2vulkan/src/lower/access/handle.rs (texture_target)`; `crates/metal2vulkan/src/lower/access/imageblock.rs (operand)`; `crates/metal2vulkan/src/lower/access/mod.rs (not_lowered)`; `crates/metal2vulkan/src/lower/access/pulled.rs (share)`; `crates/metal2vulkan/src/lower/arith/legal.rs (not_lowered)`; `crates/metal2vulkan/src/lower/dispatch.rs (not_lowered)`; `crates/metal2vulkan/src/lower/fragment/discard.rs (not_lowered)`; `crates/metal2vulkan/src/lower/fragment/discard.rs (plan)`; `crates/metal2vulkan/src/lower/fragment/mod.rs (not_lowered)`; `crates/metal2vulkan/src/lower/mesh/mod.rs (not_lowered)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs (not_lowered)`; `crates/metal2vulkan/src/lower/sampler/mod.rs (refuse)`; `crates/metal2vulkan/src/lower/sampler/select.rs (refuse)`; `crates/metal2vulkan/src/lower/select.rs (not_lowered)`; `crates/metal2vulkan/src/lower/select.rs (route_air, 2 sites)`; `crates/metal2vulkan/src/lower/simd/mod.rs (not_lowered)`; `crates/metal2vulkan/src/lower/simd/mod.rs (select_param)`; `crates/metal2vulkan/src/lower/simd/workgroup.rs (check)`; `crates/metal2vulkan/src/lower/stage_io/fetch.rs (not_lowered)`; `crates/metal2vulkan/src/lower/stage_io/mod.rs (not_lowered)`; `crates/metal2vulkan/src/lower/sync/barrier.rs (not_lowered)`; `crates/metal2vulkan/src/lower/sync/memory_model.rs (not_implemented)`; `crates/metal2vulkan/src/lower/sync/memory_model.rs (select)`; `crates/metal2vulkan/src/lower/tessellation/mod.rs (not_lowered)`; `crates/metal2vulkan/src/lower/texture/mod.rs (refuse)`; `crates/metal2vulkan/src/lower/texture/mod.rs (select_through)`; `crates/metal2vulkan/src/lower/texture/mod.rs (select_write)`; `crates/metal2vulkan/src/pipeline/link/tessellation/mod.rs (patch_fetch_projection)`
|
||||
- `feature::SamplerAddressMode`: `crates/metal2vulkan/src/lower/sampler/constexpr.rs`; `crates/metal2vulkan/src/metal/sampler.rs (check_sampler)`
|
||||
- `feature::AlphaToOne`: `crates/metal2vulkan/src/pipeline/link/graphics.rs (graphics_state)`
|
||||
- `feature::StageStoresAndAtomics`: `crates/metal2vulkan/src/lower/access/tile_memory.rs (written)`
|
||||
|
||||
Reference in new issue
Block a user