Skip to content

Recompiler: carry store address and control into direct DXIL signatures - #2035

Open
luckyteagirl wants to merge 1 commit into
xcl-dev:mainfrom
luckyteagirl:codex/dxil-store-deps
Open

luckyteagirl wants to merge 1 commit into
xcl-dev:mainfrom
luckyteagirl:codex/dxil-store-deps

Conversation

@luckyteagirl

@luckyteagirl luckyteagirl commented Nov 25, 2026 •

Copy link
Copy Markdown

Part of #1892 (its second point). compute_deps() counted the value written to an alloca/TGSM root, but missed which address was written and which branch controlled the write. A later load could therefore omit an input dependency from its dx.viewIdState and PSV0 signature tables. This PR includes both for stores and atomics. It is rebased onto main after #1966 merged the cyclic-PHI fix, and retains that fixed-point traversal.

What is in it

  • graphics.rs: propagate each write's pointer, value operands, and enclosing block's control dependencies to loads of the same root.
  • module.rs: distinguish atomic writes from other value operations so GEPs and other operations are not treated as writes.
  • graphics_tests.rs: three focused regressions for store address, store condition, and atomic address/control. The two store cases failed on the original main base 400e638 and all three passed on the rebased head. The direct-DXIL source hash from Recompiler: direct DXIL cache entries change when its sources do #1947 handles cache identity; this revision needs no manual translator-version bump.

Tested

  • Exact head 5473448c57eb13b721d44ba8cf175f4513febbe9 on main cbc296ab65a2661a61e3e2da109134bcd5319f60. Windows 11 build 26200, Ryzen 9 5980HX, AMD Radeon RX 6800M driver 30.0.13002.13003, Rust 1.99.0 MSVC, DXC/DXIL 1.9.2609.5.
  • cargo test --locked -p xcl --lib -j 2 gpu::dxil::graphics::tests -- --test-threads=1 --show-output with XCL_ADAPTER=6800M, XCL_REQUIRE_GPU=1, and XCL_DIRECT_DXIL=1: 28 passed, 0 failed, 0 ignored, no explicit skips. This includes the three regressions, DXIL validation comparisons, the merged loop regression, and four emitted GPU draw tests.
  • cargo build --locked --workspace -j 2, cargo build --locked --release -p xcl -j 2, and git diff --check origin/main...HEAD: passed.
  • cargo test --locked --workspace --no-fail-fast -j 2 -- --test-threads=4 --show-output: 996 passed, 161 failed, 46 ignored across the completed binaries. All 161 named failures were gpu:: tests after the RX 6800M device was suspended (0x887A0005). Nine explicit SKIPPED messages included no GPU/device, unavailable D3D12 debug layer, no reserved cube with mips, and no heap windows. I did not run an equivalent full-suite baseline on this new main commit, so the failures are reported without attributing them to this PR.
  • A locally owned title completed paired 7-second scripts/smoke.ps1 runs on the RX 6800M. Each revision showed one frame, with no crash or device removal. Peak process commit was 6,911 MB on main and 7,060 MB on the PR.

Regression run

main:

xcl-smoke v1
commit: cbc296ab65a2661a61e3e2da109134bcd5319f60
gpu: AMD Radeon RX 6800M
title: 2ef5fd64
seconds: 7
exit: 0x0
frames shown: 1 (PresentX 1)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 6911 MB

PR head:

xcl-smoke v1
commit: 5473448c57eb13b721d44ba8cf175f4513febbe9
gpu: AMD Radeon RX 6800M
title: 2ef5fd64
seconds: 7
exit: 0x0
frames shown: 1 (PresentX 1)
presents per 2 s (last 3): 0 0 1
device removals: 0
crashes: 0
peak commit: 7060 MB

Not tested

  • The short title runs logged zero draws and used default HLSL/DXC routing, so they do not exercise the changed direct-DXIL signature path. A prior XCL_DIRECT_DXIL=all title attempt on the pre-rebase head was stopped by a local memory guard and is not counted as a smoke result.
  • Other adapters and drivers, longer title sessions, and a full-suite comparison on this new main commit.

AI use

OpenAI Codex (GPT-6, exact variant not exposed in this session) implemented and rebased the change, ran the tests and smoke comparisons, reviewed the logs, and drafted this description.

Track each memory write's pointer, value, and control block when computing
input-to-output dependencies for dx.viewIdState and PSV0. Preserve the
fixed-point traversal merged in xcl-dev#1966. The direct-DXIL source hash from
xcl-dev#1947 accounts for the changed output without a manual version bump.

Refs xcl-dev#1892
@DavidM1911

Copy link
Copy Markdown
Contributor

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

Thanks!

@luckyteagirl
luckyteagirl marked this pull request as ready for review November 25, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants