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

Open
opened 2026-11-26 04:20:26 +00:00 by github-bot · 2 comments
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 15:54 UTC · original

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.

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 15:54 UTC · [original](https://github.com/Marvisak/VIctory/issues/1120) ### 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.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:20:26 +00:00
Author
Owner

@⁠Vittorio17 on GitHub · 2026-11-24 16:05 UTC · original

I'm working on this

**@⁠Vittorio17** on GitHub · 2026-11-24 16:05 UTC · [original](https://github.com/Marvisak/VIctory/issues/1120#issuecomment-7137097552) I'm working on this
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 10:05 UTC · original

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

**@⁠Marvisak** on GitHub · 2026-11-25 10:05 UTC · [original](https://github.com/Marvisak/VIctory/issues/1120#issuecomment-7159206012) <!-- 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)_
This discussion has been locked. Commenting is limited to contributors.
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#1120
No description provided.