wai-quantum 0.3.41: the fabric — members, parity against the CPU reference, certificates, placement by joules, and the gate kernel in 32-bit lanes #195

Merged
dcharlot merged 6 commits from wai-quantum-fabric into main 2026-10-10 09:38:01 -04:00
Owner

What

wai-quantum 0.3.41: the fabric, wai.quantum.fabric.

The algorithm is the product; the fabric is where it runs. A quantum processor is one accelerator among others: CPU, GPU, neural, tensor or dataflow processor, FPGA, or analog Ising machine. This PR is the contract every member is held to, plus the first port held to it.

  • Members (Member, FabricClass, Presence): what silicon, and how sure we are it is there. Only detected members are placed.
  • Parity against the CPU reference: BitExact, Within { max_ulp, max_abs }, Statistical { fidelity, shots }, or Uncertified. Parity::meets orders requirements, and a bound never stands in for a fidelity.
  • Certification:
    • certify compares the reference's and the member's outputs case by case; the parity is the worst case.
    • certify_sampling folds the classical fidelity of a sampling device's counts.
    • A Certificate names its kernel, implementation, member and corpus generator (with the seed), so whoever holds it can draw the corpus again and check the digest.
  • Placement (place): the detected member whose certificate is its own, earned on a corpus unless it is a CPU's reference, and whose parity meets the requirement. Among those, the fewest nanojoules per operation; ties are deterministic.
  • Receipt (FabricReceipt): a signed statement that a result was computed by a kernel on a member.
    • It binds the certificate hash, the joules and their acquisition class (energy-measurement §2.7 encoding; required for a non-zero figure).
    • Every string is length-prefixed.
    • Its figure profile, wai:quantum-fabric-id, is in §6.1, the Rust profiles, the Python verifier and an EnergyFigures view.
  • The gate kernel in 32-bit lanes (lanes): the fixed-point core's gate application, written with only wrapping 32-bit add, subtract and multiply, shifts and compares, which is what a WebGPU or Metal shader or an FPGA's DSP slices have.
    • certify_lanes certifies it against the native simulator: bit-exact.
    • Native aarch64 and wasm32-wasip2 give the same corpus digest for the same seed.
  • CLI: wai-quantum fabric [--circuits N] [--seed S] [--json] lists the detected member, certifies the lane port, and places.
  • Registry: wai.quantum.fabric joins the unregistered receipt labels (REGISTRY.md, capabilities.json, the equality test).

Numerics decide how much parity a fabric can earn. Most accelerators carry no 64-bit float, and some no 64-bit integer. The core's gate kernel needs neither, so an integer-only fabric can reproduce it bit for bit. The floating-point modules can earn bit-exactness only where 64-bit floats and the same order of operations exist; elsewhere their parity is a measured bound.

Reviewed

Two adversarial review rounds, five lenses each (lane arithmetic, parity and placement, receipt encoding, documentation claims, integration), with three skeptics per finding.

Round one: 37 findings upheld, 7 refuted. Fixed:

  • certificates bound to implementation, member and generator;
  • placement requires a certificate of the entry's own;
  • a bound no longer meets a fidelity;
  • length-prefixed encodings, including corpus outputs;
  • the energy class on the receipt;
  • statistical normalises and checks for overflow;
  • compare refuses a 64-bit scale;
  • lanes::simulate validates;
  • energy ordering;
  • run-time CPU feature detection;
  • narrowed docs, CLI labels, and the registry entry.

Round two: 11 upheld, 14 refuted. Fixed:

  • the §2.7 class encoding (a stray leading byte read as the legacy tag);
  • the §6.1 figure profile;
  • certify_sampling;
  • the length-prefixed control count in corpus inputs;
  • non-finite outputs certify nothing;
  • the lane multiply's exact range, tested on both sides of its edge;
  • detection on other targets;
  • the cross-platform wording.

Found and left for its own PR: the core's pinned dyadic phase table loses precision through cancellation in (1 − cos θ)/2 at 30 bits. P(12) to P(16) are off by more than a hundred units, P(17) and P(18) by 10–27 % in angle, and P(19) to P(32) carry no phase at all. The table is pinned by extensions/quantum-sim.md §3, so the fix is a corrected table under a new gateset version (cosines unchanged, sines from sin θ / (2 cos θ/2)), with new conformance vectors.

