wai upscale and wai tonemap: an exact derivation from the command line, with its record and its check #578

Merged
dcharlot merged 2 commits from wai/upscale-tonemap-door into main 2026-11-02 21:47:29 -05:00
Owner

WAI can verify an upscale record and a rendition record, but no door in the toolchain could make one. That logic lives in waiTransport's providers, on the wrong side of the line: WAI holds every open ability, and waiTransport operates them. These commands also give media.upscale and media.tonemap a real entry in the catalogue, which the coming tariff prices by name.

The commands

wai upscale run <in.png> --prior <p.wsr> [--derivation sr2|sr4] -o <out.png>
    [--record <out.json> --envelope <in.wai> --key <seed>]
wai upscale verify <record.json> --envelope <in.wai> --prior <p.wsr> [--picture <out.png>]

wai tonemap run <in.wai> --headrooms <h,h,...> --out <dir> [--input-class <class>]
    [--record <out.json> --key <seed>]
wai tonemap verify <record.json> --envelope <in.wai> [--renditions <dir>]
  • run makes the output, and with --record signs the record. Without it, no key is needed.
  • verify recomputes the record under require-proof and holds the output to it, printing the outcome as JSON and exiting 1 on a refusal.
  • exact_upscale::make and exact_tonemap::make are the functions underneath. They return the record's body for the caller to sign, so a service with its own key can use them.

Limits:

  • The upscale's input is an 8-bit RGB PNG, which is what the reader in png_still holds.
  • The tonemap's input is a still: a WAI2 of a PNG base and its gain map. The existing run_graph and tone-mapping limits apply unchanged.

Why run: the catalogue refuses a command that's the start of another, so wai upscale can't sit beside wai upscale verify.

What ran

  • tests/cli_derive.rs, new, runs the binary end to end. What run writes is accepted by each extension's verifier from those files alone, and refused with another prior, another envelope, an altered picture or an altered rendition. Bad arguments are refused too.
  • tests/cli_ops.rs, with both features: 10 passed, including the new operations under --dry-run. With quickstart alone: 47 passed for the binary and 10 for cli_ops.
  • Catalogue unit tests: 6 passed. catalogue/ops.json is regenerated.
  • wai breaking against the merge base: nothing unacknowledged. check-tests-in-ci: passes, with the new test added to the conformance job.

Not done here: waiTransport's providers still have their own copy of this logic. They move to these functions when it next re-pins WAI.

🤖 Generated with Claude Code

WAI can verify an upscale record and a rendition record, but no door in the toolchain could make one. That logic lives in waiTransport's providers, on the wrong side of the line: WAI holds every open ability, and waiTransport operates them. These commands also give `media.upscale` and `media.tonemap` a real entry in the catalogue, which the coming tariff prices by name. ## The commands ```text wai upscale run <in.png> --prior <p.wsr> [--derivation sr2|sr4] -o <out.png> [--record <out.json> --envelope <in.wai> --key <seed>] wai upscale verify <record.json> --envelope <in.wai> --prior <p.wsr> [--picture <out.png>] wai tonemap run <in.wai> --headrooms <h,h,...> --out <dir> [--input-class <class>] [--record <out.json> --key <seed>] wai tonemap verify <record.json> --envelope <in.wai> [--renditions <dir>] ``` - `run` makes the output, and with `--record` signs the record. Without it, no key is needed. - `verify` recomputes the record under `require-proof` and holds the output to it, printing the outcome as JSON and exiting 1 on a refusal. - `exact_upscale::make` and `exact_tonemap::make` are the functions underneath. They return the record's body for the caller to sign, so a service with its own key can use them. **Limits:** - The upscale's input is an 8-bit RGB PNG, which is what the reader in `png_still` holds. - The tonemap's input is a still: a `WAI2` of a PNG base and its gain map. The existing `run_graph` and tone-mapping limits apply unchanged. **Why `run`:** the catalogue refuses a command that's the start of another, so `wai upscale` can't sit beside `wai upscale verify`. ## What ran - `tests/cli_derive.rs`, new, runs the binary end to end. What `run` writes is accepted by each extension's verifier from those files alone, and refused with another prior, another envelope, an altered picture or an altered rendition. Bad arguments are refused too. - `tests/cli_ops.rs`, with both features: 10 passed, including the new operations under `--dry-run`. With `quickstart` alone: 47 passed for the binary and 10 for `cli_ops`. - Catalogue unit tests: 6 passed. `catalogue/ops.json` is regenerated. - `wai breaking` against the merge base: nothing unacknowledged. `check-tests-in-ci`: passes, with the new test added to the conformance job. **Not done here:** waiTransport's providers still have their own copy of this logic. They move to these functions when it next re-pins WAI. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
wai upscale and wai tonemap: an exact derivation from the command line, with its record and its check
Some checks failed
wai-quantum docs, course and locales / the Studio's words in every locale · linux (pull_request) Successful in 8s
WAI examples / WAI examples · portable · linux (pull_request) Successful in 10m28s
wai-pack / wai-pack · linux (pull_request) Successful in 2m4s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 17m14s
WAI Studio / the catalogue's actions, the unit tests and the core · linux (pull_request) Failing after 17s
wai-quantum for JavaScript / javascript · linux (pull_request) Successful in 3m7s
wai-quantum studio and desktop / studio · browser (pull_request) Successful in 3m53s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 14m53s
wai-quantum studio and desktop / desktop app · linux (pull_request) Successful in 5m41s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 5m16s
wai-quantum docs, course and locales / every command and snippet in the docs · linux (pull_request) Successful in 17m7s
WAI Studio / Studio in WebKit · linux (pull_request) Failing after 10m52s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Has been cancelled
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Has been cancelled
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Has been cancelled
WAI conformance / each feature of the independent verifiers' steps compiles alone (pull_request) Has been cancelled
WAI conformance / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Has been cancelled
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Has been cancelled
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Has been cancelled
WAI examples / WAI examples · android-app · linux-arm64 (pull_request) Has been cancelled
WAI HTTP delivery / HTTP corpus · every patch and mutation in exactly one shard (pull_request) Has been cancelled
WAI HTTP delivery / HTTP corpus · verified both ways, and the differential (pull_request) Has been cancelled
WAI HTTP delivery / cache rules · controls and labelled caches (pull_request) Has been cancelled
wai-pack / wai-pack · linux-arm64 (pull_request) Has been cancelled
wai-pack / wai-pack · independent verifier (Python) (pull_request) Has been cancelled
wai-pack / wai-pack · the floor through a media prober (pull_request) Has been cancelled
wai-pack / wai-pack · dependency licences (pull_request) Has been cancelled
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (pull_request) Has been cancelled
3ba5bccf78
The catalogue lists what works, and the toolchain could verify an upscale
record and a rendition record without any door that made one. The doing lived
in a hosted service's providers, which is the wrong side of the line: WAI holds
every open ability.

