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

Open
AnastasisKon wants to merge 4 commits from upstream-pr/385 into main
AnastasisKon commented 2026-11-27 16:00:18 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-27T16:00:18Z.


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
<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5529556792 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/385). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-27T16:00:18Z. --- ## 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
AnastasisKon commented 2026-11-27 16:00:27 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-27T16:00:27Z.


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).

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7222743272 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/385#issuecomment-7222743272). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-27T16:00:27Z. --- 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).
LakshanSivakumar commented 2026-11-27 16:44:29 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T16:44:29Z.


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.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7223615757 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/385#issuecomment-7223615757). Originally posted by [LakshanSivakumar](https://github.com/LakshanSivakumar) on 2026-11-27T16:44:29Z. --- 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.
AnastasisKon commented 2026-11-27 21:42:18 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-27T21:42:18Z.


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.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7228681306 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/385#issuecomment-7228681306). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-27T21:42:18Z. --- 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 commented 2026-11-27 21:44:41 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-27T21:44:41Z.


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.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7228715784 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/385#issuecomment-7228715784). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-27T21:44:41Z. --- 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 commented 2026-11-27 22:04:57 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-27T22:04:57Z.


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 #384 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.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7229011166 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/385#issuecomment-7229011166). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-27T22:04:57Z. --- 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 #384 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 commented 2026-11-28 15:32:16 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T15:32:16Z.


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 #548); cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings clean; cargo xtask policy ok.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7241541718 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/385#issuecomment-7241541718). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-28T15:32:16Z. --- 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 #548); `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` clean; `cargo xtask policy` ok.
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/385:upstream-pr/385'
git switch 'upstream-pr/385'

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/385'
git switch 'upstream-pr/385'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/385'
git switch 'upstream-pr/385'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/385'
git switch 'main'
git merge --squash 'upstream-pr/385'
git switch 'main'
git merge --ff-only 'upstream-pr/385'
git switch 'main'
git merge 'upstream-pr/385'
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
LakshanSivakumar/Native-Victory-macOS!385
No description provided.