Tests: xapu decodes a title's Opus packets into its output buffer (#294) #1283
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1283
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1283"
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?
@ersinhf on GitHub · 2026-11-24 14:16 UTC · original
ersinhf:tests/xapu-opus→main· +200 −0 · 1 files · 1 commits · open#294 made the console decoder (xapu) decode the Opus packets a title sends, but no test reaches that path:
acphal's tests only cover a Process without an Activate (silence). This adds an integration test that drives the exports the way a title does, so it needs no change tocrates/xcl/src. Follow-up to #294 (its author asked for these tests there).What is in it
crates/xcl/tests/xapu_opus.rs(new, one commit):XApuConnect,XApuEnqueueCommandwith the commands written as bytes at the retail title's offsets (Activate: channels at +24, 48000 at +56; Process: one raw Opus packet and a float output buffer),XApuDequeueResult. The packets are the repo's 440 Hz libopus ones (MONO_HYBRID_20MSinopus.rs). Two tests:xapu_decodes_the_titles_opus_packets_into_its_buffer: Activate (mono), 25 Process withfirst_frame312 on the first → 648 frames, then 960 each; nothing left past the frames written; the 440 Hz tone (Goertzel, asopus.rsmeasures it);xapu_decode_errorsunchanged; silence after Deactivate; a second Activate (the decoder is reset, not rebuilt) gives the same samples as the first decoderxapu_writes_unaligned_buffers_and_ignores_unknown_streams: an output buffer one byte off a 4-byte boundary is decoded into and nothing outside it is written; a stream the connection does not have gets silence and leaves stream 0 decoding in sequenceskipping: no Opus decoder) whenopus::is_available()is false, like theopus.rstests. Thexapu_packets_decodedcheck is>=because the counters are global and the two tests run in parallel.Tested
stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17 (SDK 10.0.26100.0); noXCL_SAMPLE_*set; Opus through Windows' MSOpusDecoder930e8b4plus this test:cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4(debug): 753 passed, 0 failed, 41 ignored; the same in release (--release): 753 passed, 0 failed, 41 ignoredgpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware29fb6b7(the commit before it, where xapu answered silence; the twoxaudio2::stats()checks taken out because those counters came with #294) both tests fail –first_frame (the pre-skip) is left out(960 frames, 648 expected) anddecoded into the unaligned bufferRegression run
crates/xcl/tests/.Not tested
opus.dll, the Wine path): only Windows' decoder was used hereAI use
🤖 Generated with Claude Code
@DavidM1911 on GitHub · 2026-11-24 14:18 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --test xapu_opus: 2 passed, 0 failed.Thanks!
@thehollowedone on GitHub · 2026-11-24 14:22 UTC · original
Independent stereo XApu check on
c529525, Windows 11 build 26300, Ryzen 7 9800X3D, Rust 1.99.1 MSVC, debug. XCL selected Windows’MSOpusDecoder.I fed the five in-tree stereo CELT packets through the PR’s XApu command helpers. The first packet returned 648 frames after the 312-frame pre-skip and the remaining packets returned 960 each. The decoded left channel favored 440 Hz over 880 Hz by 212×, and the right favored 880 Hz over 440 Hz by 109×, using the same Goertzel measurement as the mono fixture. The output guards stayed intact, the unused tail was silent, and reactivation produced identical PCM. All ten packets across the two passes decoded with zero errors.
Both stock tests and the added stereo check passed with zero skips. Synthetic audio only. AI-assisted. Codex (GPT-6, exact variant unavailable) wrote and ran the scratch fixture and drafted this report.
@DavidM1911 on GitHub · 2026-11-24 16:04 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib -- --test-threads=1: all passed, 0 failed, 21 ignored.Thanks!
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.