open-standards/wai/wai-rs/Cargo.toml
Transaction Science 1e435c861a toolchain: Rust 1.98.0, and MSRV follows
Latest stable (1.98.0, released 2026-08-18). The pin lives in more places than
is obvious, and missing one means CI silently builds an older compiler than the
dev box:

  - rust-toolchain.toml at the repo root
  - eoc/eoc-rs/rust-toolchain.toml, a second toolchain file
  - five CI workflows that hardcode a version instead of deferring to the file
    (wai-conformance, wai-neural-e2e, wai-byte-equality,
    joule-code-conformance, jouleclaw-public-surface-documented)

standards-build.yml needed no change, because it reads the toolchain file
rather than pinning inline. That is the pattern the other five should adopt.

MSRV raised to 1.98 across 26 manifests, following the earlier decision to have
the declared floor track the pin rather than drift behind it. Note this is a
support-policy change, not a mechanical one: it narrows which compilers can
consume these standards as libraries.

The pin stays exact, never `stable` — a pin that drifts is not a pin.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-08-26 08:33:46 -04:00

329 lines
14 KiB
TOML

[package]
name = "wai"
version = "0.3.0"
edition = "2024"
rust-version = "1.98"
license = "Apache-2.0"
description = "WAI — Web AI media transport + execution. Capability-as-requirement envelope + neural shared-prior regenerate-at-sink path + always-available zeroth-condition wrappers around SOTA standard codecs (AVIF / JPEG-XL / PNG / Opus / FLAC / AV1 / zstd / LZMA)."
[lib]
name = "wai"
crate-type = ["lib", "cdylib", "staticlib"] # cdylib + staticlib for FFI/SDK
[dependencies]
# Container manifest. preserve_order so JSON round-trips byte-identical.
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["preserve_order"] }
# ---- 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)
# 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 Microsoft's onnxruntime — 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)
sha2 = { version = "0.10", optional = true } # verify a pinned neural prior against the registered model artifact
# ---- interactive worlds (optional, behind the `world` feature) ----
# extensions/interactive-worlds: WWLD container, signed CausalOps,
# deterministic fixed-point simulation, replay-equivalence conformance.
blake3 = { version = "1", optional = true } # state hashes, node minting, op/seal commitments
ed25519-dalek = { version = "2", optional = true } # op + seal signatures
[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",
]
# 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"]
neural = ["neural_int", "dep:ort", "dep:ndarray", "dep:zstd-safe", "dep:sha2"]
# 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"]
# 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", "dep:ed25519-dalek"]
# 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", "dep:sha2"]
# 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:blake3"]
# 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", "world"]
# 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 = ["world"]
# Deterministic autonomous CALIBRATION engines (extensions/quantum-ops § Calibration):
# a fixed-point qubit-device simulator + autonomous tune-up algorithms (Rabi π-pulse
# to start) — the software capability the quantum-control vendors sell, byte-exact and
# reproducible, sealing a wai.quantum.calibration receipt per run. Pulls quantum_ops.
quantum_cal = ["quantum_ops"]
# 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"]
[[bin]]
name = "wai"
path = "src/bin/wai.rs"
required-features = ["codecs"]
[[bin]]
name = "wai_int_synth_vectors"
path = "src/bin/wai_int_synth_vectors.rs"
required-features = ["neural_int"]
[[bin]]
name = "wai_film_vectors"
path = "src/bin/wai_film_vectors.rs"
required-features = ["film"]
[[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"]
[[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_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"]
[[bin]]
name = "wai_meter"
path = "src/bin/wai_meter.rs"
required-features = ["haptic", "splat4d", "score", "film"]
[[bin]]
name = "wai_prov"
path = "src/bin/wai_prov.rs"
required-features = ["provenance", "codecs"]
[[bin]]
name = "wai_bench"
path = "src/bin/wai_bench.rs"
required-features = ["codecs"]
[[bin]]
name = "wai_bench_diff"
path = "src/bin/wai_bench_diff.rs"
required-features = ["codecs"]
[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"]