`wai upscale run` and `wai tonemap run` make the picture and, with `--record`,
sign the record. `wai upscale verify` and `wai tonemap verify` recompute that
record under require-proof from what it names, and hold the output to it.
`exact_upscale::make` and `exact_tonemap::make` are the functions under them,
and they return the record's body for a caller to sign, so a service that signs
with its own key can use them too.

The commands are `run` and `verify` because the catalogue refuses a command that
is the start of another: `wai upscale` beside `wai upscale verify` is a form
that can never be told apart from a file named verify.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
wai-studio: the action table holds the catalogue's new operations
All checks were successful
wai-quantum studio and desktop / studio · browser (pull_request) Successful in 4m56s
wai-sink-android native sink library / every ABI, the AAR, and the instrumented tests in a headless emulator · macos (pull_request) Successful in 5m24s
wai-quantum studio and desktop / desktop app · linux (pull_request) Successful in 5m33s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 19m5s
wai-ops-gpu integer operators on GPUs / Metal GPU and browser WebGPU (macos) (pull_request) Successful in 11m58s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 17m20s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 22m53s
WAI Studio / Studio in Chromium and Firefox · macos (pull_request) Successful in 8m18s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 7m15s
WAI Studio / Studio in WebKit · linux (pull_request) Successful in 12m18s
wai-quantum docs, course and locales / every command and snippet in the docs · linux (pull_request) Successful in 21m40s
wai-sink-swift native sink package / libwai slices, desktop tests, simulator tests · macos (pull_request) Successful in 22m25s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 56s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Successful in 11m45s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 21m30s
WAI conformance / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Successful in 21s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 48s
WAI conformance / each feature of the independent verifiers' steps compiles alone (pull_request) Successful in 13m52s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 3m1s
WAI examples / WAI examples · android-app · linux-arm64 (pull_request) Successful in 6m59s
WAI HTTP delivery / HTTP corpus · every patch and mutation in exactly one shard (pull_request) Successful in 11s
WAI HTTP delivery / HTTP corpus · verified both ways, and the differential (pull_request) Successful in 3m3s
WAI HTTP delivery / cache rules · controls and labelled caches (pull_request) Successful in 1m34s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 13m8s
wai-pack / wai-pack · linux-arm64 (pull_request) Successful in 2m2s
wai-pack / wai-pack · the floor through a media prober (pull_request) Successful in 19s
wai-pack / wai-pack · dependency licences (pull_request) Successful in 1m25s
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (pull_request) Successful in 3m0s
wai-pack / wai-pack · independent verifier (Python) (pull_request) Successful in 7m25s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 1h3m53s
bc65134edf
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Transaction-Science/open-standards!578
No description provided.