refactor: decomposition and tests - #42
Open
Horuse wants to merge 7 commits into
Open
Conversation
…o, and cpal streams
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.
What does this PR do?
Decomposes monolithic files into focused submodules:
src-tauri/src/audio/pipeline/dag.rs(2,030 lines) ->src-tauri/src/audio/pipeline/dag/{staging, nodes, graph, builder, mod}.rs.src-tauri/src/audio/graph.rs(1,493 lines) ->src-tauri/src/audio/graph/{types, validate, tests, mod}.rs.src-tauri/src/audio/effects/mod.rs(1,094 lines) ->src-tauri/src/audio/effects/{controls, registry, instantiate, mod}.rs.src-tauri/src/commands.rs(870 lines) ->src-tauri/src/commands/{pipeline, devices, apps, plugins, virtual_devices, network, updater, audio_files, debug, helpers, mod}.rs.Deduplicates cross-platform boilerplate:
unique_named) unified insrc-tauri/src/audio/device/mod.rs.src-tauri/src/audio/system_audio/mod.rs.src-tauri/src/audio/pipeline/output/cpal_speaker.rs.src-tauri/src/audio/pipeline/input/cpal_input.rs.Fixes Graphic EQ Phase Cancellation DSP bug:
Comprehensive Audio Quality & Invariant Test Suite:
src-tauri/tests/(audio_quality.rs,boundary_and_precision.rs,pipeline_scenarios.rs) covering bit-exact bypass, runtime parameter updates, resampler transparency, limiter brickwall ceilings, compressor release ballistics, declicker impulse suppression, and multi-node pipeline simulations.bun run testscript running cargo test suite with--test-threads=1to prevent concurrent native plugin loading crashes.Architectural & Design Documentation:
docs/RULES.md.docs/UI.md.Why is this the right approach?
cpal_speaker.rsandcpal_input.rspreserves platform-specific device logic while eliminating redundant code.Checklist
bun run checkpassescargo check --manifest-path src-tauri/Cargo.tomlpassesbun run formatleaves the tree cleanDspWorker::runPlatform coverage
bun run test(130 unit tests, 29 audio quality tests, 21 boundary and precision tests, 12 pipeline scenarios)cargo check,bun run check,bun run generate, and full integration test suite verifying DSP algorithms, gain scaling, resamplers, pipeline routing, and EQ flatness.Touches
src-tauri/src/audio/pipeline/output/cpal_speaker.rsandsrc-tauri/src/audio/pipeline/input/cpal_input.rswhich unify shared stream setup for macOS, Linux, and Windows CPAL backends.