D3D12.X: default XCL_INLINE_GUARD_BATCH off to avoid dead 64 KiB scratch allocations and AMD page faults #2757
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!2757
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2757"
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?
@Saksukella on GitHub · 2026-11-26 10:15 UTC · original
Saksukella:fix/default-inline-guard-batch-off→amd-dev· +18 −1 · 1 files · 1 commits · openWhat is in it
crates/xcl/src/hle/d3d12x/bind.rs:inline_guard_batch_on()(XCL_INLINE_GUARD_BATCH) from opt-out (default = true) to opt-in (XCL_INLINE_GUARD_BATCH=1).execute_indirectclearss.inline_guard = Noneimmediately after everyExecuteIndirect, so the 256-slot inline guard batch never batches more than 1 dispatch. Leaving it enabled by default allocates 64 KiB scratch VRAM (INLINE_GUARD_DST_BYTES) + 8,208 B coherent UMA (INLINE_GUARD_JOBS_BYTES) +Dispatch(4,1,1)ofPRELUDE_GUARD_HEAP_HLSLper guarded indirect dispatch, and on AMD RDNA 4 (RX 9070 XT) triggers a deterministic DRED GPU page fault (0x887a0006) at0x1f0060000during deep 3D frames. A/B testing withXCL_INLINE_GUARD_BATCH=0eliminated the0x1f0060000page fault completely, falling back cleanly toguard_indirect_heap_pipeline(32-bit root constants + 256 B scratch).inline_guard_batch_defaults_off_and_opts_in.amd-dev(whereinline_guard_batch_onlives).Tested
32.0.32029.2010), 24-thread x86_64 CPU, 32 GB RAM, Windows;rustc 1.100.0 (0ef1bc386 2026-11-09); debug (tests) and release (xcl.exe).cargo test -p xcl --lib inline_guard_batch_defaults_off_and_opts_in: 1 passed, 0 failed (0.00s).XCL_DRED=1+XCL_GPU_CULPRIT=13D captures on RX 9070 XT: default (XCL_INLINE_GUARD_BATCH=1) hitDRED page fault at GPU VA 0x1f0060000(0x887a0006) aroundxcl prelude_guard_dispatch_args;XCL_INLINE_GUARD_BATCH=0eliminated that page fault completely.Regression run
Not tested
AI use
XCL_GPU_CULPRITfault isolation, writing the opt-in change and unit test, and running local tests and smoke verification. All diffs and measurements were verified locally on hardware.@relativespace2K on GitHub · 2026-11-26 18:58 UTC · original
Tested - retail title and the new guard-batch default on native Windows AMD RDNA2, PR head
2eace3e1b82688cb508da22fb58feaed4157b14don its baseamd-devb5c0275f, plus the currentamd-devc32c91a3for the same environment switchTool: 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 -- inline_guard_batch_defaults_off_and_opts_in:1 passed, 0 failed, 0 ignored, 0 skipped, 1571 filtered out.
XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_FRAME_DUMP=1 XCL_RUN_SECONDS=180, no other XCL_* variables; warm shader/pipeline caches.b5c0275fdefault (2 runs)b5c0275fXCL_INLINE_GUARD_BATCH=0(2)c32c91a3default (1)c32c91a3XCL_INLINE_GUARD_BATCH=0(2)On the PR's base, the default (batching on) stopped on the loading screen at 82-107 s. With
XCL_INLINE_GUARD_BATCH=0the title left the loading screen and played the opening cutscene(Bink video, observed on screen), reaching 35,016 draws and 19,800 dispatches, last present
162.3 s. Both guard-off runs then lost the device with
0x887a0006, at 173.4 s and 129.4 s,during 311,208 B and 317,836 B MS PSO driver compiles (one took 4.7 s, the other never
returned). The PR head itself (default off, warm pipeline library) survived 2/2 at
16.8k/22.6k draws, with 12 s graphics-pipeline wait windows.
On the current
amd-devc32c91a3, which has the newer sparse commits,XCL_INLINE_GUARD_BATCH=0ran 2/2 to 180 s without a device removal (20.1k/23.5k draws), and the default also ran to 180 s
(16.5k draws). The
0x887a0006does not reproduce there in these 180 s windows.So the default flip is not what removes the device: it is what lets the title get far enough to
compile the ~300 KB MS PSOs, and the cold compile is where the old base hangs. On the current
branch the change is safe in these windows; a rebase from
b5c0275ftoc32c91a3or later wouldlet the PR be judged against the branch it targets now.
Not tested: the RDNA4 page fault from the description (this is RDNA2), NVIDIA/Intel GPUs,
world/FPS (not reached), full workspace, debug build.
AI use: OpenCode with DeepSeek V4.1 Flash 1017 ran the tests and the game runs, read the logs and wrote this comment; the counts and per-run figures were checked against the logs.
@vibryxcx on GitHub · 2026-11-26 19:08 UTC · original
Second RDNA2 report, adding what the report above does not have: the workspace suite in debug, the
xcl-smokeblocks, and two notes on the diff.This change is already on
amd-dev.2f91871(inamd-devc32c91a3) has the same+/-lines inbind.rsas this PR's head2eace3e1, so the rebase suggested above would leave the PR empty. It can probably be closed as landed.Stale comment. On
amd-devand in this PR,bind.rsstill says// Inline 256-slot offset-table batching (`XCL_INLINE_GUARD_BATCH=0` opt-out)aboveif inline_guard_batch_on()(line 2795 onamd-dev). After the change the switch is opt-in (=1), and=0is the default. This is a comment fix only, with no behaviour change.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09). Head2eace3e1vs baseb5c0275f(merge-base onamd-dev), each in its own worktree.cargo test --workspace -- --test-threads=4on head: the lib test binary aborts with0xc0000005(STATUS_ACCESS_VIOLATION), the same parallel-run abort reported on otheramd-devPRs.cargo test -p xcl --lib -- --test-threads=1on head: the first attempt hung for over 40 min intitle_textures::tests::placed_title_textures_share_vram_and_preserve_pixels. Rerun with--skipon that test: 1533 passed, 11 failed, 27 ignored, 1 filtered out. Run alone with--exact, the hung test passes in about 2.4 s on head and on base, so it hangs only inside the full run.--exact,--test-threads=1) on head and on base: the same 10 fail on both (fuzz_validate_and_gpu_1,dispatch_chain_native_wave64_builds_whole,a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier,f32_programs_on_the_gpu,a_dispatch_with_a_pipeline_still_building_waits_at_the_submit,a_put_off_dispatch_runs_at_the_submit_when_its_build_outlasts_the_wait_budget,bitset_runs_emit_exact_contiguous_page_ranges,giant_driver_compiles_have_their_own_lane,title_bytes_are_used_in_place_when_all_are_readable,physical_home_without_sparse_windows_uses_coherent_window).two_pass_binds_set_the_shared_view_heapfails only in the full run and passes alone on both. No failure comes from this PR. This is the same set as the RX 7800 XT report in #2769.inline_guard_batch_defaults_off_and_opts_in: passes.f16_programs_on_the_gpu(V_MUL_F16 / V_PK_MUL_F16, #1426).Regression run (release, a different retail title from the one in the description, warm caches. The first base run had cold caches and gave 452 frames; the base block below is the rerun.)
The base is
b5c0275fonamd-dev, not a commit ofmain. The PR targetsamd-dev, sopr_check.py's rule does not quite fit here.A/B on head, 300 s,
XCL_DRED=1, A pressed every 20 s from 40 s to 180 sXCL_INLINE_GUARD_BATCH=1(old default)Both runs stall the same way, so the stall is not caused by this PR: presents fall to 0 at about 185 s and 205 s, commit grows to about 28-30 GB and local VRAM from about 8 to about 11 GB. The log shows
graphics pipeline wait window (12000 ms) spent,ExecuteIndirect with a pipeline that is still being built skipped, and dispatches with no translated console shader. The first ExecuteIndirect calls appear only at about 194 s, and the guard path logs nothing, so these runs do not show that the inline-guard path ran.Not tested: the RDNA4 page fault from the description; NVIDIA / Intel; the cutscene / world past the loading stall;
c32c91a3directly (the report above covers it).AI use: Claude Code (Claude Opus 5.5) ran the builds, tests and game runs, read the logs and wrote this comment. Every number comes from those runs on the hardware above.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.