wai-quantum 0.4.1: the fabric's WebGPU member — one WGSL kernel, certified bit-exact on every adapter #218

Merged
dcharlot merged 11 commits from wai-quantum-webgpu into main 2026-10-11 22:28:10 -04:00

2026-10-11

Transaction Science
Merge remote-tracking branch 'origin/main' into wai-quantum-webgpu
Some checks failed
workflow hygiene / every workflow supersedes its own queue (pull_request) Successful in 6s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 2m55s
wai-pack / wai-pack · linux (pull_request) Successful in 1m29s
wai-pack / wai-pack · the floor through a media prober (pull_request) Successful in 21s
wai-pack / wai-pack · dependency licences (pull_request) Successful in 1m25s
wai-pack / wai-pack · independent verifier (Python) (pull_request) Successful in 4m5s
wai-web reach builds / wai-web reach builds · the package of record, every output as recorded (pull_request) Successful in 2m56s
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Successful in 4m20s
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 3m45s
standards workspaces build + test / aac-rs (pull_request) Successful in 2m52s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 1m8s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 44s
standards workspaces build + test / map-rs (pull_request) Successful in 43s
standards workspaces build + test / mesh-rs (pull_request) Successful in 40s
standards workspaces build + test / openpay (pull_request) Successful in 2m29s
wai cross-architecture byte-equality / linux-aarch64 (pull_request) Successful in 36s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 10m23s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 43s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 3m11s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 5m39s
wai-vector vector graphics / linux-aarch64 (pull_request) Successful in 1m17s
standards workspaces build + test / macOS energy backends (pull_request) Failing after 52m38s
wai cross-architecture byte-equality / macos-arm64 (reference) (pull_request) Successful in 11m55s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 45m43s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 2m21s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 8m51s
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Successful in 4m39s
wai-vector vector graphics / macos-arm64 (pull_request) Successful in 3m4s
wai-pack / wai-pack · linux-arm64 (pull_request) Failing after 12s
wai-pack / wai-pack · macos (pull_request) Successful in 2m39s
# Conflicts:
#	wai/CHANGELOG.md
2026-10-11 22:26:53 -04:00
Transaction Science
Merge remote-tracking branch 'origin/main' into wai-quantum-webgpu
Some checks failed
standards workspaces build + test / joule-code-rs (pull_request) Successful in 4m32s
wai-vector vector graphics / wasm32-wasip2 (wasmtime) (pull_request) Successful in 30s
wai-vector vector graphics / wasm32 under Node (pull_request) Successful in 22s
wai-web reach builds / wai-web reach · does this change touch it (pull_request) Successful in 4s
wai-vector vector graphics / fuzz, peak allocation, comparison count (pull_request) Successful in 15s
workflow hygiene / every workflow supersedes its own queue (pull_request) Successful in 4s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 1m41s
standards workspaces build + test / map-rs (pull_request) Successful in 1m49s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 3m13s
standards workspaces build + test / mesh-rs (pull_request) Successful in 2m29s
standards workspaces build + test / openpay (pull_request) Successful in 9m18s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 17m56s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 42s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 3m54s
wai-vector vector graphics / linux-aarch64 (pull_request) Successful in 1m23s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 13m4s
standards workspaces build + test / macOS energy backends (pull_request) Failing after 17m53s
wai-pack / wai-pack · linux-arm64 (pull_request) Successful in 2m22s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 36m1s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 1m25s
wai-pack / wai-pack · linux (pull_request) Successful in 1m6s
wai-pack / wai-pack · the floor through a media prober (pull_request) Successful in 19s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 7m35s
wai-pack / wai-pack · independent verifier (Python) (pull_request) Successful in 1m58s
wai-pack / wai-pack · dependency licences (pull_request) Successful in 1m27s
wai-web reach builds / wai-web reach builds · the package of record, every output as recorded (pull_request) Successful in 2m44s
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Successful in 4m8s
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Successful in 5m35s
wai-vector vector graphics / macos-arm64 (pull_request) Successful in 2m7s
wai-pack / wai-pack · macos (pull_request) Successful in 4m17s
# Conflicts:
#	wai/CHANGELOG.md
2026-10-11 16:58:38 -04:00
Transaction Science
wai-quantum WebGPU member: jetson-hub declares both of its adapters
All checks were successful
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 51s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 1m59s
WAI HTTP delivery / WAI HTTP · does this change touch it (pull_request) Successful in 4s
WAI HTTP delivery / HTTP corpus · falsify mutations 0/3 (pull_request) Has been skipped
WAI HTTP delivery / HTTP corpus · falsify mutations 1/3 (pull_request) Has been skipped
WAI HTTP delivery / HTTP corpus · falsify mutations 2/3 (pull_request) Has been skipped
WAI HTTP delivery / HTTP corpus · falsify patches 0/3 (pull_request) Has been skipped
WAI HTTP delivery / HTTP corpus · falsify patches 1/3 (pull_request) Has been skipped
WAI HTTP delivery / HTTP corpus · falsify patches 2/3 (pull_request) Has been skipped
WAI HTTP delivery / HTTP corpus · every patch and mutation in exactly one shard (pull_request) Has been skipped
WAI HTTP delivery / HTTP corpus · verified both ways, and the differential (pull_request) Has been skipped
WAI HTTP delivery / cache rules · controls and labelled caches (pull_request) Has been skipped
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Successful in 1m2s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 1m12s
wai-pack / wai-pack · does this change touch it (pull_request) Successful in 4s
wai-quantum WebGPU member / shader checks · browser build · wasip2 inertness · MSRV (pull_request) Successful in 1m31s
wai-quantum WebGPU member / member · software Vulkan (linux) (pull_request) Successful in 55s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 4m27s
wai-web reach builds / wai-web reach · does this change touch it (pull_request) Successful in 4s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 16m51s
workflow hygiene / every workflow supersedes its own queue (pull_request) Successful in 4s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 3m20s
wai-pack / wai-pack · linux (pull_request) Successful in 1m8s
wai-pack / wai-pack · the floor through a media prober (pull_request) Successful in 17s
wai-pack / wai-pack · independent verifier (Python) (pull_request) Successful in 1m57s
wai-pack / wai-pack · dependency licences (pull_request) Successful in 1m24s
wai-web reach builds / wai-web reach builds · the package of record, every output as recorded (pull_request) Successful in 2m43s
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Successful in 4m4s
wai-pack / wai-pack · linux-arm64 (pull_request) Successful in 1m46s
wai-pack / wai-pack · macos (pull_request) Successful in 3m34s
The first run found the discrete GPU and a software Vulkan driver on that host
(gpu-vulkan-10de and swgpu-vulkan-10005), and G0 refused the run as declared.
Both are declared now; the wide sizes run on the GPU only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 05:14:27 -04:00

