open-standards/wai
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science 2928ebf0e3
All checks were successful
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 7m38s
standards workspaces build + test / aac-rs (pull_request) Successful in 3m1s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 1m45s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 1m43s
standards workspaces build + test / map-rs (pull_request) Successful in 1m3s
standards workspaces build + test / mesh-rs (pull_request) Successful in 1m0s
standards workspaces build + test / openpay (pull_request) Successful in 4m56s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 8m15s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 39s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 2m43s
wai-pack / wai-pack · linux-arm64 (pull_request) Successful in 2m26s
no-vanity-metrics / Scan committed Markdown for vanity metrics (pull_request) Successful in 4s
no-vanity-metrics / WAI public text names no comparison (pull_request) Successful in 4s
no-vanity-metrics / WAI public text names no company or product (pull_request) Successful in 3s
standards workspaces build + test / arl-rs (pull_request) Successful in 1m14s
standards workspaces build + test / eoc-rs (pull_request) Successful in 2m7s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m56s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 1m27s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 1m32s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m34s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 3m6s
standards workspaces build + test / sense-rs (pull_request) Successful in 1m23s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 5m31s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 11m44s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 23s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 26m28s
WAI conformance / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Successful in 11s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 41s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 1m16s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 2m55s
wai-pack / wai-pack · linux (pull_request) Successful in 1m49s
wai-pack / wai-pack · independent verifier (Python) (pull_request) Successful in 2m59s
wai-pack / wai-pack · the floor through a media prober (pull_request) Successful in 26s
wai-pack / wai-pack · dependency licences (pull_request) Successful in 2m3s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 4m36s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 2m47s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 5m9s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 10m42s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 28s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 3m4s
wai-pack / wai-pack · macos (pull_request) Successful in 2m11s
wai: a from-rest burst asserted a 2 ms race, and linux-arm64 called it
`a_from_rest_burst_counts_only_work_begun_inside_the_window` asserted, inside
the sampler callback, that at most one unit of work per worker had begun by the
instant the window opened:

    assert!(begun <= 3, "no more than one unit per worker can have begun");

Nothing in `burst_from_rest` entails that. Once the barrier releases, each
worker increments the counter and sleeps 2 ms; the caller then calls the
closure. For `begun` to exceed the worker count the caller need only be
descheduled for longer than that 2 ms at exactly this point. It is a race the
test does not control, not a property of the code under test.

A contended host duly called it: the assertion failed on the `linux-arm64`
runner — a colima VM on a box at load 173 — while every other platform passed.
I could not reproduce it here, including under 28 competing busy loops, so this
is reasoned from the code and the CI log rather than from a local repro, and
that is the honest basis for it. The argument does not need one: an assertion
nothing establishes can fail without a defect, and the failing run is evidence
that it does.

The quantity is now recorded rather than asserted — it printed 2 on the first
local run, already below the old bound, which is the variance the bound was
pretending to constrain.

Nothing is lost. What the test establishes about starting from rest is asserted
elsewhere and does not depend on the scheduling: the window opened `FromRest`,
every worker was in flight, and completions never exceed starts by more than the
worker count. That last one bounds a *difference* by the worker count instead of
asserting an instant arrived before a sleep finished, so it holds however the
host schedules — and it now says what it saw when it fails.

