open-standards/wai/wai-rs/Cargo.toml
2026-10-08 02:00:51 -04:00

840 lines
41 KiB
TOML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[package]
name = "wai"
version = "0.3.0"
edition = "2024"
rust-version = "1.97"
license = "Apache-2.0"
description = "WAI — Web AI media transport + execution, and a deterministic QUANTUM stack: byte-exact circuit simulation with statevector / stabilizer / tensor-network / sparse-Pauli backends, error mitigation, qLDPC decoding, noise learning, circuit-equivalence proofs and signed energy-accounted receipts — identical results native and in cloud WASM. Plus a capability-as-requirement envelope and zeroth-condition wrappers around standard codec libraries (AVIF / JPEG-XL / PNG / Opus / FLAC / AV1 / zstd / LZMA)."
repository = "https://git.transaction.science/Transaction-Science/open-standards"
homepage = "https://wai.transaction.science"
documentation = "https://wai.transaction.science/quantum-ide"
keywords = ["quantum", "simulation", "wasm", "deterministic", "codec"]
categories = ["science", "simulation", "wasm", "multimedia"]
[lib]
name = "wai"
crate-type = ["lib", "cdylib", "staticlib"] # cdylib + staticlib for FFI/SDK
# clippy.toml's `disallowed-methods` lists the float functions the JPEG AI exact
# decoder must not call. Allowed for the package here; each module on that decode path
# denies it with `#![deny(clippy::disallowed_methods)]`.
[lints.clippy]
disallowed_methods = "allow"
# `cfg(kani)` is set only by the model checker (wai-verify `#[path]`-includes the
# integer sources: rans, int_entropy, int_transform, int_kernels). Declared so an
# ordinary build or clippy run knows the name and does not warn on it.
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(kani)"] }
[dependencies]
# Container manifest. preserve_order so JSON round-trips byte-identical.
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["preserve_order", "raw_value"] }
# ---- zeroth codec wrappers: lossy + lossless across all media ----
# All optional behind the (default-on) `codecs` feature: native sinks get
# the full menu; a wasm32 world sink builds with --no-default-features
# --features world and none of the C codec chain. Registration (the
# capability strings in codecs/mod.rs) is NOT gated — only the decoders.
# Image
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "webp", "avif"], optional = true } # PNG, JPEG decode, AVIF encode (via ravif)
jpeg-encoder = { version = "0.7", optional = true } # pure-Rust JPEG with optimized Huffman tables
libavif-image = { version = "0.14", optional = true } # AVIF decode via system libavif (fixes silent-empty decode bug)
jpegxl-rs = { version = "0.14", optional = true } # libjxl bindings (links system libjxl; 0.11.x and 0.12.x both work)
# Audio
opus = { version = "0.3", optional = true } # libopus bindings (lossy)
ogg = { version = "0.9", optional = true } # Ogg container for standard .opus interop
claxon = { version = "0.4", optional = true } # FLAC decode (pure Rust)
flac-bound = { version = "0.5", optional = true } # FLAC encode (libFLAC)
# Video
rav1e = { version = "0.8", default-features = false, features = ["threading"], optional = true }
dav1d = { version = "0.11", optional = true } # AV1 decode (libdav1d)
# Text
zstd = { version = "0.13", optional = true } # zstd bindings
xz2 = { version = "0.1", optional = true } # liblzma bindings (XZ/LZMA)
# Bytestream framing for video container (we wrap rav1e packets into a
# minimal IVF-like sequence for self-contained .wai video payloads).
byteorder = { version = "1", optional = true }
# ---- neural runtime (optional, behind the `neural` feature) ----
# `ort` wraps ONNX Runtime — same ORT version (1.26) the
# browser-side wai-web demo uses, so models built with our exporters
# load identically here. The `download-binaries` feature fetches the
# right libonnxruntime build at compile time; no manual brew install.
ort = { version = "2.0.0-rc.12", default-features = false, features = ["std", "download-binaries", "ndarray", "tls-rustls"], optional = true }
ndarray = { version = "0.17", optional = true }
zstd-safe = { version = "7", optional = true, features = ["std"] } # for bmshj2018 latent unpack (std → WriteBuf for Vec)
# SHA-256 is WAI's digest for parameter-set identity, component identity and decoded-output
# conformance digests (SPEC §3.1, §7 *Digests*, §7.1). Pure Rust, so it is always on: the
# envelope reader verifies a component digest and a pin with no feature enabled.
sha2 = "0.10"
# ---- real C2PA manifest emission (optional, behind `c2pa_emit`) ----
# Writes an actual signed manifest carrying the energy + reconstruction
# bindings, rather than only defining their shapes. Off by default: the SDK
# is a large dependency chain and most consumers only need the types.
c2pa = { version = "0.90", optional = true, default-features = false,
features = ["rust_native_crypto"] }
# ---- interactive worlds (optional, behind the `world` feature) ----
# extensions/interactive-worlds: WWLD container, signed CausalOps,
# deterministic fixed-point simulation, replay-equivalence conformance.
blake3 = { version = "1.8", optional = true } # state hashes, node minting, op/seal commitments; `hazmat` (1.8) for the HTTP head proof
ed25519-dalek = { version = "2", optional = true } # op + seal signatures
num-bigint = { version = "0.4", optional = true } # oer: exact decimal arithmetic in the composition checks
# The curve ed25519-dalek is built on, named directly only by `receipt_claims`: its
# conformance corpus builds the signatures jwp-receipts §3.1 step 3 must refuse (keys of
# small order, non-canonical encodings), which the signing API cannot produce, and the
# verifier checks S < L itself (§3.1 step 3).
curve25519-dalek = { version = "4", optional = true }
# ---- quantum (optional, behind the `quantum*` features) ----
# The quantum stack now lives in its own dependency-light crate so it can be used
# without the media/codec chain. `wai` re-exports it unchanged.
wai-quantum = { version = "0.3.0", path = "../wai-quantum", optional = true, default-features = false }
[features]
default = ["codecs"]
# The zeroth-condition codec wrappers (image/audio/video/text) + the C
# FFI surface built on them. Default-on: a native sink is a full sink.
# Disable for targets where the C codec chain can't follow (wasm32) —
# the envelope, manifest, and `world` engine build without it.
codecs = [
"dep:image", "dep:jpeg-encoder", "dep:libavif-image", "dep:jpegxl-rs",
"dep:opus", "dep:ogg", "dep:claxon", "dep:flac-bound",
"dep:rav1e", "dep:dav1d",
"dep:zstd", "dep:xz2", "dep:byteorder",
"ffi",
]
# The C ABI's envelope surface (buffers, errors, WAI1/WAI2 pack and unpack, §7.1
# selection), with no codec library: it builds and is tested where libjxl and the
# other C codec libraries are absent. `codecs` adds the codec wrappers to it.
ffi = []
# Pulls in the ONNX runtime + zstd unpack so the native sink can
# decode `wai.neural.<...>` envelopes. Off by default — the bare
# container + zeroth codecs build with no ML dep chain.
# The integer-exact synthesis decoder (`wai.neural.int_synth`). Pure i64
# arithmetic — no ONNX, no float, bit-identical on every machine by
# construction — so it sits behind its own light feature, checkable in a CI
# matrix with no ONNX Runtime present. `neural` pulls it in. blake3 is for the
# conformance corpus's content hash (the same hash the other classes freeze).
neural_int = ["dep:blake3"]
# Deterministic integer generative synthesis (`wai.generate.*`): byte-exact
# generation pinned to (model, prompt, seed, steps) — the create-side of the
# integer contract. Pure i64, no ONNX/float (serde_json is already a base dep),
# so it builds and is bit-checkable with no ML dep chain, and compiles to wasm32.
generate = []
# Deterministic integer inter-frame VIDEO (`wai.video.int_motion`): byte-exact
# frame-by-frame decode — integer block motion compensation + integer-quantized
# residual over the rANS coder. Frame-state-equivalence (per-frame hash); the
# temporal extension of the integer contract. Reuses the pure-i64 rANS (neural_int).
video_int = ["neural_int"]
# Integer-exact LEARNED audio codec (`wai.audio.int_codec`): a learned 1-D transform
# codec, integer transposed-conv synthesis → byte-exact int16 PCM (sample-equivalence,
# a portable PCM hash). The audio analog of int_hyper. Reuses pure-i64 rANS + IGDN.
audio_int = ["neural_int"]
# Integer-exact INTERACTIVE WORLD MODEL (the byte-exact renderer for wai.world.model):
# action-conditioned next-frame model, transition + synthesis both int_hyper IntModels.
# Reuses int_hyper_synth (neural_int).
world_int = ["neural_int"]
# Integer-exact LEARNED Gaussian-splat ATTRIBUTE codec ("the int_hyper of 3D"):
# learned transform over the [14,S,S] attribute image → byte-exact attribute tensor
# (splat-equivalence, a portable cloud hash). Reuses int_hyper_synth (neural_int).
splat_int = ["neural_int", "serde_json/float_roundtrip"]
neural = ["neural_int", "dep:ort", "dep:ndarray", "dep:zstd-safe"]
# The perceptual / generative-semantic path: CLIP-similarity conformance,
# regenerate-at-sink. Reuses the ONNX runtime for the reference CLIP embedder;
# the generator is always sink-supplied. Off by default like `neural`.
semantic = ["codecs", "dep:ort", "dep:ndarray"]
# Ed25519 verified as WAI verifies every signature (SPEC §7 *Signatures*, `src/sig.rs`):
# the dependency on its own, so the one verifier builds exactly when ed25519-dalek does
# and asks for no feature its caller does not need. Every signing feature enables it.
ed25519 = ["dep:ed25519-dalek"]
# Interactive worlds (extensions/interactive-worlds): media that consumes
# input. Pure-Rust, no ML dep chain — the sim is closed-form fixed-point.
world = ["dep:blake3", "ed25519"]
# Object-based spatial audio (extensions/spatial-audio): the deterministic
# Fx mixdown engine. Reuses the world `Fx` floor + blake3; no codec/ML deps
# (sources arrive as decoded mono PCM — decoding the wai.audio.* assets is
# the sink's job, exactly as glb/spz decode is).
audio_scene = ["world"]
# Haptics (extensions/haptics): touch as a tiny keyframed envelope,
# reconstructed in the Fx floor. Sample-equivalence; no codec/ML deps.
haptic = ["world"]
# Volumetric / 4D temporal Gaussian splats (extensions/volumetric): each
# Gaussian's keyframed tracks reconstructed at frame N in the Fx floor.
# Frame-state-equivalence; no codec/ML deps (the render is the sink's).
splat4d = ["world"]
# Music as instructions (extensions/score): a note-event score rendered to
# a canonical PCM mixdown by a deterministic trig-free synth in the Fx
# floor. Mixdown-equivalence; no codec/ML deps (the instrument is the sink's).
score = ["world"]
# Asset provenance (extensions/provenance): a signed, energy-accounted
# lineage receipt for opaque captured content WAI does not reconstruct.
# Reuses the JWP Merkle + Ed25519; no codec/ML deps.
provenance = ["world"]
# OER/2 outcome-and-energy receipts (extensions/oer-receipts.md): a verifier for
# receipts that grade what a unit of work cost (projected/simulated/derived/measured),
# content-address and chain it, and sign it. Conformance is reason-set equality with
# the reference verifier and the portable C kernel over oer-conformance/.
oer = ["dep:blake3", "ed25519", "dep:num-bigint", "serde_json/float_roundtrip"]
# jwp-receipts §2.1's object content hash (src/jwp_hash.rs), on its own so any
# receipt family that names an object can compute it with BLAKE3 alone.
jwp_hash = ["dep:blake3"]
# Staged delivery (extensions/staged-delivery.md): a base first, then refinements as
# their own objects, each bound to what it refines by content hash. The residual form
# (WIR1) is integer rANS (neural_int); content hashes are jwp_hash's BLAKE3; stage
# hashes are SHA-256, always on.
staged = ["neural_int", "jwp_hash"]
# HTTP delivery (extensions/http-delivery.md): objects named by their content hash, the
# WHP1 head proof (BLAKE3's tree, through jwp_hash's BLAKE3), verified range fetch of one
# WAI2 component, the codecs union and floor, and an origin's responses. Component
# digests are SHA-256, always on. No I/O in the library; `wai http` does it.
http = ["jwp_hash"]
# Staged-delivery measurement (extensions/staged-measurement.md): the counted bytes of
# an envelope, the output tree, and the deterministic evaluation of a staged title —
# its prefixes' counted bytes, outputs and quality integers, first presentable,
# layering overhead and deduplication — over the staged sink and the integer decoders.
# Pure integer, no ONNX, no file system on wasm32.
stage_measure = ["staged", "video_int", "audio_int", "splat_int"]
# Delivery telemetry (extensions/delivery-telemetry.md): unsigned, advisory observations,
# their CMCD version 2 and CMSD reports as RFC 9651 Structured Field Values, and session
# metrics. No dependency beyond serde_json; wasm32-clean.
telemetry = []
# Typed receipt classes on the JWP chain (extensions/jwp-receipts.md §2.4.3–§2.4.7,
# §2.6, §3.1–§3.2): `claim` receipts of class energy / lawful-basis / log-inclusion,
# the soft-binding class, and recovery under the ancestor rule. Needs `provenance`
# for the coverage vocabulary and `oer` for the evidential grades and the OER receipt
# an energy claim may name, which it reads and verifies through `crate::oer`; and
# `staged`, so a session verifier holding envelopes counts a refinement layer's `WIR1`
# payload (staged-measurement §3) and reads its `refines`. Its one direct dependency,
# curve25519-dalek, is already in the graph under ed25519-dalek.
receipt_claims = ["provenance", "oer", "jwp_hash", "staged", "dep:curve25519-dalek"]
# Key discovery and signing authority (extensions/jwp-receipts.md §7): the origin key
# log a `did:web` signer_id names, anchoring, the confirmation reported beside a receipt's
# or claim's verdict, and the authorisation and revocation of decoder and reconstruct
# modules (§7.9). Adds no dependency: it signs and hashes with what `receipt_claims`
# already brings, and a module digest is the SHA-256 `oer` already brings.
key_discovery = ["receipt_claims"]
# Emit a REAL C2PA manifest (not just the assertion shapes). Off by default:
# the SDK is a large dependency chain and most WAI consumers only need the
# binding types, which `provenance` already gives them.
c2pa_emit = ["provenance", "dep:c2pa"]
# wai.world.model — generative-world transport: a signed, replay-equivalent action
# trace (reuses the world CausalOp log) + per-frame provenance. The neural sibling
# of wai.world.replay; the renderer is a declared world model (sink-supplied, or the
# int_* family for byte-exact frames).
world_model = ["world", "provenance"]
# Linear film (extensions/linear-film): a film is a sealed camera-on-rails
# world — the world replay (replay-equivalence) + a keyframed camera track
# (Fx floor) + a frame schedule, verified frame-by-frame (film-equivalence).
# Composes the world engine; pulls `score` so a reel can embed a soundtrack
# (one envelope = movie + sound). No codec/ML deps (the render is the sink's).
film = ["world", "score"]
# Deterministic quantum-circuit SIMULATION (extensions/quantum-sim,
# `wai.quantum.circuit`): the wire carries a gate op-log (WQC container), the sink
# classically simulates it in a fixed-point complex floor, the statevector is
# byte-identical on every machine (statevector-equivalence). Pure i64, no float —
# blake3 for the conformance/receipt hashes, same discipline as the other floor
# classes. No quantum hardware (it would break determinism). Compiles to wasm32.
quantum = ["dep:wai-quantum", "wai-quantum/quantum"]
# The energy-accounted seal for a quantum reconstruction (extensions/quantum-sim
# § Receipt): a signed receipt that separates the portable-exact WORK (n_ops·2^n
# amplitude updates, recomputable) from the measured-attested ENERGY (joules_micro
# from the sink's meter), both bound to a re-simulatable statevector hash. Reuses
# the JWP Merkle + Ed25519 from `world` — reuse, not reinvention.
quantum_receipt = ["quantum", "wai-quantum/quantum_receipt"]
# The JWP receipt profile for the integer inter-frame video codec. Follows the
# same shape as `quantum_receipt`: the class feature plus `world`, which is what
# supplies blake3, ed25519 and the shared `merkle_root`. Kept OUT of `video_int`
# on purpose — `int_video.rs` is #[path]-included by the byte-exact conformance
# crate, and that crate must keep its three-dependency set to stay runnable on
# every leg of the cross-arch matrix.
video_receipt = ["video_int", "world"]
# wai.video.manifest — attested, deduplicating, energy-accounted per-session
# manifest. Reuses the world Merkle + Ed25519 and the JCP GrantRef (quantum_ops);
# carries no pixel-decode dependency, so it stays a light, pure-Rust surface.
# Depends on `world` EXPLICITLY: these receipts use
# `crate::world::receipt::merkle_root`. That used to arrive transitively via
# `quantum_ops`, which no longer provides it now the quantum stack lives in
# its own crate — a dependency this feature always had and never declared.
video_manifest = ["quantum_ops", "world"]
# Energy meters — the source of a receipt's joules_micro. Reuses the
# EnergyProvenance ladder; hardware counter vs calibrated model, mechanically.
energy_meter = ["video_manifest"]
# wai.video.ssai — attested ad decisioning + per-impression receipt. Reuses the
# manifest module's EnergyProvenance + the GrantRef/Merkle/Ed25519 floor.
# Pure decision policy (no deps) — separable so it can be model-checked.
video_policy = []
video_ssai = ["video_manifest", "video_policy"]
# wai.video.keys — attested content-key release; the DRM audit trail as a
# recomputable decision. Reuses the manifest floor (EnergyProvenance, GrantRef,
# Ed25519).
video_keys = ["video_manifest"]
# wai.video.package — deterministic segmentation + attested, deduplicating
# SegmentMap. Reuses the manifest floor (EnergyProvenance, GrantRef, Merkle). Also the
# packaging extension's stage index (WSIX) and version-2 package receipt, which name
# each object by jwp-receipts §2.1's content hash (jwp_hash).
video_package = ["video_manifest", "jwp_hash"]
# wai.video.channel — virtual linear / FAST assembly; the program-as-run hash
# chain. Reuses the manifest floor (EnergyProvenance, GrantRef, Merkle).
video_channel = ["video_manifest"]
# The whole OTT workflow suite in one switch.
video_workflow = ["video_manifest", "video_ssai", "video_keys", "video_package", "video_channel"]
# Balanced-ternary matrix-product-state transform (`wai.ternary.tt`,
# extensions/ternary-tt): quantum-INSPIRED (tensor-network) compression whose
# novel delta is an INTEGER core scale — the whole decode is pure i64/i128, so a
# ternary-MPS reconstruction is byte-identical on every machine (a portable
# reconstruction hash), unlike the float-scale ternary/MPS fabric it ports from.
# Lossy codec, deterministic decode. Encoder-side float (SVD) only. Reuses
# int_transform's fixed-point idiom (neural_int) + blake3 for the recon hash.
ternary = ["neural_int"]
# The energy-accounted seal for a ternary-MPS reconstruction (extensions/ternary-tt
# § Receipt): a signed receipt separating portable-exact WORK (trit_macs) from
# measured-attested ENERGY (joules_micro), bound to the WQTT payload hash + a
# re-decodable reconstruction hash. Reuses the JWP Merkle + Ed25519 from `world`.
ternary_receipt = ["ternary", "world"]
# Quantum-operations attestation (extensions/quantum-ops, `wai.quantum.calibration`
# + `wai.quantum.job`): signed, content-addressed, joule-metered, grant-authorized
# receipts of calibration runs and QPU jobs — the verify-half of WAI applied to the
# quantum-control industry. WAI does NOT run hardware; it owns the receipt. Reuses
# the JWP Merkle + Ed25519 from `world`; no sim/codec deps.
quantum_ops = ["dep:wai-quantum", "wai-quantum/quantum_ops"]
# Deterministic autonomous CALIBRATION engines (extensions/quantum-ops § Calibration):
# a fixed-point qubit-device simulator + autonomous tune-up algorithms (Rabi π-pulse
# to start), byte-exact and reproducible, sealing a wai.quantum.calibration receipt per run. Pulls quantum_ops.
quantum_cal = ["quantum_ops", "wai-quantum/quantum_cal"]
# Deterministic quantum ERROR MITIGATION (extensions/quantum-ops § Mitigation,
# `wai.quantum.mitigate`): the classical post-processing layer between raw QPU
# counts and the reported number — zero-noise extrapolation, tensored readout
# inversion, classical shadows — in pure fixed-point, byte-exact, each sealing a
# signed, joule-metered MitigationReceipt over the step. Pulls quantum_ops.
quantum_mitigate = ["quantum_ops", "wai-quantum/quantum_mitigate"]
# Deterministic quantum LDPC DECODING (extensions/quantum-ops § Decoding,
# `wai.quantum.decode`): a fixed-point Relay-BP (normalized min-sum) decoder for
# qLDPC codes (toric + bivariate-bicycle), byte-exact on every machine, each
# decode sealing a signed, joule-metered DecodeReceipt carrying joules-per-decode
# signed with the correction. Pulls quantum_ops.
quantum_qec = ["quantum_ops", "wai-quantum/quantum_qec"]
# Deterministic FILTER-FUNCTION control + NOISE SPECTROSCOPY (extensions/quantum-ops
# § Calibration, frequency domain): the filter-function overlap χ = ∫ S(ω)F(ω)/ω²
# — DD noise spectroscopy (reconstruct S(ω) from a filter bank) + filter-function
# robust control (reshape a DD sequence to dodge a PSD). Fully offline, byte-exact,
# sealing wai.quantum.calibration receipts. Pulls quantum_cal (trig/exp + seal).
quantum_control = ["quantum_cal", "wai-quantum/quantum_control"]
# Deterministic NOISE LEARNING (extensions/quantum-ops § Calibration, noise model,
# `wai.quantum.cal.noise_learn`): Cycle Benchmarking + Cycle Error Reconstruction
# of a sparse Pauli–Lindblad model — recover a hidden device's Pauli error rates
# from a simulated twirled-cycle experiment (multiplicative NNLS), byte-exact,
# sealing a signed model whose hash a MitigationReceipt binds (the PEC producer).
quantum_noise = ["quantum_cal", "wai-quantum/quantum_noise"]
# Deterministic circuit COMPILATION + equivalence proof (extensions/quantum-ops
# § Compilation, `wai.quantum.compile`): a coupling-graph router (SWAP insertion)
# + a byte-exact Clifford stabilizer-tableau equivalence check, sealing a signed
# CompileReceipt that a routed circuit is equivalent to its source — compilation
# correctness, which no compiler signs. Pulls quantum_ops.
quantum_compile = ["quantum_ops", "wai-quantum/quantum_compile"]
# Deterministic neutral-atom REARRANGEMENT (extensions/quantum-ops § Register
# preparation, `wai.quantum.rearrange`): a Hungarian / LSAP solver that assigns a
# defect-free target register a distinct loaded atom minimizing total move
# distance, byte-exact, sealing a signed RearrangeReceipt whose success verdict is
# re-checkable. Pulls quantum_ops.
quantum_atom = ["quantum_ops", "wai-quantum/quantum_atom"]
# WAI Quantum Toolchain (extensions/quantum-sim § Toolchain,
# `wai.quantum.toolchain`): the compute core of a classical-hardware quantum IDE —
# algorithm library + state analysis (Bloch, entanglement, expectations) + backend
# selection (Clifford → statevector → tensor-network cascade) + OpenQASM interop,
# all over the byte-exact fixed-point simulator. Framework-neutral, no cloud.
quantum_toolchain = ["quantum", "wai-quantum/quantum_toolchain"]
# Matrix Product State backend (extensions/quantum-sim § MPS, `wai.quantum.mps`):
# the tensor-network "classical referee" — evolve a bounded-bond MPS gate-by-gate
# with a deterministic complex Jacobi SVD truncation, reproducible on every machine
# (approximate method → determinism + retained-weight fidelity, not byte-exact).
# Verified against the dense simulator. Pure Rust; only IEEE-754 + - * / sqrt.
quantum_mps = ["quantum", "wai-quantum/quantum_mps"]
# Stabilizer / CHP backend (extensions/quantum-sim § Stabilizer,
# `wai.quantum.stabilizer`): the O(n²) Clifford tier of the cascade — the
# Aaronson–Gottesman tableau simulates + samples Clifford circuits far past the
# dense 2^n wall (thousands of qubits), exact integer bit-arithmetic (no floats),
# deterministic histograms. Rejects non-Clifford gates for fallback.
quantum_stabilizer = ["quantum", "wai-quantum/quantum_stabilizer"]
# Sparse-Pauli / Heisenberg propagation (extensions/quantum-sim § Pauli,
# `wai.quantum.pauli`): the observable referee — propagate an observable backward
# through the circuit as a truncated sum of Pauli strings (Begušić and Chan's sparse
# Pauli dynamics). Computes ⟨O⟩ on large
# low-magic circuits where no state vector exists; grows with magic, not qubits.
quantum_pauli = ["quantum", "wai-quantum/quantum_pauli"]
# Sparse Pauli dynamics at utility scale (arbitrary angles, up to 1024 qubits),
# and its signed receipts.
quantum_spd = ["quantum", "wai-quantum/quantum_spd"]
quantum_spd_receipt = ["quantum_spd", "wai-quantum/quantum_spd_receipt"]
# Tensor-network states on the hardware graph (simple update, belief propagation).
quantum_bptn = ["quantum_spd", "wai-quantum/quantum_bptn"]
# Fault-tolerant resource estimation (layout, distance, T factories, frontier),
# and its signed receipts.
quantum_resource = ["dep:wai-quantum", "wai-quantum/quantum_resource"]
quantum_resource_receipt = ["quantum_resource", "wai-quantum/quantum_resource_receipt"]
# Noisy Clifford circuits at QEC scale: frame sampling, detector error models,
# exact matching, measured code models.
quantum_frame = ["dep:wai-quantum", "wai-quantum/quantum_frame", "wai-quantum/quantum_uf"]
# Tensor-network contraction: hyper-optimised trees, slicing, circuit amplitudes.
quantum_tn = ["dep:wai-quantum", "wai-quantum/quantum_tn"]
# Gaussian boson sampling: hafnians, torontonians, exact probabilities, samples, checks.
quantum_gbs = ["dep:wai-quantum", "wai-quantum/quantum_gbs"]
# The dense state vector at any angle: fusion, threads, the same bits everywhere.
quantum_sv = ["dep:wai-quantum", "wai-quantum/quantum_sv", "wai-quantum/quantum_noisy"]
# Architecture-level estimation: yoked storage, cultivation, CCZ factories,
# reaction-limited time, whole machines.
quantum_arch = ["dep:wai-quantum", "wai-quantum/quantum_arch"]
# qLDPC memory at circuit level: bivariate-bicycle codes, BP-OSD.
quantum_ldpc = ["quantum_frame", "wai-quantum/quantum_ldpc"]
# Quantum-inspired optimisation: simulated bifurcation, annealing, exact referee.
quantum_qio = ["dep:wai-quantum", "wai-quantum/quantum_qio", "wai-quantum/quantum_dmrg", "wai-quantum/quantum_tdvp", "wai-quantum/quantum_chem", "wai-quantum/quantum_nqs"]
quantum_qir = ["quantum_toolchain", "wai-quantum/quantum_qir"]
# Variational quantum machine learning (extensions/quantum-sim § VML,
# `wai.quantum.vml`): the interference-based ML the thermodynamic-computing pivot
# left behind — a Quantum Circuit Born Machine (P_θ(x)=|ψ_θ(x)|²) trained by the
# exact parameter-shift gradient on the classical state vector, plus a
# barren-plateau probe (the honest limit). Deterministic f64. Pure Rust, no deps.
quantum_vml = ["dep:wai-quantum", "wai-quantum/quantum_vml"]
# The phasor bridge (extensions/quantum-sim § Phasor, `wai.quantum.phasor`): a
# quantum feature-map model is exactly a Fourier series of phasors (Schuld et al.).
# Compute the model on the state vector, extract its spectrum, and reproduce the
# identical function as a classical phasor sum (FHRR/HDC) — same interference, two
# substrates — with a qFHRR quantized-phase variant. Pure f64, no deps.
quantum_phasor = ["dep:wai-quantum", "wai-quantum/quantum_phasor"]
# The full Born machine on the qFHRR substrate (extensions/quantum-sim § qFHRR,
# `wai.quantum.qfhrr`): run the whole generative distribution P(x)=|ψ(x)|² with
# amplitude phases held at qFHRR resolution (b-bit, integer-native) — a trained
# Born machine deployed end-to-end on the phasor substrate, converging to the exact
# state vector as phase bits grow. Pure f64; reuses the vml ansatz for the ref.
quantum_qfhrr = ["quantum_vml", "wai-quantum/quantum_qfhrr"]
# Phasor-feature classifier (extensions/quantum-sim § Kernel, `wai.quantum.kernel`):
# the quantum kernel deployed as random Fourier / FHRR phasor features + a ridge
# classifier — separates nonlinearly-separable data a linear model cannot, at qFHRR
# phase resolution, with a counted phasor-op tally for joule pricing. Pure f64.
quantum_kernel = ["dep:wai-quantum", "wai-quantum/quantum_kernel"]
# Phasor energy meter (extensions/quantum-sim § Receipt, `wai.quantum.phasor`): the
# energy-accounted seal for an interference computation. Splits portable-exact
# phasor WORK — `D·(dim+1)·n`, linear and recomputable from the shape — from
# measured-attested joules, binding both to a reproducible-f64 result hash. Prices
# every bind/bundle/similarity op so qFHRR is an accountable substrate, not merely a
# fast one. Reuses the JWP Merkle + Ed25519 from `world`.
quantum_phasor_meter = ["dep:wai-quantum", "wai-quantum/quantum_phasor_meter"]
# Learning from quantum data (extensions/quantum-sim § QData, `wai.quantum.qdata`):
# the exponential sample-complexity separation for Pauli-channel learning — Ω(2^n)
# copies entanglement-free vs O(1/ε²) n-independent copies with a two-copy Bell
# measurement (Chen–Cotler–Huang–Li / Huang Science 2022). The quantum-data advantage
# that survives dequantization; it is why `noise_learn`'s Bell/CB sampling is
# data-efficient. Pure f64, deterministic in the seed.
quantum_qdata = ["dep:wai-quantum", "wai-quantum/quantum_qdata"]
# Quantum Bill of Materials (extensions/quantum-ops § Provenance,
# `wai.quantum.qbom`): assemble the stage receipts of one quantum computation
# (compile/calibrate/execute/mitigate/…) into a single signed, content-addressed
# provenance manifest with a total-energy roll-up and an operator-envelope export;
# binds each stage to a receipt that itself verifies. Pulls quantum_ops.
quantum_qbom = ["quantum_ops", "wai-quantum/quantum_qbom"]
# Mixed states (extensions/quantum-sim § Information): density matrices, the
# partial trace, purity, exact Pauli expectations, and CHSH against the classical
# and Tsirelson bounds. A state vector cannot describe a subsystem; this can.
quantum_info = ["quantum", "wai-quantum/quantum_info"]
# Qubits AND qutrits (extensions/quantum-sim § Qudits): the Weyl–Heisenberg group,
# the Fourier gate over `Z_d`, the controlled sum — exact for `d = 2` and `3`.
quantum_qudit = ["quantum", "wai-quantum/quantum_qudit"]
# Key distribution and security (extensions/quantum-sim § Communication): BB84 with
# an intercept-resend eavesdropper, and the no-cloning theorem priced.
quantum_comm = ["quantum", "wai-quantum/quantum_comm"]
# The limits on encoding and transport (extensions/quantum-sim § Source): von
# Neumann entropy, the Schumacher limit, and the Holevo bound — which says `n`
# qubits carry at most `n` classical bits, so quantum does not compress classical
# media. The layer that lets WAI state real limits instead of overclaiming.
quantum_source = ["quantum_info", "wai-quantum/quantum_source"]
# Transport itself (extensions/quantum-sim § Channel): Kraus channels and
# linear-inversion tomography, with the law that a channel can only lose
# information, never create it.
quantum_channel = ["quantum_source", "wai-quantum/quantum_channel"]
# Codec-chain examples gate on `codecs` (they call the C codec wrappers), so
# a `--no-default-features --features neural` build doesn't try to compile them.
[[example]]
name = "gen_preview"
path = "examples/gen_preview.rs"
required-features = ["generate"]
[[example]]
name = "int_hyper_decode_frame"
path = "examples/int_hyper_decode_frame.rs"
required-features = ["neural_int"]
[[example]]
name = "int_audio_decode"
path = "examples/int_audio_decode.rs"
required-features = ["audio_int"]
[[example]]
name = "int_world_decode"
path = "examples/int_world_decode.rs"
required-features = ["world_int"]
[[example]]
name = "int_splat_decode"
path = "examples/int_splat_decode.rs"
required-features = ["splat_int"]
[[example]]
name = "opus_check"
path = "examples/opus_check.rs"
required-features = ["codecs"]
[[example]]
name = "dl_check"
path = "examples/dl_check.rs"
required-features = ["codecs"]
[[example]]
name = "jpeg_test"
path = "examples/jpeg_test.rs"
required-features = ["codecs"]
# `encode` and `decode` need the `codecs` feature and are compiled out without it;
# every other command (wrap, unwrap, inspect, capabilities, registry export) builds
# with --no-default-features, which is how CI runs it.
[[bin]]
name = "wai"
path = "src/bin/wai.rs"
# The quantum stack as a CLI. Pure Rust, no host bindings — the same source builds
# for native AND `wasm32-wasip2`, producing byte-identical output under wasmtime.
[[bin]]
name = "wai-quantum"
path = "src/bin/wai_quantum.rs"
required-features = [
"quantum_toolchain",
"quantum_receipt",
"quantum_qir",
"quantum_channel",
"quantum_comm",
"quantum_qudit",
"quantum_spd_receipt",
"quantum_bptn",
"quantum_resource_receipt",
"quantum_frame",
"quantum_tn",
"quantum_gbs",
"quantum_sv",
"quantum_arch",
"quantum_ldpc",
"quantum_qio",
]
[[bin]]
name = "wai_int_synth_vectors"
path = "src/bin/wai_int_synth_vectors.rs"
required-features = ["neural_int"]
# The binary payload vectors of the integer codecs and their refusal fixtures
# (extensions/integer-payloads.md §12): `gen` converts the committed JSON, `verify`
# requires byte-identical regeneration, the sidecars' SHA-256 and every fixture's code.
[[bin]]
name = "wai_int_payload_vectors"
path = "src/bin/wai_int_payload_vectors.rs"
required-features = ["video_int", "audio_int", "splat_int"]
[[bin]]
name = "wai_staged_vectors"
path = "src/bin/wai_staged_vectors.rs"
required-features = ["staged", "video_int", "audio_int", "splat_int"]
[[bin]]
name = "wai_stage_bench"
path = "src/bin/wai_stage_bench.rs"
required-features = ["staged", "video_int", "audio_int", "splat_int"]
[[bin]]
name = "wai_film_vectors"
path = "src/bin/wai_film_vectors.rs"
required-features = ["film"]
[[bin]]
name = "wai_http_vectors"
path = "src/bin/wai_http_vectors.rs"
required-features = ["http"]
[[bin]]
name = "wai_world_vectors"
path = "src/bin/wai_world_vectors.rs"
required-features = ["world"]
[[bin]]
name = "wai_world_meter"
path = "src/bin/wai_world_meter.rs"
required-features = ["world", "receipt_claims"]
[[bin]]
name = "wai_audio_vectors"
path = "src/bin/wai_audio_vectors.rs"
required-features = ["audio_scene"]
[[bin]]
name = "wai_haptic_vectors"
path = "src/bin/wai_haptic_vectors.rs"
required-features = ["haptic"]
[[bin]]
name = "wai_feed_vectors"
path = "src/bin/wai_feed_vectors.rs"
required-features = ["world"]
[[bin]]
name = "wai_avatar_vectors"
path = "src/bin/wai_avatar_vectors.rs"
required-features = ["world"]
[[bin]]
name = "wai_splat4d_vectors"
path = "src/bin/wai_splat4d_vectors.rs"
required-features = ["splat4d"]
[[bin]]
name = "wai_oer_vectors"
path = "src/bin/wai_oer_vectors.rs"
required-features = ["oer"]
[[bin]]
name = "wai_oer_diff"
path = "src/bin/wai_oer_diff.rs"
required-features = ["oer"]
[[bin]]
name = "wai_pin_vectors"
path = "src/bin/wai_pin_vectors.rs"
[[bin]]
name = "wai_claim_vectors"
path = "src/bin/wai_claim_vectors.rs"
required-features = ["receipt_claims"]
[[bin]]
name = "wai_jwp_vectors"
path = "src/bin/wai_jwp_vectors.rs"
required-features = ["receipt_claims"]
[[bin]]
name = "wai_signer_vectors"
path = "src/bin/wai_signer_vectors.rs"
required-features = ["key_discovery"]
[[bin]]
name = "wai-keys"
path = "src/bin/wai_keys.rs"
required-features = ["key_discovery"]
[[bin]]
name = "wai_quantum_vectors"
path = "src/bin/wai_quantum_vectors.rs"
required-features = ["quantum"]
[[bin]]
name = "wai_quantum_ops_vectors"
path = "src/bin/wai_quantum_ops_vectors.rs"
required-features = ["quantum_ops"]
[[bin]]
name = "wai_quantum_meter"
path = "src/bin/wai_quantum_meter.rs"
required-features = ["quantum_receipt", "receipt_claims"]
[[bin]]
name = "wai_video_meter"
path = "src/bin/wai_video_meter.rs"
required-features = ["video_receipt", "receipt_claims"]
[[bin]]
name = "wai_meter"
path = "src/bin/wai_meter.rs"
required-features = ["haptic", "splat4d", "score", "film", "receipt_claims"]
[[bin]]
name = "wai_prov"
path = "src/bin/wai_prov.rs"
required-features = ["provenance", "codecs", "receipt_claims"]
[[bin]]
name = "wai_bench"
path = "src/bin/wai_bench.rs"
required-features = ["codecs"]
[[bin]]
name = "wai_decode_bench"
path = "src/bin/wai_decode_bench.rs"
required-features = ["neural_int", "video_int", "audio_int", "world_int", "splat_int"]
[[bin]]
name = "wai_bench_diff"
path = "src/bin/wai_bench_diff.rs"
required-features = ["codecs"]
# A program, not a libtest suite: it lists its own executable's symbols, so the test
# harness's code must not be in it (see the file's doc).
[[test]]
name = "jpegai_decode_symbols"
path = "tests/jpegai_decode_symbols.rs"
harness = false
required-features = ["neural_int"]
# Feature-gated integration tests that CI names with `--test`. Declared with their
# features so that naming one without them stops cargo with an error, instead of
# compiling the `#![cfg(feature)]` file to an empty binary that reports ok.
[[test]]
name = "int_audio"
path = "tests/int_audio.rs"
required-features = ["audio_int"]
[[test]]
name = "int_splat"
path = "tests/int_splat.rs"
required-features = ["splat_int"]
[[test]]
name = "cli_http"
path = "tests/cli_http.rs"
required-features = ["http"]
[[test]]
name = "int_kernels_vectors"
path = "tests/int_kernels_vectors.rs"
required-features = ["neural_int", "video_int", "audio_int", "world_int", "splat_int"]
[[test]]
name = "int_kernels_geometry"
path = "tests/int_kernels_geometry.rs"
required-features = ["neural_int"]
[[test]]
name = "int_mlicpp"
path = "tests/int_mlicpp.rs"
required-features = ["neural_int"]
[[test]]
name = "int_mlicpp_preflight"
path = "tests/int_mlicpp_preflight.rs"
required-features = ["neural_int"]
[[test]]
name = "cli_stage"
path = "tests/cli_stage.rs"
required-features = ["staged", "video_int", "audio_int", "splat_int"]
[[test]]
name = "staged_resources"
path = "tests/staged_resources.rs"
required-features = ["staged", "video_int"]
[[test]]
name = "staged_moq"
path = "tests/staged_moq.rs"
required-features = ["staged", "video_int", "receipt_claims"]
[[test]]
name = "int_payload"
path = "tests/int_payload.rs"
required-features = ["video_int", "audio_int", "splat_int"]
[[test]]
name = "int_payload_preflight"
path = "tests/int_payload_preflight.rs"
required-features = ["video_int", "audio_int", "splat_int"]
[[test]]
name = "int_payload_cost"
path = "tests/int_payload_cost.rs"
required-features = ["video_int", "audio_int", "splat_int"]
[[test]]
name = "int_video_enc_memory"
path = "tests/int_video_enc_memory.rs"
required-features = ["video_int"]
[[test]]
name = "generate"
path = "tests/generate.rs"
required-features = ["generate"]
[[test]]
name = "ffi_envelope"
path = "tests/ffi_envelope.rs"
required-features = ["ffi"]
[[test]]
name = "ffi_neural_pin"
path = "tests/ffi_neural_pin.rs"
required-features = ["neural", "ffi"]
[[test]]
name = "neural_native_decode"
path = "tests/neural_native_decode.rs"
required-features = ["neural"]
[[test]]
name = "jpegai_e2e_full"
path = "tests/jpegai_e2e_full.rs"
required-features = ["neural_int"]
# Drives the `wai-keys` binary, so it needs the feature that builds it.
[[test]]
name = "wai_keys_cli"
path = "tests/wai_keys_cli.rs"
required-features = ["key_discovery"]
[dev-dependencies]
serde_json = { version = "1", features = ["preserve_order"] } # construct manifests in tests
[build-dependencies]
pkg-config = "0.3" # locate system libflac (cross-platform; replaces
# the macOS-hardcoded .cargo/config.toml rustflags)
cbindgen = { version = "0.29", default-features = false }
# generate include/wai.h from the FFI surface so
# SDK consumers get a typed C header instead of
# hand-writing extern decls
[profile.release]
opt-level = 3
lto = true
codegen-units = 1
[[bin]]
name = "wai_score_vectors"
path = "src/bin/wai_score_vectors.rs"
required-features = ["score"]
# Staged-delivery measurement (extensions/staged-measurement.md): `eval` one title,
# `verify` the corpus staged-measure-conformance/ (fixtures regenerated in memory,
# evaluations, the fixture tool's own reconstruction, goldens), `generate-goldens`
# and `gen-fixtures` (never in CI), and `bench` (never in CI): one title's decode time
# and decode figure on this machine, and, with `receipt_claims`, its session claim
# (`--sign`).
[[bin]]
name = "wai_stage_measure"
path = "src/bin/wai_stage_measure.rs"
required-features = ["stage_measure"]
[[test]]
name = "stage_measure"
path = "tests/stage_measure.rs"
required-features = ["stage_measure"]
# Its own binary: a counting allocator shows a title over an outsized base is refused
# before anything is allocated for it.
[[test]]
name = "stage_measure_bounds"
path = "tests/stage_measure_bounds.rs"
required-features = ["stage_measure"]
# Delivery telemetry (extensions/delivery-telemetry.md): `encode` an observation's CMCD
# report, `decode` one, `verify` the corpus telemetry-conformance/, `gen` (never in CI).
[[bin]]
name = "wai_telemetry"
path = "src/bin/wai_telemetry.rs"
required-features = ["telemetry"]