fix(audio/oracle): stop global alignment locking onto a capture's silent tail (nightly #418) #140

Merged
robocub merged 2 commits from fix/oracle-align-overlap-floor into master 2026-10-01 16:05:32 +00:00
Member

Why. Nightly #418 (2026-09-29) failed audio_d2m_unenc with mean NCC 0.009 although the audio crossed intact: replaying the artifact WAVs through the real oracle shows cycles 2–7 at ≥ 0.98 once aligned correctly. align() refined each coarse candidate over the first second of the source only; a slip inside cycle 0 zeroed the true lag's score and a lag overlapping ~120 ms of tail dither (score 0.047) won, so every per-cycle window pointed at silence.

What changed (crates/audio/src/oracle.rs):

  • coarse candidates must overlap at least half the shorter signal (was 100 ms) — tail lags of a long capture are excluded outright;
  • refinement correlates over 3 s instead of 1 s;
  • candidates are ranked by raw NCC over their whole overlap (capped at 30 s), not by the refinement-window score.

Evidence.

Capture before after
run 418 (failed night) delay 15.87 s, mean NCC 0.009, 0/8 delay 3.794 s, mean NCC 0.860, 5/8 → PASS
run 416 (passing night) delay 3.716 s, 0.818, 6/8 unchanged

New regression test alignment_survives_a_damaged_first_second (long lead-in, damaged first cycle, 4 s dither tail) fails on the old code and passes now. Workspace clippy -D warnings clean; 378 tests pass on forgejo-runner. Also adds crates/audio/examples/oracle_replay.rs, the offline replay used for the diagnosis.

Harness-only change; no bridge runtime code touched. A live e2e dispatch of the four audio scenarios on this branch is linked below.

🤖 Generated with Claude Code

**Why.** Nightly #418 (2026-09-29) failed `audio_d2m_unenc` with mean NCC 0.009 although the audio crossed intact: replaying the artifact WAVs through the real oracle shows cycles 2–7 at ≥ 0.98 once aligned correctly. `align()` refined each coarse candidate over the first second of the source only; a slip inside cycle 0 zeroed the true lag's score and a lag overlapping ~120 ms of tail dither (score 0.047) won, so every per-cycle window pointed at silence. **What changed** (`crates/audio/src/oracle.rs`): - coarse candidates must overlap at least half the shorter signal (was 100 ms) — tail lags of a long capture are excluded outright; - refinement correlates over 3 s instead of 1 s; - candidates are ranked by raw NCC over their whole overlap (capped at 30 s), not by the refinement-window score. **Evidence.** | Capture | before | after | |---|---|---| | run 418 (failed night) | delay 15.87 s, mean NCC 0.009, 0/8 | delay 3.794 s, mean NCC 0.860, 5/8 → PASS | | run 416 (passing night) | delay 3.716 s, 0.818, 6/8 | unchanged | New regression test `alignment_survives_a_damaged_first_second` (long lead-in, damaged first cycle, 4 s dither tail) fails on the old code and passes now. Workspace clippy `-D warnings` clean; 378 tests pass on forgejo-runner. Also adds `crates/audio/examples/oracle_replay.rs`, the offline replay used for the diagnosis. Harness-only change; no bridge runtime code touched. A live e2e dispatch of the four audio scenarios on this branch is linked below. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(audio/oracle): stop global alignment locking onto a capture's silent tail
Some checks failed
CI / test (pull_request) Failing after 9m13s
CI / test (push) Failing after 9m43s
E2E (live) / e2e (push) Successful in 10m53s
df5b22ad38
Nightly #418 (2026-09-29) failed audio_d2m_unenc with mean NCC 0.009 while
the audio had crossed intact (cycles 2-7 >= 0.98 once aligned). align()
refined each coarse candidate over the first second of the source only, so
a slip inside cycle 0 zeroed the true lag's score and a lag overlapping
~120 ms of tail dither (score 0.047) won; every per-cycle window then
pointed at silence.

- coarse candidates must overlap at least half the shorter signal (was
  100 ms), which removes tail lags of a long capture outright;
- refinement correlates over 3 s instead of 1 s;
- candidates are ranked by raw NCC over their whole overlap (capped at
  30 s), not by the refinement-window score.

Regression test: long lead-in + damaged first cycle (35 ms slip, and a
phase-inverted cycle) + 4 s of tail dither; fails on the old code (delay
lost), passes now. Replaying the failed night's WAVs through the fixed
oracle: delay 3.794 s, mean NCC 0.860, 5/8 -> PASS; the passing night is
unchanged (0.818, 6/8).

Also adds crates/audio/examples/oracle_replay.rs, the offline replay used
for that diagnosis.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
robocub force-pushed fix/oracle-align-overlap-floor from df5b22ad38
Some checks failed
CI / test (pull_request) Failing after 9m13s
CI / test (push) Failing after 9m43s
E2E (live) / e2e (push) Successful in 10m53s
to 2fc038b0a9
Some checks failed
CI / test (push) Failing after 10m36s
E2E (live) / e2e (push) Successful in 12m49s
CI / test (pull_request) Failing after 17m26s
2026-10-01 14:08:23 +00:00
Compare
ci: allow clippy::double_must_use on the two async_trait items (Rust 1.99 clippy)
Some checks failed
CI / test (push) Has been cancelled
E2E (live) / e2e (push) Has been cancelled
CI / test (pull_request) Has been cancelled
9425fd3110
Rust 1.99.0 (2026-09-28) reached the CI toolchain today; its clippy denies
double_must_use under -D warnings on the #[must_use] that the async_trait
macro attaches to its generated boxed-future methods, breaking every
workspace clippy run. The attribute is the macro's, so the lint is allowed
on exactly those two items.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
robocub force-pushed fix/oracle-align-overlap-floor from 9425fd3110
Some checks failed
CI / test (push) Has been cancelled
E2E (live) / e2e (push) Has been cancelled
CI / test (pull_request) Has been cancelled
to 8ff2bf3f69
All checks were successful
CI / test (push) Successful in 11m0s
E2E (live) / e2e (push) Successful in 14m49s
CI / test (pull_request) Successful in 13m51s
2026-10-01 14:22:05 +00:00
Compare
robocub merged commit f4ec2503eb into master 2026-10-01 16:05:32 +00:00
Sign in to join this conversation.
No reviewers
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
nether/nether-voicebridge!140
No description provided.