Skip to content

dsp + golden net: prep for the encoder relocation (modular-backends part 3a/3b) - #3

Merged
vynulldev merged 3 commits into
mainfrom
encoder-relocation
Jul 7, 2026
Merged

dsp + golden net: prep for the encoder relocation (modular-backends part 3a/3b)#3
vynulldev merged 3 commits into
mainfrom
encoder-relocation

Conversation

@vynulldev

Copy link
Copy Markdown
Owner

Summary

Low-risk groundwork for relocating the Pioneer wire encoders (part 3c, a follow-up PR). Two things, both additive with zero behavior change:

  1. Extract a shared dsp package — the low-level signal-processing primitives the analyzer and the (soon-to-move) encoders both need.
  2. Complete the golden-hash safety net over every Pioneer wire encoder, so the byte-sensitive relocation can't silently change a single byte a deck renders.

Landing this first means part 3c is fully guarded before it starts.

What's in it

dsp/ (part 3a) — new stdlib-only package with BiquadCoeffs, ButterworthLow/ButterworthHigh, ApplyBiquad, and SplitBandsAndPeaks, moved out of analysis/waveform.go. SplitBandsAndPeaks is parameterized on its crossover frequencies (callers pass the analysis-level BandBassMidHz/BandMidTrebleHz) so dsp stays brand-agnostic. analysis (both waveform.go and bandwaveform.go) now imports it. Pure relocation.

Golden tests (part 3b) — byte-for-byte hash tests for the encoders that had none: GeneratePQT2, GenerateBeatGrid, GenerateBeatGridFromBeats, GeneratePSSI, GeneratePVB2, GeneratePVBR, against deterministic synthetic inputs (a fixed 120-BPM beat grid + phrase set) that isolate the encoder from the detector. Together with the existing PWV4/5/6/7 tests, all 10 Pioneer wire encoders are now locked.

docs/design/part3-encoder-relocation.md — the detailed 3a–3e plan (relocate encoders → flip to serve-time encoding), with the risk/verification per step and the real-CDJ smoke-test gate on the flow flip. Anchors the follow-up.

Why it's safe

  • No serving-path, cache, or encoder-logic change — only a code move + new tests.
  • The PWV4/5/6/7 golden hashes are unchanged (the dsp extraction is byte-identical), and the 6 new blob hashes are deterministic (verified -count=2).

Verification

  • go build ./... ✅ · go vet ./dsp/ ./analysis/ ✅ · gofmt -l clean ✅
  • go test ./analysis/ ./dsp/ ✅ — all 10 golden hashes byte-for-byte, plus the band-waveform / core.Analysis tests.

Next

Part 3c (move the encoders into link/prolink/anlz) and 3d (neutral cache + serve-time encoding) land as their own PR — the latter with a real-CDJ smoke test before merge. This PR just makes that move safe to attempt.

Where to look

dsp/biquad.go + dsp/bands.go are the whole new package; analysis/blob_golden_test.go shows the new guardrails; the plan doc frames what's coming.

vynulldev added 3 commits July 7, 2026 21:21
Move the biquad/Butterworth filters and the band-splitting peak extractor
(BiquadCoeffs, ButterworthLow/High, ApplyBiquad, SplitBandsAndPeaks) into a
new stdlib-only `dsp` package, so both the analyzer and the soon-to-move
Pioneer encoders can share them without depending on the whole analysis
package. SplitBandsAndPeaks is parameterized on its crossover frequencies
(callers pass the analysis-level BandBassMidHz/BandMidTrebleHz) to keep dsp
brand-agnostic.

Pure relocation — behavior unchanged; the PWV4/5/6/7 golden hashes and the
band-waveform tests are byte-for-byte identical.
Detailed staging (3a–3e) for moving the Pioneer wire encoders into
link/prolink and flipping to serve-time encoding, with the risk/verification
per step and the real-CDJ smoke-test gate on the flow flip. Anchors the
encoder-relocation branch alongside the modular-backends ADR.
… (part 3b)

Lock GeneratePQT2, GenerateBeatGrid[FromBeats], GeneratePSSI, GeneratePVB2,
and GeneratePVBR byte-for-byte against synthetic deterministic inputs (a
fixed 120-BPM beat grid + phrase set), completing the golden safety net over
the Pioneer wire encoders ahead of the 3c relocation.

Test-only.
@vynulldev
vynulldev merged commit fcc840e into main Jul 7, 2026
1 check passed
@vynulldev
vynulldev deleted the encoder-relocation branch July 7, 2026 21:38
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