open-standards/wai/wai-web/Cargo.toml
Transaction Science 4c1f640588 platform-decode: keep the query, move the order into browser-sink's routing, drop the budget
The review of #452 (M4–M9) found its platform-decode part at odds with
browser-sink on main. Reworked inside EN-C:

- Kept: the query read from the payload (AV1-ISOBMFF codec string from the
  sequence header, Annex E.3 from an HEVC SPS) with queries.json; the rule that
  powerEfficient and prefer-hardware are hints, never energy and never evidence
  of hardware.
- Reworked: the answers enter browser-sink §3's report, one shape
  (report_answer): supported from isConfigSupported() alone, smooth and
  power_efficient from decodingInfo() only once WebCodecs said supported, so a
  Media Capabilities supported:false overrides nothing (http-delivery §12.2).
  The extension defines no order and no second meaning of advertising: the order
  is SPEC §4's energy order inside browser-sink §4.7, where an answer counts only
  for an object routed ua (AV1's user-agent tier is none; a decode-equivalence
  need with no probe run routes elsewhere).
- Dropped: rank/order/select, advertise_for_envelope (a second advertising
  definition that could make a decodable WAI1 inert), the EnergyBudget and its
  ceiling, and order.json. A learned entry's measurement is browser-sink §6's
  energy entry.
- wai-web: the platform bundle binds platformQuery, platformAnswer and
  platformChoose (browser-sink §4.7) on the browser_sink feature; the demo builds
  every query from a payload (the hand-written 1920x1080 query is gone), asks
  Media Capabilities after WebCodecs, and marks its one figure synthetic. The
  wording calls the HEVC source the platform's encoder configured with
  prefer-hardware. wai-web-wasm.yml builds the bundle.
- int_kernels_vectors: the two new corpora's sidecar exclusions (review M1).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit ce38948dad)
2026-10-26 08:31:14 -04:00

63 lines
3.6 KiB
TOML

[package]
name = "wai-web"
version = "0.3.0"
edition = "2021"
license = "Apache-2.0"
description = "WAI envelope parser + capability dispatch for the browser. Wasm-bindgen surface over the standard's container format. NOT a codec backend — backends are pluggable, the deployer chooses (WASM / WebGPU / WebNN / native ONNX / transformers.js / etc.)."
[lib]
crate-type = ["cdylib"]
[dependencies]
wasm-bindgen = { version = "0.2", features = ["serde-serialize"] }
serde-wasm-bindgen = "0.6"
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["preserve_order"] }
js-sys = "0.3"
# THE world engine — the same crate native sinks run, compiled to wasm32
# with the codec chain off. No second implementation: replay-equivalence
# in the browser is the identical Rust that generated the conformance
# corpus hashes.
wai = { path = "../wai-rs", default-features = false, features = ["world", "audio_scene", "haptic", "splat4d", "provenance", "score", "film", "neural_int", "generate", "video_int", "audio_int", "world_model", "world_int", "splat_int", "quantum", "quantum_ops", "quantum_cal", "quantum_mitigate", "quantum_qec", "quantum_control", "quantum_noise", "quantum_compile", "quantum_atom", "quantum_qbom", "quantum_receipt", "quantum_toolchain", "quantum_qasm", "quantum_mps", "quantum_stabilizer", "quantum_pauli", "quantum_vml", "quantum_phasor", "quantum_qfhrr", "quantum_kernel", "quantum_phasor_meter", "quantum_qdata", "video_workflow", "staged", "stage_measure", "receipt_claims"] }
ed25519-dalek = "2" # actor keys for browser-side op authoring (same version as wai-rs)
blake3 = "1" # in-page receipt check: hash a decoded image against a pinned digest
# Awaits the WebGPU member's futures behind the promises of src/quantum_webgpu.rs;
# only the `quantum_webgpu` feature compiles it.
wasm-bindgen-futures = { version = "0.4.77", optional = true }
[features]
# The fabric's WebGPU member in a page (src/quantum_webgpu.rs): the gate kernel's
# WGSL compiled by the browser's own WebGPU, certified in the page against the CPU
# reference's pinned corpus digests. Built as its own bundle with its own
# --out-name (demo/quantum_webgpu.html); off by default, so the main bundle is
# unchanged.
quantum_webgpu = ["wai/quantum_fabric", "wai/quantum_fabric_webgpu", "dep:wasm-bindgen-futures"]
# The job service's engine in a page (src/quantum_engine.rs): a job planned, run
# and signed in the tab as the service runs it, its receipt checked there. Built
# into the IDE's bundle (scripts/wasm-pkgs.tsv on the site), which the console
# also loads; off by default, so the main bundle is unchanged.
quantum_engine = ["wai/quantum_engine"]
# Platform decode capabilities (src/platform_decode.rs, extensions/platform-decode.md): the
# query a page makes of Media Capabilities and WebCodecs for an entry, the answer in
# browser-sink's report, and browser-sink §4.7's choice among alternatives. Built as its own
# bundle with its own --out-name (demo/platform_decode.html); off by default, so the main
# bundle is unchanged.
platform_decode = ["wai/browser_sink"]
[dev-dependencies]
# Pinned to the wasm-bindgen release Cargo.lock holds, so the test runner and the
# bindings agree.
wasm-bindgen-test = "=0.3.77"
[profile.release]
opt-level = "s" # size, not speed — runtime is parse-only
lto = true
codegen-units = 1
strip = "symbols"
[package.metadata.wasm-pack.profile.release]
# The host's wasm-opt (binaryen) is behind the Rust toolchain's emitted
# wasm features; rustc already runs LTO + size opts so skipping wasm-opt
# costs little. Re-enable when binaryen catches up.
wasm-opt = false