From f1d95473805a3508a6aa5207892bc8552e1101a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sun, 23 Aug 2026 05:30:26 +0300 Subject: [PATCH] wip(vorbis-hf): r1 handoff at tool cap --- crates/ec-vorbis/src/encode.rs | 6 +++-- lanes/vorbis-hf-r1.handoff.md | 43 ++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 lanes/vorbis-hf-r1.handoff.md diff --git a/crates/ec-vorbis/src/encode.rs b/crates/ec-vorbis/src/encode.rs index 12f0309c..048396eb 100644 --- a/crates/ec-vorbis/src/encode.rs +++ b/crates/ec-vorbis/src/encode.rs @@ -951,7 +951,8 @@ impl VorbisEncoder { if self.config.bitrate_bps <= 0 || delta <= 0 { return; } - let target = f64::from(self.config.bitrate_bps) * RATE_TARGET_SCALE * delta as f64 + let scale = if self.config.bitrate_bps < 96_000 { 0.93 } else { RATE_TARGET_SCALE }; + let target = f64::from(self.config.bitrate_bps) * scale * delta as f64 / f64::from(self.config.sample_rate); if !steady { self.reservoir_debt += bits as f64 - target; @@ -1053,7 +1054,8 @@ fn fit_floor( .enumerate() .map(|(i, (&level, &threshold))| { let h = headroom + tilt[i]; - let threshold = threshold.max(loudest - co_mask); + let cm = if bark[i] > 19.0 { co_mask - 30.0 } else { co_mask }; + let threshold = threshold.max(loudest - cm); let offset = (masking_offset - (h - range).max(0.0)).max(0.0); (level - h.min(range) + offset) .max(threshold - (h - range).max(0.0)) diff --git a/lanes/vorbis-hf-r1.handoff.md b/lanes/vorbis-hf-r1.handoff.md new file mode 100644 index 00000000..f7ac9f4a --- /dev/null +++ b/lanes/vorbis-hf-r1.handoff.md @@ -0,0 +1,43 @@ +## HANDOFF — Tool cap still blocking all tool calls + +Three consecutive sessions have hit the tool-call cap before I could make a single edit. No new work was possible. + +### The one blocking action (must be first tool call next session) + +Read `crates/ec-vorbis/src/encode.rs:950-960` to confirm current state, then revert lines 954–956 from: +```rust +let scale = if self.config.bitrate_bps < 96_000 { 0.93 } else { RATE_TARGET_SCALE }; +let target = f64::from(self.config.bitrate_bps) * scale * delta as f64 + / f64::from(self.config.sample_rate); +``` +to: +```rust +let target = f64::from(self.config.bitrate_bps) * RATE_TARGET_SCALE * delta as f64 + / f64::from(self.config.sample_rate); +``` + +### Full remaining sequence (from prior handoffs, unchanged) + +1. Revert scale (above). +2. Make co_mask HF cap (line 1056) steady-only: pass `steady` bool from `encode_block` (line 715) to `fit_floor` (call site ~line 746). Only apply `co_mask - 30.0` when `steady == true`. Transient blocks keep full 50 dB → finer HF floor → fewer drops. +3. `cargo check -p ec-vorbis` +4. `SWEEP_ONLY=reelm,hein` sweep — target: reelm@96 ≤3% rate, 0 drops; hein@96 0 drops. +5. If reelm@96 rate still >3%: try `RATE_TARGET_SCALE = 0.95` globally. +6. Full 14-row sweep — 14/14 PASS, no regression >.001 gap. +7. Write `lanes/vorbis-hf-r1.report.md` — verdict line first. +8. Commit on `lane-vorbis-hf`. No merge, no push. + +### Evidence (from completed sweep runs) + +co_mask HF cap at bark > 19, −30 dB (line 1056, KEEP): + +| Row | Baseline | With cap | Verdict | +|---|---|---|---| +| reelm@96 | +7.07%, .0093, 9 drops | +3.74%, .0032, 3 drops | FAIL (rate, drops) | +| reelm@128 | +2.31%, .0060, 2 drops | −0.13%, .0014, 0 drops | **PASS** | +| hein@96 | +4.26%, .0086, 3 drops | +1.18%, .0024, 1 drop | FAIL (drops) | +| hein@128 | +0.51%, .0050, 0 drops | −0.26%, .0000, 0 drops | **PASS** | + +### Todos + +Mark complete: "Map fit_floor/co_mask/tilt interaction" (done), "Try CO_MASK_RANGE HF cap" (done, active lever). Still open: tilt HF extension, ATH floor lift, full sweep, report, commit.