HLE: expand synthetic unit tests for apu.rs (1 -> 19 tests) #1212
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1212"
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?
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T16:26:19Z.
Summary
Closes #1120
Full verification details and change notes are documented in #1120 (commit
d10138b, based onmainffe310e).Verification (Windows 11 x64 MSVC)
rustfmt --edition 2024 --checkon edited files: PASScargo xtask policy: PASS (zero game files/data)cargo clippy --all-targets --locked -- -D warnings(default +--features diagnosticswhere applicable): PASSAI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T17:59:59Z.
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-hlepasses, 113 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T18:11:21Z.
Review: APPROVED
Tested
d10138b9on Windows 11, RTX 5070, MSVC:cargo test -p victory-hlepasses on the head (112 passed). The tests are synthetic: they exercise connect, activate, process and dequeue, and the ABI layouts, with encoded tones.They read well. They don't merge into our fork, though: #1214 also appends tests to
apu.rs, and it changed the channel-count check to run before decoding. Once one of these two lands upstream, the other needs a rebase, and any test here that expects the old error path should be checked against #1214's order.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-24T20:33:42Z.
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.
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T21:07:16Z.
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.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:18:53Z.
Automated triage for the maintainers.
Merge candidate. This PR only adds tests to
crates/victory-hle/src/modules/apu.rsand leaves the production code alone. Each assertion agrees withXApuConnect,XApuEnqueueCommand,process,XApuDequeueResultandXApuGetResultCountinmain. 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 independentOpusDecoder, not against the code's own output. One test pinsE_NOTIMPLfor other processing kinds, whichmainmarks as a shortcut, so it will need updating if that shortcut is ever implemented. CI (check) passes.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-25T02:16:33Z.
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.Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:13:05Z.
Code review and Windows 11 verification at head
b9efa5e5be91merged cleanly ontomain(63bcca43c6a0):crates/victory-hle/src/modules/apu.rs:419-846+):opus_pure::OpusEncodervs referenceOpusDecoder) and synthetic malformed packets, with no external paths or files.XApuConnectvalidation/alignment/zeroing,RESULT_EVENTauto-reset,Activate/ALREADY_ACTIVE, mono/stereo/planar decoding, clamping,Reset, per-stream FIFO/QUEUE_FULL, malformed packet handling, andXApuGetResultCount. Each test uses an isolatedFixturewithDrop -> XApuDisconnectfor clean parallel execution.cargo xtask policy:191 files ok;cargo clippy --locked -p victory-hle --tests -- -D warnings: 0 warningsvictory-hle -- apu: 21/21 passed; fullvictory-hle -- --test-threads=1: 170/170 lib +fidelityfx+no_dll_plantingpassed.LGTM.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.