Repository navigation
D3D12.X: guard null and unreadable pointers in graphics and compute PSO hooks - #2297
GustavoEllwanger wants to merge 1 commit into
Conversation
|
Regression run of Against the limits in CONTRIBUTING.md: 100 % of AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, AI use: Claude Code (Claude Opus 5.5) built both trees and ran |
5f0547e to
5f084cc
Compare
|
Thanks @Toons29 for the earlier RX 9070 smoke run on |
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
…#2296, xcl-dev#2297, xcl-dev#2320, xcl-dev#2323, xcl-dev#2329, xcl-dev#2333 Integrates shader heap-base addresses (xcl-dev#1803), fenced superseded texture unmaps (xcl-dev#2270), cross-queue VRAM heap reclamation fencing (xcl-dev#2275, using create_raw_fence under Wine), PcCall frame clamping and orphan PSO drop (xcl-dev#2296), PSO pointer guards (xcl-dev#2297), KickoffX idle spare list switching (xcl-dev#2320, preserving UnadoptGuard), console-list descriptor heap binding (xcl-dev#2323), ClearUnorderedAccessView PC handles (xcl-dev#2329), and dispatch_chain PSO retention (xcl-dev#2333).
|
Thanks @futurepro62 for running the full RTX 5070 Ti + AMD RDNA2 iGPU verification on |
Follow-up to #2015 for the graphics and compute PSO hooks (
CreateGraphicsPipelineState/CreateComputePipelineState).What is in it
crates/xcl/src/hle/d3d12x/real.rs:read_cstr_checked, shader/cached-PSO readability checks, validatedinput_layout_slice, andgraphics_desc_has_unreadable_pointers/compute_desc_has_unreadable_pointers.CachedPSO,InputLayout(including overflowingNumElementsand unreadable/unterminatedSemanticName), andStreamOutputpointers ingraphics_psoanddev_create_compute_psowithE_INVALIDARGinstead of crashing insideD3D12Coreor background copying.own_shader,own_compute,own_graphics,graphics_blob_key, and frame-trace layout logging against nullSemanticName(CStr::from_ptr(null)), unreadable/overflowingInputLayout, and unreadable shader/desc pointers.*ppvdereferences incompute_container,translated_compute_pso_once(including thedispatch_chainanddred::labelpaths), andtranslated_graphics_pso_oncewith!ppv.is_null() && !(*ppv).is_null()(validppPipelineState == NULLprobes returnS_FALSE).hle::d3d12x::real::pso_pointer_guard_tests.crates/xcl/src/hle/d3d12x/device_x.rs: usesreal::read_cstr_checkedinstead of rawCStr::from_ptrinnote_base.crates/xcl/tests/d3d12_pso_guards.rs: standalone integration tests (no game data, no vendor-specific skips) reproducing nullSemanticName, unreadable/overflowingInputLayout, cross-page unterminatedSemanticName, unreadable shader/CachedPSO/StreamOutputpointers, and unreadable top-level desc pointers via raw COM vtable calls.Tested
1.95.0 (59807616e 2026-04-14), DXC1.8.2502.11, debug build.32.0.16.1088)32.0.21042.62)origin/mainafc5ee8(head5f084cc).cargo test -p xcl --test d3d12_pso_guards -- --test-threads=1on RTX 5060): bothgraphics_and_compute_pso_unreadable_shader_and_desc_pointers_return_invalidargandgraphics_pso_null_semantic_name_does_not_crashcrashed with0xc0000005(STATUS_ACCESS_VIOLATION).5f084cc:cargo test -p xcl --lib hle::d3d12x::real::pso_pointer_guard_tests: 2 passed, 0 failed, 0 ignored.XCL_ADAPTER=5060 cargo test -p xcl --test d3d12_pso_guards --test d3d12_mesh_stream -- --test-threads=1(NVIDIA RTX 5060):d3d12_pso_guards3 passed,d3d12_mesh_stream3 passed (0 failed, 0 ignored, 0 skipped).XCL_ADAPTER=Radeon cargo test -p xcl --test d3d12_pso_guards --test d3d12_mesh_stream -- --test-threads=1(AMD Radeon RDNA2):d3d12_pso_guards3 passed,d3d12_mesh_stream3 passed (0 failed, 0 ignored, 0 skipped).5f084cc(XCL_ADAPTER=5060 cargo test --workspace -- --test-threads=4, NVIDIA RTX 5060): 1268 passed, 0 failed, 46 ignored (28 pre-existing runtimeSKIPPEDlines on wave32 NVIDIA / without D3D12 debug layer / Developer Mode / heap windows).5f084ccby @futurepro62 (comment):Not tested
scripts/smoke.ps1) on the rebased head5f084cc: I do not have a retail title package on this machine (@Toons29 ran a clean 60 s RX 9070 pair on the pre-rebase head5f0547ein comment, but rebasing ontoafc5ee8changed the head SHA). Any community tester with a retail title who can rerun pairedscripts/smoke.ps1blocks againstafc5ee8and5f084ccis welcome to post them.AI use
crates/xcl/src/hle/d3d12x/for pointer/bounds safety bugs, implemented the guards inreal.rsanddevice_x.rs, wrote the unit and integration tests, rebased ontoafc5ee8, reproduced the pre-fix0xc0000005crashes, and ran the dual-GPU and workspace test suites.