Skip to content

Pin librosa <0.11 to protect voicing-gate calibration; fix fork HQ lane test stub - #2

Open
KhryptorGraphics wants to merge 2 commits into
mainfrom
claude/refine-local-plan-wbqqrf
Open

Pin librosa <0.11 to protect voicing-gate calibration; fix fork HQ lane test stub#2
KhryptorGraphics wants to merge 2 commits into
mainfrom
claude/refine-local-plan-wbqqrf

Conversation

@KhryptorGraphics

@KhryptorGraphics KhryptorGraphics commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Two fixes found while auditing the multi-speaker conversion path.

1. Pin librosa>=0.10,<0.11 (762f0b7)

librosa 0.11 changed pyin's voiced decision: white noise scores ~0.43 voiced fraction on 0.11 vs 0.0 on 0.10.2 (probed on both versions). Every multi-speaker routing gate — multi_speaker_merge_voiced_min and friends, calibrated on leads 0.76–0.87 vs keep-cases 0.14–0.51 — was measured on 0.10 semantics. With the previous open bound (librosa>=0.10), any fresh install, CI run, or redeploy resolving to 0.11 gets a silently mis-calibrated router and a failing test_multi_speaker_routing noise test.

  • requirements-runtime.txt: bound to >=0.10,<0.11 with a comment saying re-calibrate before raising it
  • _voiced_fraction docstring: notes the calibration coupling
  • requirements.lock: refreshed sha256 + line_count (follows the checker's runtime_requirement_count, now 32); scripts/check_dependency_contract.py passes with no errors

2. Fix test_fork_hq_lane stub signature (a4b67eb)

The quality-tiers change (8ad0500) made _convert_song_fork_hq call _extract_pitch(..., method=q['f0_method']), but the test's monkeypatched lambda kept the old (audio, sr) signature, so test_fork_hq_lane_is_stereo_and_mirrors_contract failed at HEAD with a TypeError. The stub now mirrors the real signature's optional kwarg.

Verification

  • test_separation_bridge + test_multi_speaker_routing + test_svc_fork_bridge: 71/71 pass under librosa 0.10.2
  • test_fork_hq_lane + test_web_conversion_metadata + test_conversion_workflow_api: 16/16 pass
  • scripts/check_dependency_contract.py: no errors
  • cd frontend && npm run build: clean
  • Not runnable in the audit container (expected to pass on the Jetson): 14 pipeline tests needing the HiFiGAN checkpoint, 4 platform-script tests needing the autovoice-thor conda env

🤖 Generated with claude-flow

https://claude.ai/code/session_01Vqqhm9yzsrG7rgmiMrBjC1


Generated by Claude Code

Summary by Sourcery

Preserve multi-speaker routing calibration across installations and restore fork HQ lane test compatibility.

Bug Fixes:

  • Pin librosa to the 0.10 release line to preserve the calibrated multi-speaker voicing-gate behavior.
  • Update the fork HQ lane test stub to support the pitch-extraction interface used by the conversion path.

Build:

  • Refresh the runtime dependency lock metadata for the librosa version constraint.

claude and others added 2 commits September 7, 2026 01:38
librosa 0.11 changed pyin's voiced decision: white noise scores ~0.43
voiced fraction vs 0.0 on 0.10.x (probed on both versions). Every
multi-speaker routing gate (multi_speaker_merge_voiced_min and friends,
calibrated leads 0.76-0.87 vs keep-cases 0.14-0.51) was calibrated on
0.10 semantics, so an environment resolving librosa>=0.10 to 0.11 gets
a silently mis-calibrated router (and a failing
test_multi_speaker_routing noise test). Bound the requirement to the
calibrated major, note the coupling in _voiced_fraction, and refresh the
requirements-runtime hash in the dependency contract lock
(line_count follows the checker's runtime_requirement_count, now 32).

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01Vqqhm9yzsrG7rgmiMrBjC1
The quality-tiers change made _convert_song_fork_hq pass
method=q['f0_method'] to _extract_pitch, but the test's monkeypatched
lambda still had the old (audio, sr) signature, so
test_fork_hq_lane_is_stereo_and_mirrors_contract failed at HEAD with a
TypeError. Mirror the real signature's optional kwarg in the stub.

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01Vqqhm9yzsrG7rgmiMrBjC1
@cr-gpt

cr-gpt Bot commented Sep 7, 2026

Copy link
Copy Markdown

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@sourcery-ai

sourcery-ai Bot commented Sep 7, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The PR protects multi-speaker routing behavior by pinning librosa to the pyin semantics used during calibration, documenting and locking that dependency contract, and fixes the fork HQ lane test stub to accept the new pitch-extraction keyword argument.

Sequence diagram for the fork HQ lane pitch extraction test

sequenceDiagram
    participant T as test_fork_hq_lane_is_stereo_and_mirrors_contract
    participant C as _convert_song_fork_hq
    participant E as _extract_pitch
    T->>C: invoke fork HQ conversion
    C->>E: _extract_pitch(audio, sr, method=q['f0_method'])
    E-->>C: pitch result
    C-->>T: stereo conversion result
Loading

Flow diagram for librosa calibration protection

flowchart LR
    R["requirements-runtime.txt: librosa>=0.10,<0.11"] --> P["librosa 0.10 pyin semantics"]
    P --> V["_voiced_fraction"]
    V --> G["Multi-speaker routing gates"]
    U["librosa 0.11"] --> W["Changed voiced decision"]
    W --> M["Mis-calibrated routing"]
Loading

File-Level Changes

Change Details Files
Constrain the runtime librosa version to preserve the voicing-gate calibration contract.
  • Pin librosa to >=0.10,<0.11 and document that recalibration is required before upgrading.
  • Refresh the locked dependency metadata and update the voiced-fraction documentation with the librosa-version coupling.
requirements-runtime.txt
requirements.lock
src/auto_voice/inference/singing_conversion_pipeline.py
Align the fork HQ lane test double with the production pitch-extraction call signature.
  • Allow the monkeypatched extractor to accept the optional f0 method keyword argument.
tests/test_fork_hq_lane.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@greptile-apps

greptile-apps Bot commented Sep 7, 2026

Copy link
Copy Markdown

Greptile Summary

The PR protects calibrated multi-speaker voicing gates by constraining librosa to its 0.10 behavior and updates the HQ-lane test stub for the current pitch-extraction signature.

  • Pins librosa below 0.11 and refreshes dependency-contract metadata.
  • Documents the coupling between _voiced_fraction calibration and librosa semantics.
  • Allows the HQ-lane test double to receive the pitch-extraction method, although the forwarding contract remains unasserted.

Confidence Score: 4/5

The PR appears safe to merge, with one non-blocking test-strengthening opportunity around HQ pitch-method forwarding.

The dependency constraint is consistently integrated and the production behavior is unchanged; the only accepted concern is that the revised stub can conceal a future loss of the f0_method argument.

Files Needing Attention: tests/test_fork_hq_lane.py

Important Files Changed

Filename Overview
requirements-runtime.txt Constrains librosa to the calibrated 0.10 release series with an explanatory comment.
requirements.lock Refreshes the runtime requirements hash and count consistently with the manifest.
src/auto_voice/inference/singing_conversion_pipeline.py Documents the version-sensitive pyin calibration without changing runtime behavior.
tests/test_fork_hq_lane.py Fixes the test-double signature but does not verify that a configured non-default pitch method is forwarded.

Reviews (1): Last reviewed commit: "fix: accept method kwarg in fork HQ lane..." | Re-trigger Greptile

Comment on lines +36 to +37
monkeypatch.setattr(p, "_extract_pitch",
lambda a, sr, method=None: np.zeros(8, np.float32))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Pitch forwarding remains untested

The updated stub accepts but ignores method, and this test does not configure an f0_method. It will therefore still pass if the HQ lane stops forwarding a selected pitch-extraction method. Exercise a non-None override and assert the received argument so this routing contract is protected.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants