wai: the int_codec audio trained on a generated signal, and every corpus states its provenance #184

Merged
dcharlot merged 10 commits from wai/audio-provenance into main 2026-10-07 21:26:28 -04:00
Owner

The learned integer audio codec's model and vectors are now trained on, and code, a generated signal. Earlier revisions used a third-party recording. Every corpus now states the provenance of its content.

  • The audio.
    • tools/wai_int_audio_export.py generates its own signal from a seed: tones, chirps, noise bursts and formant sweeps. It is integer-only and takes no audio input.
    • The model, the vectors and every corpus that embeds them were regenerated through their own generators:
      • the int_audio vectors;
      • the int-payload WIA1 vectors and refusal fixtures;
      • the staged-delivery audio case;
      • the staged-measurement audio fixture and its goldens.
    • Training is deterministic: two runs give byte-identical weights. Rust's integer decode equals the Python reference.
  • A guard.
    • tools/wai_audio_provenance_check.py correlates every committed audio vector against a reference set of recordings the CI host has, and fails above a stated threshold.
    • A host without the reference set reports the step as skipped, with the reason.
  • Provenance everywhere.
    • Every corpus README carries a provenance line, and tests/vectors/README.md lists each vector directory's source.
    • tests/corpus_provenance.rs fails when either is missing.
    • The rule is in CONTRIBUTING.
    • Two vectors are recorded as not generated and are to be replaced in a following change: a real-footage video vector and a photograph vector.

Checked locally on macOS arm64:

  • the link gate;
  • every corpus through both implementations;
  • the guard, falsified both ways;
  • the public-text checks.

The forge CI runs on this pull request.

🤖 Generated with Claude Code

The learned integer audio codec's model and vectors are now trained on, and code, a generated signal. Earlier revisions used a third-party recording. Every corpus now states the provenance of its content. - **The audio.** - `tools/wai_int_audio_export.py` generates its own signal from a seed: tones, chirps, noise bursts and formant sweeps. It is integer-only and takes no audio input. - The model, the vectors and every corpus that embeds them were regenerated through their own generators: - the int_audio vectors; - the int-payload WIA1 vectors and refusal fixtures; - the staged-delivery audio case; - the staged-measurement audio fixture and its goldens. - Training is deterministic: two runs give byte-identical weights. Rust's integer decode equals the Python reference. - **A guard.** - `tools/wai_audio_provenance_check.py` correlates every committed audio vector against a reference set of recordings the CI host has, and fails above a stated threshold. - A host without the reference set reports the step as skipped, with the reason. - **Provenance everywhere.** - Every corpus README carries a provenance line, and `tests/vectors/README.md` lists each vector directory's source. - `tests/corpus_provenance.rs` fails when either is missing. - The rule is in CONTRIBUTING. - Two vectors are recorded as not generated and are to be replaced in a following change: a real-footage video vector and a photograph vector. **Checked locally on macOS arm64:** - the link gate; - every corpus through both implementations; - the guard, falsified both ways; - the public-text checks. The forge CI runs on this pull request. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tools/wai_int_audio_export.py no longer reads an audio file. It writes the
training signal and the test signal (the clip a vector codes) itself, from a
seed: 16 kHz mono s16, segments of tones, chirps, noise bursts and
speech-like formant sweeps, sometimes two overlaid, with short gaps. The
generator is integer arithmetic only (a SplitMix64 counter stream, a 32-bit
phase accumulator, a Bhaskara I sine table, an exact 2^(k/64) table), so a
seed gives the same samples on every machine. The codec trains on stream 0
of the seed and codes stream 1.

Training is seeded from the same seed with deterministic algorithms and a
fixed thread count. --signal-only writes one generated signal with the
Python standard library alone. The model, payload and capability are
unchanged; the vectors are regenerated in the commits that follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
tools/wai_audio_provenance_check.py (Python standard library) reads every
committed audio vector to PCM — each audio base's stage 0 in the staged
corpus, each staged-measurement source over one, each spatial-audio source,
every audio file under wai/ — and computes its normalised cross-correlation
at every lag against every recording in a reference set the host has (the
host's system sound directory, --ref, WAI_AUDIO_REFERENCE_DIRS). Above the
threshold (0.5) it fails. A learned-codec vector is covered through its
decode, which must be a staged case's stage 0. With no reference set, or no
converter to read it, the check prints why and is skipped.

On this commit it fails: the int_codec stage 0 and the measurement source
built on it match a reference recording (0.984 and 0.963). The vectors are
replaced next.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
wia1_cdf_malformed and wia1_order_table_before_length change the last entry
of the payload's first CDF table, and the second cuts the payload inside the
second table. Both used fixed offsets for the old vector's shape (16
channels, tables of 14 entries). They now read n_ch (offset 12) and cdf_len
(offset 28) from the payload itself: the first table starts at 32 + 8·n_ch,
its last entry is at (cdf_len − 1)·4 from there.

