D3D12.X: the hot list, resource and queue hooks look their PC slot up once #897
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/903"
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 mastrr9 on 2026-11-24T08:00:10Z.
Caches PC COM vtable slot indices per hot hook call site (
slot!(this, "Name")) incrates/xcl/src/hle/d3d12x/real.rsinstead of locking the globalCLASSESmutex and scanning method names on every draw, bind, map, unmap, render-target set, andExecuteCommandListscall:hot_methods_have_one_slot_in_every_version_of_their_interface) and that repeated draws/binds perform one lookup per call site (draws_and_pipeline_binds_look_their_slot_up_once).Tested
617.42/32.0.16.1742), Windows 11 Pro 25H2 (26200.9974),rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC debug, DXC Windows SDK10.0.26100.0,d3d12SDKLayers.dllinstalled0a1141e93c14dd348a9469ff7bad220d978e7908(HEAD3179fa00d420fafdab43b7ec484d1c04c1d8a8b6has an identical tree; only commit author metadata was updated after GitHub account rename)cargo build --workspace: clean (no new warnings; only pre-existingfetch_updatedeprecation warning)cargo test --workspace -- --test-threads=4: 717 passed, 0 failed, 41 ignoredSKIPPEDGPU tests:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64Regression run
Smoke run by @Toons29 in comment below: https://github.com/xcl-dev/xcl/pull/903#issuecomment-7151626764
Contributed by a community tester; the PR author did not run it. Both blocks are pasted as posted.
main:
PR:
Tester's setup and limits: AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.Tester's AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; the tester checked the blocks before posting.Not tested
AI use
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T09:34:31Z.
Heads-up: this branch now conflicts with main.
Rebuild today:
pull/903/head(29e85d2) onto current main (09940bb) hits a merge conflict incrates/xcl/src/hle/d3d12x/real.rs(main moved through the sparse/readback work since the branch was cut). CI is x86-windows only, so nothing here will catch it.Untested until rebase; happy to re-run on RDNA3 after it lands rebased.
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 mastrr9 on 2026-11-24T14:38:09Z.
@SlopTart Thanks for the heads-up! Rebased cleanly onto current
main(930e8b4, PR head0733369cc2e1389bd745e5f423b6939fce6efa07), keepingslot!(raw, "Reset")inreset_pc_allocator. Ready for your RDNA3 re-run whenever you have a moment (I'll re-run Windows RTX 5080 verification on this rebased head shortly too).Imported from ivall/xcl. Originally posted by mastrr9 on 2026-11-24T14:54:47Z.
Verified rebased head
0733369cc2e1389bd745e5f423b6939fce6efa07on Windows 11 / NVIDIA RTX 5080 (cargo test --workspace -- --test-threads=4: 753 passed / 0 failed / 41 ignored, 0 new warnings).Imported from ivall/xcl. Originally posted by mastrr9 on 2026-11-24T16:16:56Z.
Rebased cleanly onto latest
main(b7aa9f3, new head03f85e2875cd3f32b65ecf4011b9af4640128e15) and re-verified on Windows 11 / NVIDIA RTX 5080:cargo build --workspace: OK (0 new warnings)cargo test --workspace -- --test-threads=4: 772 passed, 0 failed, 41 ignoredImported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:08:19Z.
Regression run of
03f85e28on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 100 % of
main's frames, 100 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; I checked the blocks before posting.Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T06:02:58Z.
Empirical test report (
03f85e28)Tested xcl-dev/xcl PR #903 at
03f85e2875cd3f32b65ecf4011b9af4640128e15. The PR caches the PC vtable slot at selected D3D12.X hook call sites.Hardware / environment
1.100.0 (0ef1bc386 2026-11-09). DXC1.9.2609.5 (01b62ad47). Cargo used the unoptimized test profile with debug info and incremental compilation disabled.XCL_ADAPTER=NONE_CPU_ONLYandRUST_TEST_NOCAPTURE=1outsideInvoke-ArcTest.ps1.Commands and results
cargo test --workspace --no-runbuilt the workspace test executables and exited 0.cargo test -p xcl --lib hle::d3d12x::real::slot_cache_tests::exited 0. The log reports 2 passed, 0 failed, 0 ignored, 0SKIPPED, and 743 filtered out.Observed behavior
hot_methods_have_one_slot_in_every_version_of_their_interfacepassed. For each of the 15 named methods across five interface families, the slots found in the layout tables agreed on one nonzero index.draws_and_pipeline_binds_look_their_slot_up_oncepassed. The fake PC callbacks received all three draws and the three expected pipeline handles in bind order. The fixture asserted at most twoslot_oflookups across the six calls.Not tested
The full GPU workspace suite and game smoke runs were omitted. Live D3D12 device behavior and frame-time impact were outside this run.
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr903-focused.logand published.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T09:31:09Z.
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 github-actions[bot] on 2026-11-28T20:19:10Z.
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:27:56Z.
Triage (#1607) – head
03f85e2Main already has this change. Commit
f05846e7("D3D12.X: cache invariant slots in hot hooks", merged with #2959) adds the sameslot!macro andcached_slotfunction to real.rs, and 2987c19b'spc_slot!covers the draw hooks (cl_draw_instancedand others). None of the hooks this PR changes still callsslot_ofper call on main.Recommendation: close (superseded by main commit
f05846e7).AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:41:10Z.
Closing as superseded: this change is already on
main(f05846e7). main has the slot! macro and cached_slot in real.rs (f05846e7) and all 14 hot hooks the PR converts (Map, Unmap, WriteToSubresource, Close, Reset, draws, Signal, ExecuteCommandLists ...) use slot!/pc_slot! (2987c19b)Two independent checks found this: Foniass's close list on #1607 and ours against current
main. If something here is still missing onmain, say so and reopen it, or ask and I will.AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.
Pull request closed