Skip to content

Follow-up: use pYIN block transition structure for fast Viterbi#12

Draft
ssmall256 wants to merge 2 commits intogroupmm:mainfrom
ssmall256:pr/pyin-kron-transition-followup
Draft

Follow-up: use pYIN block transition structure for fast Viterbi#12
ssmall256 wants to merge 2 commits intogroupmm:mainfrom
ssmall256:pr/pyin-kron-transition-followup

Conversation

@ssmall256
Copy link
Copy Markdown

Summary

Follow-up to #11.

This PR switches the viterbi_impl="fast" pYIN path from building sparse predecessors by scanning a dense transition matrix to building them directly from the pYIN block transition model.

Dependency

What Changed

  • Added compute_transition_structure_pyin_block(...) in libf0/pyin.py
  • Fast path now uses this structured builder directly
  • Added/updated tests to verify structure and decode parity against dense-matrix-derived structure
  • Updated benchmark harness to use the structured builder

Validation

  • python -m pytest tests/test_algorithms.py -q (10 passed)
  • python -m py_compile libf0/pyin.py tests/test_algorithms.py scripts/benchmark_pyin_viterbi.py
  • PYTHONPATH=/Users/sam/Code/libf0 python scripts/benchmark_pyin_viterbi.py --warmup 1 --iters 2 --json
    • decoder parity: true
    • pyin parity (f0/time/conf): true

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.

1 participant