feat/phase3-perf-and-refactor - #115
Merged
Merged
Conversation
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.
Phase 3: parallel WAV export, route→services split, deprecation/logging cleanup
Performance & refactor pass on Phase 3 of the roadmap.
WAV export (the real "1–2 min" wait — generation is only ~0.5s):
concurrently (Chromium runs them on separate threads — ~2.48x on 8 cores),
sums them, and applies the master limiter once in a raw-WaveShaper pass that
reproduces makeMasterLimiter bit-for-bit. Output is mathematically identical
to the old single-pass mix. New offlineMix.test.ts covers the sum logic.
timeline on the main thread and starved the Transport scheduler, freezing
playback mid-export. MIDI export was never affected.
Route god-files split into services/ (handlers now thin, verified by 135 tests):
overlay, voice-leading + quality helpers) -> services/generation.py
writer, bridge-escape) -> services/song_builder.py
route->route generation import (both files now depend on the service).
Cleanups:
Electron console-message rewritten for the 36+ single-details signature.
priors, style-load for track names, ...); by-design fallbacks left as-is.
Also retired the obsolete "parallelize section generation" roadmap item
(measurement showed generation is ~0.5s, not the bottleneck) and added a
Chromium-over-CDP render benchmark (frontend/scripts/bench_render.mjs).
Tests: backend 135 green + ruff clean; frontend 92->96 green + vue-tsc/eslint clean.