2026-10-10

Transaction Science
Merge remote-tracking branch 'origin/main' into wai-quantum-webgpu
Some checks failed
WAI energy receipts / energy receipts · macos (pull_request) Has been cancelled
WAI HTTP delivery / WAI HTTP · does this change touch it (pull_request) Has been cancelled
WAI HTTP delivery / HTTP corpus · falsify mutations 0/3 (pull_request) Has been cancelled
WAI HTTP delivery / HTTP corpus · falsify mutations 1/3 (pull_request) Has been cancelled
WAI HTTP delivery / HTTP corpus · falsify mutations 2/3 (pull_request) Has been cancelled
WAI HTTP delivery / HTTP corpus · falsify patches 0/3 (pull_request) Has been cancelled
WAI HTTP delivery / HTTP corpus · falsify patches 1/3 (pull_request) Has been cancelled
WAI HTTP delivery / HTTP corpus · falsify patches 2/3 (pull_request) Has been cancelled
WAI HTTP delivery / HTTP corpus · every patch and mutation in exactly one shard (pull_request) Has been cancelled
WAI HTTP delivery / HTTP corpus · verified both ways, and the differential (pull_request) Has been cancelled
WAI HTTP delivery / cache rules · controls and labelled caches (pull_request) Has been cancelled
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Has been cancelled
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Has been cancelled
wai-pack / wai-pack · does this change touch it (pull_request) Has been cancelled
wai-pack / wai-pack · linux (pull_request) Has been cancelled
wai-pack / wai-pack · linux-arm64 (pull_request) Has been cancelled
wai-pack / wai-pack · macos (pull_request) Has been cancelled
wai-pack / wai-pack · independent verifier (Python) (pull_request) Has been cancelled
wai-pack / wai-pack · the floor through a media prober (pull_request) Has been cancelled
wai-pack / wai-pack · dependency licences (pull_request) Has been cancelled
wai-quantum WebGPU member / shader checks · browser build · wasip2 inertness · MSRV (pull_request) Has been cancelled
wai-quantum WebGPU member / member · software Vulkan (linux) (pull_request) Has been cancelled
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Has been cancelled
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Has been cancelled
wai-web reach builds / wai-web reach · does this change touch it (pull_request) Has been cancelled
wai-web reach builds / wai-web reach builds · the package of record, every output as recorded (pull_request) Has been cancelled
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Has been cancelled
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Has been cancelled
workflow hygiene / every workflow supersedes its own queue (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Has been cancelled
# Conflicts:
#	wai/CHANGELOG.md
#	wai/wai-rs/Cargo.lock
2026-10-10 23:42:28 -04:00
Transaction Science
wai-quantum WebGPU member: the checks job runs the member's unit tests
The guard that types a failed native wait is tested without a device, by a
unit test that only the feature build compiles; no job ran it. The checks job
now runs the member's unit tests and fails unless that test ran and passed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-10 23:41:11 -04:00
Transaction Science
wai-quantum WebGPU member: chunked work under test, a failed wait is typed
Review findings on the member, none of which changed a result:

- Ring rewrites and multi-piece readback were never exercised below the
  wide sizes: every corpus circuit fit one submission and one readback
  piece. Hidden knobs `with_ring_records` and `with_readback_chunk` (like
  `with_max_x`) let G4 certify random-v1 through a ring of three records
  with state planes read back twelve bytes at a time, and fabric-v1
  through a ring of two with pieces of 12 KiB and four bytes; both give
  the pinned digests. G6 adds long four-qubit circuits in each gateset,
  more gates than one submission holds, at the default ring and a ring of
  three, against native; and a run whose first out-of-range op sits in a
  later submission than the first, with a later one after it, reported
  at its op-log index.
- wgpu's native device poll reports a failed wait other than a timeout,
  such as device loss, by panicking. The poll now runs under
  catch_unwind: the panic becomes WebGpuError::Device and the device is
  treated as lost from then on. Documented, including that a
  panic = "abort" build still aborts. A unit test holds the mapping.
- POLL_TIMEOUT bounded the whole run's GPU time, since the first wait was
  on the readback queued behind every gate submission. Natively each
  submission, a chunk of gates sized by the work budget, the probe's
  dispatch or a readback copy, is now waited on before the next, so the
  timeout bounds one chunk. The documentation and changelog say so.

Still 12 device tests; the member script's checks are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-10 23:40:08 -04:00
Transaction Science
wai-quantum WebGPU member: CI review fixes
- The hardware job fetches the commit it must test by its full SHA, not the
  ref: a later commit on main that this workflow's paths do not match would
  otherwise be fetched instead, failing the job with nothing to retest it.
- The path filters add wai-rs's Cargo.toml, Cargo.lock and lib.rs and the
  toolchain pin: the GPU jobs build wai-rs with the forwarded feature, --locked,
  and no other workflow does.
- The public-names check reads .wgsl files: the crate ships its shader.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-10 23:29:10 -04:00
Transaction Science
wai-quantum 0.4.1: CI for the WebGPU member, verify --webgpu, lockfiles
The member's tests run in CI on every adapter a runner declares, the
quantum corpus runs through each member, and wai-quantum is 0.4.1.

- scripts/wai-quantum-webgpu-member.sh: runs tests/webgpu_member.rs and
  fails unless all 12 tests ran and passed, the adapters found are exactly
  WAI_QUANTUM_WEBGPU_EXPECT, each declared adapter earned one bit-exact
  certificate per pinned digest (random-v1 and fabric-v1, both gatesets),
  and each killed 7 of 7 shader mutants; with WAI_QUANTUM_WEBGPU_WIDE=1 a
  GPU adapter must also have matched native at its full width.
- .github/workflows/wai-quantum-webgpu.yml (per-ref concurrency group):
  checks (linux): the shader under naga 30.0.1 and a SPIR-V validator, the
  browser build, no wgpu in the wasm32-wasip2 tree, the shader in the
  package, MSRV 1.97.0. member-software (linux, swgpu-vulkan-10005),
  member-metal (macos, gpu-metal-0), member-hw (linux-hw, gpu-vulkan-10de,
  wide sizes). The two GPU jobs then run verify --webgpu. No linux-arm64
  job; no windows job while that runner is offline.
- wai-conformance.yml: the wasm32-wasip2 job requires each new fabric unit
  test by name.
- wai-rs: feature quantum_fabric_webgpu forwards to wai-quantum's and
  re-exports the module; the requirement on wai-quantum is 0.4.1.
  wai_quantum_vectors verify <dir> --webgpu runs the whole check once per
  member, each state computed by the member, and holds each accept file to
  the native simulator's result (the 255-qubit files are refused as
  too-many-qubits by both). No member: exit 2; without the feature, the
  flag is an error.
