wai: D2c O8 + M7b — JPEG AI's networks written in jpegai-int/1 and run through wai-ops/1, goldens unchanged #315

Merged
dcharlot merged 15 commits from wai/d2c-m7b into main 2026-10-18 12:35:32 -04:00

2026-10-18

Transaction Science
Merge origin/main into wai/d2c-m7b; CHANGELOG keeps every entry
Some checks failed
wai formal verification (integer core) / kani (plan) (pull_request) Has been cancelled
wai formal verification (integer core) / kani (sound) (pull_request) Has been cancelled
wai formal verification (integer core) / kani (stage) (pull_request) Has been cancelled
wai formal verification (integer core) / kani (rans64-t2) (pull_request) Has been cancelled
wai formal verification (integer core) / kani (stage-long) (pull_request) Has been cancelled
wai formal verification (integer core) / kani (integer-core) (pull_request) Has been cancelled
WAI energy receipts / does this change touch it (pull_request) Has been cancelled
WAI energy receipts / energy receipts · linux (pull_request) Has been cancelled
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Has been cancelled
WAI energy receipts / energy receipts · macos (pull_request) Has been cancelled
WAI conformance / does this change touch it (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · linux (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · macos (pull_request) Has been cancelled
WAI conformance / quantum core and corpus under wasm32-wasip2 (wasmtime) (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 / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · linux (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · macos (pull_request) Has been cancelled
WAI conformance / codec wrappers · fuzz smoke, text decode limits, C entry points, provenance, the semantic path (pull_request) Has been cancelled
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Has been cancelled
wai cross-architecture byte-equality / does this change touch it (pull_request) Has been cancelled
wai cross-architecture byte-equality / linux-aarch64 (pull_request) Has been cancelled
wai cross-architecture byte-equality / linux-x86_64 (pull_request) Has been cancelled
wai cross-architecture byte-equality / macos-arm64 (reference) (pull_request) Has been cancelled
standards workspaces build + test / which workspaces this change touches (pull_request) Has been cancelled
standards workspaces build + test / macOS energy backends (pull_request) Has been cancelled
repository checks / lockfiles, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Has been cancelled
Main gained wai-quantum 0.6.3 and lockfile updates from other merges. The only
conflict was the CHANGELOG's top insertion; O8 + M7b's entry stays first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 12:34:39 -04:00
Transaction Science
Merge origin/main into wai/d2c-m7b
All checks were successful
WAI neural decoders end-to-end / synthetic fixtures → Rust decode → reference (±4) (pull_request) Successful in 1m12s
wai-pack / wai-pack · macos (pull_request) Successful in 1m51s
wai formal verification (integer core) / kani (integer-core) (pull_request) Successful in 6m13s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 1m20s
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Successful in 3m22s
wai-ops integer operators / linux-x86_64 (pull_request) Successful in 50s
wai-ops integer operators / wasm32-wasip2 (wasmtime) (pull_request) Successful in 32s
wai-ops integer operators / wasm32 under Node (pull_request) Successful in 22s
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Successful in 6m17s
wai-ops integer operators / independent checker (Python) (pull_request) Successful in 12s
wai-quantum WebGPU member / member · browser WebGPU (macos) (pull_request) Successful in 1m59s
wai-pack / wai-pack · linux (pull_request) Successful in 1m23s
wai-quantum WebGPU member / shader checks · browser build · wasip2 inertness · MSRV (pull_request) Successful in 3m14s
wai-quantum WebGPU member / member · software Vulkan (linux) (pull_request) Successful in 2m7s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 3m9s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 5m17s
WAI HTTP delivery / HTTP corpus · falsify mutations 0/3 (pull_request) Successful in 59m35s
WAI HTTP delivery / HTTP corpus · falsify mutations 1/3 (pull_request) Successful in 58m54s
WAI HTTP delivery / HTTP corpus · falsify mutations 2/3 (pull_request) Successful in 59m22s
WAI HTTP delivery / HTTP corpus · falsify patches 0/3 (pull_request) Successful in 8m51s
WAI HTTP delivery / HTTP corpus · every patch and mutation in exactly one shard (pull_request) Successful in 13s
WAI HTTP delivery / HTTP corpus · verified both ways, and the differential (pull_request) Successful in 4m22s
WAI HTTP delivery / cache rules · controls and labelled caches (pull_request) Successful in 2m2s
wai-ops integer operators / linux-aarch64 (pull_request) Successful in 1m29s
WAI HTTP delivery / HTTP corpus · falsify patches 1/3 (pull_request) Successful in 10m16s
WAI HTTP delivery / HTTP corpus · falsify patches 2/3 (pull_request) Successful in 9m34s
wai-pack / wai-pack · the floor through a media prober (pull_request) Successful in 39s
wai-pack / wai-pack · linux-arm64 (pull_request) Successful in 1m48s
wai-pack / wai-pack · dependency licences (pull_request) Successful in 1m45s
wai-pack / wai-pack · independent verifier (Python) (pull_request) Successful in 6m12s
#308 (M8, which carried #298, M7a) has landed on main as bbc2681d. Main's other
changes since are outside wai/ (mesh, jcp, joule-code, joulehook).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 07:21:14 -04:00
Transaction Science
wai: gate the direct-network tests on legacy_int in their files too
Gate 7 made these seven tests require `legacy_int` in Cargo.toml, but their files
were still gated on `neural_int` or `neural` alone, which `check-tests-in-ci.py`
reports: a file's `#![cfg]` must name what its `[[test]]` requires. Each file is
now gated on `all(..., feature = "legacy_int")`, as `jpegai_ops.rs` is.

Three test comments named the design's appendix and a plan item. They now name
the text's sections (§11's `role_profiles`, §13.6.2's table).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 02:41:38 -04:00
Transaction Science
wai: D2c M7b gate 7: the direct networks leave production
The decode runs the hyper decoders, context stages and synthesis through the
operator set (gate 6), so their direct computation is test-only (legacy_int), the
reference the golden-equality tests and the differential hold the graphs to:

- int_transformer (the Q16 attention, normalisation and convolution executors);
- jpegai_synthesis' networks (decode_y/_uv and their _f32 forms, decode_hyper,
  mcm_stage0/_n, q16_from_symbols, and the helpers and Weights' accessors they
  use); Weights, IntNet, BadMember, from_json and ptq stay, for the loads;
- jpegai_pipeline's reconstruct_yhat/_uv and the sub-lattice shuffles;
- int_kernels' par_map, par_zip and conv_acc_i64, which only they called.

The tests that run the direct networks require legacy_int (int_kernels_geometry,
which the fast-kernel steps run with it; the calibration tests NOT-IN-CI lists).
wai_decode_bench's JPEG-AI cases now run the graphs the decode runs: its kernel
cases as one-operator WHG1 graphs under acc64, its synthesis case through syn_y and
syn_uv, through the interpreter with the fast kernels behind it.

Build host: the library with neural_int alone and with neural (no new warning),
with legacy_int and its tests; clippy's guard; the pinned goldens
(jpegai_cross_platform, jpegai_e2e_full, jpegai_reconstruction_binding with the
pinned RGB SHA-256); jpegai_ops and jpegai_nets_ops; byte-exact-conformance (101);
the wai-verify build; the bench's JPEG-AI cases; wai-web wasm32; include/wai.h
unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 02:17:11 -04:00
Transaction Science
wai: D2c M7b gate 6: the switch; the decode's networks run through the operator set
- jpegai_decode::{decode, decode_with_stages} load the bundle's networks
  (load_networks, under acc64) beside its scale path and run the hyper decoders,
  context stages and synthesis through rec_y, rec_uv, syn_y and syn_uv;
  decode_loaded(data, icci, norm, scale path, networks, observe) decodes with
  both loaded once. The direct networks are reached only from
  jpegai_decode::legacy (Front::Direct, Back::Direct, test-only, legacy_int).
- The loaders no longer panic: Weights::from_json, IntNet::from_json and
  IcciNet::from_json return Result<_, BadMember>; a mistyped member is
  model_mismatch. IntNet keeps only well-formed tensors, so a member §13.6.1 reads
  that is mistyped is missing, as the lowering of the bytes refuses it.
- The neural sink lowers and loads the networks from their eight files' bytes
  through the store of loaded sets (keyed by their listing, at acc64), parses only
  the eICCI net besides, and reports a refusal (model_mismatch, field_range)
  without falling back: a_refused_exact_decode_does_not_fall_back gains a
  non-integer network weight and a mistyped eICCI field.
- The browser crate's decodeJpegAiFull reports a mistyped member.
- Goldens, unchanged (build host, release): jpegai_cross_platform's nine pinned
  hashes, the Synthesis stage d56695726bb6ebed… among them; the decoded RGB
  SHA-256 dbc494a5a670914e… (jpegai_reconstruction_binding with
  WAI_JPEGAI_EXPECT_SHA256, jpegai_e2e_full: max|Δ| = 1 on 4.446%).
- Memory (jpegai_memory, reference kernels): with the scale path and the networks
  loaded beforehand the decode holds 72,752,387 bytes, the direct decode
  175,465,380; the networks take 89,727,913 to load and hold 55,530,900.
- Also green: clippy's disallowed-methods guard and jpegai_decode_symbols, the
  sink's three dispatch tests, wai-web's tests and its wasm32 build; include/wai.h
  unchanged.
- CHANGELOG: the M7b entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 02:00:19 -04:00
Transaction Science
wai: gate 5's falsification found the synthetic networks refuse every decode
Gate 5's fault (a grouped convolution finished with its neighbour channel's
requantisation on the fast kernel) left the unit test green: every committed
vector of rec_y, rec_uv, syn_y and syn_uv refused past A32, because the synthetic
networks' multipliers grew each convolution's output by up to 2^6 per product, so
no decode of those graphs ran its operators end to end.

- The generator now sets each synthetic convolution's multiplier so that a weight
  of 32767 times its products keeps the input's magnitude (and halves the biases):
  every rec_y, rec_uv, syn_y and syn_uv vector of graphs/lower_jpegai.jsonl now
  decodes, and only the vectors one past an input's range refuse. The set's digest
  is 1bc0daae…; its graphs, certificate and vectors are regenerated, and both
  certifiers reproduce them (wai-verify vectors verify; wai_ops_check.py
  ops-conformance), with the tests naming the new digest.
- jpegai_ops::fast_kernels::the_jpegai_networks_run_their_convolutions_on_the_fast_kernel
  requires a completed decode of each of the four graphs, not of any one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 01:43:32 -04:00
Transaction Science
wai: D2c M7b gate 5: the networks' convolutions run on the fast kernels
- jpegai_ops::fast_kernels::the_jpegai_networks_run_their_convolutions_on_the_fast_kernel:
  on the committed networks' four graphs, under every fast policy, every
  convolution and transposed convolution of each graph runs on the fast kernel
  (counted, int_ops::Host) and every value is the interpreter's alone, on inputs
  of four magnitudes; debug and release, build host.
- tests/jpegai_nets_ops.rs, every_kernel_policy_runs_the_networks_alike (since
  the work-in-progress commit): the reference and four fast policies give the
  same outputs or the same refusals on the committed networks (16 runs, 12
  refused alike past A32) and on the test codestream's inputs to the pinned
  bundle's graphs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 01:09:37 -04:00
Transaction Science
wai: D2c M7b gate 4: the networks against the direct networks, on random networks
tests/int_ops_differential.rs gains a half for jpegai's hyper decoders, context
stages and synthesis (§13.6.2): random weight files in the export's form at the
shapes the direct networks read (multipliers scaled to keep magnitudes, shifts 24
to 40, one convolution in about 64 grown past A32 in a "hot" case), random
hyper-latents, residuals and latents.

- jpegai_random_networks_reconstruct_alike (rec_y, rec_uv): ŷ equals the direct
  hyper decoder's and context stages', or the operator set refuses field_range at
  a checked tensor (the direct networks computed on); a file that breaks a load
  check (a member missing, a shift of 128, a weight short, dims, a bias long) is
  refused model_mismatch, and its bytes and its parsed form lower to the same
  graph or the same refusal.
- jpegai_random_synthesis_networks_decode_alike (syn_y, syn_uv), at the whole
  picture's size: the planes equal the direct synthesis's, or field_range.
- Per push (release, build host): rec 64 cases (alike 56, past A32 3; planned
  breaks: a member missing 1, a shift of 128 2, a weight short 2); synthesis 8
  cases (alike 7, past A32 1). The nightly wai-ops-differential.yml runs both for
  its time, and names them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 01:07:07 -04:00
Transaction Science
wai: D2c M7b gate 3: the networks' refusals, and the ops member's role profiles
- Refusal parity (tests/jpegai_nets_ops.rs):
  - every_load_check_of_the_networks_refuses_model_mismatch: 19 breaks of
    §13.6.2's load checks in the committed networks (a member missing or of the
    other kind, dims, counts, groups other than 4 or 5, a kernel not the
    topology's, a bias short, shifts of 128 and -1, a non-integer weight, a
    multiplier past i64, three temperatures, ψ of other than 4C channels, a luma
    synthesis of two planes, an odd feed-forward width, a mistyped member, a sum
    past i64 under A32) are refused model_mismatch from the files' bytes, 15 of
    them from the parsed networks too (the rest the direct parser cannot read);
    and two members of one name, from the bytes;
  - a_value_past_its_range_is_refused_field_range: a residual or a latent one
    past A32 at either end is refused field_range at its input by every graph
    that reads it; on the test codestream a residual at either end of A32, where
    the mean keeps the sum within it, decodes through rec_y and rec_uv as the
    direct decode does, and one past it is refused where the direct decode
    computed on (integer-operators §15.3 item 4).
- Registry: wai.image.jpegai's ops member is { wai-ops/1, acc64, full,
  jpegai-int/1, role_profiles: { hs_y: acc32, hs_uv: acc32 } } (§11); the schema
  gains role_profiles (it requires profile); registry/capabilities.json and its
  schema regenerated by `wai registry export`.
