Skip to content

D3D12.X: log the driver's refusal of a translated compute PSO - #1300

Closed
zorde23 wants to merge 1 commit into
xcl-dev:mainfrom
zorde23:preload-log
Closed

zorde23 wants to merge 1 commit into
xcl-dev:mainfrom
zorde23:preload-log

Conversation

@zorde23

@zorde23 zorde23 commented Nov 24, 2026

Copy link
Copy Markdown

Part of #1035.

When the driver refuses a compute PSO built from a translated console shader, XCL only told note_translation_error, which
logs its first 40 distinct reasons. A retail title's mesh warnings use those up in its first seconds, so on an RX 6750 XT a
~14 MB program the AMD driver worked on for ~46 s and refused with E_OUTOFMEMORY — at ~53 GB of commit, in every run — left
no line at all. This logs hr, DXIL size and the time spent in the driver (first 16, then powers of two, like
resolve_within). note_translation_error is still called (it feeds report.json).

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs: translated_compute_pso warns on a refusal, with the time since started (taken after
    the big-compile turn, so it is the time in the driver).

Tested

  • AMD Radeon RX 6750 XT, driver 32.0.21045.29003; AMD Ryzen 7 5700X, 32 GB; Windows 11 Pro 26200; Rust 1.100 MSVC; release.
  • cargo test --workspace --no-fail-fast -- --test-threads=4, at ff1df7c: 748 passed, 3 failed, 41 ignored; at main
    930e8b4: the same 748 / 3 / 41. The 3 failures are the same on both and fail on this GPU on main
    (title_textures::placed_title_textures_share_vram_and_preserve_pixels,
    title_textures::transitions_apply_when_their_list_is_submitted,
    vram::d32s8_targets_take_their_own_size_of_video_memory). SKIPPED GPU tests: none. No new test (logging only).
  • Before the rebase (at 2d61304 on main 47efa2e, 60 s smoke) the run logged ~53 s in: D3D12.X: the driver rejected a compute PSO (0x8007000e): ~14 MB DXIL, 47554 ms in the driver (1 so far) (size rounded here). On main 930e8b4 the big build ahead no
    longer runs in the first 60 s (peak 18.5 GB on main too), so the smoke below has no refusal to log.

Regression run

main:

xcl-smoke v1
commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56
gpu: AMD Radeon RX 6750 XT
title: retail-a
seconds: 60
exit: 0x0
frames shown: 1538 (PresentX 1538)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 18558 MB

PR:

xcl-smoke v1
commit: ff1df7c6c9495ac3c2943bf84386cb7d6f2752eb
gpu: AMD Radeon RX 6750 XT
title: retail-a
seconds: 60
exit: 0x0
frames shown: 1545 (PresentX 1545)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 18141 MB

Not tested

  • Other GPUs/drivers; a driver call that never returns (then there is nothing to log).

AI use

  • Claude Code found the hidden refusal, wrote the change and this text from runs on my machine; I reviewed
    and ran everything.

@zorde23
zorde23 marked this pull request as ready for review November 24, 2026 14:37
@futurepro62

Copy link
Copy Markdown

