open-standards/wai/extensions/reconstruction-binding.md
Transaction Science 48426dd890
Some checks failed
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 2m18s
standards workspaces build + test / aac-rs (pull_request) Successful in 47s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 47s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 29s
standards workspaces build + test / map-rs (pull_request) Successful in 28s
standards workspaces build + test / mesh-rs (pull_request) Successful in 26s
no-vanity-metrics / Scan committed Markdown for vanity metrics (pull_request) Successful in 3s
standards workspaces build + test / openpay (pull_request) Successful in 1m18s
wai cross-architecture byte-equality / linux-aarch64 (pull_request) Successful in 16s
standards workspaces build + test / eoc-rs (pull_request) Successful in 1m48s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 49s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 15s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m17s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m10s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m6s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 2m28s
wai cross-architecture byte-equality / linux-x86_64 (pull_request) Successful in 15s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 1m9s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 14s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 40s
wai formal verification (integer core) / kani (pull_request) Successful in 3m51s
WAI neural decoders end-to-end / synthetic fixtures → Rust decode → reference (±4) (pull_request) Failing after 1m11s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 26s
standards workspaces build + test / arl-rs (pull_request) Successful in 3m55s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 2m26s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 2m43s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 2m46s
standards workspaces build + test / sense-rs (pull_request) Successful in 2m36s
standards workspaces build + test / macOS energy backend (jcp-energy) (pull_request) Failing after 2m29s
wai cross-architecture byte-equality / macos-arm64 (reference) (pull_request) Successful in 13s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 56s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 13s
wai cross-architecture byte-equality / windows-x86_64 (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · windows (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · windows (pull_request) Has been cancelled
wai: state what each determinism tier guarantees, and make replicate mean it
SPEC §7 required an integer decode for `intent = replicate` in one paragraph
and accepted entropy-consistency in another. Resolved in one direction:

- Over a neural capability, `replicate` promises `decode-equivalence` — the
  whole decode to the final medium reproduces on every conforming sink.
  `entropy-consistency` (the decoded symbols reproduce; later stages may not)
  no longer backs it. The tier is a property of the capability as registered,
  not of one implementation.
- Over a standard codec, `replicate` promises that standard's decoder
  conformance, stated per registry class. `StandardTolerance` covers codecs
  whose standard holds decoders to a criterion around a reference;
  `StandardUnclassified` covers codecs not yet classified.
- `wai.image.jpegai` moves to the new `NeuralEntropyExact` class: its
  entropy decode is integer and exact, its later stages are float. It no longer
  backs `replicate`. This is recorded as a conservative choice pending a
  reading of ISO/IEC 6048-4, not as a finding about that standard.
- The JPEG AI decoders now refuse codestreams outside the configuration they
  implement (other β, model_id, colour transform or LSBS settings) instead of
  decoding them incorrectly, and detect flush-to-zero and round-toward-zero
  float environments.
- `wai wrap` writes `replicate` only over capabilities, and fallbacks, whose
  class a sink accepts unpinned.
- extensions/determinism-tiers.md gains an evidence table stating which
  platforms and CI jobs have exercised each guarantee, including what has not
  run.
- CI: a neural-gates workflow runs the model-free gates, including
  decode_envelope_strict, in an Ubuntu 24.04 image where the `neural` build
  links.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 18:25:52 -04:00

170 lines
9.5 KiB
Markdown
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.

# WAI Extension: Reproducible-Reconstruction Binding
> Status: Draft. A cryptographic **hard binding over the deterministically
> decoded pixels** of a neural-coded asset — the reconstruct-side analogue of
> the [Asset Provenance](provenance.md) extension, and a bridge from WAI's
> byte-exact decode into C2PA / JPEG Trust provenance. Reference impl: the
> `reconstruction_binding` module of `wai-rs` (feature `provenance`).
> Keywords **MUST**, **MUST NOT**, **SHOULD**, **MAY** are RFC 2119/8174.
## 1. Scope and model
A provenance manifest binds itself to an asset with a **hard binding**: a
cryptographic hash over the asset's bytes. For neural-coded media that hash
covers the *compressed* codestream. A hard binding over the *decoded image* is
possible only when the decode is reproducible: where two conformant decoders may
produce different pixels, a hash of the decoded image is not portable across
implementations, and provenance over the rendered result falls back to fuzzy
**soft** bindings (perceptual hashes, watermarks), which are approximate and
spoofable.
This is not incidental to the codec. The JPEG AI standard (ISO/IEC 6048 /
ITU-T T.840) defines its normative bit-exact conformance point at the **output
of the entropy decoder**, not at reconstruction to pixels; and its multi-branch
design specifies **up to three synthesis transforms** (`decoderID` 0/1/2), any of
which produces a conformant reconstruction of the same codestream. Reconstruction
to pixels is therefore, by design, **not** required to be bit-exact, and one
codestream may legally decode to different images. A hash of the decoded pixels is
not portable under the base standard.
Over a capability registered at `decode-equivalence` — WAI's integer-exact
decoders, `wai.neural.int_hyper` and the other `NeuralIntegerExact` capabilities
([determinism-tiers](determinism-tiers.md) §5) — every conforming sink
reconstructs the same pixels, so the decoded-pixel hash is portable by
construction.
`wai.image.jpegai` is registered at `entropy-consistency`, the tier of the base
standard's conformance point. WAI's exact JPEG AI decoder nevertheless reconstructs
to RGB **deterministically** — one pinned reconstruction, reproducible across
machines under stated conditions. Its entropy decode and its hyper-decoder,
context-model and synthesis networks are integer; dequantisation, latent
refinement, the post-filter chain (including the eICCI post-filter, a float CNN)
and colour conversion run in IEEE-754 float with a fixed evaluation order, in the
default floating-point environment, which the decoder checks before decoding. It
implements one configuration: 256×256 4:4:4, `model_id` 0 (tools_0),
`beta_displacement_log` 0, the high-operation-point synthesis (so a binding over its
output carries `decoderId` 2), and the other header conditions in
[determinism-tiers](determinism-tiers.md) §5. The reference sink refuses codestreams
outside that configuration. Within it, a sink without the integer weight bundle, or
in a non-default floating-point environment, falls back to a float decode whose
pixels are not pinned, and no binding applies to its output. The pinned
reconstruction is a property of the exact decoder, not of the capability: its
reproducibility rests on that decoder's build and on the process's floating-point
environment ([determinism-tiers](determinism-tiers.md) §5–§6). Within those
conditions it restores the precondition a hard binding needs — a stable hash of the
decoded pixels — for a verifier that runs the same decoder (§2). This extension
expresses that hash as a provenance assertion.
A `reconstruction-binding` is **not a content capability**. The asset declares an
ordinary capability (`wai.image.jpegai`, `wai.neural.int_hyper`, …) and is carried
and decoded normally; the binding is metadata *about* the decoded result, the way
[`provenance`](provenance.md) is metadata about the carried bytes.
## 2. The binding
A binding is a hash plus the descriptor that makes the decode reproducible:
```json
{
"alg": "sha256",
"hash": "<lowercase hex SHA-256 over the canonical decoded pixels>",
"reconstruction": {
"decoderId": 2, // the pinned synthesis branch (multi-branch codecs;
// 2 for wai.image.jpegai's exact decoder)
"profile": "<id>", // codec profile
"level": "<id>", // codec level
"width": 256,
"height": 256,
"format": "RGB8", // canonical: row-major, 3 bytes/pixel, no padding, no alpha
"colorSpace": "bt709"
}
}
```
- **Hash algorithm** — `sha256` (the C2PA default; every C2PA validator supports
it). MUST be an algorithm in the C2PA hash-algorithm registry.
- **Canonical buffer** — the hash is computed over the decoded image as a `RGB8`
buffer: row-major, three bytes per pixel, no row padding, no alpha, exactly
`width * height * 3` bytes. No other pre-processing.
- **The descriptor is part of the binding.** A multi-branch codec decodes one
codestream several ways; a verifier MUST decode under exactly the descriptor's
`decoderId`, `profile`, and `level` before hashing, or the comparison is
meaningless. The descriptor pins the one reconstruction the hash is over.
Conformance criterion:
- Over a capability registered at **decode-equivalence** (see
[determinism-tiers](determinism-tiers.md)), a verifier that decodes the
codestream with any conforming decoder under the binding's descriptor, hashes the
canonical `RGB8` buffer, and compares MUST obtain the recorded `hash`.
- Over `wai.image.jpegai` (registered at `entropy-consistency`), the hash is over
the reconstruction of WAI's exact decoder (§1). A verifier MUST decode with that
decoder — not the float fallback — in the default floating-point environment,
and then MUST obtain the recorded `hash`. A verifier that decodes any other way
has not checked the binding: a mismatch it finds is not evidence that the asset
changed, and it MUST NOT report the binding as failed on that basis. The
reference dispatch (`decode_envelope`) does not report which path ran, so a
verifier calls the exact decoder directly (`jpegai_decode::decode`), which
refuses rather than falls back.
## 3. C2PA / JPEG Trust carriage
C2PA (and JPEG Trust, ISO/IEC 21617-1, which is built on the C2PA architecture)
has **no standard assertion that hashes decoded/rendered pixels** — every standard
hard binding (`c2pa.hash.data`, `c2pa.hash.boxes`, `c2pa.hash.bmff`) hashes the
compressed bytes. A reproducible-reconstruction binding is therefore expressed as a
**custom assertion**, using C2PA's reverse-domain labelling for third-party
assertions:
- **Assertion label:** `science.transaction.wai.hash.reconstruction`
- **Body:** the object in §2, serialized as a CBOR map (the C2PA assertion
serialization). Field names map 1:1 to the JSON above:
`alg` (text), `hash` (byte string), and `reconstruction` (a map of
`decoderId` (uint), `profile`/`level`/`format`/`colorSpace` (text),
`width`/`height` (uint)).
- **Placement:** this assertion is **additional**. A manifest SHOULD still carry a
standard hard binding (`c2pa.hash.data` over the codestream) referenced by the
claim's `created_assertions`, so it is valid in any C2PA validator; the
reconstruction binding sits **beside** it. The byte-binding proves *these
compressed bytes*; the reconstruction binding upgrades that to *and anyone who
decodes them per this descriptor obtains this exact image* (for
`wai.image.jpegai`, anyone who decodes them with the exact decoder, §2).
- **Signature:** the assertion is covered by the C2PA claim signature like any
other, so it is tamper-evident.
The digest is the same value WAI's own receipt carries (§4), so a validator with a
WAI decoder reaches a matching hash whether it reads the C2PA CBOR assertion or the
WAI receipt.
## 4. WAI receipt carriage
The binding MAY be carried in a WAI receipt alongside an [asset
provenance](provenance.md) receipt: provenance binds the opaque asset bytes
(content-hash-equivalence, BLAKE3 over the envelope); this binds the reconstructed
pixels (SHA-256 over the canonical RGB — decode-equivalence, or for
`wai.image.jpegai` the exact decoder's pinned reconstruction). Together they cover
both halves of the thesis — the bytes that are carried and the pixels that are
reconstructed. The reference impl emits the §2 JSON via
`ReconstructionBinding::to_json`.
## 5. Machine-readable AI-content marking
A reproducible-reconstruction binding is a substrate for **machine-readable marking
of AI-processed media**. Where a regime requires content to be marked in a
machine-readable, detectable format (for example EU AI Act Article 50, whose
transparency obligations apply from 2 August 2026, with the technical marking
standards developed via the Code of Practice), a signed assertion that binds the
*reconstructed* content — carried through the neural coding step rather than
invalidated by it — is a mechanism that survives decode. WAI states this as a
capability (a signed, reproducible binding over decoded content); it does not make
a legal claim, and any deployment MUST confirm sufficiency against the applicable
regime.
## 6. Reference implementation
`wai-rs`, feature `provenance`, module `reconstruction_binding`:
`ReconstructionDescriptor`, `ReconstructionBinding::{bind, verify, hash_hex,
to_json, C2PA_LABEL}`. `bind` hashes the canonical `RGB8` buffer under a
descriptor; `verify` re-hashes a freshly decoded buffer and compares. The digest is
a plain SHA-256, reproducible by any SHA-256 implementation — which is what makes it
portable into a C2PA validator.