Commits
2026-10-23
Restore edith_codecs after local data loss (2026-10-23)Ahmet Kaan Gümüş · b7434a2
Restore edith_codecs after local data loss (2026-10-23) On 2026-10-23 an automated agent ran `rm -rf $HOME` and deleted the local repository with all of its history. This commit restores the working tree from the newest surviving copy, the host-c server lane mirror. That mirror matches local main as of the testcut Phase 2 reports, including the tool cache, the nextest fast profile and changed-crates.sh. The history before this commit was not recovered.
2026-09-29
fixture-preflight: kill the fixture-absent silent-skip class, generate the fixture library manifestAhmet Kaan Gümüş · 60e2653
fixture-preflight: kill the fixture-absent silent-skip class, generate the fixture library manifest
A test that could not find its fixture printed SKIP and returned, so the suite
reported PASS having tested nothing. That cost a 3-hour suite red from a missing
repo-root fixtures/ dir and three hosts whose fixture libraries differed
silently. Two halves:
1. The sweep. One convention in every non-av1 test crate: probe first, assert
LAST with an EC_REQUIRE_FIXTURES escape, return LAST -- never an early
return, and never the probe folded into the same `if` as the escape (the
`have_ffmpeg` short-circuit in crates/ec-av1/src/stream.rs). Converted
ec-h264 (conformance + encode), ec-flac (xiph_vectors + encode_matrix),
ec-opus conformance, ec-aac (oracle + sbr_real_library), ec-mp3
encode_matrix, ec-vp9 (hbd_exact, inter_pixels_exact, subsampling_exact,
scratch_interdump), plus non-empty floors on fixture loops that ended in a
bare assert!(failed.is_empty()) over a possibly ZERO-iteration loop
(jvt_full_sequence_bit_exact, corrupt_streams_never_panic,
ns_per_macroblock_measurement, ec-aac synthetic_heaac_matrix, ec-mp3's 8-WAV
corpus, ec-vorbis' three user-library sweeps).
Host media directories are deliberately NOT gated: a personal corpus is not
the committed library, and EC_REQUIRE_FIXTURES must not turn one operator's
home into a red fleet. They route through a separate require_host_media
helper. Tool-absence SKIPs (ffmpeg/x264/aomenc on PATH) stay a tool gate,
out of scope.
2. The preflight. scripts/gen-fixture-library.sh GENERATES
scripts/fixture-library.tsv (path, required-by file:line, provenance,
status, sha256) and scripts/verify-fixture-library.sh checks SHAPE, RESOLVE
(every path exists, every directory non-empty) and DRIFT (regenerating
reproduces the committed file). It distinguishes the two failure modes: a
missing fixture ROOT (mode i -- a linked worktree never has the gitignored
fixtures/; fix the tree) from a missing path inside a present root (mode ii
-- run the generator). It honours the same EC_REQUIRE_FIXTURES env: red when
set, SKIP-shaped and exit 0 when not.
The manifest states findings rather than hiding them: 52 committed pins
whose only provenance is a gate comment, 3 known-absent pins kept as rows
(ll444-lossless-key.obu, golden3-pin.obu, sbpart-pin.obu), and 4 committed
pins no source literal references. Enumeration is grep-derived and therefore
blind to runtime-assembled names (191 media literals resolve under no
enumerated directory); those are covered as far as their parent directory,
which must exist and be non-empty.
Proof (EC_NOMEMGUARD=1 only because the repo's memguard runner hit a stale
systemd scope):
EC_REQUIRE_FIXTURES=1 ec-h264 conformance 23 passed / encode 12 passed
EC_REQUIRE_FIXTURES=1 ec-flac xiph_vectors 4, encode_matrix 2 passed
EC_REQUIRE_FIXTURES=1 ec-opus conformance 28 passed / 16 ignored
EC_REQUIRE_FIXTURES=1 ec-aac oracle 14, ec-mp3 encode_matrix 5, ec-vorbis 8
mv fixtures/video/h264-open-gop.mp4 -> RED: "EC_REQUIRE_FIXTURES=1 but
fixture ... is absent -- regenerate with: scripts/gen-fixtures.sh"
mv flac subset/ and opus testvector01.bit -> RED on both
scripts/verify-fixture-library.sh: GREEN; with a fixture renamed and
EC_REQUIRE_FIXTURES=1 -> RED mode ii listing the path; same rename with
the env unset -> SKIP-shaped, exit 0; EC_FIXTURES=/nonexistent -> RED
mode i.2026-08-23
test(vorbis): per-second dropout gate in the library sweepAhmet Kaan Gümüş · 4174c4b
test(vorbis): per-second dropout gate in the library sweep A post-transient silence is invisible in whole-file corr and bimodal per second, so the sweep now traces corr per second and fails any row with a second under 0.9 where libvorbis is not. Proven both ways on reelm.wav: main 0 dropout seconds (min-second .911/.934 vs ref .927/.950); reservoir disabled 357/295 seconds, min-second .117.
ec-vorbis: band-error + bit-split oracle vs libvorbis, 7 sources x {96,128}kAhmet Kaan Gümüş · 2f04c6e
ec-vorbis: band-error + bit-split oracle vs libvorbis, 7 sources x {96,128}k
Instrument test (ignored) folding the bit-split oracle into one pass:
band NSR/E vs source through our decoder, ours vs ffmpeg libvorbis at
matched rate. All 14 rows: bits/nonzero 1.48-2.12x ref on ~half the
nonzeros, dNSR concentrated 300-1080 Hz (+9..+15 dB), HF droop on
nik/reelm/hein only. Lanes files + report + round-3 handoff.2026-08-22
test(vorbis): bit split oracle — floor vs residue bits per coded value (cherry-pick 107b096)Ahmet Kaan Gümüş · a4a1e96
test(vorbis): bit split oracle — floor vs residue bits per coded value (cherry-pick 107b096) Decoder captures (floor bits, residue bits, packet bits) per block; histogram report prints residue bits per non-zero for ours vs ref. Output stays lanes/vorbis-psy-r1.histogram.txt.
test(vorbis): histogram shape metrics + -vn audio-only ref encode (cherry-pick 4db6f24)Ahmet Kaan Gümüş · 647bc2d
test(vorbis): histogram shape metrics + -vn audio-only ref encode (cherry-pick 4db6f24)
Rename output paths to lanes/vorbis-psy-r1.{histogram,sweep}.txt.test(vorbis): decoder-side residue reference — valid histogram oracle (cherry-pick 5ede0ed)Ahmet Kaan Gümüş · 454cb75
test(vorbis): decoder-side residue reference — valid histogram oracle (cherry-pick 5ede0ed) Resolve add/add conflicts in oracle.rs: keep both residue_histogram_vs_reference (theirs) and real_library_sweep_vs_reference (ours); git auto-merged identical ffmpeg_decode_limited/shellexpand bodies. Adapt capture hook to main's BlockConfig (main has no residue_end field — codes full half*channels region, so coded=half).
fix(vorbis): bit reservoir stops the rate loop winding up on short-block runsAhmet Kaan Gümüş · fc5a0f8
fix(vorbis): bit reservoir stops the rate loop winding up on short-block runs Blocks next to a short window are quantised with a forced minimum precision the loop cannot lower, yet their overspend stepped the headroom -2 dB each; a 16-32 block run drove it to the -24 dB floor, the floor sat above the signal, and ~10 silent long blocks followed every transient: 200 ms dropouts at -20 dBFS on reelm.wav, per-second corr 0.27-0.70 where libvorbis holds 0.99. Forced blocks now bank their excess as reservoir debt that steady blocks repay at <=25% of a block's share, so the rate still lands on target over about a second. reelm 128k: all 30 seconds >= 0.9935; quiet_content_reaches_the_target_or_is_transparent, failing since 5314f5a for the same reason, passes. The library sweep joins the oracle binary (ignored, SWEEP_ONLY=name,...). ffmpeg's libvorbis under -b:a is unmanaged VBR and lands 10-30% under nominal on real music, so ours is encoded at the size libvorbis produced and compared there (rate within 3%, correlation gap <= .005): source kbps ours ref rate% corr_ours corr_ref gap nik 96 84.0 84.5 -0.61 0.9690 0.9903 0.0213 nik 128 115.5 115.8 -0.24 0.9838 0.9951 0.0113 reelo 96 81.5 81.8 -0.30 0.9739 0.9922 0.0183 reelo 128 109.1 108.6 +0.45 0.9868 0.9955 0.0087 her 96 89.9 89.9 +0.04 0.9668 0.9867 0.0199 her 128 123.5 124.9 -1.13 0.9810 0.9927 0.0117 reell 96 85.4 85.5 -0.12 0.9792 0.9923 0.0131 reell 128 121.3 120.9 +0.39 0.9914 0.9968 0.0054 reelm 96 80.5 79.3 +1.52 0.9796 0.9865 0.0069 reelm 128 93.5 91.0 +2.70 0.9890 0.9906 0.0017 PASS dl8a 96 86.9 86.9 -0.01 0.9655 0.9916 0.0261 dl8a 128 118.7 117.8 +0.80 0.9826 0.9957 0.0132 hein 96 80.3 79.1 +1.53 0.9789 0.9869 0.0080 hein 128 92.8 90.7 +2.31 0.9883 0.9906 0.0023 PASS Rate tracks on every row; the remaining gap is the psychoacoustic model, not dropouts.
2026-08-20
test(ec-vorbis): quiet-content oracle honors transparent undershootAhmet Kaan Gümüş · cc68682
test(ec-vorbis): quiet-content oracle honors transparent undershoot The rate loop bottoms out at +-127 step range once a quiet source's residue is exhausted; no finer step can spend more bits without a cascade coding pass (not implemented). Replace the flat +-25% target assertion with: within 25% OR (undershoot AND corr >= 0.999), and only require monotone-in-target spend for cases that actually spend.
perf(vorbis-enc): quality per bit on real music — finer residue classes, co-mask cap, point stereo, drum-only transient detectorAhmet Kaan Gümüş · 9203ba6
perf(vorbis-enc): quality per bit on real music — finer residue classes, co-mask cap, point stereo, drum-only transient detector Three 30 s tracks at 128 kbps, correlation with the source: 0.9812/0.9745/0.9911 (9ac19d6) -> 0.9711/0.9663/0.9984 (f1fa335, block switching firing ~1/s on music with 16 short blocks each) -> 0.9955/0.9936/1.0000 now, at 131/131/109 kbps. At the reference encoder's own size (109/116/92 kbps): 0.9906/0.9901/0.9999 vs its 0.9970/0.9960/0.9986. - residue: nine classes one octave of range apart (+-1 ... +-64, +-127), 16 coefficients per long partition, books from measured per-class statistics (mean |v| ~ range/6): 0.977 -> 0.988 on the two rock tracks alone - floor: 12 long points instead of 20 (16/20/32/44 each worse on music) - co-mask cap: nothing under loudest-50 dB in a long block is coded; corner-cut named in the code, upgrade is a Bark-domain spread - point stereo above 4 kHz while the rate loop is starving (headroom under the range); lossless pair coding otherwise - transient detector: jump measured against the loudest of the four ticks before, -60 dBFS absolute floor; music now fires 16-32 short blocks per 30 s - short blocks quantised with at least 42 dB headroom whatever the loop's state, and no co-mask cap: fixes the 6 ch / 96 kHz onset leak (peak 0.0106 -> 0.0062 at 36 dB, under 0.005 at 42) that the sweep now covers (onset sweep: 44.1k 1/2 ch, 48k 1/2/6 ch, 96k 6 ch) Known failing: quiet_content_reaches_the_target_within_25pct — the quiet fixture codes at corr 0.9999 and 74 kbps at every target; with the cheaper residue and 12-point floor nothing codable is left inside the 36 dB range, so the loop cannot spend up to 128/192 kbps on it.
fix(vorbis-enc): 42 dB residue range in short blocks, with a clamp-guarded floor refit; onset test sweeps phase, hop offset and per-channel contentAhmet Kaan Gümüş · a554dfa
fix(vorbis-enc): 42 dB residue range in short blocks, with a clamp-guarded floor refit; onset test sweeps phase, hop offset and per-channel content An onset inside a short block leaked up to 0.0113 peak (1.6x the 0.01*amp bar) because the block's step was the 36 dB pair range. The full 42 dB could not be used: the floor is set per X point from its region's peak and drawn as straight lines, so a peak at a region's edge sits further under the curve than the range states and clamps at 127 — catastrophically (0.11 peak) on some phases. Now any block whose quantised values exceed the range lifts the floor points around the clamping bins and refits, so short blocks run at 42 dB and long blocks keep 36. Worst gap peak over the 40-case sweep: 0.0113 -> 0.0053; worst RMS 0.000245 -> 0.000140. Fixture 46492 -> 46493 bytes, 60 s stereo unchanged.
fix(vorbis-enc): let rate-loop headroom past the residue range lower the ATH bound, so quiet/sparse content reaches the targetAhmet Kaan Gümüş · 14b96be
fix(vorbis-enc): let rate-loop headroom past the residue range lower the ATH bound, so quiet/sparse content reaches the target The widest residue book states +-127 and a coupled angle is a difference of two magnitudes, so a pair's step cannot usefully go past 36 dB under the peak. On sparse or quiet content the floor sits on the absolute threshold almost everywhere, those partitions code as class 0 at any step, and the loop pegged at 36 dB with ~44 kbps against a 128 kbps target. Headroom now clamps at 84 dB; the part past 36 dB lowers the threshold bound instead of the step, which gives the loop bins under the old threshold to spend on. Decoder and stream syntax untouched.
fix(vorbis-enc): cap the ATH at -80 dBFS so an onset inside a short block is not coded against a -10 dB floorAhmet Kaan Gümüş · 9b7e0e0
fix(vorbis-enc): cap the ATH at -80 dBFS so an onset inside a short block is not coded against a -10 dB floor The pre-echo the verifier measured (gap RMS 0.002261 at 44.1k, peak 0.073) lived entirely in the one short block whose window straddles the onset, not in the long->short transition block: the block plan already puts the onset mid short-run. Its DC bin and every bin above ~17 kHz were quantised against the absolute-threshold floor, whose own curve sits at -13 / -10 dBFS there, so a 0.1-amplitude step coefficient took a 0.2-0.3 quantiser step and its error spread over the whole 256-sample window at -38 dB. Capping the ATH at -80 dBFS gives gap RMS 0.000059 / peak 0.0028 (reference encoder on the same input: 0.000120 / 0.0057). Also gate a steady long block on its lookahead hop being buffered: with chunked input the plan was committed before the detector could see the transient it is supposed to make room for. Test now places the onset off the block grid (0.9137 s) as well as on it, measures the whole [0, onset) gap plus its peak, mono and stereo, 44.1k/48k, our decoder and the reference oracle.
feat(vorbis-enc): real block switching — short blocks eliminate pre-echo at silence→onsetAhmet Kaan Gümüş · 63f547a
feat(vorbis-enc): real block switching — short blocks eliminate pre-echo at silence→onset Two modes now: 2048-sample long blocks (steady state) and 256-sample short blocks, with their own floor1 X-grids and residue partition sizing but sharing the encoder's designed codebooks. A per-hop energy-tick transient detector (an onset after digital silence is the degenerate, always-firing case of the general jump-past-predecessor check) swaps a pair of would-be long blocks for long-with-short-right-window, a run of short blocks over the transient, and long-with-short-left-window resuming steady state — a run sized to land the transient safely inside short-block coverage rather than in a transition block's own flat (unwindowed) span, which is what silently reintroduced the leak the first cut of this fix produced. Granule advance across a switch is exactly N long hops, so it never moves the steady-state grid; a stationary signal still never leaves long-block mode (tested). New oracle test onset_after_silence_has_no_pre_echo measures gap RMS immediately before the onset at 44.1/48 kHz through both our own decoder and the reference oracle: 0.0064 -> 0.0 (both rates, both decoders).
fix(vorbis): flush() delivers the terminal block's un-overlapped tailAhmet Kaan Gümüş · 750facc
fix(vorbis): flush() delivers the terminal block's un-overlapped tail VorbisDecoder::flush() set drained=true and returned without emitting self.lap, the accumulator holding the last decoded block's samples past the final centre that had not yet been overlap-added into an output frame. Per Vorbis I §1.3.2 those samples, up to the stream's final granule position, are valid output the decoder must deliver — dropping them left every decode exactly one hop (1024 samples at typical rates) short of the encoded length at true EOS. flush() now emits any non-empty self.lap as one final Frame::Audio, permuted through the same to_ec channel map decode_audio uses, before marking drained. Also converts encode.rs's debug_tail_granule_44100_mono from a panic-driven probe into a real assertion (packets==45, last granule==44100), and adds oracle.rs::flush_delivers_the_terminal_hop, a decoder-trait (send_packet/receive_frame/flush) round trip over a sample count that is deliberately not a multiple of the hop, checking exact output length and tail correlation against the source.
2026-08-14
test(vorbis): Xiph vectors, fixture sweep and encode oracleAhmet Kaan Gümüş · c547ecb
test(vorbis): Xiph vectors, fixture sweep and encode oracle 25 Xiph decoder vectors against ffmpeg, the repo's mono/stereo/5.1 fixtures, and the encoder's own output decoded by ffmpeg and by us.