open-standards/wai/wai-web/demo
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science 4e7155b955
Some checks failed
energy meters on real hardware / RAPL and NVML on jetson-hub (pull_request) Successful in 32s
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 4m8s
standards workspaces build + test / aac-rs (pull_request) Successful in 3m7s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 1m4s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 52s
standards workspaces build + test / map-rs (pull_request) Successful in 1m10s
standards workspaces build + test / mesh-rs (pull_request) Successful in 57s
standards workspaces build + test / openpay (pull_request) Successful in 4m31s
wai cross-architecture byte-equality / linux-aarch64 (pull_request) Successful in 59s
joule-code conformance gate / Build + round-trip C1-C4 vectors (pull_request) Successful in 1m59s
jouleclaw public surface must stay documented / Public-surface audit (jouleclaw-rs) (pull_request) Successful in 59s
no-vanity-metrics / Scan committed Markdown for vanity metrics (pull_request) Successful in 3s
no-vanity-metrics / WAI public text names no comparison (pull_request) Successful in 3s
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 1m11s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 16m32s
standards workspaces build + test / eoc-rs (pull_request) Successful in 2m50s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m55s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 1m34s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 1m12s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 1m13s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m20s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m22s
standards workspaces build + test / sense-rs (pull_request) Successful in 1m22s
wai cross-architecture byte-equality / linux-x86_64 (pull_request) Successful in 28s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 6m51s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 4m15s
wai-ops integer operators / linux-aarch64 (pull_request) Successful in 1m3s
WAI conformance / quantum core and corpus under wasm32-wasip2 (wasmtime) (pull_request) Failing after 1m29s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 16s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 8m40s
WAI conformance / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Successful in 12s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 48m7s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 25s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 51s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 1m57s
WAI HTTP delivery / WAI HTTP · does this change touch it (pull_request) Successful in 7s
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Successful in 1m16s
WAI neural decoders end-to-end / synthetic fixtures → Rust decode → reference (±4) (pull_request) Successful in 1m13s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 1m15s
wai-ops integer operators / linux-x86_64 (pull_request) Successful in 25s
wai-ops integer operators / wasm32-wasip2 (wasmtime) (pull_request) Successful in 24s
wai-ops integer operators / wasm32 under Node (pull_request) Successful in 20s
wai-ops integer operators / independent checker (Python) (pull_request) Successful in 11s
wai-pack / wai-pack · does this change touch it (pull_request) Successful in 4s
WAI section references / cited sections exist (pull_request) Successful in 10s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 16m41s
wai-web reach builds / wai-web reach · does this change touch it (pull_request) Successful in 4s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 4m35s
workflow hygiene / every workflow supersedes its own queue (pull_request) Successful in 5s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 3m3s
standards workspaces build + test / macOS energy backends (pull_request) Failing after 31m19s
wai cross-architecture byte-equality / macos-arm64 (reference) (pull_request) Successful in 1m1s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 23m0s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 33s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 3m37s
wai-ops integer operators / macos-arm64 (pull_request) Successful in 27s
wai-pack / wai-pack · linux-arm64 (pull_request) Successful in 1m3s
WAI HTTP delivery / HTTP corpus · falsify mutations 0/3 (pull_request) Successful in 38m28s
WAI HTTP delivery / HTTP corpus · falsify mutations 1/3 (pull_request) Successful in 38m16s
WAI HTTP delivery / HTTP corpus · falsify patches 0/3 (pull_request) Successful in 4m35s
WAI HTTP delivery / HTTP corpus · falsify patches 1/3 (pull_request) Successful in 5m21s
WAI HTTP delivery / HTTP corpus · falsify patches 2/3 (pull_request) Successful in 4m30s
WAI HTTP delivery / HTTP corpus · every patch and mutation in exactly one shard (pull_request) Successful in 4s
wai-pack / wai-pack · macos (pull_request) Successful in 2m11s
WAI HTTP delivery / HTTP corpus · verified both ways, and the differential (pull_request) Successful in 2m21s
WAI HTTP delivery / cache rules · controls and labelled caches (pull_request) Successful in 1m11s
wai-pack / wai-pack · linux (pull_request) Successful in 1m13s
WAI HTTP delivery / HTTP corpus · falsify mutations 2/3 (pull_request) Successful in 37m30s
wai-pack / wai-pack · the floor through a media prober (pull_request) Successful in 22s
wai-pack / wai-pack · independent verifier (Python) (pull_request) Successful in 1m57s
wai-pack / wai-pack · dependency licences (pull_request) Successful in 1m23s
wai-web reach builds / wai-web reach builds · the package of record, every output as recorded (pull_request) Failing after 2m9s
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Successful in 4m14s
Merge wai/reach-builds (with #197 and main) into wai/d1-record-true
Brings in #205 and #197 and, through them, main as of #200 and #206.

- wai/extensions/quantum-sim.md: both sides rewrote the status line's
  reference implementation. Kept main's two capabilities (circuit2 WQC2,
  circuit WQC1 frozen) and this branch's wording of where the reference
  lives (the `quantum` feature of wai-quantum, forwarded by wai-rs).
