D3D12.X: check writability in note_signaled and remove per-frame allocations in WaitFrameEventX #2692
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!2692
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2692"
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?
@Decodere on GitHub · 2026-11-26 06:27 UTC · original
Decodere:fix-frame-note-signaled-writable-and-zero-alloc→main· +232 −20 · 1 files · 1 commits · openWhat is in it
Hardens
note_signaledagainst non-writable output pointers and removes per-frame heap allocations, unnecessaryArc::clonetraffic, and O(N) ring-buffer shifts on theWaitFrameEventX/mark_flippedhot path incrates/xcl/src/hle/d3d12x/frame.rs.note_signaled: Replacescrate::gpu::shader::readable(out, 4)withwritable(p, len).writablechecks aK32QueryWorkingSetExfast path (resident_and_writable, up to 16 pages, treating onlyflags & 1 != 0 && protect != 0entries as resident so non-resident orprotect == 0pages fall through cleanly) and falls back toVirtualQuery, requiringMEM_COMMIT, noPAGE_GUARD, and a writable page protection (PAGE_READWRITE,PAGE_WRITECOPY,PAGE_EXECUTE_READWRITE, orPAGE_EXECUTE_WRITECOPY). Read-only, execute-read, guard, no-access, reserved-only, null, and cross-page RW->RO targets are safely skipped without touching pages or triggering guard faults.WaitFrameEventX: Replacesancillary'sVec<HANDLE>with a stack-allocatedAncillaryHandles([HANDLE; 63]+len, implementingDeref<Target = [HANDLE]>andIntoIterator) and replaces the paced wait-handleVec<HANDLE>with a stack[HANDLE; 64]array.Arc::clonefor uncapped mode: Clonesc.kinds[ty as usize].extrainsidewait_frame_event_xonly wheninterval_override() == Some(0), avoiding an unused atomic reference-count increment/decrement on every default paced frame wait.ISSUEDandFLIPPEDfromVec(remove(0)/drain(..n)) toVecDeque(pop_front()/push_back(...)).writable/note_signaled(read-only, resident read-only, RW->RO cross-page straddle,PAGE_GUARDpreservation,PAGE_EXECUTE_READ,PAGE_NOACCESS, reserved-only, and valid write),AncillaryHandlesboundary cases (null,0,63,64,u32::MAX, unreadable list), andISSUED/FLIPPEDFIFO eviction order.Part of #103
Tested
origin/main(b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7): Confirmed unmodifiedgpu::shader::readableaccepted both aPAGE_READONLYtarget (ro_ok=true) and a 4-bytePAGE_READWRITE -> PAGE_READONLYcross-page straddle (straddle_ok=true), whereas post-fixwritablerejects both andnote_signaledskips them safely.XCL_ADAPTER=warp,XCL_WARP=1):cargo test -p xcl --lib -- hle::d3d12x::frame::tests:: --nocapture->8 passed; 0 failed; 0 ignored(0skipped,1.05s).XCL_ADAPTER=warp,XCL_WARP=1):cargo test --release -p xcl --lib -- hle::d3d12x::frame::tests:: --nocapture->8 passed; 0 failed; 0 ignored(0skipped,0.25s).cargo clippy --all-targets->0new warnings incrates/xcl/src/hle/d3d12x/frame.rs.cargo test --release -p xcl --lib -- hle::d3d12x::frame::tests:: --nocapture->8 passed; 0 failed; 0 ignored(0skipped,0.25s).cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture->37test binaries,1438 passed; 0 failed; 47 ignored(29pre-existing host-gatedSKIPPEDlines:21wave64-only tests on a 32-lane GPU,3per-lane wave32 tests refused by the driver,3D3D12 debug layer tests withoutd3d12SDKLayers.dll,1no heap windows,1cannot disable the driver cache).Regression run
Baseline (
origin/main):Branch (
HEAD):Not tested
d3d12SDKLayers.dll).K32QueryWorkingSetExreportsprotect == 0(covered structurally by falling through toVirtualQuery).XCL_FRAME_INTERVAL_US=0(uncapped override path).AI use
Implemented, unit-tested, and verified with assistance from Google Antigravity (Gemini 4 Neon); every change and test result was reviewed and executed locally.
@SlopTart on GitHub · 2026-11-26 06:50 UTC · original · edited 2026-11-26 07:02 UTC
Tested on the Linux/Wine lane, full standard env (AMD rig: Ryzen 9 9900X, 96 GB DDR5, RX 7900 XT 20 GB, Arch kernel 7.2.15, Mesa 26.2.5 RADV, wine-11.0 Proton, rustc 1.94.0;
d3d12,d3d12core,dxgi,d3d11,d3d10core=n,boverrides, official DXC kit,VKD3D_CONFIG=ignore_shared_fence, threads=2), head9a547e23, mergeable against mainb49be183:non-gpu suite (
--skip gpu::): 599 passed, 3 failed, 4 ignored, 733 filtered.The failure set is identical to bare main
b49be183measured on the same rig the same day (596 passed, 3 failed): gpu_promoted_uav_clear (our #2490), xma2_source_voice (#2481, vendored-FAudio gate). The third red, the sparse tile video-memory test, is a known batch flake (green solo).Zero delta from this PR; every test it adds passes inside the suite.
Not tested: gpu suite, Windows native.
Correction: an earlier version of this row reported three extra reds; those runs lacked the
d3d12,d3d12core=n,bDLL overrides and hit stub-DLL NOTIMPL artifacts. Re-ran with the standard env, artifacts gone.AI use: Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.
@sage-sage on GitHub · 2026-11-26 07:05 UTC · original
Test report: passes on NVIDIA. Exact head
9a547e23(its base is currentmainb49be18, so head = merged).Tested
cargo test --workspace -- --test-threads=4: 1438 passed, 0 failed, 47 ignored; the 3 new tests passmainon this machine): 21 wave64 tests (NVIDIA is wave32 only), 3 per-lane wave32 f16/f32 forms (refused), 3 D3D12 debug layer (d3d12SDKLayers.dllnot installed), 1no heap windows, 1pso_measurement_compiles_an_exact_synthetic_record(Developer Mode off)Not tested
WaitFrameEventXpacing on a title.Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
@relativespace2K on GitHub · 2026-11-26 07:18 UTC · original
Tested - native Windows AMD RDNA2, PR head
9a547e23onmainb49be183Tool: OpenCode with DeepSeek V4.1 Flash 1017
Windows 11 IoT Enterprise LTSC 26100; release build; DXC 1.9.2602.17.
cargo test --release -p xcl --lib -- hle::d3d12x::frame::tests:: --nocapture:8 passed, 0 failed, 0 ignored, 0 skipped, 1331 filtered out.
XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_FRAME_DUMP=1 XCL_RUN_SECONDS=240, no other XCL_* variables; shader and pipelinecaches warm;
mainand the PR run alternately.main1main2 (warm)PR 1 ran second and started with a warmer cache (139 -> 41 DXIL misses); the warm repeat
does not reproduce 3,780 (PR 1,780 vs
main1,849, within run-to-run variance). The onlyconsistent difference is the first frame ~4 s earlier in both PR runs (17.2/16.2 s vs
20.9/20.1 s); n=2, not enough to claim a gain.
Both trees: 40 mesh refusals, 0 failed pipelines, 0 DXIL failures, no crash and no device
removal. The title still stalls on its loading screen (presentation falls to zero around
125 s; 1,780-1,849 frames), so there is no world or FPS comparison in this window.
Not tested: full workspace, NVIDIA, debug build, world/FPS runs.
AI use: OpenCode with DeepSeek V4.1 Flash 1017 ran the tests, read the logs and wrote this comment; the figures and crash lines were checked against the run logs.
@luckyteagirl on GitHub · 2026-11-26 07:23 UTC · original
RX 6800M verification at exact PR head
9a547e23ab97a0620384a91c305f5a8ebac3088bagainst current mainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7(Windows 11, AMD driver30.0.13002.13003, Rust 1.99.0 MSVC):cargo test --locked -p xcl --lib hle::d3d12x::frame::tests:: -j 1 -- --test-threads=1 --nocapture, withXCL_ADAPTER=6800M: 8 passed, 0 failed, 0 ignored, 1,331 filtered.cargo build --locked --release -p xcl -j 1: passed; head executable SHA-2560A0B772118DD4E4A7DB88D8CE014A70A1146BCCF5F5B48A5C778C62195A7C95C.XCL_FRAME_INTERVAL_US=0,XCL_TRACE_FRAME_EVENTS=1,XCL_ADAPTER=6800M, separate data/DXIL cache directories, and the same locally owned title build (hash2ef5fd64). Both logs explicitly sayXCL_FRAME_INTERVAL_US=0 – uncappedand showWaitFrameEventXcalls plus nonzero frame-event wait counts.b49be1839a547e230x00x0This confirms startup presentation and frame-event activity on this AMD card with the uncapped override. The 12-second samples are too short for a performance conclusion and do not establish world-load behavior or exercise every changed edge case. I did not run the full workspace suite on this head. AI-assisted test report with Codex.
@Aniseto on GitHub · 2026-11-26 09:41 UTC · original
Ran the frame hot-path tests at
9a547e23:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.
All eight tests pass, including the three new ones for the writability check (
note_signaled_skips_readonly_guard_and_cross_page_targets), the 63/64-handle boundary (ancillary_stack_handles_boundary_cases) and the FIFO eviction (issued_and_flipped_ring_buffers_evict_oldest_in_order). These are Win32 unit tests, not GPU rendering measurements.What this adds: the author measured on an RTX 4060 (Ada) and WARP; this is a second NVIDIA host (Blackwell, different driver), and the thread already has one more NVIDIA report on an RTX 4080 SUPER.
Not tested: the full workspace suite, a paired 60 s smoke run, the retail title under
XCL_FRAME_INTERVAL_US=0, AMD and Intel GPUs, Wine, release profile, title data.AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
github-bot referenced this pull request2026-11-26 12:40:17 +00:00
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.