DSP: convolve reverb streams on the host #240
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!240
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-240"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Quat3rnion on GitHub · 2026-11-24 01:43 UTC · original
Quat3rnion:victory-dsp-reverb→main· +513 −10 · 3 files · 1 commits · openWhat
DSP convolution streams returned silence because the impulse-response layout
was unknown. The Xbox docs describe it: frequency-domain complex pairs split
into filter blocks of
blockFrameCountpairs, with an optional per-channelstereo IR. This adds a portable partitioned FFT convolver that decodes that
layout and wires it into
XDspSubmitCommand, so reverb returns are wet. FFTand IFFT streams still return silence; their buffers are spectra, not audio.
The console does not store the Nyquist bin, so it is reconstructed by
conjugate symmetry. A unity impulse therefore comes back within about 0.2
percent instead of exactly, and the convolver allocates block scratch per
call; both are noted in the code.
An AI tool wrote part of this change.
Tested
cargo test --workspacewith PR #112's Linux build fix applied locally (not part of this PR): 171 passed, 0 failed, 3 ignored. The convolution tests compare against direct time-domain convolution and exercise the API end to end.cargo check --target x86_64-pc-windows-gnu --workspace --testspasses. The Windows-only tests were not run; there is no Windows host here.Checklist
cargo fmton the changed files; workspace tests and Windows cross-check pass as described.cargo xtask policypasses (151 files ok). No game files or data from them were added.@jeremygold02 on GitHub · 2026-11-24 05:05 UTC · original
Thanks @Quat3rnion for the host-side DSP convolution path. I tested the open PR at head
9f77a9a27d620ee5f88384f7f98c517f2d38741fwith:Result: 6 passed, 0 failed, 0 ignored. The tests cover FFT round-tripping, impulse response copying, block convolution against a direct reference, stereo channel separation, gain ramps/reset, and malformed layout/buffer rejection. This validates the synthetic convolution math and buffer handling; it does not measure behavior with a live title audio stream or real host audio device.
Code: dsp_convolve.rs, dsp.rs.
@Yaekai on GitHub · 2026-11-24 16:28 UTC · original
Independent test & review on Windows 11 (Rust 1.98.1) at head
723f4a2:cargo test -p victory-hle --lib: 101 passed, 0 failed.1.0.2.1,--console series-s): audio runs cleanly with no panics or crashes.cargo clippy -p victory-hle -- -D warnings): fails with 5 lints indsp_convolve.rsbefore merge:dead_code:method reset is never useddead_code:function encode_ir is never usedundocumented_unsafe_blocks:unsafe block missing a safety commentneedless_range_loop:the loop variable frame is used to index spectrumneedless_range_loop:the loop variable bin is only used to index spectrum@MamaLeVrai on GitHub · 2026-11-24 17:41 UTC · original · edited 2026-11-24 18:26 UTC
Correction to my earlier comment: the CI run of this PR did run and fails on clippy. For reference, what
cargo clippy -p victory-hle --all-targets --locked -- -D warningsreports on this PR merged ontomainatffe310e:dsp_convolve.rs:173: methodresetis never used (dead code)dsp_convolve.rs:246: functionencode_iris never used (dead code)dsp.rs:179: unsafe block missing a safety commentdsp_convolve.rs:203and:256:needless_range_loop(the loop variables only indexspectrum)dsp_convolve.rs:328: castingf32tof32is unnecessary (test build)The tests pass. AI-assisted (Claude Code); no game data.
@Marvisak on GitHub · 2026-11-25 00:26 UTC · original
Automated triage for the maintainers.
Needs work. CI fails on clippy in
crates/victory-hle/src/modules/dsp_convolve.rs(needless_range_looparound line 256,unnecessary_castat line 328, and others).Beyond that, this changes emulation behaviour without stated evidence: the impulse-response layout
Convolver::newdecodes (complex pairs in blocks offrames, the Nyquist bin dropped, one run per channel with option bit 8) is asserted, while main's module doc indsp.rssays the layout is unknown. The new checks invalid()also change the activation call's return values, and the tests use the PR's ownencode_ir, so they only check that the code agrees with itself. Please cite public documentation for the layout or show it against the title's own data, and reword the comment that uses an identifier copied from the console SDK headers.CI: failing (clippy).
Generated by Claude Code
@kais7654 on GitHub · 2026-11-25 14:44 UTC · original
The check job fails on clippy -D warnings: five warnings in the new
code, no test failure. Rebased onto main 940d32f's layout with the
fixes and opened a PR: the needless_range_loop pair,
resetandencode_irmarked cfg(test) (their only callers are tests), the IRslice's SAFETY note moved against its unsafe block, and a doubled cast.
Your convolution tests all pass on a Windows host (victory-hle: 150/0),
so the change itself is sound — the head was one clippy pass away.
AI-assisted (Mistral Vibe).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.