- wai-quantum 0.4.1 with a CHANGELOG entry for the API of the last three
  commits. Lockfiles: the version line in all six that resolve
  wai-quantum (quantum-wgsl-check included); wai-rs also gains the wgpu
  tree through its new feature, at the versions wai-quantum's lock holds.

Local: on Metal the script passes; it fails with a wrong EXPECT, with the
feature dropped from its cargo test, with M1 as the shader, and with one
pin changed. verify --webgpu passes on Metal. cargo publish --dry-run and
cargo package --list pass. The runs on linux, macos and linux-hw are
pending CI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-10 22:32:43 -04:00
Transaction Science
wai-quantum fabric: the WebGPU member on a native GPU
Adds the opt-in feature `quantum_fabric_webgpu` (not in `full`): the
32-bit-lane gate kernel of `quantum_fabric::wgsl` run through the
platform's GPU interface natively (Metal, Vulkan, DX12) and through a
browser's WebGPU on wasm32-unknown-unknown. wgpu 30.0.1 enters only those
two target tables, default features off; on every other target, wasm32-
wasip2 included, it is absent and the module is compiled out.

`quantum_fabric_webgpu`:
- discovery opens each adapter at the WebGPU downlevel limits with only
  the two buffer limits raised, lists an unsuitable one with its reason,
  pins the DX12 compiler (translator "naga+dxbc" in the member id), and
  probes the device's arithmetic against lanes before it is a member;