- SPEC §5 (the row's refusals and its reference implementation), §7
  (NeuralEntropyExact names the profiles; the networks lie outside the claim),
  §8 (the networks' planned breaks).
- CHANGELOG: a truncated sentence of the WIV1/WIR1 entry completed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 01:06:49 -04:00
Transaction Science
wai: D2c M7b gate 2: through their graphs the networks give the pinned decode
- jpegai_decode::decode_networks runs the whole decode with every integer stage
  through the operator set: the scale path and entropy decodes (§13.6.1), and the
  hyper decoders, context stages and synthesis through rec_y, rec_uv, syn_y and
  syn_uv (§13.6.2). The decode's default is unchanged until the switch (gate 6).
- tests/jpegai_nets_ops.rs, on jpegai/v1 and the test codestream (build host,
  release, WAI_REQUIRE_SOTA_VECTORS=1):
  - the_networks_decode_through_the_lowering_as_directly: ŷ through rec_y
    (40960 values) and rec_uv (24576) equals the direct hyper decoder and context
    stages; Y (65536) and U, V (131072) through syn_y and syn_uv equal the direct
    synthesis, bit for bit as the float values the decode reports;
  - the_whole_decode_through_the_networks_is_the_pinned_decode: every stage hash
    equals the direct decode's and the pinned values of
    tests/jpegai_cross_platform.rs: the Synthesis stage d56695726bb6ebed…, the RGB
    SHA-256 dbc494a5a670914e…, both unchanged.
- wai-jpegai-e2e.yml requires the new test by name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 01:03:14 -04:00
Transaction Science
wai: D2c M7b gate 1: the networks' lowering and certificate, reproduced from the text
jpegai-int/1 now writes six graphs (hs_y, hs_uv, rec_y, rec_uv, syn_y, syn_uv;
integer-operators §13.6.2). The independent checker (tools/wai_ops_check.py),
written by a separate session from §13.6.2's text without reading the Rust,
lowers the eight weight files and reproduces every lowered graph and certificate
byte for byte: the committed synthetic set (4e4ba5e4…) through `ops-conformance`
(19 sets, 34 graphs, 19 certificates), and jpegai/v1 (3e243dc1…) through
`certify --check`, with `--external jpegai/v1=DIR` recomputing it too.

- The verdict: Appendix C's prediction for these networks (acc64) holds; the set
  meets acc64 and not acc32 (first failure rec_y node 1, conv.acc 42 bits), and
  the scale graphs still meet acc32 on every node.
- §11's role_profiles in both certifiers: `--role-profile ROLE=PROFILE` (exit 1
  when the named graph fails it), and the external-set check reads an entry's
  role_profiles; external.json's jpegai/v1 entry declares acc64 with acc32 for
  hs_y and hs_uv. wai-jpegai-e2e.yml certifies with both.
- The checker's readings of the member rules made two of them explicit: a file
  with two members of one name at any depth is refused, and a conv member's `w`
  holds the product of its dims of integers that fit i64. wai-ops' parse and the
  parsed form's conversion (Weights::ptq) now refuse what the text refuses.
- wai-jpegai-e2e.yml gains a step for tests/jpegai_nets_ops.rs on the pinned
  bundle (and its timeout 60 minutes); both fast-kernel steps of
  wai-conformance.yml run it on the committed set.
- tests/jpegai_ops.rs: the scale-path certificate test reads the set's eleven
  members and holds the scale graphs, not the set, to acc32.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 01:02:55 -04:00
Transaction Science
wai: the synthetic jpegai networks give each convolution its own shift
So the committed set's lowered bytes show §13.6.2's TAB rule (each half's
convolutions take its first convolution's shift). The set's digest is now
4e4ba5e4…; its graphs and certificate are regenerated by wai-verify vectors gen,
and the tests name the new digest.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 00:46:05 -04:00
Transaction Science
wai: O8 (c), measured: no sum of the jpegai networks needs more than 64 bits
integer-operators §13.6.2, Accumulators, measured: on the jpegai/v1 test codestream
every value the four graphs form lies within its certified interval
(tests/jpegai_nets_ops.rs, held by wai_ops::bounds::Within), and the largest
magnitudes are 37 bits for any acc-class sum (syn_uv's conv.acc and mul.p),
36 for a transposed convolution's, against certified bounds of 42 to 60 bits.
Inputs stay within 21 bits and activations within 24, inside the A32 checks.
No real or certified sum reaches 2^63, so acc64 holds and O8's acc128
fallback is not needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 00:46:05 -04:00
Transaction Science
wai: D2c O8 + M7b, work in progress: §13.6.2 graphs and the networks' lowering
The state of the work when a session limit stopped it, committed so that nothing
is lost. Not a gate commit; the gates follow in their own commits.

- integer-operators §13.6.2 written as a normative lowering (the members, the
  blocks, TAB, the graphs rec_y, rec_uv, syn_y, syn_uv, the A32 check ranges,
  the load checks, the driver, the refusals, the profiles); §1's claim widened;
  §5.1, §11 (role_profiles), §13.0 (roles, widths, driver contract), §13.6's
  intro, §15.1 and §15.3 item 4. The measured accumulator table is still a
  placeholder (MEASURED_TABLE).
- determinism-tiers §5: the networks' codes (model_mismatch, field_range).
- wai-ops: lower::jpegai_nets (the lowering of §13.6.2), lower::jpegai now
  writes the six roles, lower::jpegai_scale the scale path alone; Builder::ops.
- The generator: the synthetic jpegai set gains small-width weight files for the
  eight networks (set digest 1b5d0f77…, replacing 60020d06…); graph vectors for
  the multi-input graphs. The pinned bundle's certificate (3e243dc1…) is
  regenerated with the six graphs (acc64; acc32 for hs_y and hs_uv).
- wai-rs: jpegai_ops::Networks (load, reconstruct, synthesize_y/_uv),
  Weights::ptq, the store's Resident impl; tests/jpegai_nets_ops.rs (lowering
  and certificate, golden equality per network, the measured maxima held to the
  certificate, kernel-policy parity). Ran green once on the build host on the
  pinned bundle. The decode is not switched yet.

The independent Python checker does not yet lower §13.6.2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 00:43:29 -04:00