Gates

  • cargo test --locked --release --features full --lib --tests in wai-quantum: 468 library tests, the 22 bit-identity pins and the other test files, all passed.
  • The fabric tests alone, with only --features quantum_fabric: 11 passed in debug (0.8 s) and in release.
  • cargo test --locked --features full --lib --tests --no-run (debug) compiles. Clippy is clean in the module.
  • The x86-64 detection path compiles for x86_64-apple-darwin; CI's Linux x86-64 leg runs it.
  • wai-rs: the registry tests (committed export, label equality) and the energy-figure tests, the new profile view included, pass. cargo check --locked passes for the wai-quantum bin, wai-quantum-serve and wai-web.
  • claim_verify.py passes all 567 vectors.
  • The wai-quantum fabric CLI, native aarch64 and wasm32-wasip2 under wasmtime: the same parity, generator, cases and corpus digest for the same seed.
  • --locked resolves in all five lockfiles that pin wai-quantum.
  • scripts/check-comparative-prose.sh and scripts/check-no-vanity-metrics.sh are clean.

🤖 Generated with Claude Code

## What wai-quantum 0.3.41: the fabric, `wai.quantum.fabric`. The algorithm is the product; the fabric is where it runs. A quantum processor is one accelerator among others: CPU, GPU, neural, tensor or dataflow processor, FPGA, or analog Ising machine. This PR is the contract every member is held to, plus the first port held to it. - **Members** (`Member`, `FabricClass`, `Presence`): what silicon, and how sure we are it is there. Only detected members are placed. - **Parity** against the CPU reference: `BitExact`, `Within { max_ulp, max_abs }`, `Statistical { fidelity, shots }`, or `Uncertified`. `Parity::meets` orders requirements, and a bound never stands in for a fidelity. - **Certification**: - `certify` compares the reference's and the member's outputs case by case; the parity is the worst case. - `certify_sampling` folds the classical fidelity of a sampling device's counts. - A `Certificate` names its kernel, implementation, member and corpus generator (with the seed), so whoever holds it can draw the corpus again and check the digest. - **Placement** (`place`): the detected member whose certificate is its own, earned on a corpus unless it is a CPU's reference, and whose parity meets the requirement. Among those, the fewest nanojoules per operation; ties are deterministic. - **Receipt** (`FabricReceipt`): a signed statement that a result was computed by a kernel on a member. - It binds the certificate hash, the joules and their acquisition class (energy-measurement §2.7 encoding; required for a non-zero figure). - Every string is length-prefixed. - Its figure profile, `wai:quantum-fabric-id`, is in §6.1, the Rust profiles, the Python verifier and an `EnergyFigures` view. - **The gate kernel in 32-bit lanes** (`lanes`): the fixed-point core's gate application, written with only wrapping 32-bit add, subtract and multiply, shifts and compares, which is what a WebGPU or Metal shader or an FPGA's DSP slices have. - `certify_lanes` certifies it against the native simulator: **bit-exact**. - Native aarch64 and wasm32-wasip2 give the same corpus digest for the same seed. - **CLI**: `wai-quantum fabric [--circuits N] [--seed S] [--json]` lists the detected member, certifies the lane port, and places. - **Registry**: `wai.quantum.fabric` joins the unregistered receipt labels (REGISTRY.md, capabilities.json, the equality test). Numerics decide how much parity a fabric can earn. Most accelerators carry no 64-bit float, and some no 64-bit integer. The core's gate kernel needs neither, so an integer-only fabric can reproduce it bit for bit. The floating-point modules can earn bit-exactness only where 64-bit floats and the same order of operations exist; elsewhere their parity is a measured bound. ## Reviewed Two adversarial review rounds, five lenses each (lane arithmetic, parity and placement, receipt encoding, documentation claims, integration), with three skeptics per finding. **Round one: 37 findings upheld, 7 refuted.** Fixed: - certificates bound to implementation, member and generator; - placement requires a certificate of the entry's own; - a bound no longer meets a fidelity; - length-prefixed encodings, including corpus outputs; - the energy class on the receipt; - `statistical` normalises and checks for overflow; - `compare` refuses a 64-bit scale; - `lanes::simulate` validates; - energy ordering; - run-time CPU feature detection; - narrowed docs, CLI labels, and the registry entry. **Round two: 11 upheld, 14 refuted.** Fixed: - the §2.7 class encoding (a stray leading byte read as the legacy tag); - the §6.1 figure profile; - `certify_sampling`; - the length-prefixed control count in corpus inputs; - non-finite outputs certify nothing; - the lane multiply's exact range, tested on both sides of its edge; - detection on other targets; - the cross-platform wording. **Found and left for its own PR:** the core's pinned dyadic phase table loses precision through cancellation in `(1 − cos θ)/2` at 30 bits. P(12) to P(16) are off by more than a hundred units, P(17) and P(18) by 10–27 % in angle, and P(19) to P(32) carry no phase at all. The table is pinned by `extensions/quantum-sim.md` §3, so the fix is a corrected table under a new gateset version (cosines unchanged, sines from `sin θ / (2 cos θ/2)`), with new conformance vectors. ## Gates - `cargo test --locked --release --features full --lib --tests` in wai-quantum: 468 library tests, the 22 bit-identity pins and the other test files, all passed. - The fabric tests alone, with only `--features quantum_fabric`: 11 passed in debug (0.8 s) and in release. - `cargo test --locked --features full --lib --tests --no-run` (debug) compiles. Clippy is clean in the module. - The x86-64 detection path compiles for `x86_64-apple-darwin`; CI's Linux x86-64 leg runs it. - wai-rs: the registry tests (committed export, label equality) and the energy-figure tests, the new profile view included, pass. `cargo check --locked` passes for the `wai-quantum` bin, wai-quantum-serve and wai-web. - `claim_verify.py` passes all 567 vectors. - The `wai-quantum fabric` CLI, native aarch64 and wasm32-wasip2 under wasmtime: the same parity, generator, cases and corpus digest for the same seed. - `--locked` resolves in all five lockfiles that pin wai-quantum. - `scripts/check-comparative-prose.sh` and `scripts/check-no-vanity-metrics.sh` are clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
From a five-lens review with three skeptics per finding:

