open-standards/wai/tools/quantum-wgsl-check/Cargo.toml
Transaction Science 1f7fa8666a wai-quantum fabric: the WGSL gate kernel, its host layout, and a checker
The kernel a WebGPU member runs, and everything such a member needs that is
not the device, under the existing quantum_fabric feature with no new
dependency; it builds and is tested on every target including wasm32-wasip2.

- lanes32.wgsl: quantum_fabric::lanes transcribed line for line into WGSL,
  every value a u32 holding a 32-bit pattern, with an exact 64-bit copy of
  every result so that the kernel reports, exactly, any result that leaves
  32 bits. No signed type, float, division, conversion, workgroup memory or
  barrier; every shift amount a literal. Entry points apply (one gate, one
  invocation per amplitude pair, in place) and probe (the wide multiply and
  the exact fx on listed operands).
- quantum_fabric::wgsl: SHADER, the implementation id (BLAKE3 over the shader
  text and HOST_LAYOUT), the 64-byte gate record, the dispatch grid
  (X_GROUPS_MAX = 64, so 2-D grids occur from 14 qubits, inside fabric-v1),
  AdapterIdentity with its member id (local/gpu-... or local/swgpu-..., both
  sorting after every local/cpu-<arch>) and CI key, and the seven textual
  mutants with their detectors. The module docs carry the argument that the
  kernel is bit-exact (same function, exact fx64, no dynamic error, order
  independence).
- .gitattributes: the shader is checked out with LF, since its bytes are hashed.
- wai/tools/quantum-wgsl-check (unpublished, own lockfile; the only place naga
  is a dependency): parses and validates SHADER under naga 30.0.1, walks the
  IR (entry points, bindings, no workgroup variable, bool/u32 scalars only, no
  conversion/division/math, literal shifts in 1..=31, atomicOr/atomicMin
  only, no barrier), translates to MSL 2.4, SPIR-V and HLSL 5.1, writes
  lanes32.spv for spirv-val, and checks every mutant validates. --shader
  <file> checks another text, to show a planted violation failing.

Pinned: implementation wgsl-lanes32/dc8e19f61e0e87ab; member ids of the two
test identities local/gpu-metal-a47619e299a8 and
local/swgpu-vulkan-917c9bb1d948 (each cross-checked by an independent BLAKE3
computation). The probe mutants' witness counts over the probe edges equal
the ones computed when the mutants were chosen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-10 17:39:37 -04:00

18 lines
791 B
TOML

# Checks the WGSL gate kernel of wai-quantum (quantum_fabric::wgsl::SHADER) under
# naga 30.0.1, the shader translator the native WebGPU member compiles it with:
# the rules the kernel's bit-exactness argument rests on, on naga's IR, and
# translation to MSL, SPIR-V and HLSL.
#
# Deliberately a SEPARATE crate with its own lockfile: naga is a dependency here
# only, and never compiles in wai-quantum's own builds or tests.
[package]
name = "quantum-wgsl-check"
version = "0.0.0"
edition = "2024"
rust-version = "1.97"
license = "Apache-2.0"
publish = false
[dependencies]
naga = { version = "30.0.1", default-features = false, features = ["wgsl-in", "spv-out", "msl-out", "hlsl-out"] }
wai-quantum = { path = "../../wai-quantum", default-features = false, features = ["quantum_fabric"] }