This is the fifth copy of this family in the repo. `eoc-meter`,
`jouleclaw-energy` (#166), `proof-cascade` and `sandbox-meter` (#181) each put a
floor on something the host's scheduler controls; this one puts a ceiling on how
much work fits in an interval it does not control. Same mistake, opposite
direction.

wai-rs lib: 187 passed, clippy clean on the touched file. Pre-existing and
untouched by any branch of mine — it surfaced on #183 only because a rebase
fires every path-filtered workflow (#191).

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-10-08 14:36:19 -04:00
..
audio-conformance wai: every corpus states the provenance of its content 2026-10-07 10:09:21 -04:00
avatar-conformance wai: every corpus states the provenance of its content 2026-10-07 10:09:21 -04:00
byte-exact-conformance wai: every corpus states the provenance of its content 2026-10-07 10:09:21 -04:00
cache-conformance wai: every corpus states the provenance of its content 2026-10-07 10:09:21 -04:00
claim-conformance wai: state the ranged-WAI2 classical length as a limitation of this revision 2026-10-08 05:23:56 -04:00
extensions wai: state the ranged-WAI2 classical length as a limitation of this revision 2026-10-08 05:23:56 -04:00
feed-conformance wai: every corpus states the provenance of its content 2026-10-07 10:09:21 -04:00
film-conformance wai: every corpus states the provenance of its content 2026-10-07 10:09:21 -04:00
glossary wai/glossary: the codec glossary declares its schema version 2026-10-01 08:38:22 -04:00
haptic-conformance wai: every corpus states the provenance of its content 2026-10-07 10:09:21 -04:00
http-conformance wai: HTTP reports a refinement by its refines.base alone; a conforming envelope's refinement tested 2026-10-08 03:11:46 -04:00
int-payload-conformance wai: every corpus states the provenance of its content 2026-10-07 10:09:21 -04:00
jwp-conformance Merge main (1cf132ec: audio provenance) into wai/strict-ed25519 2026-10-07 21:30:21 -04:00
neural-conformance wai: every corpus states the provenance of its content 2026-10-07 10:09:21 -04:00
oer-conformance wai/oer: differential fuzzing of the reference verifier against wai-rs 2026-09-29 01:27:31 -04:00
pack-conformance Merge main (1cf132ec: audio provenance) into wai/strict-ed25519 2026-10-07 21:30:21 -04:00
pin-conformance wai: an encrypted envelope's clear parts checked; a record or derivation is no component 2026-10-08 01:24:50 -04:00
quantum-conformance wai: every corpus states the provenance of its content 2026-10-07 10:09:21 -04:00
quantum-ops-conformance Leave wai-quantum on its own verifier; the rule goes back into wai-rs 2026-10-07 14:33:18 -04:00
registry Merge main (session claim merged as #173) into wai/w1-6-moq-layers 2026-10-06 13:52:09 -04:00
research wai: the int_codec vector's README, and the statements about what it was trained on 2026-10-07 10:09:20 -04:00
score-conformance wai: every corpus states the provenance of its content 2026-10-07 10:09:21 -04:00
signer-conformance Merge main (#186 merged as ae9a1ca6: strict Ed25519) into wai/w5-4-measure-web 2026-10-08 02:00:51 -04:00
staged-conformance wai: the HTTP plan follows SPEC §7.1's offer rule 2026-10-08 01:38:05 -04:00
staged-measure-conformance wai: the recorder derives the classical length; a malformed sha256 refused behind encryption 2026-10-08 03:02:27 -04:00
telemetry-conformance wai: every corpus states the provenance of its content 2026-10-07 10:09:21 -04:00
tools wai: a check that no committed audio vector is a coding of a recording 2026-10-07 09:16:05 -04:00
vocab wai: the refinement-only role, base admission as one table, and refines 2026-10-02 00:02:12 -04:00
volumetric-conformance wai: every corpus states the provenance of its content 2026-10-07 10:09:21 -04:00
wai-pack Merge pull request 'wai-quantum 0.3.38: neural quantum states held in their symmetry sector' (#180) from wai-quantum-nqs-symmetry into main 2026-10-08 10:24:10 -04:00
wai-quantum Leave wai-quantum on its own verifier; the rule goes back into wai-rs 2026-10-07 14:33:18 -04:00
wai-quantum-serve Leave wai-quantum on its own verifier; the rule goes back into wai-rs 2026-10-07 14:33:18 -04:00
wai-relay Leave wai-quantum on its own verifier; the rule goes back into wai-rs 2026-10-07 14:33:18 -04:00
wai-rs wai: a from-rest burst asserted a 2 ms race, and linux-arm64 called it 2026-10-08 14:36:19 -04:00
wai-spz-gen Leave wai-quantum on its own verifier; the rule goes back into wai-rs 2026-10-07 14:33:18 -04:00
wai-verify wai: Kani proofs of the staged arithmetic, predictors and indices 2026-10-04 14:51:53 -04:00
wai-web Merge pull request 'wai-quantum 0.3.38: neural quantum states held in their symmetry sector' (#180) from wai-quantum-nqs-symmetry into main 2026-10-08 10:24:10 -04:00
world-conformance wai: every corpus states the provenance of its content 2026-10-07 10:09:21 -04:00
.gitattributes wai-rs: int_payload — the WIV1, WIH1, WIA1 and WIS1 payloads, and decode_int 2026-10-01 12:20:06 -04:00
.gitignore wai: one registry table, candidate capabilities, public-text checks 2026-09-30 22:38:09 -04:00
CHANGELOG.md wai: state the ranged-WAI2 classical length as a limitation of this revision 2026-10-08 05:23:56 -04:00
CONTRIBUTING.md wai: every corpus states the provenance of its content 2026-10-07 10:09:21 -04:00
LICENSE Add WAI — Web AI Media Transport & Execution standard 2026-05-24 13:36:51 -04:00
README.md wai: SPEC §5 pins the integer codecs' payloads; extensions/integer-payloads.md 2026-10-01 13:12:44 -04:00
REGISTRY.md Merge main (session claim merged as #173) into wai/w1-6-moq-layers 2026-10-06 13:52:09 -04:00
SPEC.md Merge main (#186 merged as ae9a1ca6: strict Ed25519) into wai/w5-4-measure-web 2026-10-08 02:00:51 -04:00

WAI — Web AI Media Transport & Execution

A container + capability-dispatch standard for media. A standard codec (AVIF, JPEG XL, PNG, JPEG, Opus, FLAC, AV1, zstd, XZ and the others the registry names) is dispatched to the library a sink already has; WAI also defines its own capability classes — integer codecs, worlds, scores, films — each with a conformance criterion, and an envelope that lets the neural-shared-prior path coexist with the model-free floor.

Two paths open every conforming file:

  • Neural condition — the sink regenerates the media against a shared ambient prior (a model). The model is a requirement of existence, never shipped (an .mp3 doesn't ship its decoder either).
  • Zeroth condition — a menu of registered standard codecs, decoded with the libraries a device already ships.

The capability a file requires is named, not supplied.

Building

wai-rs builds the codec chain by default (the codecs feature), and those crates link system libraries rather than vendoring them — consistent with "WAI does not re-implement codecs". Without them the build stops in a codec crate's build script, not in WAI's own code:

# macOS
brew install jpeg-xl libavif opus dav1d xz

# Debian / Ubuntu
apt-get install libjxl-dev libavif-dev libopus-dev libdav1d-dev liblzma-dev

To build without the C codec chain — the envelope, manifest and world engine do not need it, which is also how the wasm32 target is built:

cargo check -p wai --no-default-features

What's here

Path Contents
SPEC.md WAI v1.0 spec — envelope, manifest, capability menu
wai-rs/ Rust reference implementation (lib + cdylib + staticlib + C FFI)
REGISTRY.md, registry/capabilities.json The registry: every registered string with its kind, status, classes and edition, generated from the reference implementation (wai registry export), with its JSON Schema and the policy for registering a string
vocab/ RDF vocabulary: v2 generated from the registry, v1 frozen
extensions/ Sub-specifications (confidentiality, receipts, worlds, film, quantum operations, …)
research/ Research notes and dated records: graded, not normative
glossary/ Reference catalog of media codecs surveyed for capability registration. codecs.json is the dataset, linked to the registry; SCHEMA.md defines the shape and contribution rules. Rendered at wai.transaction.science/glossary.
CONTRIBUTING.md How to change the specification, register a capability and add tests CI runs

Quickstart

cd wai-rs
cargo test --no-default-features --lib --test carriage   # registry, envelope, every capability round-trips
cargo run --no-default-features --bin wai -- capabilities  # the registry, one row per capability
cargo build --release --lib    # with the codecs feature: libwai.dylib/.so/.dll + libwai.a

On macOS, libflac lives under the Homebrew "flac" formula prefix that Cargo doesn't probe automatically. The committed .cargo/config.toml adds the path; if you build outside the repo set RUSTFLAGS="-L /opt/homebrew/opt/flac/lib".

SDK consumption

wai-rs exposes a stable C ABI in src/ffi.rs — the cdylib drops in as libwai.dylib/.so/.dll. Bindings for any language (Python ctypes, Node N-API, Swift, JNI, Go cgo, etc.) call into:

  • wai_image_{png,jpeg,avif,jxl}_{encode,decode}
  • wai_audio_{opus,flac}_{encode,decode}
  • wai_text_{zstd,xz}_{encode,decode}
  • wai_envelope_{pack,unpack} — wrap/unwrap the WAI container
  • wai_buffer_free, wai_last_error — memory + error handling

Registered capabilities (the zeroth menu)

Capability Codec Lossless? Mandatory?
wai.image.png PNG yes mandatory floor
wai.image.jxl JPEG-XL both recommended
wai.image.avif AVIF (AV1-based) lossy recommended
wai.image.jpeg JPEG lossy recommended (legacy compat)
wai.audio.flac FLAC yes mandatory floor
wai.audio.opus Opus lossy recommended
wai.video.av1 AV1 lossy recommended
wai.video.av1.lossless AV1 (quantizer=0) YUV-lossless recommended
wai.text.zstd zstd yes mandatory floor
wai.text.xz XZ/LZMA2 yes recommended

Neural capabilities (wai.neural.*) are OPTIONAL and sink-advertised. Most run float inference, so their decode is exact only on the build that produced it. A distinguished subset is integer-exact by construction — an all-i64 decode with no float and no ONNX — so the reconstructed artifact is byte-identical on every machine and its hash is portable. Conformance is a hash: a deployer can require intent=replicate to dispatch only to these.

Capability Integer-exact decode of Conformance
wai.neural.int_hyper image — integer hyperprior σ source + integer entropy + integer synthesis byte-exact (hash-portable)
wai.neural.int_mlicpp image — MLIC++ entropy topology (channel slices × checkerboard passes, an entropy network re-run before each pass) on integer networks byte-exact (hash-portable)
wai.neural.int_synth image — integer synthesis only byte-exact (hash-portable)
wai.video.int_hyper video — int_hyper I-frame + integer half-pel motion-compensated P-frames byte-exact (hash-portable)
wai.audio.int_codec audio — learned 1-D transform, integer synthesis → int16 PCM byte-exact (hash-portable)
wai.splat.int_codec 3D — learned Gaussian-splat-attribute transform, integer synthesis byte-exact (hash-portable)

Their payloads are binary formats SPEC §5 pins — WIV1 for the integer video codecs, WIH1, WIA1 and WIS1 (extensions/integer-payloads.md). The JSON the encode and export tools write is converted to them, never carried.

Interactive & temporal content (extensions)

Beyond the codec menu, WAI carries content that consumes input or moves over time — reconstructed from instructions at the sink, over one wai.det.fixed64 fixed-point floor, each with its own deterministic *-equivalence conformance criterion:

Capability What it carries Conformance
wai.world.{scene,replay,live} interactive worlds (signed op log) replay-equivalence
wai.world.model action-conditioned world model (signed action ops → next frame, integer transition + synthesis) replay-equivalence
wai.mesh.glb / wai.splat.spz 3D mesh / Gaussian-splat assets content-addressed
wai.audio.scene object-based spatial audio mixdown-equivalence
wai.audio.score music as note events (synthesized at the sink) mixdown-equivalence
wai.haptic.signal keyframed touch envelopes sample-equivalence
wai.feed.state scoreboards / telemetry / market feeds replay-equivalence
wai.avatar.pose digital humans (skeletal pose stream) pose-equivalence
wai.splat.4d volumetric / 4D temporal Gaussian splats frame-state-equivalence
wai.film.linear animation / CGI film (sealed world + camera track) film-equivalence
wai.film.reel a film with cuts (one world, a sequence of shots) reel-equivalence

And the verify half — a signed, energy-accounted lineage for opaque captured content WAI does not reconstruct (wai.asset.provenance). See SPEC.md §5 and extensions/ for each.

Quantum — deterministic, native and in cloud WASM

WAI carries a full quantum stack in pure Rust: circuit simulation and the whole operational layer around it, every stage byte-exact and sealable into a signed, energy-accounted receipt. No QPU and no cloud service. Because it is pure Rust with no host bindings, one source builds for native and wasm32-wasip2 and produces byte-identical results — the same circuit reconstructs to the same statevector hash on a laptop or at the edge.

Only wai.quantum.circuit is a registered payload capability, and wai.quantum.calibration and wai.quantum.job are registered records; the other names below are module labels (REGISTRY.md lists the receipt labels no revision registers).

Module What it does Conformance
wai.quantum.circuit byte-exact statevector simulation (dyadic Clifford+T+P(k)) statevector-equivalence
wai.quantum.toolchain four backends (statevector / stabilizer / tensor-network MPS / sparse-Pauli), algorithm library, OpenQASM 3.0 in-and-out, QIR export + ingest, Bloch + entanglement analysis statevector-equivalence
wai.quantum.compile Clifford routing + stabilizer-tableau equivalence proof signed equivalence certificate
wai.quantum.cal.* calibration, filter-function robust control, DD noise spectroscopy reproducible + receipt
wai.quantum.cal.noise_learn Cycle Benchmarking / CER sparse Pauli–Lindblad learning signed noise model
wai.quantum.mitigate ZNE + readout M3 + classical shadows byte-exact post-processing
wai.quantum.decode CSS codes (rotated surface, toric, bivariate-bicycle) + union-find and Relay-BP decoders signed decode + joules
wai.quantum.rearrange neutral-atom register prep (Hungarian / LSAP) signed defect-free plan
wai.quantum.phasor interference substrate + energy-accounted phasor receipts reproducible f64
wai.quantum.kernel the quantum kernel deployed as phasor features reproducible f64
wai.quantum.qdata learning-from-quantum-data sample-complexity separation reproducible f64
wai.quantum.qbom Quantum Bill of Materials — stage receipts into one provenance manifest signed manifest

Quickstart

# native
cargo build --release --no-default-features \
  --features "quantum_toolchain,quantum_receipt" --bin wai-quantum

./target/release/wai-quantum list                  # algorithm catalog
./target/release/wai-quantum run ghz -n 5          # simulate + hash + outcomes
./target/release/wai-quantum run grover -n 4 -p 9  # amplitude amplification
./target/release/wai-quantum qasm bell             # emit OpenQASM 3.0
./target/release/wai-quantum qir  bell             # emit QIR (LLVM IR)
./target/release/wai-quantum qir  qft -n 4 | \\
  ./target/release/wai-quantum run --qir           # and read it back
./target/release/wai-quantum receipt ghz -n 3 | ./target/release/wai-quantum verify

Same source, at the edge

cargo build --release --target wasm32-wasip2 --no-default-features \
  --features "quantum_toolchain,quantum_receipt" --bin wai-quantum

wasmtime run target/wasm32-wasip2/release/wai-quantum.wasm run ghz -n 5

Both print the identical state-hash. A receipt sealed in cloud WASM verifies natively and vice-versa, and the receipt bytes themselves are identical — the signature travels because the computation is reproducible, not because the two runtimes agreed to trust each other.

As a serverless function

wai-quantum-serve/ exports the same stack as a WASI-HTTP component (wasi:http/proxy), so quantum computation runs as an ordinary HTTP handler on a component-model host:

cd wai-quantum-serve
cargo build --release --target wasm32-wasip2
wasmtime serve -S cli=y --addr 127.0.0.1:8231 \
  target/wasm32-wasip2/release/wai_quantum_serve.wasm
GET  /health                      GET  /algorithms
GET  /run?algo=ghz&n=5&top=8      POST /run       (body = OpenQASM 3.0)
GET  /qasm?algo=bell              GET  /receipt?algo=ghz&n=3[&shots=&seed=]
POST /verify                      (body = receipt JSON; 200 valid / 409 invalid / 400 unparseable)

The endpoint returns the same statevector_hash as the native CLI for the same circuit, and a receipt sealed by the HTTP handler verifies with the native wai-quantum verify — the JSON content is byte-identical (the CLI adds a trailing newline; nothing else differs). Both verify paths accept a receipt in either form: as sealed, or labelled with its figure's acquisition class, as wai_quantum_meter emits a measured figure (quantum_energy::MaybeLabelled, energy-measurement §2.8). Both restate the class, or say the figure has none.

That wasm32-wasip2 build needs -S cli=y, because Rust's std imports wasi:cli/environment at startup and the bare wasi:http/proxy world does not provide it. For a component that runs on any wasi:http host with no host flags at all, build the pure proxy-world artifact instead:

./build-proxy.sh
wasmtime serve --addr 127.0.0.1:8080 target/wai_quantum_serve.proxy.wasm

That path compiles a wasm32-wasip1 core module and adapts it with the Bytecode Alliance proxy adapter, leaving only imports the proxy world defines (wasi:http/types, wasi:io/*, wasi:cli/std{in,out,err}, wasi:random). The script fails the build if wasi:cli/environment ever reappears, and the served results are byte-identical either way.

Explore the whole stack in the browser (it is the same Rust, compiled to wasm): the toolchain IDE, the ML layer, and a working course.

License

Apache-2.0 — see LICENSE. Implementing a registered capability carries that capability's own licence class (royalty-free, patent-pool, proprietary or non-commercial), recorded in the registry. Companion implementations outside this tree keep their own licences.