dsp: a CPU-fallback reverb tail for convolution streams, behind VICTORY_GUESS_DSP #146

Merged
m0rff merged 1 commit from upstream-pr/146 into main 2026-11-26 22:38:23 +00:00
m0rff commented 2026-11-26 20:36:18 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-26T20:36:18Z.


Issue #17: chad.dll convolution streams always returned digital silence, since the title's own impulse response arrives in the hardware's own partitioned frequency-domain layout, which is not documented, so StreamDesc::ir was never read.

This adds the CPU fallback the issue suggests as an alternative: a fixed, deterministic ~100 ms synthetic decaying-noise tail, convolved with the input per channel and scaled by the command's gains, with the tail carried across blocks so it does not click at every block boundary. It is a guess, so it stays off by default behind VICTORY_GUESS_DSP=1; default behaviour (silence) is unchanged.

Also adds VICTORY_TRACE_DSP=1, which logs the leading floats of a convolution stream's own StreamDesc::ir at activation, to help a future run with the real game settle what format that data is actually in (and possibly replace this guess with the real thing).

No game needed to test this: the convolution math, the history carry-over across block boundaries, and the exported XDspSubmitCommand path are all covered by new/updated unit tests in modules::dsp::tests.

  • cargo test -p victory-hle -p victory -p victory-gpu -p xtask: pass
  • cargo clippy --workspace --all-targets --target x86_64-pc-windows-gnullvm -- -D warnings: clean
  • cargo xtask policy: pass
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5516817183 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/146). Originally posted by [m0rff](https://github.com/m0rff) on 2026-11-26T20:36:18Z. --- Issue #17: `chad.dll` convolution streams always returned digital silence, since the title's own impulse response arrives in the hardware's own partitioned frequency-domain layout, which is not documented, so `StreamDesc::ir` was never read. This adds the CPU fallback the issue suggests as an alternative: a fixed, deterministic ~100 ms synthetic decaying-noise tail, convolved with the input per channel and scaled by the command's gains, with the tail carried across blocks so it does not click at every block boundary. It is a guess, so it stays off by default behind `VICTORY_GUESS_DSP=1`; default behaviour (silence) is unchanged. Also adds `VICTORY_TRACE_DSP=1`, which logs the leading floats of a convolution stream's own `StreamDesc::ir` at activation, to help a future run with the real game settle what format that data is actually in (and possibly replace this guess with the real thing). No game needed to test this: the convolution math, the history carry-over across block boundaries, and the exported `XDspSubmitCommand` path are all covered by new/updated unit tests in `modules::dsp::tests`. - `cargo test -p victory-hle -p victory -p victory-gpu -p xtask`: pass - `cargo clippy --workspace --all-targets --target x86_64-pc-windows-gnullvm -- -D warnings`: clean - `cargo xtask policy`: pass
LakshanSivakumar commented 2026-11-26 22:38:20 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T22:38:20Z.

Review: APPROVED


Reviewed and tested together with the other open PRs on main (macOS x86_64 workspace tests, the setup shell tests, and Windows clippy). Thanks!

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:review:6081183366 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/146#pullrequestreview-6081183366). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-26T22:38:20Z. **Review:** APPROVED --- Reviewed and tested together with the other open PRs on main (macOS x86_64 workspace tests, the setup shell tests, and Windows clippy). Thanks!
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
LakshanSivakumar/Native-Victory-macOS!146
No description provided.