- A certificate now names its kernel, implementation, member and corpus
  generator (with the seed), all in its hash. Placement relies only on a
  certificate that is for that kernel, implementation and member, and
  earned on a corpus unless it is a CPU's own reference.
- A bound no longer stands in for a fidelity.
- The receipt and certificate encodings length-prefix every string, so
  bytes cannot move between fields under one signature. The corpus digest
  length-prefixes every output.
- The receipt carries the joules' acquisition class: required for a
  non-zero figure, absent for zero, checked by the crate's label rule.
- statistical() normalises the reference, refuses a shot total past 64
  bits, and cannot exceed one. compare() refuses a scale of 64 bits or
  more. lanes::simulate refuses what the native simulator refuses.
- A known energy figure of any size comes before none.
- Detection asks the running CPU for its vector units on x86-64 and
  aarch64 and says when it reports what the binary was compiled for.
- The docs claim no more than the gate kernel for lanes.
- The CLI labels by implementation and prints the generator; its doc says
  fabric describes the host while its certificate agrees everywhere.
- wai.quantum.fabric joins the registry's unregistered receipt labels.

Native aarch64 and wasm32-wasip2 give the same certificate, corpus digest
included, for the same seed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
wai-quantum fabric: the second review round
Some checks failed
WAI conformance / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Successful in 8s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 24s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 45s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 1m47s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 5m43s
standards workspaces build + test / map-rs (pull_request) Successful in 5m0s
standards workspaces build + test / mesh-rs (pull_request) Successful in 4m49s
standards workspaces build + test / openpay (pull_request) Successful in 22m8s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 10m6s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 1m32s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 3m41s
WAI HTTP delivery / HTTP corpus · falsification and differential (pull_request) Successful in 1h19m36s
WAI HTTP delivery / cache rules · controls and labelled caches (pull_request) Successful in 1m3s
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Successful in 1m1s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 1m7s
wai-pack / wai-pack · does this change touch it (pull_request) Successful in 5s
WAI section references / cited sections exist (pull_request) Successful in 10s
wai-pack / wai-pack · linux-arm64 (pull_request) Successful in 3m42s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 4m15s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 2m39s
wai-pack / wai-pack · linux (pull_request) Successful in 1m2s
wai-pack / wai-pack · independent verifier (Python) (pull_request) Successful in 1m42s
wai-pack / wai-pack · the floor through a media prober (pull_request) Successful in 16s
wai-pack / wai-pack · dependency licences (pull_request) Successful in 1m6s
standards workspaces build + test / jouledesk-rs (pull_request) Has been cancelled
standards workspaces build + test / macOS energy backends (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · macos (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 23m0s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 2h23m35s
wai-pack / wai-pack · macos (pull_request) Successful in 1h7m26s
5767799cc3
- The energy class is encoded as energy-measurement §2.7 does: tag 0 for
  an unmetered zero, otherwise the class's own tag, with no byte before
  it (a leading 1 read as the legacy HwShunt tag).
- The fabric receipt has its figure profile, wai:quantum-fabric-id, in
  the §6.1 table, the Rust profiles, the Python verifier, and an
  EnergyFigures view with a test.
- certify_sampling certifies a sampling device from its counts, with the
  weights and counts in the corpus digest.
- Corpus inputs length-prefix the control count; non-finite floats
  certify nothing even when they match; the lane multiply's exact range
  is stated and tested on both sides of its edge; detection names the
  units it probes on targets it cannot ask.
- The docs say a certificate names the member it ran on, so only its
  parity and corpus digest agree across platforms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Transaction-Science/open-standards!195
No description provided.