HLE: expand synthetic unit tests for apu.rs (1 -> 19 tests) #1212

Open
github-bot wants to merge 1 commit from github-bot/gh-1212 into main AGit
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 16:26 UTC · original
geiyiliyabumo:test/hle-apu-audit → main · +679 −0 · 1 files · 1 commits · open

Summary

Closes #1120

Full verification details and change notes are documented in #1120 (commit d10138b, based on main ffe310e).

 crates/victory-hle/src/modules/apu.rs | 679 ++++++++++++++++++++++++++++++++++
 1 file changed, 679 insertions(+)

Verification (Windows 11 x64 MSVC)

  • rustfmt --edition 2024 --check on edited files: PASS
  • cargo xtask policy: PASS (zero game files/data)
  • cargo clippy --all-targets --locked -- -D warnings (default + --features diagnostics where applicable): PASS
  • Targeted & crate unit/GPU tests: PASS

AI-assisted; synthetic tests only, no game files.

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 16:26 UTC · [original](https://github.com/Marvisak/VIctory/pull/1212) `geiyiliyabumo:test/hle-apu-audit` → `main` · +679 −0 · 1 files · 1 commits · open ### Summary Closes #1120 Full verification details and change notes are documented in #1120 (commit `d10138b`, based on `main` `ffe310e`). ```text crates/victory-hle/src/modules/apu.rs | 679 ++++++++++++++++++++++++++++++++++ 1 file changed, 679 insertions(+) ``` ### Verification (Windows 11 x64 MSVC) - `rustfmt --edition 2024 --check` on edited files: **PASS** - `cargo xtask policy`: **PASS** (zero game files/data) - `cargo clippy --all-targets --locked -- -D warnings` (default + `--features diagnostics` where applicable): **PASS** - Targeted & crate unit/GPU tests: **PASS** *AI-assisted; synthetic tests only, no game files.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:23:55 +00:00
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 17:59 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at d10138b: cargo test -p victory-hle passes, 113 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 17:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/1212#issuecomment-7140009986) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at d10138b: `cargo test -p victory-hle` passes, 113 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠upipibi on GitHub · 2026-11-24 20:33 UTC · original

Duplicate check: this PR and #1137 have the same diff (681 changed lines, no differences) and commits by the same author (给伊莉雅补魔). Only one of the two needs review; the other can be closed.

**@⁠upipibi** on GitHub · 2026-11-24 20:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/1212#issuecomment-7143734218) Duplicate check: this PR and #1137 have the same diff (681 changed lines, no differences) and commits by the same author (给伊莉雅补魔). Only one of the two needs review; the other can be closed.
Author
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 21:07 UTC · original

Thanks @⁠upipibi for flagging this! Just to clarify provenance: this PR (#1212) is the original author PR (authored by geiyiliyabumo, already reviewed/approved by @⁠mercuryVM). #1137 was opened by another account (@Vittorio17) using our commit from our fork branch, so #1212 is the canonical one to keep.

AI-assisted; synthetic tests only, no game files.

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 21:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/1212#issuecomment-7144502587) Thanks @⁠upipibi for flagging this! Just to clarify provenance: this PR (#1212) is the original author PR (authored by `geiyiliyabumo`, already reviewed/approved by @⁠mercuryVM). #1137 was opened by another account (`@Vittorio17`) using our commit from our fork branch, so #1212 is the canonical one to keep. *AI-assisted; synthetic tests only, no game files.*
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:18 UTC · original · edited 2026-11-25 03:22 UTC

Automated triage for the maintainers.

Merge candidate. This PR only adds tests to crates/victory-hle/src/modules/apu.rs and leaves the production code alone. Each assertion agrees with XApuConnect, XApuEnqueueCommand, process, XApuDequeueResult and XApuGetResultCount in main. The tests cover the connect argument ranges, zeroed memory and the optional event, refused activations, first_frame/frame_count/output-room clamping, deinterleaved and mono output, BAD_PACKET, the decoder history reset, per-stream queue limits and the auto-reset result event. The decode checks compare against an independent OpusDecoder, not against the code's own output. One test pins E_NOTIMPL for other processing kinds, which main marks as a shortcut, so it will need updating if that shortcut is ever implemented. CI (check) passes.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/1212#issuecomment-7149420736) · edited 2026-11-25 03:22 UTC <!-- victory-triage v1 head=b9efa5e5be914628401f636b23cec3ad4a26ffd1 verdict=merge-candidate at=2026-11-25T03:23:00Z --> Automated triage for the maintainers. **Merge candidate.** This PR only adds tests to `crates/victory-hle/src/modules/apu.rs` and leaves the production code alone. Each assertion agrees with `XApuConnect`, `XApuEnqueueCommand`, `process`, `XApuDequeueResult` and `XApuGetResultCount` in `main`. The tests cover the connect argument ranges, zeroed memory and the optional event, refused activations, `first_frame`/`frame_count`/output-room clamping, deinterleaved and mono output, `BAD_PACKET`, the decoder history reset, per-stream queue limits and the auto-reset result event. The decode checks compare against an independent `OpusDecoder`, not against the code's own output. One test pins `E_NOTIMPL` for other processing kinds, which `main` marks as a shortcut, so it will need updating if that shortcut is ever implemented. CI (`check`) passes. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-25 02:16 UTC · original

Rebased cleanly onto \main\ (\ccfb029). \cargo test -p victory-hle --locked modules::apu::tests\ (20 passed, 0 failed), \cargo clippy -p victory-hle --all-targets --locked -- -D warnings, and \cargo xtask policy\ all pass.

**@⁠geiyiliyabumo** on GitHub · 2026-11-25 02:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/1212#issuecomment-7150521978) Rebased cleanly onto \main\ (\ccfb029\). \cargo test -p victory-hle --locked modules::apu::tests\ (20 passed, 0 failed), \cargo clippy -p victory-hle --all-targets --locked -- -D warnings\, and \cargo xtask policy\ all pass.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 01:13 UTC · original

Code review and Windows 11 verification at head b9efa5e5be91 merged cleanly onto main (63bcca43c6a0):

  • Code & isolation audit (crates/victory-hle/src/modules/apu.rs:419-846+):
    • All 18 new unit tests use purely synthetic sine-wave Opus packets (opus_pure::OpusEncoder vs reference OpusDecoder) and synthetic malformed packets, with no external paths or files.
    • Covers ABI layout, XApuConnect validation/alignment/zeroing, RESULT_EVENT auto-reset, Activate/ALREADY_ACTIVE, mono/stereo/planar decoding, clamping, Reset, per-stream FIFO/QUEUE_FULL, malformed packet handling, and XApuGetResultCount. Each test uses an isolated Fixture with Drop -> XApuDisconnect for clean parallel execution.
  • Verified (Windows 11, Rust 1.98.1):
    • cargo xtask policy: 191 files ok; cargo clippy --locked -p victory-hle --tests -- -D warnings: 0 warnings
    • victory-hle -- apu: 21/21 passed; full victory-hle -- --test-threads=1: 170/170 lib + fidelityfx + no_dll_planting passed.

LGTM.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 01:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/1212#issuecomment-7179551031) Code review and Windows 11 verification at head `b9efa5e5be91` merged cleanly onto `main` (`63bcca43c6a0`): - **Code & isolation audit (`crates/victory-hle/src/modules/apu.rs:419-846+`)**: - All 18 new unit tests use purely synthetic sine-wave Opus packets (`opus_pure::OpusEncoder` vs reference `OpusDecoder`) and synthetic malformed packets, with no external paths or files. - Covers ABI layout, `XApuConnect` validation/alignment/zeroing, `RESULT_EVENT` auto-reset, `Activate`/`ALREADY_ACTIVE`, mono/stereo/planar decoding, clamping, `Reset`, per-stream FIFO/`QUEUE_FULL`, malformed packet handling, and `XApuGetResultCount`. Each test uses an isolated `Fixture` with `Drop -> XApuDisconnect` for clean parallel execution. - **Verified (Windows 11, Rust 1.98.1)**: - `cargo xtask policy`: `191 files ok`; `cargo clippy --locked -p victory-hle --tests -- -D warnings`: 0 warnings - `victory-hle -- apu`: **21/21 passed**; full `victory-hle -- --test-threads=1`: **170/170 lib + `fidelityfx` + `no_dll_planting`** passed. LGTM.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/1212/head:github-bot/gh-1212'
git switch 'github-bot/gh-1212'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1212'
git switch 'github-bot/gh-1212'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1212'
git switch 'github-bot/gh-1212'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1212'
git switch 'main'
git merge --squash 'github-bot/gh-1212'
git switch 'main'
git merge --ff-only 'github-bot/gh-1212'
git switch 'main'
git merge 'github-bot/gh-1212'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1212
No description provided.