HLE: bridge ID3D12Device before direct ResetDevice and cache D3D11 companion #1677
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!1677
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1677"
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?
@eizispark on GitHub · 2026-11-24 19:12 UTC · original
eizispark:fix/mfplat-d3d12-bridge→main· +169 −43 · 1 files · 1 commits · openMFResetDXGIDeviceManagerXpreviously tried callingIMFDXGIDeviceManager::ResetDevicedirectly withpDevicebefore checking whetherpDeviceimplementsID3D12Device. Under XCL'snullD3D12 backend (NullObj::QueryInterfaceanswersS_OKto every IID, includingIID_ID3D11DeviceandIID_ID3D10Multithread), systemmfplat.dllacceptedNullObjdirectly and stored it insideIMFDXGIDeviceManager, causing subsequentLockDevice(IID_ID3D11Device)calls to fail withMF_E_UNEXPECTED(0xC00D36BB).In addition,
MFResetDXGIDeviceManagerXcreated a new companionID3D11Device(D3D11CreateDevice+VIDEO_SUPPORT) on every call rather than reusing the companion D3D11 device for the adapter LUID.What is in it
crates/xcl/src/hle/mfplat.rs: checkdevice_unk.cast::<ID3D12Device>()before falling back to directIMFDXGIDeviceManager::ResetDevice, cache multithread-protected companionID3D11Deviceinstances per adapter LUID (recreating only ifID3D11Device::GetDeviceRemovedReasonat vtable slot 39 reports removal), and addnull_d3d12_device_bridges_to_real_d3d11_and_reuses_companion_per_luidcovering both thenullD3D12 backend and hardwareID3D12DeviceLUID caching.Tested
32.0.32015.16001), AMD Ryzen 7 9800X3D, Windows 11 x64,rustc 1.100.0 (0ef1bc386 2026-11-09)(stable-x86_64-pc-windows-msvc), debug (unit + workspace tests) and release (60 s title smoke).cargo test -p xcl --lib mfplat: 4 passed, 0 failed, 0 ignored (null_d3d12_device_bridges_to_real_d3d11_and_reuses_companion_per_luidverified failing with0xC00D36BB(MF_E_UNEXPECTED) before the fix).cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 777 passed, 0 failed, 41 ignored (SKIPPED GPU/SDK tests: 3 —test_title_draws_with_a_root_signature_under_the_debug_layer: nod3d12SDKLayers.dll;heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows;uploads_start_from_each_subresources_state: no D3D12 debug layer).Regression run
main(9e3831e1f570d3646e53ab753b19ec07eb8f1485):PR (
8c441777a6c06197b00baca498790ae02f4154f5):Not tested
MFResetDXGIDeviceManagerX+MFSourceReader/ hardware MFTs) undergraphics = "null"or Linux / Wine.d3d12SDKLayers.dllnot installed on this machine).AI use
mfplat.rsandd3d11.h(ID3D11DeviceVtbl), wrote the regression test and fix, ran the workspace test suite andscripts/smoke.ps1runs, and drafted this PR description.@DavidM1911 on GitHub · 2026-11-24 21:37 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@frenziedcoder on GitHub · 2026-11-24 21:54 UTC · original
NVIDIA test report for
8c44177: the full workspace and a smoke pair on the retail title, next to @DavidM1911's RTX 3060 Ti library run above. Full suite green, the PR's own test passes, and a clean smoke pair (1654 vs 1655 frames).Tested
stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head8c441777a6c06197b00baca498790ae02f4154f5, no local changes.cargo build --workspace && cargo test --workspace -- --test-threads=4(debug): 777 passed, 0 failed, 41 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).test_title_draws_with_a_root_signature_under_the_debug_layerreports ok, but this machine has no D3D12 debug layer (debug layer requested but unavailable … (0x887A002D)), so it ran without the layer and is no evidence either way.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 (
9e3831e, this PR's merge base withmain):this PR:
Not tested: hardware Media Foundation video playback;
graphics = "null"; the debug-layer test (see above); Linux / Wine; 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.
@JJAutoCompare on GitHub · 2026-11-25 04:38 UTC · original
XCL PR #1677 verification
Head
8c441777a6c06197b00baca498790ae02f4154f5, clean detached checkout. The PR changescrates/xcl/src/hle/mfplat.rsonly.STOR-WINLAB ran Windows 11 Enterprise Evaluation x64, build 26200, on an AMD Family 23 Model 113 CPU with Intel Arc A770 Graphics and driver 32.0.101.9175. DXC was 1.9.2609.5. Rust was 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc).
Tested
cargo build --workspaceandcargo test --workspace --no-runboth exited 0 outside the Arc mutex. The latter built 19 test executables.cargo test -p xcl --lib hle::mfplat::tests -- --test-threads=1ran underInvoke-ArcTest.ps1withXCL_ADAPTER=A770. All 4 passed, with 0 failed, 0 ignored and no skip markers. For both null and hardware D3D12 inputs, the new test locked a genuine D3D11 device and confirmed the same COM identity across two Media Foundation managers for each LUID. The token test rejected an invalid token and checked device-handle usability after a valid reset. The other tests checked null arguments and export routing.cargo test --workspace --no-fail-fast -- --test-threads=4ran once under the same mutex and adapter setting withRUST_TEST_NOCAPTURE=1. Cargo exited 101. The 20 summaries inpr1677-suite.logcover 19 test binaries and 1 doctest target and total 761 passed, 16 failed and 41 ignored. The bundled title logged a passing MFPlat reset check.Workspace failures and skips
The library had 15 shader-recompiler failures. Eleven reported
CreateComputePipelineStatereturning0x80070057, and four reported output mismatches. The end-to-end title test failed its dynamic depth-bias check. The log contains 6 lines beginning withSKIPPED. Two cited wave64, two cited the D3D12 debug layer, one cited tiled resource tier and one cited heap windows. Those skips provide no coverage.Not tested
A matched main run, retail-title smoke or playback, other GPU vendors, and forced device removal during a companion reset.
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
pr1677-suite.logand published.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.