Full-suite run, since this PR has no test report yet. Tested exact head ff1df7c (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • No new #[test] functions in the diff.

Not tested

  • AMD, a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.

gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 24, 2026
…cl-dev#1286-xcl-dev#1291, xcl-dev#1294, xcl-dev#1296-xcl-dev#1297, xcl-dev#1300

Prevent background shader preloading and concurrent DXC/RADV compiles from exhausting host RAM under Wine, and integrate 11 open upstream PRs:
- dxc.rs & real.rs: check free physical RAM (ullAvailPhys.min(ullAvailPageFile)) under Wine instead of swap-inclusive ullAvailPageFile, avoid bypassing the guard after 60 s under Wine, and serialize giant (>= 4 MiB DXIL) driver compiles with BIG_COMPILES under Wine.
- pso_async.rs: cap background preload workers to 1 under Wine.
- title_textures.rs: use real::create_raw_fence in submit_on_title_queue and read coherent-window hash bytes safely via with_title_bytes.
- Integrate upstream PRs xcl-dev#968 (sparse::queue lock-free for late_release), xcl-dev#1286 (v_dot2_f32_f16 NEG_HI abs), xcl-dev#1287 (XMA >8 channels), xcl-dev#1288 (Sleep pauses during PSO bind waits), xcl-dev#1289 (pipeline stream bounds check), xcl-dev#1290 (root signature MAX_ARGS cap), xcl-dev#1291 (console UAV clears xcl-dev#53/xcl-dev#54), xcl-dev#1294 (shadowed PENDING accuracy), xcl-dev#1296 (16-bit compare low halves), xcl-dev#1297 (fence_x pre-cell signal arming), xcl-dev#1300 (log driver compute PSO refusal).

Verified on RX 9060 XT under GE-Proton11-14 (MemoryMax=12G, 80 s): committed RAM stays flat at 4830 MB (down from 27.6 GB OOM), 1493 frames shown, exit 0x0.

Assisted-by: Antigravity (Google DeepMind)
gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 24, 2026
anoyarou added a commit to anoyarou/xcl that referenced this pull request Nov 24, 2026
…fallbacks

Incorporate targeted upstream fixes from ivall/xcl PRs and local diagnostics
to resolve world-loading E_ACCESS_VIOLATION streaming errors, fence monitor
deadlocks, and mesh/compute PSO visibility:

- DirectStorage (ivall/xcl PR xcl-dev#549; relates to xcl-dev#289, xcl-dev#476, xcl-dev#1164):
  * crates/xcl/src/hle/dstorage.rs: Add Pending::late and refill_late_pages()
    so queues with 0 entries in destination physical-page arrays do not
    auto-submit at half capacity before the title calls Submit() and fills
    the page entries. Add unit test
    a_late_page_array_holds_a_half_full_queue_until_the_titles_submit.
  * Ensure lazy physical pages via kernelx::lazy::ensure() in
    snapshot_page_array() and before re-reading stale destination page tables
    on execute() failure, logging failing snapshot/live entries (adds test
    dest_physical_pages_rereads_stale_snapshot).

- D3D12.X fences (ivall/xcl PR xcl-dev#1297):
  * crates/xcl/src/hle/d3d12x/fence_x.rs: Track all intermediate queued signal
    values in Fence::pending (BTreeSet<u64>) before completed_value_address()
    creates the cell, initialize the cell from GetCompletedValue() before
    publishing, and arm all pending values > initial so *cell cannot remain
    stale at 0 and deadlock callers waiting on intermediate fence values.
    Adds test intermediate_signal_queued_before_completed_value_address_updates_cell.

- D3D12.X PSOs (ivall/xcl PR xcl-dev#1300 / xcl-dev#1035 and PR xcl-dev#1298):
  * crates/xcl/src/hle/d3d12x/real.rs: Log driver rejections of translated
    compute PSOs (hr, DXIL byte size, elapsed compile ms) directly via
    xlog_warn! so refusals are not masked after note_translation_error's
    40-reason limit is consumed (PR xcl-dev#1300).
  * Update fallback_stream() to handle subobject types 24/25 (AS/MS) so
    mesh pipelines with MS in slot 24 rewrite cleanly with stand-in mesh
    shaders instead of invalid null AS payloads (PR xcl-dev#1298).

Assisted-by: Antigravity (Gemini 4 Neon)
@tugasky

tugasky commented Nov 24, 2026

Copy link
Copy Markdown

Tested on a card and a driver the PR has not seen: AMD Radeon RX 9070 XT (RDNA4, gfx1201), driver 32.0.32029.2010; AMD Ryzen 7 9700X, 31 GB; Windows 11 Pro 26300; Rust 1.98.0 MSVC; release. Both builds are the same tree plus this commit, built back to back.

Tested

  • cargo test --workspace --release --no-fail-fast -- --test-threads=4 (19 binaries), at ff1df7c: 751 passed, 0 failed, 41 ignored; at main 930e8b4: 751 / 0 / 41. Zero SKIPPED lines — this card has wave64 and mesh, so no gpu:: test returned early through gpu_ready().
  • The three tests that fail on your 6750 XT pass here, in release, on both commits: title_textures::placed_title_textures_share_vram_and_preserve_pixels, title_textures::transitions_apply_when_their_list_is_submitted, vram::d32s8_targets_take_their_own_size_of_video_memory.
  • Logging only, no new test: nothing else to run.
  • scripts/smoke.ps1 -Seconds 60 on the retail title, once per build (XCL_NETWORK=0), blocks below.

Regression run

main:

xcl-smoke v1
commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1-CYBERLEEK
seconds: 60
exit: 0x0
frames shown: 1437 (PresentX 1437)
presents per 2 s (last 3): 6 0 2
device removals: 0
crashes: 0
peak commit: 22699 MB

ff1df7c:

xcl-smoke v1
commit: ff1df7c6c9495ac3c2943bf84386cb7d6f2752eb
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1-CYBERLEEK
seconds: 60
exit: 0x0
frames shown: 1445 (PresentX 1445)
presents per 2 s (last 3): 7 2 3
device removals: 0
crashes: 0
peak commit: 23407 MB

The low presents per 2 s is not a regression and not this commit: at 60 s this title is still in its first dxil compile on this machine (the window title reads compiling shaders: … 52147 pipelines queued), unlike your 6750 XT run which already shows 60 60 60. Steady state here is 60 presents per 2 s (30 fps), reached at ~100 s — outside the smoke window, so the block above says nothing about it either way.

The line never fires on this card, and that is the interesting part

I also ran the title past the smoke window on ff1df7c, pressing A every 8 s from 20 s to get past the menu into the world load: 114.6 s, 20 245 log lines, 78 WARN lines (the usual [STUB] / QueryInterface ones, so the sink works), and zero the driver rejected a compute PSO lines — nothing in the log, nothing on stdout/stderr. The run ended in the same abort this title always ends in here, 0xc0000005 write at 0x0 in game_scarlett_master.exe+0x23cf683, the offset #505 reports.

So on this card the wall is not a driver compute-PSO refusal: no E_OUTOFMEMORY, no 0x887a0006; the long run on main 930e8b4 had dxil cache 60 hits / 72 compiles / 0 failures and fallback_pipelines 0. Your 6750 XT reaches the ~14 MB program at ~53 GB of commit; here commit peaks at 28.2–29.1 GB of 31.1 GB and the big build-ahead never gets that far — consistent with your own note that main 930e8b4 no longer runs it in the first 60 s.

That makes the change worth merging as diagnostics that cost nothing when the path is not taken (it is silent here, and both blocks and the suite are identical to main), but it does not give you a second refusal to compare with — for that the card that hits E_OUTOFMEMORY at the commit limit is still the only one reporting.

Written with AI assistance (Cline); every number above was produced by the commands shown on the hardware named.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib -- --test-threads=1: all passed, 0 failed, 21 ignored. (Parallel runs intermittently abort with 0xc0000005 — same harness flake seen on unmodified main.)

Thanks!

The refusal went only through note_translation_error, which logs its first 40
distinct reasons; a retail title's mesh warnings use them up in the first seconds,
so a 14 MB program the AMD driver worked on for 45 s and refused with E_OUTOFMEMORY
left no line at all. Log hr, DXIL size and the time in the driver (first 16, then
powers of two).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zorde23

zorde23 commented Nov 25, 2026

Copy link
Copy Markdown
Author

Closing this: #1918 (merged) logs the driver's refusal of a huge compute program with its record, DXIL size, HRESULT and time in the driver, which is what this PR was for. Rebased onto current main, this commit has nothing left to add. #1665 no longer depends on it.

Written with Claude Code from runs on this machine.

@zorde23 zorde23 closed this Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants