XAudio2: retain incomplete XMA frame continuations #1718
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1728"
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 ivall/xcl. Originally posted by hajduzsolt on 2026-11-24T19:58:05Z.
Runtime fix verified with unit tests and RX 9070 XT smoke run.
What is in it
Tested
cargo test -p xcl --lib xma2::tests -- --test-threads=2passed (8 passed).cargo test --workspace -- --test-threads=2passed; library tests: 815 passed, 22 ignored. Other test binaries also passed. Runtime GPU skips were not individually assessed in this run.Regression run
main:
PR:
Not tested
AI use
Imported from ivall/xcl. Originally posted by frenziedcoder on 2026-11-24T21:54:38Z.
NVIDIA test report for
14dec4b: the NVIDIA run the description lists as not tested. Full suite green, the PR's own test passes, and a clean smoke pair (1654 vs 1656 frames).Tested
stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head14dec4b98d4b45c2ab1ef820454d76a237780748, no local changes.cargo build --workspace && cargo test --workspace -- --test-threads=4(debug): 864 passed, 0 failed, 42 ignored; the PR's own test passes. SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).Regression run (
scripts/smoke.ps1 -Seconds 60, release, the retail title of #505 at its start screen;XCL_PSO_PRELOAD=0for both builds, because this machine's preload list holds the program of #1307)base (
6c89285, this PR's merge base withmain):this PR:
Not tested: an independently encoded frame across three or more packets; XMA itself in this title (its report shows Opus through
xapu, not XMA voices, at the start screen); AMD.AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report; I checked it.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T22:37:43Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored.Thanks!
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T03:55:14Z.
PR #1728 — XAudio2 XMA continuation verification
Verified head:
14dec4b98d4b45c2ab1ef820454d76a237780748(clean detached checkout).Environment
STOR-WINLAB, Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB (driver 32.0.101.9175, waves 8–32,
DoublePrecisionFloatShaderOps=0). DXC/DXIL 1.9.2609.5, rustc 1.100.0 (0ef1bc386 2026-11-09), unoptimized builds with debug info disabled.Tested
cargo build --workspaceandcargo test --workspace --no-runsucceeded.cargo test -p xcl hle::xma2 -- --nocaptureunder the Arc lock: 8 passed, 0 failed, 0 ignored, 0 explicit skips. The new regression passed. Across two incomplete continuation packets, the decoder retained the accumulated bits, produced no frame, and kept packet loss clear. The existing cross-packet streaming and XMA1/XMA2 reference-vector tests also passed.cargo test --workspace --no-fail-fast -- --test-threads=4under the Arc lock: 846 passed, 18 failed, 42 ignored, summed across 20 harness summaries. Cargo exited 101. The test title reported a pass for its XAudio2 check (XMA2/Opus decoding, PCM and callbacks).Workspace failures and skips
CreateComputePipelineStateerror 0x80070057, including double-precision cases. Four failed assertions covering fused FMA overflow, mip sampling, FP16 high-half preservation, and wave64 pixel reductions.SKIPPEDlines: two for unavailable wave64 and one for unavailable heap windows. These early returns earn no coverage.Not tested
No main baseline was run to establish whether the GPU failures predate this head. Retail-title smoke and sample-dependent checks were outside this run (
XCL_SAMPLE_*unset). D3D12 debug-layer coverage was unavailable (d3d12SDKLayers.dllabsent). No other adapters were tested.AI use
T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr1728-suite.logand published.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T06:17:12Z.
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T14:46:23Z.
Independent desktop NVIDIA verification of PR #1728 at head
b4484bc80226370d4aa0efb075150861374315f4(1commit; exact parent & merge-base:06c9f5505f63f10c5ec49ef932d75b2c28177324, pre-#2555ancestor ofmain).Environment
7956 MiBreported by D3D12, Wave32-only Ada), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200(Developer Mode off)rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.9.2609.5,--releaseTargeted tests & build (
b4484bc8)cargo test --release -p xcl --lib -- --nocapture incomplete_continuation_remains_buffered_for_the_next_packet(3 consecutive runs)1 passed; 0 failed; 0 ignored; 1222 filtered out× 3 (0.00s,0.00s,0.00s,0skipped)cargo test --release -p xcl --lib -- --nocapture hle::xma2::(3 consecutive runs)9 passed; 0 failed; 0 ignored; 1214 filtered out× 3 (0.00s,0.00s,0.00s,0skipped)cargo build --release -p xcl1m 47s, exit0,0new warnings inhle/xma2/mod.rs)Paired quiet 60 s retail smoke (
title: 29640639)Exact parent & merge-base (
06c9f5505f63f10c5ec49ef932d75b2c28177324, cached baseline on the same machine):PR #1728 (
b4484bc80226370d4aa0efb075150861374315f4):Limits of coverage
incomplete_continuation_remains_buffered_for_the_next_packetand the fullhle::xma2::suite (9/9,0skipped, including FFmpeg-matched XMA1/XMA2 vectors and cross-packet streaming) passed3/3, directly verifying thatStreamDecoder::decode_packet_stepkeeps incomplete continuation bits buffered inreservoirwithout prematurely decoding whennum_bits_prev_frame > remaining_packet_bits.0device removals,0crashes, steady 60 Hz); single-run frame/commit delta vs. the cached parent reflects normal startup variance.AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-27T18:00:20Z.
NVIDIA and AMD full-suite run, to go with the reports above by Decodere, since none of them covers AMD. Tested exact head
b4484bc8(on its base06c9f55).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace --no-fail-fast -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1254 passed, 0 failed, 44 ignored. SKIPPED (no wave64, no xgameruntime.dll):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,dispatch_chain_native_wave64_builds_whole,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,test_title_draws_with_a_root_signature_under_the_debug_layer,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.incomplete_continuation_remains_buffered_for_the_next_packet.XCL_ADAPTER=radeon),cargo test --workspace --no-fail-fast -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1265 passed, 0 failed, 46 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),test_title_draws_with_a_root_signature_under_the_debug_layer(no xgameruntime.dll).--skipleaves out tests that fail on main6089122atoo, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651), the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests,const_and_null_mask_operands_agree_with_hlsl_on_the_gpuandmask_ff0_and_flbit_agree_with_hlsl_on_the_gpu(follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
Imported from ivall/xcl. Originally posted by throny on 2026-11-28T14:12:49Z.
merge-check claim
head:
b4484bc802Imported from ivall/xcl. Originally posted by throny on 2026-11-28T14:26:35Z.
merge-check
base:
b937fbabhead:
b4484bc802merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2141 passed, 1 failed, 48 ignored (26 SKIPPED lines). The one failure is gpu::dxil::msaa_tests::direct_msaa_loads_precede_get_dimensions, which fails on main without this PR too (reported on #3093) and in every tree of this batch; the nine failures main had since #2959 are gone at
b937fbab. I did not runb937fbabalone: the last base-only run ise13d6250(2130 passed, 10 failed, 48 ignored).review: none blocking. The retained data cannot grow without bound: appending refuses anything past the maximum frame size (32 KiB), marks a packet loss and the next packet resets, and the reservoir is a fixed buffer. Not verified: the reference decoder, as far as I recall, decodes a cross-packet frame only when it is strictly smaller than the bits left, while this PR also decodes one that fills the packet exactly. Stale bits after a discontinuity get the next continuation appended, as before. The description names an overlap with #1460 in the same continuation code.
performance: none (the buffer exists already).
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-30T01:43:00Z.
merge-check claim
head:
b4484bc802Imported from ivall/xcl. Originally posted by relativespace2K on 2026-11-30T01:49:40Z.
merge-check
base:
53e85fb1head:
b4484bc802merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2788 passed, 7 failed, 49 ignored; failing: the five that also fail on base
53e85fb1alone (gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form,gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk,hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline,ram_budget::tests::windows_takes_a_working_set_maximum_and_lifts_it,two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobsin--test gpu_two_pass_cache_e2e), plushle::d3d12x::alloc_pool::tests::completion_queries_run_outside_allocator_state(allocator polling must not hold STATEatalloc_pool.rs:1793), which is not the PR's: it passes 3 of 3 alone on this merge, it passed in the base run and in three other merge runs of this same suite on this machine today, and the PR touches onlycrates/xcl/src/hle/xma2/mod.rs; it is aSTATE-lock check that another parallel test perturbs. The PR's new test passed. 13 SKIPPED lines, all environmental: no D3D12 debug layer / d3d12SDKLayers.dll, no heap windows, no GPU_UPLOAD, per-lane f16/f32 forms refused.review: no blocking finding; 34 lines in
crates/xcl/src/hle/xma2/mod.rs, every hunk read. The change refuses to decode a frame whose continuation was cut by the packet end:continuation_completecompares the continuation length with what the packet still holds before the clamp, the bits taken are still saved into the reservoir,packet_donestill ends the packet, and the frame is decoded on the next packet when the rest arrives. The exact-fit case (num_bits_prev_frame == remaining_packet_bits) keeps the old path and still decodes, which is what the>=clamp implies. The new test drives the same cut twice and asserts the reservoir keeps growing without a decode, so it fails without the fix. No duplicate: nothing else open or merged carries this change (#1728 is the only one), and #1607 has no group for it.performance: one comparison per packet; nothing else changes.
verdict: safe to merge
hardware / tool and model: AMD Radeon RX 6800 XT 16 GB (RDNA2, wave64), driver 32.0.21045.29003; Ryzen 5 5600, 32 GB RAM; Windows 10 IoT Enterprise LTSC 2024, 10.0.26100 build 26100.9974; Rust 1.100.0; DXC 1.9.2602.17; debug build. DeepSeek Harness coding agent, model DeepSeek V4.1 Flash.
Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-30T01:53:34Z.
merge-check
base:
53e85fb124head:
b4484bc802merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2791 passed, 3 failed, 49 ignored; SKIPPED: 30 (22 no wave64, 3 per-lane #1426 refused, 2 no heap windows, 2 no xgameruntime.dll, 1 cannot disable the driver cache 0x887A002D); failing: hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline (also fails on base
53e85fb1alone), test_title_runs_and_game_folder_is_untouched and incomplete_discovered_corpus_blocks_headless_title_entry (failed in the recreated worktree because xcl_testtitle.exe/testgame_mw.dll were not built there; also fail the same way on unbuilt base53e85fb1)review: none (read the full +34/-1 diff in crates/xcl/src/hle/xma2/mod.rs: keeps incomplete non-packet-loss XMA continuations buffered in the bit reservoir when num_bits_prev_frame > remaining_packet_bits instead of decoding a partial frame, while still decoding when num_bits_prev_frame == remaining_packet_bits; all 9 xma2::tests passed including incomplete_continuation_remains_buffered_for_the_next_packet; no duplicates found; note: touches the same continuation path as #1460; not tested: retail smoke on this machine or multi-packet real bitstream)
performance: none (adds one boolean check on continuation packets)
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4070 SUPER (32.0.16.2140), AMD Ryzen 7 7800X3D, Windows 11 Pro 26300, rustc 1.100.0, debug / Antigravity (Gemini 4 Hydrogen)