Files
Anees Iqbal 0ce2f39b71 Translator: the resident core deleted; every device compiles the one form, and the tests run it
Every device now compiles the identity domains, the one form: a kernel's
buffer arguments are bound as storage buffers of set 0 where the device
binds them (DeviceProfile::binds_kernel_buffers) and are reached at their
device addresses elsewhere, as every other stage's are; vertex attributes
are fetched by fixed-function vertex input; textures and samplers are
elements of the identity arrays of set 1, named by their resource IDs.
What the one form does not lower is a typed refusal,
Unsupported{IdentityDomains, NotImplemented} with the IdentityCause the
previous commit names.

Deleted, with everything only they reached:
- the device policy (device/policy.rs) that chose the resident-table
  domains, and the resident root table, handle table and their facts;
- the heap raw reads (lower/sampler/heap_raw.rs, lower/texture/heap_raw.rs),
  sampler footprints, bind/texel_parts.rs and bind/status.rs;
- the lockstep orders' barrier tiers, which no order key adds now
  (OrderKey::of orders nothing).

Tests: 274 tests that only the resident-table policy compiled (development's
DevicePolicy::RESIDENT_TABLES, which only tests built) are deleted, among
them 15 whole files (argument tables, cross-class, device replay, dynamic
roots, two extended-range files, image shapes, mesh barriers, profile F,
separate samplers, sparse unmapped, tile, wide, sweep and the footprint
tests); each deletion's reason is listed with the READY. The others are
ported to what the one form compiles and names today: census names,
push fields, refusals with their causes, and run values. A new interpreter
harness (tests/identity_harness.rs) binds a dispatch's buffers at device
addresses and its textures as identity-array elements. Census naming is
unchanged. The validation tests that read compiled modules (coverage,
companions, the authored compile census, specialization) assert the one
form's present strings. The extended-range levels and volume tests, whose
mip filters development built under the resident tables, become two tests
of the one form's answer, which is development's default policy's: a 2D or
3D sample of an extended-range slot texture is refused, TextureState
(lower::texture::identity_class holds no class for it); a padded form's 3D
sample stays the lowering's NotImplemented(Format). Development's new
thread-local test binds through the one form's harness, and its
handle-web test (every_handle_web_an_instruction_observes_is_refused)
compiles on the default profile.

SEMANTICS_VERSION 2355 and ARTIFACT_FORMAT_VERSION 607 (cached
translations and artifacts change). docs/REFUSALS.md is regenerated and
runtime-sources.sha256 is pinned at this tree.

Verified at the stack's tip, which differs from this commit only by the
five commits after it; the jobs and their results are named in the READY.
2026-12-03 09:15:33 -08:00
..

regen-spirv-grammar

Generates the translator's SPIR-V grammar items from Khronos's machine-readable SPIR-V grammar (SPIRV-Headers, MIT-licensed) with our own generator, generate.py. Nothing else feeds it.

Output Role
crates/metal2vulkan/src/spv.rs The opcodes (Op), enumerants (Capability, Decoration, BuiltIn, ...), masks and GlslStd450Op the translator names, with their grammar values
crates/metal2vulkan/src/spirv_binary/table.rs Test only: every core instruction's operands and every enumerant's parameters, which the test parser (spirv_binary/) reads

What spv.rs holds

Only what items.txt lists: each kind the code names, the values it names, and from_u32 where the code converts words back. Values that only tests name are cfg(test). The compiler checks the list: a value the code names that is missing fails to build, and a listed value nothing uses is dead code where rustc can see it. When code needs a new opcode or enumerant, add it to items.txt and regenerate.

Names follow the grammar's, with a few changes Rust's and Clippy's naming rules need (see variant_name and const_name in generate.py): an opcode drops its Op prefix, leading digits move to the end (Dim::D2), a name of four or more capitals only is written with one capital (Capability::Fmakhr), SpecConstantOp is SpecConstantOperation, and a mask's bits are capitalized consts (FPFastMathMode::NOT_NAN). Debug always prints the grammar's own name.

Revision

SPIRV-Headers tag vulkan-sdk-1.4.341.0 (SPIR-V 1.6 revision 4; GLSL.std.450 version 100 revision 2). HEADERS_REF=<tag> selects another. Every generated file's header names the source, its revision and Khronos's MIT notice.

Run

./scripts/regen-spirv-grammar/regen-spirv-grammar.sh
cargo nextest run -p metal2vulkan --all-features

The script fetches spirv.core.grammar.json, extinst.glsl.std.450.grammar.json and LICENSE once per tag into .cache/spirv-headers/<tag>/ (gitignored; METAL2VULKAN_GRAMMAR_CACHE names another directory), runs generate.py and formats both outputs with rustfmt. It needs curl, Python 3 and rustfmt, and network access for a tag not yet fetched.