On the committed vector the offsets are the same, so the corpus is
unchanged: this binary verifies the corpus of the previous commit byte for
byte. On a payload whose tables have another length the fixtures keep their
meaning, which the regenerated audio vector needs (its tables have 15
entries).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The wai.audio.int_codec vector (wai-rs/tests/vectors/int_audio/) is now an
export of tools/wai_int_audio_export.py on its own generated signal:

    python tools/wai_int_audio_export.py <out> --seed 1 --channels 16 \
        --samples 8192 --steps 2500

Two runs with seed 1 gave byte-identical audio_model.bin,
audio_bitstream.json, audio.json and decoded PCM. Every file that depends
on the vector was regenerated through its own generator, from it:

- int_audio/sha256.json — WAI_WRITE_SHA256_SIDECARS=1 cargo test
  --test int_kernels_vectors int_audio_clip (the Rust decode equals the
  Python integer reference's PCM first);
- int_audio/audio_bitstream.wia1, int-payload-conformance/vectors.json and
  the thirteen wia1_* refusal fixtures — wai_int_payload_vectors gen;
- staged-conformance/cases/audio_int_codec_1l/ (base.wai, L1.wai,
  stage0.bin, case.json) and index.json — wai_staged_vectors gen;
- staged-measure-conformance/fixtures/audio/ (source, layers, references,
  expect.json, title.json), goldens.json and sim/results.json —
  wai_stage_measure gen-fixtures, then generate-goldens. quality.json is
  regenerated unchanged (it holds no audio).

The format, the payload layout and the capability are unchanged; the
model's shape is the same (16 channels, 512 latent samples, 8192 output
samples at 16 kHz). Verified: the six affected Rust corpus verifiers
(int-payload, staged, staged-measure, http, claims, pin), the Python
verifiers int_payload_verify.py, staged_verify.py, measure_verify.py,
sim_verify.py, http_verify.py and pin_verify.py, and the integer-kernel,
int_audio, int_payload and stage_measure tests. The provenance check now
passes: the stage 0 and the measurement source correlate at most 0.22
with any reference recording.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The cargo-class job's unix legs run tools/wai_audio_provenance_check.py.
On the macOS leg the reference set is the host's system sound directory and
the check runs; the linux legs have none and print that the check is
skipped. A change to the tool fires the workflow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
wai-rs/tests/vectors/int_audio/README.md states the vector's provenance (a
signal the export tool generates; no audio input), the seed (1), the
command, the tool versions, and that two runs gave byte-identical files.

research/decode-throughput.md keeps its text (a dated record) and gains a
dated correction: the int_audio vector it timed was trained on, and coded,
a third-party recording, and has been replaced by one trained and coded on a
generated signal of the same shape. wai_decode_bench's doc comment now lists
int_audio among the vectors trained on generated content.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each *-conformance/README.md now has a line that begins **Provenance.**:
the generator that writes the corpus and its input, and for an input not
generated here its source and licence. OER/2's corpus is settled and left
as it is. byte-exact-conformance and quantum-ops-conformance get a README.
wai-rs/tests/vectors/README.md gives a row per vector directory. Where the
staged-delivery, staged-measurement and telemetry READMEs called their
content "synthetic", that sentence is now their provenance line.

Two vectors are recorded as not generated, from the provenance audit:
int_video's video_real (a pan over a third-party picture) and
neural-conformance's photo (a third-party picture, with a decoder trained on
unrecorded images). Their lines say so and that they are to be replaced;
the photo bullet no longer names the picture's source product.

tests/corpus_provenance.rs requires the line in every corpus and a row for
every vector directory; CI runs it with the carriage tests. CONTRIBUTING
states the rule: corpus content is generated here, or recorded with a
licence that permits redistribution, and a word like "synthetic" is not a
provenance line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merge remote-tracking branch 'origin/main' into wai/audio-provenance
Some checks failed
joule-code conformance gate / Build + round-trip C1-C4 vectors (pull_request) Successful in 1m53s
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 4s
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 1m8s
standards workspaces build + test / eoc-rs (pull_request) Successful in 1m55s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m32s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 1m9s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 1m12s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m15s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m12s
standards workspaces build + test / sense-rs (pull_request) Successful in 1m7s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 3m42s
wai cross-architecture byte-equality / linux-x86_64 (pull_request) Successful in 27s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 6m20s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 14s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 11m46s
WAI conformance / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Successful in 8s
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 46s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 1m37s
WAI HTTP delivery / HTTP corpus · falsification and differential (pull_request) Successful in 1h13m54s
WAI HTTP delivery / cache rules · controls and labelled caches (pull_request) Successful in 1m6s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 1m13s
wai-pack / wai-pack · linux (pull_request) Failing after 16s
wai-pack / wai-pack · independent verifier (Python) (pull_request) Failing after 56s
wai-pack / wai-pack · the floor through a media prober (pull_request) Successful in 17s
wai-pack / wai-pack · dependency licences (pull_request) Failing after 1m11s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 2m3s
workflow hygiene / every workflow supersedes its own queue (pull_request) Successful in 4s
3a3c0a49d9
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!184
No description provided.