fix: log why an audio DSP stream renders silence (rule 3) #590

Open
KainanP wants to merge 1 commit from upstream-pr/590 into main
KainanP commented 2026-11-28 16:52:13 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by KainanP on 2026-11-28T16:52:13Z.


Refs #534 (the "Nothing is logged when it happens" part; rule 3).

The convolver from #534 is already on main: #563 brought Vice-Tay 4f15f09e, which includes Vice-Tay #293 (dsp_convolve.rs, opt-in VICTORY_DSP_CONVOLUTION=1). Without the switch, though, XDspSubmitCommand still writes silence and returns S_OK, and nothing in the log says so. AGENTS.md rule 3 asks for a log there.

Change (third_party/victory/crates/victory-hle/src/modules/dsp.rs only):

  • A stream whose output isn't computed gets a Fallback reason at activation. There are three:
    • a convolution stream while VICTORY_DSP_CONVOLUTION isn't 1;
    • an impulse response the host convolver refused;
    • a block transform other than convolution.
      A fourth reason comes at submit time: a convolution block whose input can't be read.
  • Each reason is logged once per process as a warn! that names it and says the command still reports S_OK. Once per process keeps the 47-commands-a-second path quiet.
  • The stream keeps its reason, which the deactivation debug! logs and the tests read.
  • Output, status words and HRESULTs don't change. Convolution stays opt-in, as Vice-Tay kept it, until the in-game comparison of Vice-Tay #259. Turning it on by default (the second box of #534) is left to that measurement.

Tests (cargo test -p victory-hle --lib dsp, from third_party/victory):

  • every_silent_stream_has_a_logged_reason (new): the reason for each kind and switch state, and that a reason is recorded once.
  • convolution_stream_as_the_title_drives_it now checks the stream's reason: ConvolutionOff with the switch unset, none when the switch is on (that IR is accepted), and Transform for a kind-2 stream. Neither test compiles on main.
  • 11 passed with VICTORY_DSP_CONVOLUTION unset, and 11 passed with it set to 1.
  • cargo test -p victory-hle --lib: 259 passed, 1 failed. The failure is lifecycle::tests::direct_close_suspends_and_exits, which fails the same way on main and isn't in a file this PR touches.
  • Full pytest (ANYXBOXX_REQUIRE_RUNTIME=1 python -m pytest -n auto): 1990 passed (RTX 4060 Laptop, run on main 66b92fbe with this PR and the two companion PRs from the same triage applied together).

AI use: written and tested by Claude Code (Claude Opus 5.5) for KainanP. The tests were run in both switch states.

🤖 Generated with Claude Code

<!-- greyfinch-sync:LooperSalty/AnyXboxX:issue:5542479762 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/590). Originally posted by [KainanP](https://github.com/KainanP) on 2026-11-28T16:52:13Z. --- Refs #534 (the "Nothing is logged when it happens" part; rule 3). The convolver from #534 is already on main: #563 brought Vice-Tay `4f15f09e`, which includes Vice-Tay #293 (`dsp_convolve.rs`, opt-in `VICTORY_DSP_CONVOLUTION=1`). Without the switch, though, `XDspSubmitCommand` still writes silence and returns `S_OK`, and nothing in the log says so. AGENTS.md rule 3 asks for a log there. **Change** (`third_party/victory/crates/victory-hle/src/modules/dsp.rs` only): - A stream whose output isn't computed gets a `Fallback` reason at activation. There are three: - a convolution stream while `VICTORY_DSP_CONVOLUTION` isn't `1`; - an impulse response the host convolver refused; - a block transform other than convolution. A fourth reason comes at submit time: a convolution block whose input can't be read. - Each reason is logged once per process as a `warn!` that names it and says the command still reports `S_OK`. Once per process keeps the 47-commands-a-second path quiet. - The stream keeps its reason, which the deactivation `debug!` logs and the tests read. - Output, status words and HRESULTs don't change. Convolution stays opt-in, as Vice-Tay kept it, until the in-game comparison of Vice-Tay #259. Turning it on by default (the second box of #534) is left to that measurement. **Tests** (`cargo test -p victory-hle --lib dsp`, from `third_party/victory`): - `every_silent_stream_has_a_logged_reason` (new): the reason for each kind and switch state, and that a reason is recorded once. - `convolution_stream_as_the_title_drives_it` now checks the stream's reason: `ConvolutionOff` with the switch unset, none when the switch is on (that IR is accepted), and `Transform` for a kind-2 stream. Neither test compiles on main. - 11 passed with `VICTORY_DSP_CONVOLUTION` unset, and 11 passed with it set to `1`. - `cargo test -p victory-hle --lib`: 259 passed, 1 failed. The failure is `lifecycle::tests::direct_close_suspends_and_exits`, which fails the same way on main and isn't in a file this PR touches. - Full pytest (`ANYXBOXX_REQUIRE_RUNTIME=1 python -m pytest -n auto`): 1990 passed (RTX 4060 Laptop, run on main `66b92fbe` with this PR and the two companion PRs from the same triage applied together). _AI use: written and tested by Claude Code (Claude Opus 5.5) for KainanP. The tests were run in both switch states._ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/590:upstream-pr/590'
git switch 'upstream-pr/590'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/590'
git switch 'upstream-pr/590'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/590'
git switch 'upstream-pr/590'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/590'
git switch 'main'
git merge --squash 'upstream-pr/590'
git switch 'main'
git merge --ff-only 'upstream-pr/590'
git switch 'main'
git merge 'upstream-pr/590'
git push origin 'main'
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
LooperSalty/AnyXboxX!590
No description provided.