dsp: a VICTORY_DUMP_DSP capture stops at 64 MiB, and the docs say cap… #388

Open
github-bot wants to merge 4 commits from github-bot/gh-385 into main AGit
Owner

@⁠AnastasisKon on GitHub · 2026-11-27 16:00 UTC · original
AnastasisKon:vibe/dsp-dump-cap-9e73da → main · +69 −16 · 2 files · 4 commits · open

What this changes

VICTORY_DUMP_DSP appended each stream's blocks and outputs for as long as the title ran, so a capture grew without bound. Now:

  • each stream's block and output capture stops at 64 MiB (DUMP_MAX), with one warn! line when it reaches the cap, so a capture is the first bytes the title plays rather than an ever-growing file;
  • the one-shot impulse-response capture keeps its existing bound (ir_floats, DUMP_IR_MAX) and moved to its own append_ir, so the cap applies to the streaming files only;
  • docs/native-host.md says the capture files are the title's own audio data and are never committed, attached or posted — the same rule the shader dumps carry.

No issue claimed: found while reading crates/victory-hle/src/modules/dsp.rs for #17. I will open one and link it if you would rather have one.

How it was tested

  • cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory: all pass — victory 19, victory-hle 327, native_probe 17, victory-loader 29, 0 failed.
  • tools/macos/test-native.sh -p victory-hle -p victory -p victory-gpu -p xtask on the arm64 host (the native gate, with Apple's converter installed): victory-gpu 412 passed, 0 failed, 6 ignored; victory-hle 144 passed; victory 14; xtask 6.
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings: no warnings (victory-hle re-checked).
  • cargo xtask policy: 398 files ok.
  • Ran the game: not possible on this Mac, which has no copy of the title. What a run has to show: with VICTORY_DUMP_DSP=<dir> set, the block and output files stop at 64 MiB with one warning, the _ir.f32 capture is unchanged, and audio sounds as before.

The branch now carries current main (b998bb65) as a merge commit, so what this changes is down to dsp.rs (+70/−17) and native-host.md (+8/−2), and the failure the branch used to show — host_posix::ucrt::tests::dlls_that_are_not_the_c_runtime_are_left_alone, from its stale ucrt.rs — is gone.

Checklist

  • No game files, game code, disassembly listings or SDK files are included
  • Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md: no new guess; the convolution's synthetic tail is unchanged and still behind VICTORY_GUESS_DSP=1
  • New diagnostics are behind a VICTORY_* variable and documented: the cap belongs to the existing VICTORY_DUMP_DSP, and the docs now state the cap and the data-handling rule
**@⁠AnastasisKon** on GitHub · 2026-11-27 16:00 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/385) `AnastasisKon:vibe/dsp-dump-cap-9e73da` → `main` · +69 −16 · 2 files · 4 commits · open ## What this changes `VICTORY_DUMP_DSP` appended each stream's blocks and outputs for as long as the title ran, so a capture grew without bound. Now: - each stream's block and output capture stops at 64 MiB (`DUMP_MAX`), with one `warn!` line when it reaches the cap, so a capture is the first bytes the title plays rather than an ever-growing file; - the one-shot impulse-response capture keeps its existing bound (`ir_floats`, `DUMP_IR_MAX`) and moved to its own `append_ir`, so the cap applies to the streaming files only; - `docs/native-host.md` says the capture files are the title's own audio data and are never committed, attached or posted — the same rule the shader dumps carry. No issue claimed: found while reading `crates/victory-hle/src/modules/dsp.rs` for #17. I will open one and link it if you would rather have one. ## How it was tested - [x] `cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory`: all pass — victory 19, victory-hle 327, native_probe 17, victory-loader 29, 0 failed. - [x] `tools/macos/test-native.sh -p victory-hle -p victory -p victory-gpu -p xtask` on the arm64 host (the native gate, with Apple's converter installed): victory-gpu 412 passed, 0 failed, 6 ignored; victory-hle 144 passed; victory 14; xtask 6. - [x] `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings`: no warnings (`victory-hle` re-checked). - [x] `cargo xtask policy`: 398 files ok. - [ ] Ran the game: not possible on this Mac, which has no copy of the title. What a run has to show: with `VICTORY_DUMP_DSP=<dir>` set, the block and output files stop at 64 MiB with one warning, the `_ir.f32` capture is unchanged, and audio sounds as before. The branch now carries current `main` (`b998bb65`) as a merge commit, so what this changes is down to `dsp.rs` (+70/−17) and `native-host.md` (+8/−2), and the failure the branch used to show — `host_posix::ucrt::tests::dlls_that_are_not_the_c_runtime_are_left_alone`, from its stale `ucrt.rs` — is gone. ## Checklist - [x] No game files, game code, disassembly listings or SDK files are included - [x] Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md: no new guess; the convolution's synthetic tail is unchanged and still behind `VICTORY_GUESS_DSP=1` - [x] New diagnostics are behind a `VICTORY_*` variable and documented: the cap belongs to the existing `VICTORY_DUMP_DSP`, and the docs now state the cap and the data-handling rule
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 16:13:16 +00:00
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-27 16:00 UTC · original