- wai/http-conformance/falsify/run.sh: #200 rewrote the single-run script
  into shards; took the sharded runner unchanged and ported this branch's
  additions into it: manifest-limit-dropped.patch sits with the other
  patches with its must-fail cases on its first line (it applies to the
  merged head.rs unchanged), and the Python mutation manifest-limit-dropped
  is declared in falsify/mutations.txt, after reload-walked where the old
  list had it, with the cases it must fail:
  head_malformed_manifest_too_large_O5 and _OD. The 3/3 shards cover
  134 patches and 78 mutations, each once.
- wai/http-conformance/cases.json: regenerated with wai_http_vectors gen;
  the generator's output equals the merged text (1049 cases), and both
  wai_http_vectors verify and http_verify.py give every outcome.
- wai/CHANGELOG.md: no textual conflict, but git left this branch's entry
  below "Staged measurement"; moved "The record made true" to the top of
  v0.4.0, newest first, above #205's and #197's entries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-10 17:35:03 -04:00
..
audio wai: interactive + temporal cargo classes, provenance, telepresence 2026-06-13 23:16:42 -04:00
int_synth wai-web: integer-exact neural decode in the browser, no ML runtime 2026-06-21 05:53:41 -04:00
vectors wai: interactive + temporal cargo classes, provenance, telepresence 2026-06-13 23:16:42 -04:00
audio.html wai: interactive + temporal cargo classes, provenance, telepresence 2026-06-13 23:16:42 -04:00
audio.js wai: interactive + temporal cargo classes, provenance, telepresence 2026-06-13 23:16:42 -04:00
int_hyper.html wai: the integer-payload pin, as SPEC §8 now permits it, and what is final 2026-10-01 19:47:27 -04:00
int_hyper.js wai: the headline decode tests fail on a missing input, and CI supplies their inputs 2026-09-28 18:40:59 -04:00
int_synth.html wai: one registry table, candidate capabilities, public-text checks 2026-09-30 22:38:09 -04:00
int_synth.js wai-web: integer-exact neural decode in the browser, no ML runtime 2026-06-21 05:53:41 -04:00
README.md wai-web: staged measurement and the session claim in the browser (W5-4) 2026-10-06 16:59:27 -04:00
verify_generate_wasm.mjs wai-web wasm32 CI: the browser generator and score synth make every native pin 2026-10-09 17:17:06 -04:00
verify_int_hyper.sh wai: one registry table, candidate capabilities, public-text checks 2026-09-30 22:38:09 -04:00
verify_int_hyper_wasm.mjs wai: one registry table, candidate capabilities, public-text checks 2026-09-30 22:38:09 -04:00
verify_int_payload_wasm.mjs wai: integer decodes do only the work their streams back 2026-10-01 19:08:03 -04:00
verify_int_synth.sh wai: one registry table, candidate capabilities, public-text checks 2026-09-30 22:38:09 -04:00
verify_int_synth_wasm.mjs wai: one registry table, candidate capabilities, public-text checks 2026-09-30 22:38:09 -04:00
verify_measure.sh wai-web: staged measurement and the session claim in the browser (W5-4) 2026-10-06 16:59:27 -04:00
verify_measure_wasm.mjs wai: the recorder derives the classical length; a malformed sha256 refused behind encryption 2026-10-08 03:02:27 -04:00
verify_menu.mjs wai: one registry table, candidate capabilities, public-text checks 2026-09-30 22:38:09 -04:00
verify_pack.mjs wai-web: pack and packMulti refuse a payload past its u32 field 2026-10-09 17:14:52 -04:00
verify_staged_wasm.mjs wai: round 3 of the link-18 review — claimed stage0 in the CLI, inert claims, order and limits 2026-10-05 07:23:23 -04:00
world.html wai: interactive + temporal cargo classes, provenance, telepresence 2026-06-13 23:16:42 -04:00
world.js wai: key discovery, signing authority and module revocation 2026-10-01 07:12:20 -04:00

wai-web demo — interactive-worlds browser sink

world.html is a conformant wai.world.replay sink running in a tab: the WWLD payload (a tick-0 world + signed op log, ~1.3 KB for the truss vector) is re-derived frame by frame in WebGPU by the same wai crate native sinks run, compiled to wasm32 with the codec chain off (--no-default-features --features world). At the sealed final tick the sink recomputes the BLAKE3 state hash and compares it to the publisher's Ed25519-signed seal — replay-equivalence, demonstrated: the hash the browser computes is byte-identical to world-conformance/expected_hashes.json.

Run

