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

Manually merged
github merged 1 commit from github-bot/gh-146 into main 2026-11-27 00:51:19 +00:00 AGit
Owner

@⁠m0rff on GitHub · 2026-11-26 20:36 UTC · original
m0rff:fix/dsp-reverb-cpu-fallback → main · +262 −10 · 3 files · 1 commits · merged 2026-11-26 22:38 UTC

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
**@⁠m0rff** on GitHub · 2026-11-26 20:36 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/146) `m0rff:fix/dsp-reverb-cpu-fallback` → `main` · +262 −10 · 3 files · 1 commits · merged 2026-11-26 22:38 UTC 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
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 block boundaries.
It is a guess (per AGENTS.md), 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:36:58 +00:00
github manually merged commit 0e2caa6627 into main 2026-11-27 00:51:19 +00:00
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-26 22:38 UTC · original · approved these changes

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

**@⁠LakshanSivakumar** on GitHub · 2026-11-26 22:38 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/146#pullrequestreview-6081183366) · **approved these changes** Reviewed and tested together with the other open PRs on main (macOS x86_64 workspace tests, the setup shell tests, and Windows clippy). Thanks!
This discussion has been locked. Commenting is limited to contributors.
No description provided.