open-standards/wai/wai-pack/tests/conformance.rs
Transaction Science fb61bb69bd wai-pack: the policy, scene-cut segmentation and their corpus
A new crate beside wai-rs, with its own workspace and lock: the reference
packager of the packaging extension, built so far as far as a plan.

- policy.rs: wai.pack.policy/1 read in three stages (value kinds a canonical
  JSON cannot carry; the schema with every default written in; the
  constraints across members), each refusal named. The effective policy's
  canonical JSON goes through wai::jcs, and its digest is
  BLAKE3("wai:pack-policy\x01" || JCS).
- source/: Y4M to RGB8 (BT.709 limited range, integer), WAV PCM s16le.
- scenecut.rs: wai.pack.scenecut/1, one streaming segmenter with a bounded
  lookahead and the return and revisit clauses, so live and on-demand
  packing cut alike at equal lookahead; plan digest.
- classify.rs: static, synthetic, high motion, natural.
- fixture.rs: integer-generated Y4M fixtures (cuts-01, kinds-01).
- conformance.rs and wai-pack conformance regen|check.

pack-conformance/ holds the policy digests and equal-spelling pairs, a
refusal case per reason, the unit and colour conversions, and the scene-cut
vectors; pack_verify.py recomputes every one of them from the rules, with
its own TOML schema, JCS, readers, fixture generator and segmenter. It
found one defect while it was written: a millisecond bound converted to an
extreme timebase wrapped past 2^64; both conversions now saturate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 07:33:52 -04:00

12 lines
445 B
Rust

//! The packaging corpus (`wai/pack-conformance`) holds: every expected file is what
//! this crate computes from the corpus's inputs, and every generated input is what the
//! generator writes.
use std::path::Path;
#[test]
fn the_corpus_holds() {
let dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("../pack-conformance");
let m = wai_pack::conformance::check(&dir).expect("the corpus reads");
assert!(m.is_empty(), "{m:#?}");
}