link/prolink: relocate the Pioneer wire encoders out of analysis (modular-backends part 3c)#4
Merged
Merged
Conversation
…ep 1) Split AnalyzeTrack into DSP (brand-neutral) followed by an installed Encoder that fills the Pioneer wire blobs (waveforms, beat grid, PQT2, PSSI). analysis knows only the Encoder interface + a package-level default (the built-in pioneerEncoder), so the encoders can move to link/prolink next without inverting the dependency; SetEncoder swaps the implementation. Byte-safe: the encode sequence and inputs are unchanged — all 10 golden hashes and the full analysis suite pass. Relocating pioneerEncoder and the Generate* functions to link/prolink is the next commit.
…rt 3c prep) Rename previewPoints, anlzPreviewPoints, colorPreviewPoints, maxHeight, previewMaxHeight, fftSize, and detailEntriesPerSec to exported names so the encoders can reference them once relocated to link/prolink. Pure rename — byte-neutral, all 10 golden hashes unchanged.
…t 3c) Move the Pro DJ Link waveform/PQT2/PSSI/PVB2/PVBR generators and the pioneerEncoder into a new link/prolink package, leaving analysis as DSP plus the neutral core.Analysis projection. AnalyzeTrack delegates to the installed Encoder (main installs prolink.NewEncoder() at startup); the direct callers in dbserver/api/tools switch to prolink. The encoder tests move with the code (they'd cycle if left in package analysis). Kept in analysis where a non-serving consumer needs them without inverting the dependency: the beat-grid encoders (GenerateBeatGrid[FromBeats] — used by the ANLZ import path, so prolink calls them via analysis and no logic is duplicated) and the ANLZ container / VBR-seek helpers (WrapANLZ, VBRSeekIndex, section IO — used by dbserver/export/import). Those relocate later, once the rekordbox import/export is extracted. Byte-safe: all 10 colour-waveform + blob golden hashes unchanged; analysis, prolink, api, and dbserver suites pass. analysisRate is exported as AnalysisRate so the relocated tests share the DSP rate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part 3c of the modular-backends refactor: move the Pioneer (Pro DJ Link) wire-format encoders out of
analysisinto a newlink/prolinkpackage, leavinganalysisas pure DSP plus the neutralcore.Analysisprojection. Byte-safe with zero behavior change — the golden-hash net over all 10 encoders is unchanged, and no serving-path logic is touched, so no deck is needed to merge.What's in it (3 commits)
AnalyzeTracksplits into DSP followed by an installedEncoderinterface;analysisknows only the interface +SetEncoder.pioneerEncoder+ their tests move tolink/prolink;maininstallsprolink.NewEncoder()at startup;dbserver/api/toolscallprolink.*.Moved to
link/prolinkThe waveform generators (PWV4/5/6/7),
GeneratePQT2,GeneratePSSI,GeneratePVB2,GeneratePVBR,pioneerEncoder(+NewEncoder()), and all the encoder tests (they'd form an import cycle if left inpackage analysis).Deliberately kept in
analysisThings with a non-serving consumer that would otherwise invert the dependency: the beat-grid encoders (
GenerateBeatGrid[FromBeats], used by the ANLZ import path —prolinkcalls them across the package, so there's a single source of truth and no duplicated logic) and the ANLZ container / VBR-seek helpers (WrapANLZ,VBRSeekIndex, section IO — used bydbserver/export/import). These relocate when the rekordbox import/export is extracted (a later step).Why it's safe
No cache, serving-path, or encoder-logic change — just relocation + delegation. The 10 golden-hash tests (PWV4/5/6/7 + PQT2 + beat-grid ×2 + PSSI + PVB2 + PVBR) are byte-for-byte identical.
Verification
go build ./...,go vet,gofmt -lclean.go test ./analysis/ ./link/prolink/ ./dsp/ ./api/ ./dbserver/all pass, all 10 golden hashes unchanged.analysisRatewas exported toAnalysisRateso the relocated tests share the DSP rate. History preserved viagit mv.Not in this PR (next)
Part 3d — the flow flip: cache neutral
core.Analysis, encode at serve time, repoint the ~14 serving reads, slimResult. That one changes live behavior and gets a real-CDJ smoke test before merge.Where to look
link/prolink/is the new package (encoders + tests);analysis/encoder.goholds theEncoderinterface +SetEncoder;main.goinstalls the encoder.