What this changes
Follow-up to #287, its reviewer's two notes: the docs (module and docs/native-host.md) now say the capture files are the title's own audio data, never committed, attached or posted, as for the shader dumps; and a stream's block and output capture stops at 64 MiB (about a few minutes at 48 kHz, one line when it caps) instead of growing for as long as the title runs. The one-shot IR capture keeps its DUMP_IR_MAX bound.

How it was tested
cargo test -p victory-hle --target x86_64-unknown-linux-gnu (95 passed, including the existing dump-capture test through the capped path)
cargo clippy -p victory-hle --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings, cargo xtask policy (384 files ok)
A title run — for whoever runs it; the cap is a per-stream counter plus one comparison per appended block
Checklist
No game files, game code, disassembly listings or SDK files are included
No guesses about console behaviour
Existing diagnostic (VICTORY_DUMP_DSP), docs updated
Based on the hostless-fix branch (bottom commit is that PR's change).

**@⁠AnastasisKon** on GitHub · 2026-11-27 16:00 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/385#issuecomment-7222743272) What this changes Follow-up to #287, its reviewer's two notes: the docs (module and docs/native-host.md) now say the capture files are the title's own audio data, never committed, attached or posted, as for the shader dumps; and a stream's block and output capture stops at 64 MiB (about a few minutes at 48 kHz, one line when it caps) instead of growing for as long as the title runs. The one-shot IR capture keeps its DUMP_IR_MAX bound. How it was tested cargo test -p victory-hle --target x86_64-unknown-linux-gnu (95 passed, including the existing dump-capture test through the capped path) cargo clippy -p victory-hle --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings, cargo xtask policy (384 files ok) A title run — for whoever runs it; the cap is a per-stream counter plus one comparison per appended block Checklist No game files, game code, disassembly listings or SDK files are included No guesses about console behaviour Existing diagnostic (VICTORY_DUMP_DSP), docs updated Based on the hostless-fix branch (bottom commit is that PR's change).
github-bot referenced this pull request from a commit 2026-11-27 16:29:45 +00:00
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-27 16:44 UTC · original

Reviewed and merged locally with 384/385 together. Tests, Windows clippy, policy and the release build all pass. I haven't pushed it yet because it still needs a game run, and the machine's GPU memory was held by another run when I tried. I'll land it after that run.

**@⁠LakshanSivakumar** on GitHub · 2026-11-27 16:44 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/385#issuecomment-7223615757) Reviewed and merged locally with 384/385 together. Tests, Windows clippy, policy and the release build all pass. I haven't pushed it yet because it still needs a game run, and the machine's GPU memory was held by another run when I tried. I'll land it after that run.
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-27 21:42 UTC · original

Brought this branch up to current main (b998bb65) so its gate stops failing on a staleness that has nothing to do with the cap.

What changed on the branch: one merge commit, no conflicts. dsp.rs and native-host.md auto-merged onto the rewritten DSP; the result is dsp.rs +70/−17 and native-host.md +8/−2 against main, and nothing else. I re-read the merged code rather than trusting the auto-merge: DUMP_MAX, the Cell<u64> in Stream::dump, append_f32(dir, n, name, written, floats), append_ir and the dump_block callers all land coherently on the current file.

Gates on the merged tree: cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory passes 327 + 17 + 29 + 19, 0 failed — host_posix::ucrt::tests::dlls_that_are_not_the_c_runtime_are_left_alone passes now; clippy for x86_64-pc-windows-gnullvm is clean; cargo xtask policy says 398 files ok.

One nit I left alone rather than edit code someone else wrote: the old dump_ir doc paragraph ("Writes a convolution stream's own impulse response ... Off by default") now sits above append_ir, so append_ir carries two doc blocks and dump_ir has none. Moving those four lines back onto dump_ir is the fix; say the word and I will push it.

**@⁠AnastasisKon** on GitHub · 2026-11-27 21:42 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/385#issuecomment-7228681306) Brought this branch up to current `main` (`b998bb65`) so its gate stops failing on a staleness that has nothing to do with the cap. What changed on the branch: one merge commit, no conflicts. `dsp.rs` and `native-host.md` auto-merged onto the rewritten DSP; the result is `dsp.rs` +70/−17 and `native-host.md` +8/−2 against `main`, and nothing else. I re-read the merged code rather than trusting the auto-merge: `DUMP_MAX`, the `Cell<u64>` in `Stream::dump`, `append_f32(dir, n, name, written, floats)`, `append_ir` and the `dump_block` callers all land coherently on the current file. Gates on the merged tree: `cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory` passes 327 + 17 + 29 + 19, 0 failed — `host_posix::ucrt::tests::dlls_that_are_not_the_c_runtime_are_left_alone` passes now; clippy for `x86_64-pc-windows-gnullvm` is clean; `cargo xtask policy` says 398 files ok. One nit I left alone rather than edit code someone else wrote: the old `dump_ir` doc paragraph ("Writes a convolution stream's own impulse response ... Off by default") now sits above `append_ir`, so `append_ir` carries two doc blocks and `dump_ir` has none. Moving those four lines back onto `dump_ir` is the fix; say the word and I will push it.
It moved above append_ir when the two appends were split, so append_ir
carried two doc blocks and dump_ir had none. Comment move only.
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-27 21:44 UTC · original

Apple's Metal Shader Converter is installed on this Mac now (/usr/local/lib/libmetalirconverter.dylib), so the native gate runs whole here and I re-ran it on the merged tree: tools/macos/test-native.sh -p victory-hle -p victory -p victory-gpu -p xtask gives victory-gpu 412 passed, 0 failed, 6 ignored (the 10 that used to fail at dlopen are gone), victory-hle 144, victory 14, xtask 6. The earlier "victory-gpu could not be run" caveat in this description no longer applies; the body now records the full gate.

**@⁠AnastasisKon** on GitHub · 2026-11-27 21:44 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/385#issuecomment-7228715784) Apple's Metal Shader Converter is installed on this Mac now (`/usr/local/lib/libmetalirconverter.dylib`), so the native gate runs whole here and I re-ran it on the merged tree: `tools/macos/test-native.sh -p victory-hle -p victory -p victory-gpu -p xtask` gives victory-gpu 412 passed, 0 failed, 6 ignored (the 10 that used to fail at `dlopen` are gone), victory-hle 144, victory 14, xtask 6. The earlier "victory-gpu could not be run" caveat in this description no longer applies; the body now records the full gate.
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-27 22:04 UTC · original

One more commit after the copy you merged locally: 596314d5 moves the impulse-response doc paragraph back onto dump_ir — it had been left above append_ir when the two appends were split, so append_ir carried two doc blocks and dump_ir had none. Comment move only, no code line touched, and the gate still passes here. Pull it before landing.

While I am here: the VICTORY_TEXTURE_BACK question on #387 applies to this one too in a way worth knowing — nothing in the DSP path is behind a switch beyond VICTORY_DUMP_DSP itself, so this change acts in any run that sets it, which is what a capture run does.

**@⁠AnastasisKon** on GitHub · 2026-11-27 22:04 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/385#issuecomment-7229011166) One more commit after the copy you merged locally: `596314d5` moves the impulse-response doc paragraph back onto `dump_ir` — it had been left above `append_ir` when the two appends were split, so `append_ir` carried two doc blocks and `dump_ir` had none. Comment move only, no code line touched, and the gate still passes here. Pull it before landing. While I am here: the `VICTORY_TEXTURE_BACK` question on #387 applies to this one too in a way worth knowing — nothing in the DSP path is behind a switch beyond `VICTORY_DUMP_DSP` itself, so this change acts in any run that sets it, which is what a capture run does.
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 15:32 UTC · original

Merged current public main (26817285) into the branch (clean merge, no conflicts; new head 0e7ab8ca) to refresh it against the moved main.

Gates on the new head: cargo test -p victory-hle -p victory -p victory-gpu -p xtask (host) green; cargo test --target x86_64-apple-darwin -p victory-hle green on rerun (338 passed — one wait_on_address timing test flaked once under parallel Rosetta and passes in isolation and on rerun, same class as #552); cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings clean; cargo xtask policy ok.

**@⁠AnastasisKon** on GitHub · 2026-11-28 15:32 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/385#issuecomment-7241541718) Merged current public `main` (26817285) into the branch (clean merge, no conflicts; new head 0e7ab8ca) to refresh it against the moved main. Gates on the new head: `cargo test -p victory-hle -p victory -p victory-gpu -p xtask` (host) green; `cargo test --target x86_64-apple-darwin -p victory-hle` green on rerun (338 passed — one `wait_on_address` timing test flaked once under parallel Rosetta and passes in isolation and on rerun, same class as #552); `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` clean; `cargo xtask policy` ok.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/388/head:github-bot/gh-385'
git switch 'github-bot/gh-385'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-385'
git switch 'github-bot/gh-385'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-385'
git switch 'github-bot/gh-385'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-385'
git switch 'main'
git merge --squash 'github-bot/gh-385'
git switch 'main'
git merge --ff-only 'github-bot/gh-385'
git switch 'main'
git merge 'github-bot/gh-385'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.