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

Open
opened 2026-11-24 15:54:59 +00:00 by geiyiliyabumo · 2 comments
geiyiliyabumo commented 2026-11-24 15:54:59 +00:00 (Migrated from github.com)
Contributor

Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T15:54:59Z.


Summary

Audits crates/victory-hle/src/modules/apu.rs and expands deterministic synthetic unit tests from 1 to 19 passing tests (encoding synthetic two-tone Opus packets at test time via opus_pure, zero fixtures/game data). Production code is unchanged.

Because external PR creation is currently restricted (collaborators_only), the CI-green branch is ready on my fork for cherry-pick / review:

  • Branch: geiyiliyabumo/VIctory@test/hle-apu-audit
  • Commit: geiyiliyabumo/VIctory@d10138b (based on main ffe310e)

Tests Added (crates/victory-hle/src/modules/apu.rs, 1 -> 19 tests)

  • Connect validation matrix (nulls, streams 0/501, commands_per_stream 0/17, memory 0, frames_per_output, E_NOTIMPL), 16-byte-aligned zeroed memory, event creation.
  • Activate channel checks, ALREADY_ACTIVE, decode determinism, first_frame/output-room clamping, planar DEINTERLEAVED_OUTPUT, mono + stereo-to-mono downmix, null/empty buffers, BAD_PACKET leaving title buffer untouched.
  • RESET, FIFO one-result-per-command, per-stream QUEUE_FULL & slot release, rejected-command accounting, identity echo, PENDING_RESULTS, null args on every export, and SIGNAL/auto-reset event behavior.

Verification (Windows 11 x64 MSVC)

  • rustfmt --edition 2024 --check crates/victory-hle/src/modules/apu.rs: PASS
  • cargo xtask policy: PASS (154 files ok)
  • cargo clippy -p victory-hle --all-targets --locked -- -D warnings (default + --features diagnostics): PASS (0 warnings)
  • cargo test -p victory-hle --locked -- apu::: 19 passed, 0 failed (victory-hle 112 + 1 passed)

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

<!-- greyfinch-sync:Marvisak/VIctory:issue:6585867786 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/1120). Originally posted by [geiyiliyabumo](https://github.com/geiyiliyabumo) on 2026-11-24T15:54:59Z. --- ### Summary Audits `crates/victory-hle/src/modules/apu.rs` and expands deterministic synthetic unit tests from 1 to **19 passing tests** (encoding synthetic two-tone Opus packets at test time via `opus_pure`, zero fixtures/game data). Production code is unchanged. Because external PR creation is currently restricted (`collaborators_only`), the CI-green branch is ready on my fork for cherry-pick / review: - **Branch**: `geiyiliyabumo/VIctory@test/hle-apu-audit` - **Commit**: `geiyiliyabumo/VIctory@d10138b` (based on `main` `ffe310e`) ### Tests Added (`crates/victory-hle/src/modules/apu.rs`, 1 -> 19 tests) - Connect validation matrix (nulls, `streams` `0`/`501`, `commands_per_stream` `0`/`17`, `memory` `0`, `frames_per_output`, `E_NOTIMPL`), 16-byte-aligned zeroed memory, event creation. - Activate channel checks, `ALREADY_ACTIVE`, decode determinism, `first_frame`/output-room clamping, planar `DEINTERLEAVED_OUTPUT`, mono + stereo-to-mono downmix, null/empty buffers, `BAD_PACKET` leaving title buffer untouched. - `RESET`, FIFO one-result-per-command, per-stream `QUEUE_FULL` & slot release, rejected-command accounting, identity echo, `PENDING_RESULTS`, null args on every export, and `SIGNAL`/auto-reset event behavior. ### Verification (Windows 11 x64 MSVC) - `rustfmt --edition 2024 --check crates/victory-hle/src/modules/apu.rs`: **PASS** - `cargo xtask policy`: **PASS** (`154 files ok`) - `cargo clippy -p victory-hle --all-targets --locked -- -D warnings` (default + `--features diagnostics`): **PASS** (0 warnings) - `cargo test -p victory-hle --locked -- apu::`: **19 passed, 0 failed** (`victory-hle` `112 + 1` passed) *AI-assisted; synthetic tests only, no game files.*
Vittorio17 commented 2026-11-24 16:05:30 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Vittorio17 on 2026-11-24T16:05:17Z.


I'm working on this

<!-- greyfinch-sync:Marvisak/VIctory:comment:7137097552 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/1120#issuecomment-7137097552). Originally posted by [Vittorio17](https://github.com/Vittorio17) on 2026-11-24T16:05:17Z. --- I'm working on this
Marvisak commented 2026-11-25 10:07:56 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T10:05:19Z.


Automated triage for the maintainers.

Thanks. This adds tests only: crates/victory-hle/src/modules/apu.rs has 2 tests on main today, and production code is unchanged. Pull requests are open to everyone now, and your open PR #1212 already carries this branch (test/hle-apu-audit). Review and CI belong there, and this issue tracks it until #1212 is merged or closed. If main has moved under it, a rebase of #1212 onto current main will help it get reviewed.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7159206012 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/1120#issuecomment-7159206012). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T10:05:19Z. --- <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-24T16:05:17Z at=2026-11-25T09:50:38Z --> Automated triage for the maintainers. Thanks. This adds tests only: `crates/victory-hle/src/modules/apu.rs` has 2 tests on `main` today, and production code is unchanged. Pull requests are open to everyone now, and your open PR #1212 already carries this branch (`test/hle-apu-audit`). Review and CI belong there, and this issue tracks it until #1212 is merged or closed. If `main` has moved under it, a rebase of #1212 onto current `main` will help it get reviewed. --- _Generated by [Claude Code](https://claude.ai/code)_
Sign in to join this conversation.
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
Marvisak/VIctory#1120
No description provided.