- a run is one dispatch per gate, in place, with gate records in a
  uniform ring at dynamic offsets, x = min(groups, 64), submissions
  bounded by a work budget, and readback in 64 MiB pieces; every step
  runs inside error scopes and uncaptured errors and device loss are
  recorded, never left to the default handler;
- every entry point is async with no executor; natively `blocking`
  resolves each call with one poll on a no-op waker, and a future still
  pending is an error;
- certification folds the member's own run of a corpus into a
  Certification, so a bit-exact member reproduces the pinned random-v1
  and fabric-v1 digests; `member` certifies both gatesets, and placement
  and receipts go through the fabric unchanged.

tests/webgpu_member.rs (required-features): G0-G11 against a declared
adapter set (WAI_QUANTUM_WEBGPU_EXPECT), with liveness lines appended to
WAI_QUANTUM_WEBGPU_REPORT. On Metal: 12 of 12 pass; both gatesets
certify bit-exact with the pinned digests, forced geometries give the
same digests, and every mutant is killed.

Docs: the package description, crate doc and README say the default
features reach no system library and this feature reaches the GPU
interface; the fabric's honest boundaries say the WebGPU member is
detected per process and runs lanes on real hardware.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-10 18:15:35 -04:00
Transaction Science
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
Transaction Science
wai-quantum fabric: CPU groundwork for accelerator members
Everything a 32-bit-lane member needs except the device, under the existing
quantum_fabric feature and with no new dependency, so it builds and is tested
on every target including wasm32-wasip2.

- Certification: certify one case at a time, for members whose outputs arrive
  asynchronously; certify is now a loop over it (the lanes32 pins guard it).
- Corpus and fabric-v1: random-v1's circuits, then wide circuits of 11 to 17
  qubits continuing the same stream (lanes::random_wide_circuit), so every
  dispatch shape is exercised. FABRIC_DEFAULT = seed 7, 200 + 24 circuits.
  certify_lanes is certify_corpus on Corpus::Random, with the same generator
  string; random_circuit keeps its draw order.
- lanes: GateWords and gate_words, fxmul_wide, PROBE_EDGES, apply_words (the
  general 2x2 path from exact 64-bit values, flagging a gate exactly when the
  reference's result leaves 32 bits; malformed words refused), run_words,
  simulate_checked, output, reference_output, certify_corpus, and horizon: the
  gate count below which a valid circuit provably cannot leave 32 bits,
  computed in integers from the gateset's table.
- quantum_fabric::plan: the program a member runs for a circuit (one gate step
  per op, the start reduced modulo 2^n) and its CPU executor.
- Docs: the module and fxmul no longer claim that every result of a valid
  circuit fits in 32 bits; it holds within lanes::horizon.

fabric-v1 corpus digests, computed by the pin test's first run and pinned:
  circuit  41c726a0ac80f7defef92e15ecf893bdb7a3076b5e7f670fa0b7142e5c033df7
  circuit2 9a84b55af68f1a8b07390b234cf562dd8d85cef3185a697ab85690c8790a7809
The random-v1 lanes32 pins are unchanged and their test unedited.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-10 16:42:27 -04:00