Some checks failed
no-vanity-metrics / Scan committed Markdown for vanity metrics (pull_request) Successful in 3s
standards workspaces build + test / eoc-rs (pull_request) Successful in 1m48s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m17s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m16s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m7s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 2m29s
wai cross-architecture byte-equality / linux-x86_64 (pull_request) Successful in 22s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 2m7s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 22s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 42s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 39s
wai formal verification (integer core) / kani (pull_request) Successful in 4m59s
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Successful in 52s
WAI neural decoders end-to-end / synthetic fixtures → Rust decode → reference (±4) (pull_request) Failing after 1m7s
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 6m49s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 24s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 2m28s
standards workspaces build + test / aac-rs (pull_request) Successful in 3m25s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 3m46s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 1m22s
standards workspaces build + test / map-rs (pull_request) Successful in 2m16s
standards workspaces build + test / mesh-rs (pull_request) Successful in 2m3s
standards workspaces build + test / openpay (pull_request) Successful in 18m29s
wai cross-architecture byte-equality / linux-aarch64 (pull_request) Successful in 1m58s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Failing after 7s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Failing after 7s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Failing after 8s
standards workspaces build + test / arl-rs (pull_request) Successful in 3m49s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 3m19s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 3m45s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 3m17s
standards workspaces build + test / sense-rs (pull_request) Successful in 4m0s
standards workspaces build + test / macOS energy backend (jcp-energy) (pull_request) Successful in 3m42s
wai cross-architecture byte-equality / macos-arm64 (reference) (pull_request) Successful in 27s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 2m43s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 28s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 1m14s
wai cross-architecture byte-equality / windows-x86_64 (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · windows (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · windows (pull_request) Has been cancelled
The single `HwShunt` acquisition class covered both an on-chip vendor counter (RAPL, NVML, SMC, IOReport) and an external calibrated shunt. They are different evidence: a calibrated instrument's uncertainty is traceable to a calibration, while a counter is a vendor's reading whose error the vendor states (RAPL readings are deliberately noised when SGX or TDX is enabled, per security advisory INTEL-SA-00389). - extensions/energy-measurement.md §2 splits hardware evidence into `OnChipCounter` and `CalibratedInstrument`, each with a required declared uncertainty (relative error and integration window). IOReport is an on-chip counter, like RAPL and NVML. `HwShunt` stays readable as the legacy class, ranked below both, and is not sealed into a new WAI receipt. - Every receipt family that carries joules — video, world, film, reel, haptic, score, splat4d, audio scene, ternary, provenance and the wai-quantum receipts — can carry its class. The label is additive: every committed signed vector still verifies, and the signed bytes of unlabelled and legacy-labelled receipts are pinned by tests. A sealed figure declares its 1 µJ resolution, and the floor is stated as the rule verified (0.5/√3 µJ). - The acquisition rules are scoped to the receipt profiles WAI defines, and the text says what enforces each one. - Meters open their window from rest, report an all-zero power reader as unusable rather than clean, and state the running-window count model as conservative. - oer-receipts.md maps OER's evidential grade onto the refined classes. The rule that a producer must not grade `measured` a figure whose class is `Estimator` is kept as settled on main. - wai-quantum verifies a receipt in either form on every in-tree verify path, including wai-quantum-serve's POST /verify. - CI: wai-energy-receipts.yml runs the energy-class, label and legacy-pin tests for wai-rs, wai-quantum and wai-quantum-serve, which no workflow enabled before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
114 lines
3 KiB
Rust
114 lines
3 KiB
Rust
//! **wai-quantum** — a deterministic quantum stack in pure Rust.
|
|
//!
|
|
//! Byte-exact circuit simulation (statevector, stabilizer, tensor-network MPS and
|
|
//! sparse-Pauli backends), the operational layer around it (calibration, error
|
|
//! mitigation, qLDPC decoding, noise learning, circuit-equivalence proofs, atom
|
|
//! rearrangement), a phasor/interference ML layer, and signed energy-accounted
|
|
//! receipts binding every stage.
|
|
//!
|
|
//! No QPU, no cloud service, no vendor SDK, and **no system libraries** — pure
|
|
//! Rust, so the same source runs natively, in the browser via wasm, and as a
|
|
//! WASI component at the edge, producing **byte-identical** results and receipts
|
|
//! on all three.
|
|
//!
|
|
//! Everything is behind a feature; enable only what you use.
|
|
|
|
mod merkle;
|
|
|
|
/// Re-exported so consumers get a **version-matched** signing type: the receipt
|
|
/// sealing APIs take an `ed25519_dalek::SigningKey`, and a caller who depended on
|
|
/// their own copy could easily pick an incompatible version.
|
|
#[cfg(feature = "_signing")]
|
|
pub use ed25519_dalek;
|
|
|
|
|
|
#[cfg(feature = "quantum")]
|
|
pub mod quantum;
|
|
|
|
#[cfg(feature = "quantum_atom")]
|
|
pub mod quantum_atom;
|
|
|
|
#[cfg(feature = "quantum_cal")]
|
|
pub mod quantum_cal;
|
|
|
|
#[cfg(feature = "quantum_compile")]
|
|
pub mod quantum_compile;
|
|
|
|
#[cfg(feature = "quantum_control")]
|
|
pub mod quantum_control;
|
|
|
|
#[cfg(feature = "quantum_kernel")]
|
|
pub mod quantum_kernel;
|
|
|
|
#[cfg(feature = "quantum_mitigate")]
|
|
pub mod quantum_mitigate;
|
|
|
|
// The acquisition class of a receipt's joule figure, as an optional signed
|
|
// label. Additive: unlabelled receipts keep their exact bytes.
|
|
#[cfg(feature = "_signing")]
|
|
pub mod quantum_energy;
|
|
|
|
#[cfg(feature = "quantum_mps")]
|
|
pub mod quantum_mps;
|
|
|
|
#[cfg(feature = "quantum_noise")]
|
|
pub mod quantum_noise;
|
|
|
|
#[cfg(feature = "quantum_ops")]
|
|
pub mod quantum_ops;
|
|
|
|
#[cfg(feature = "quantum_pauli")]
|
|
pub mod quantum_pauli;
|
|
|
|
#[cfg(feature = "quantum_info")]
|
|
pub mod quantum_info;
|
|
|
|
#[cfg(feature = "quantum_qudit")]
|
|
pub mod quantum_qudit;
|
|
|
|
#[cfg(feature = "quantum_comm")]
|
|
pub mod quantum_comm;
|
|
|
|
#[cfg(feature = "quantum_source")]
|
|
pub mod quantum_source;
|
|
|
|
#[cfg(feature = "quantum_channel")]
|
|
pub mod quantum_channel;
|
|
|
|
#[cfg(feature = "quantum_qir")]
|
|
pub mod quantum_qir;
|
|
|
|
#[cfg(feature = "quantum_phasor")]
|
|
pub mod quantum_phasor;
|
|
|
|
#[cfg(feature = "quantum_phasor_meter")]
|
|
pub mod quantum_phasor_meter;
|
|
|
|
#[cfg(feature = "quantum_qbom")]
|
|
pub mod quantum_qbom;
|
|
|
|
#[cfg(feature = "quantum_qdata")]
|
|
pub mod quantum_qdata;
|
|
|
|
#[cfg(feature = "quantum_qec")]
|
|
pub mod quantum_qec;
|
|
|
|
#[cfg(feature = "quantum_qfhrr")]
|
|
pub mod quantum_qfhrr;
|
|
|
|
#[cfg(feature = "quantum_receipt")]
|
|
pub mod quantum_receipt;
|
|
|
|
#[cfg(feature = "quantum_stabilizer")]
|
|
pub mod quantum_stabilizer;
|
|
|
|
#[cfg(feature = "quantum_toolchain")]
|
|
pub mod quantum_toolchain;
|
|
|
|
#[cfg(feature = "quantum_vml")]
|
|
pub mod quantum_vml;
|
|
|
|
// Signed-byte pins: an unlabelled receipt keeps the exact bytes it had before
|
|
// the optional acquisition class existed. Test-only.
|
|
#[cfg(all(test, feature = "_signing"))]
|
|
mod receipt_pins;
|