[removed by author] #884
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/890"
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 shortside on 2026-11-24T07:44:03Z.
[removed by author]
Imported from ivall/xcl. Originally posted by crastinator on 2026-11-24T08:01:49Z.
Review: COMMENTED
Tested on Linux with Proton's Wine, in addition to the CrossOver run in the description: same failure on
main, fixed by this PR.Tested (head
76d2ff7, and merged ontomain1ec4c98: no conflicts)files/bin/wine, kernel write watches), with its own vkd3d-proton (stock, not the #257 patch) and DXVK v3.1.1-209dxgi;VKD3D_CONFIG=ignore_shared_fence; DXC 1.9.2609x86_64-pc-windows-msvc(clang-cl / lld-link 23.1.5, xwin SDK 10.0.26100), Rust 1.99.1, debug; the lib test binary run under Winemain1ec4c98,hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetimefails here too, withleft: 0, right: 12291atxaudio2.rs:1599. That is Proton's Wine giving a nullpCurrentBufferContext, the same as CrossOver.hle::xaudio2:: --test-threads=1, 3 runs each: head76d2ff79 passed / 0 failed every time. Merged onto1ec4c98, also 9 / 0 every time.main: 8 passed / 1 failed.Not tested
AI use
Update (merged onto
main930e8b4, vkd3d-proton v3.1 + #257 patch + #775's dxil-spirv,opus.dllfrom #257'sbuild-opus.sh)hle::xaudio2::9 passed / 0 failed in 3 runs, now includingopus_source_voice_decodes_and_manages_lifetime, which only reaches the check with an Opus decoder. The e2e test title's XAudio2 check passes as well.opus.dll, which is a stock Wine/Proton setup since there is noMSOpusDecoder.dllthere, the e2e test title still fails withOpus GetState: ctx=0x0, queued=1. The Opus voice then takes the silence fallback insubmit_source_buffer. That voice is not inDECODED_VOICES, soget_statenever reaches the new fallback, and the host's null context passes through. This might be out of scope here, but it should be named somewhere, since #257 makes libopus optional.Imported from ivall/xcl. Originally posted by ettehn on 2026-11-24T07:46:23Z.
Native Windows x64 verification on
76d2ff732e: all 9 XAudio2 unit tests passed with system XAudio2 2.9 (cargo test -p xcl --lib hle::xaudio2:: -- --test-threads=1 --nocapture). Both source-voice lifetime tests ran to completion, including the Opus path using Windows Media Foundation’s MSOpusDecoder. Neither took the missing-device/decoder skip.I also exercised the fallback separately. In a local test build I verified that the native GetState result had two queued buffers and a non-null current context, then cleared only that context immediately after the host call. The fallback returned the first submitted context for both codecs: 0x1001 for Opus and 0x3003 for XMA2. Both tests passed their subsequent playback callback and lifetime assertions. This second run simulates the missing host context on Windows; Wine and retail playback were outside this check.
OpenAI Codex (GPT-6.2 Astra) assisted with verification.
Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-24T07:57:31Z.
Tested on Linux / RADV, and it also fixes the Opus variant of the same test.
Tested
experimental-11.0-20261112), vkd3d-proton v3.1 + #257's patch, DXVKv3.1.1-209, DXC 1.9.2609.5,opus.dll(libopus) from #257'sbuild-opus.shthroughXCL_OPUS_DIR.76d2ff7(basebeaa245) againstmain1ec4c98, both release builds forx86_64-pc-windows-gnu, Rust 1.96.0.xcl-<hash>.exe hle::xaudio2:: --test-threads=1under Wine, 3 runs each:main: 7 passed, 2 failed every run:xma2_source_voice_decodes_and_manages_lifetime(left: 0, right: 12291) andopus_source_voice_decodes_and_manages_lifetime(left: 0, right: 4097, the sameGetStatecontext check).Not tested: the whole suite on the head, the
e2etest title's XAudio2 check (XMA2 GetState: ctx=0x0, queued=1), and Windows.AI use: T3 Code (Claude Opus 5.5) built both, ran the tests and wrote this comment. The runs are real, on the hardware above, and I checked the report before posting.
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T09:34:12Z.
Linux / AMD RDNA3 datapoint.
Merged state: head
76d2ff7onto main077ce40, clean merge.Full suite,
cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 707 passed, 9 failed, 41 ignored; failures are the known Wine-lane set from my #42 rows plus this rig's title-textures flake family (see #718). GetState oldest-buffer naming green.Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile,--test-threads=4. My Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Imported from ivall/xcl. Originally posted by vakaobr on 2026-11-24T10:27:46Z.
Test report from macOS (CrossOver/Wine), head
76d2ff7applied tomain9aec53d, with the cause on this host. Part of #258.Under CrossOver 26.3 (Wine 11.0),
GetStateon a source voice that has queued buffers but has not started returnspCurrentBufferContext = NULL. In upstream FAudio, 24.01 to 26.03 only name a buffer once it has started, and 26.04 namesqueued_buffers[0], as Windows does; Wine 11.0 bundles FAudio 25.12 (I did not check the FAudio inside the CrossOver binary). The XMA2 lifetime test'sleft: 0, right: 12291is that context (0x3003), not a sample count: the decode asserts before it pass. A temporary probe of the host's rawGetStateshowedctx=0x0 queued=2before Start and XCL's token after the firstOnBufferStart.Tested
x86_64-pc-windows-gnu(mingw-w64 GCC 16.2.0), debug.hle::xaudio2::tests, one per process (--exact <name> --test-threads=1), 3 runs each:main8 passed, 1 failed (xma2_source_voice_decodes_and_manages_lifetime), 0 ignored; with this PR 9 passed, 0 failed, 0 ignored.opus_source_voice_decodes_and_manages_lifetimereturns early in all runs ("MSOpusDecoder.dll not available"), so Opus under Wine is not covered here.max_by_keyinstead ofmin_by_keyin the fallback, the XMA2 test fails with0x4004(CTX_BAD).Not tested
AI use
Imported from ivall/xcl. Originally posted by mikebuckets171 on 2026-11-24T11:09:51Z.
Verified on a second host, on the
gnullvmtarget: the failure reproduces on three differentmaincommits and on the Mac port branch, and your commit fixes it on today'smain.Host: MacBook Pro M5 Pro (48 GB), macOS 27.2.1, CrossOver 26 with D3DMetal, Rosetta 2, Rust 1.100.0,
x86_64-pc-windows-gnullvmwith LLVM-MinGW 20261117 (clang 23.1.6),--release --locked, test binaries under Wine, one test per process (--exact <full test path> --nocapture --test-threads=1), a fresh data root for each run.hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime:1ec4c98(this PR's stated base)panicked at crates/xcl/src/hle/xaudio2.rs:1599:13: assertion left == right failed, left: 0, right: 12291, exit0x65beaa245(the base the description ran on)6efdabc(today's main)mac-on-main-wipdb065d8(the Mac port branch)6efdabc+ this PR's commit76d2ff7cherry-picked (clean, +16 / -2)0x0What the numbers are, since they read like a sample count and are not: the failing assert is
assert_eq!({ st.current_buffer_context } as usize, CTX_VALID)atxaudio2.rs:1599, withconst CTX_VALID: usize = 0x3003= 12291 - soleft: 0, right: 12291isGetState's current-buffer token, exactly as your description says. Everything before it passes on this host: both submits return S_OK,stats().xma_buffers_decodedis +1 andxma_decode_errors+1 (lines 1593-1594),buffers_queued == 2(1598). The assert sits beforestart(voice, 0, 0)at 1603, so what reads 0 is which bufferGetStatenames as current for a decoded voice with two buffers submitted and not yet started - not the XMA2 decode.Two things worth having on the record:
gnullvm/ LLVM-MinGW build here and on the clang-cl + xwin MSVC build the description used, and on the Mac port branch as well as on main - so the fix is not papering over a cross-build difference.6efdabcit applies cleanly (xaudio2.rs, +16 / -2, no conflicts) even though the PR's base is1ec4c98, and the PR reportsmergeable: true. So the pair above describesmaintoday against your change, not against a stale base.One methodological note, in case anyone else is about to run this pair: my first attempt at a "clean main" run looked like a pass, and it was a mistake of mine -
git checkout -- .restores the working tree from the index, so a staged cherry-pick stayed in the sources while HEAD still read as the base commit. Re-run in a worktree whose working tree was verified clean (I checked for the patch'sNEXT_BUFFER_SEQmarker in the file), and the base fails as above. Worth stating because "it passed here" would otherwise send someone down a dead end.Host: macOS 27.2.1 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal; local inference unloaded and the bottle's wineserver stopped for each run. AI use: GPT-6 Luna built every tree, ran the tests and drafted this comment; the counts, line numbers and codes are from those runs.
Imported from ivall/xcl. Originally posted by pablogonz12 on 2026-11-24T18:48:42Z.
Test report on RDNA4 / Wine:
76d2ff7merged ontomain9e3831e(clean merge). It fixes the XMA2 check of the e2e test title, and shows a second GetState gap that this change does not reach.Tested
x86_64-pc-windows-msvccross-built with cargo-xwin (static CRT), no Windows build.cargo test -p xcl --libbinary under Wine,--test-threads=4, with--skip jumps_to_outer_loop_heads_are_structured(it aborts the whole binary here, #1246): 722 passed, 4 failed, 21 ignored. The four:gpu_f64_roots,gpu_f64_math_random,gpu_nonfused_mad_and_mac_prevent_fma_contraction,gpu_depth_buffer_created_for_unordered_access_is_placed. None is XAudio2;hle::xaudio2alone: 9 passed.tests/e2e.rstest_title_runs_and_game_folder_is_untouched, run alone:main:[FAIL] XAudio2: ... XMA2 GetState: ctx=0x0, queued=1.[FAIL] XAudio2: ... Opus GetState: ctx=0x0, queued=1. The log of that run saysOpus: decoder = none (MSOpusDecoder.dll not available; no opus.dll ...)andOpus decoder unavailable ... falling back to silence. The voice is then not one of the decoded voices (it takes theXMAsilence path ofsubmit_source_buffer), soget_statehas no token to map and Wine returns a null context. Theget_statechange here only runs for voices inDECODED_VOICES. A host with libopus would take the decoded path; I did not run that.user32 ... not cloakedcheck (#1462 / #794), unrelated.Not tested
AI use
Imported from ivall/xcl. Originally posted by shortside on 2026-11-24T19:24:07Z.
@pablogonz12 thanks, that is the run this PR was missing (the test title does not get that far on my Mac). The second gap is real and wider than the Opus voice: under Wine any voice XCL does not decode reads that way before it starts, a plain PCM voice too. It is in #1698, stacked on this one, so this commit and the runs against it stay as they are. If you have a moment, the test title's
Opus GetStatecheck on your host (Wine without libopus) is the one thing I cannot run for it.Imported from ivall/xcl. Originally posted by crastinator on 2026-11-24T19:25:22Z.
@pablogonz12 matches what I see on RDNA2 under Wine (my review above, the Update section). The one case you didn't run, with libopus: given an
opus.dllfrom #257'sbuild-opus.sh(XCL_OPUS_DIR), the Opus voice takes the decoded path. The e2e test title's XAudio2 check then passes completely with this PR, andhle::xaudio2::is 9/9 withopus_source_voice_decodes_and_manages_lifetimeincluded (76d2ff7merged ontomain930e8b4, RX 6700 XT, Mesa 26.3.1, 3 runs). So what's left is only the silence fallback for an Opus voice when there's no decoder (stock Wine/Proton).Imported from ivall/xcl. Originally posted by pablogonz12 on 2026-11-24T22:41:28Z.
On the merged
main689f2dbthe unit test this touches is red on AMD/RADV/Wine:hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetimefails atcrates/xcl/src/hle/xaudio2.rs:1599,GetStatereturnscurrent_buffer_context = 0where the test wants the playing buffer's0x3003, both in the full run and run alone (--exact). RX 9070 XT, RADV/Mesa 26.3.1, Wine GE-Proton11-14,x86_64-pc-windows-msvcrelease with+crt-static.At your head
76d2ff7the same test passes here (722 passed, 4 failed, 21 ignored, the four being the known ones), so the test that main carries today is green with this PR and red without it.Written with Claude (Anthropic) assistance; tested by me on the hardware listed.
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T05:38:46Z.
Empirical test report (
76d2ff73)Verified the clean, detached PR #890 head
76d2ff732e8af140a40570f7de38289a16861380.Hardware / environment
rustc 1.100.0 (0ef1bc386 2026-11-09)(x86_64-pc-windows-msvc), DXC1.9.2609.5 (01b62ad47), Cargo test profile with debug info and incremental compilation disabled.Invoke-ArcTest.ps1. No Arc GPU mutex was acquired. The focused tests use no D3D12 or GPU and require a working Windows XAudio2 output endpoint.Commands and results
cargo test --workspace --no-runexited 0 and built the workspace test executables.cargo test -p xcl --lib source_voice_decodes_and_manages_lifetime -- --nocaptureran withXCL_ADAPTER=NONE_CPU_ONLYandRUST_TEST_NOCAPTURE=1, and exited 0. Cargo reported 2 passed, 0 failed, 0 ignored and 691 filtered out. The log contained 0 uppercaseSKIPPEDmarkers and 2 explicitskipping: no audio devicemessages. Counting those early returns as skips gives 0 behavioral passes and 2 skipped.Observed behavior
The PR changes runtime code and adds or modifies no tests. The filter selected the existing XMA2 and Opus source-voice tests. Both created a system XAudio2 2.9 engine, then received
0x80070490fromCreateMasteringVoiceand returned before submitting buffers. The checks for two queued buffers and the oldest buffer's original context therefore did not run.Not tested
The full GPU workspace suite and game smoke runs were omitted. The XMA2 and Opus
GetStateassertions and the Wine/CrossOver null-context fallback remain unverified.AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr890-focused.logand published.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T09:41:59Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by shortside on 2026-11-25T09:43:53Z.
@pablogonz12 thanks for the run. The Opus case you hit behind this one is the gap #1698 covers (it is stacked on this PR); a run of that on your setup would be very welcome.
Imported from ivall/xcl. Originally posted by pablogonz12 on 2026-11-25T09:50:44Z.
Ran the stacked head on Linux here.
e2ee5c0merged withmain568e7db(clean, no conflicts),cargo xwin test -p xcl --lib --release --target x86_64-pc-windows-msvc --target-dir target-static.--test-threads=4), filterxaudio2: 11 passed, 0 failed, 1115 filtered out.get_state_names_the_oldest_buffer_of_a_voice_that_is_not_decodedandxma2_source_voice_decodes_and_manages_lifetime. The run took the real path, not a skip:engine created (system XAudio2 2.9, flags 0x0)andXMA2 voice (1 ch., 48000 Hz) → real PCM16 decoding.main689f2dbalone (xma2GetState naming no context): with #890 + #1698 in the tree that assertion passes.Not tested: the full lib suite on this head, and any game run. Scope is the
xaudio2module. Written with Claude assistance.Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T20:19:32Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:25:32Z.
Triage (#1607) – head
76d2ff7#1698 is stacked on this PR (it contains this commit and adds the case of voices XCL does not decode), so it is not a duplicate. Main's
get_statestill only maps a non-null context, so the change is not on main.The diff adds no test, and a bug fix needs one that fails without it. #1698 has tests for the voices it covers, but not for this decoded-voice branch.
min_by_key(seq)overlive_buffersis correct because entries leave the map at OnBufferEnd.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Pull request closed