# from wai-web/: rebuild the wasm pkg after engine changes
wasm-pack build --target web --out-dir demo/pkg

# vectors come from the conformance corpus
cp ../world-conformance/vectors/{truss_fracture,ballistic_bounce,basic_kinematics}.wwld demo/vectors/

# serve (any static server; WASM needs http, not file://)
python3 -m http.server 8741
# → http://localhost:8741/demo/world.html

Needs a browser with WebGPU enabled. No build steps beyond wasm-pack; no JS dependencies.

int_synth.html — integer-exact neural image sink (no ML runtime)

int_synth.html decodes a wai.neural.int_synth payload to RGB with the same pure-i64 Rust that decodes natively, compiled to wasm32 — no onnxruntime-web, no WebGPU, no float. Because the decode is integer all the way down (the integer-entropy contract, SPEC §6), the reconstruction is byte-identical on every machine, so the page re-checks its BLAKE3 against the hash the native reference froze into neural-conformance/expected_hashes.json. The four staged vectors (demo/int_synth/, copied from the corpus) include the real trained photo model (128×128, 21.6 dB PSNR).

# from wai-web/: build the web pkg, then serve
wasm-pack build --release --target web --out-dir demo/pkg --out-name wai_web
python3 -m http.server 8741   # → http://localhost:8741/demo/int_synth.html

Reproducible CLI proof that the wasm decode equals the native corpus (builds the nodejs-target pkg and checks all four vectors' hashes):

./demo/verify_int_synth.sh

Staged delivery — StageSink in the browser

src/stage.rs binds wai::staged::StageSink, the staged-delivery sink a native player runs (extensions/staged-delivery.md), for JS: StageBase.decode decodes a base envelope by SPEC §4 through the integer path, with its pin and under the page's cost limit; StageBase.fromStage0 takes a base the page decoded elsewhere, which is claimed (its chain's reports, units and stage hashes say so). StageSink adds bases (taking them), offers refinement layers, expires holds and removes bases in any order, and every unit's stage, producer, tier, output and stage hash reads back. stageLayerInfo reads a layer's refines, WIR1 header and declared cost, and a base's declared decode cost, before either is offered. Reports and units come back in the corpus's own form (staged-conformance/README.md).

verify_staged_wasm.mjs replays every case of staged-conformance/ through the wasm32 build and requires every report, final unit, stage hash and clip hash the native sink wrote; each integer base is decoded in wasm32 and must give its stage0.bin. It then checks the binding's guards: bases that declare huge clips (wai-rs/tests/vectors/staged_bounds/) refused under a cost limit with linear memory watched, a base past the chain budget, base facts a page cannot raise, and a seeded fuzz that must not trap:

# from wai-web/
cargo build --release --target wasm32-unknown-unknown
wasm-bindgen --target nodejs --out-dir demo/pkg-node --out-name wai_web \
  target/wasm32-unknown-unknown/release/wai_web.wasm
node demo/verify_staged_wasm.mjs ./pkg-node/wai_web.js ../staged-conformance

Staged measurement — the native figures in the browser

src/measure.rs binds wai::stage_measure, the code the native measurement tool wai_stage_measure runs (extensions/staged-measurement.md), for JS. A title is read from a Map of files by their path below wai/: titleMissing(dir, files) names the next file it needs, so a page fetches files one at a time until it holds them all. evaluateTitle (or new MeasureTitle(dir, files).json()) gives the text wai_stage_measure eval --json prints: counted bytes per object, stage and prefix, quality integers per presentation and per prefix, first presentable bytes, the layering overhead's points, deduplication and the output tree. simulate and simulateModel give the text wai_stage_measure sim prints. countObject counts one envelope (or names the code it is not countable with), qualityRgb8 gives one picture pair's integers (sums of squares as decimal strings), and outputRoot the output tree's root over presentations.

sessionBegin(entry, host, nonce) is wai::session_recorder::SessionRecorder over the session's entry object: decoderFor names the decoder that decoded an envelope, presented and received record what the page did, and finish(seed, signer_id, issued_at) seals the reconstruct-session claim (extensions/jwp-receipts.md §2.4.12), checked against the record first; a browser session states no energy figure. verifyClaim(claim, outputs, objects) checks a claim against the presentations and the objects received, and gives "" or the reason.

verify_measure.sh builds the nodejs package (or takes one already built), runs verify_measure_wasm.mjs over staged-measure-conformance/ — every golden, refusal title, counted object, quality pair and simulator case, byte for byte, and a session per fixture recorded the way a page records one, which must be the native tool's claim byte for byte — then requires the native wai_stage_measure eval --json to equal the wasm32 evaluation of every fixture, and the native and independent Python claim verifiers to give the wasm32 build's verdicts on every session it sealed:

# from wai-web/ (claim_verify.py needs the `cryptography` package)
bash demo/verify_measure.sh