Skip to content

D3D12.X: do not record BEGIN_ONLY split barriers as completed texture states - #1654

Open
AlpPesen wants to merge 1 commit into
xcl-dev:mainfrom
AlpPesen:fix/split-barrier-begin-only
Open

AlpPesen wants to merge 1 commit into
xcl-dev:mainfrom
AlpPesen:fix/split-barrier-begin-only

Conversation

@AlpPesen

@AlpPesen AlpPesen commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Part of #1488 (XCL-BT-032).

When a title records a split transition barrier with D3D12_RESOURCE_BARRIER_FLAG_BEGIN_ONLY (flags & 1 != 0), the transition to StateAfter has only begun and is not complete until the matching END_ONLY barrier. Recording StateAfter in tracked_states on BEGIN_ONLY can mislead subsequent title_textures transition tracking.

What is in it

  • Skip BEGIN_ONLY split transition barriers (flags & 1 != 0) when collecting completed transitions in crates/xcl/src/hle/d3d12x/list_x.rs.
  • Add unit test completed_transitions_skips_split_begin_only_barriers verifying normal (NONE), BEGIN_ONLY, END_ONLY, aliasing, and UAV barriers.

Tested

  • Hardware: Intel Core i9-9900K, 32 GB RAM, AMD Radeon RX 6800 (16337 MiB VRAM, RDNA2, driver 32.0.21045.29003), Windows 11 Pro build 26300, rustc 1.100.0, DXC 1.9.2602.17.
  • cargo test -p xcl --lib completed_transitions_skips_split_begin_only_barriers: 1 passed, 0 failed, 0 ignored, 0 skipped.
  • Previously verified on NVIDIA RTX 3090, RTX 3060 Ti, and Intel Arc A770 before rebasing onto 426a5a7.

Not tested

  • Linux/Wine or wave32-only GPUs after rebase onto 426a5a7.

Regression run

xcl-smoke v1
commit: 426a5a745db4d5e4b037449ede0b70cb342f5192
gpu: AMD Radeon RX 6800
title: 6ca5cab7
seconds: 60
exit: 0x0
frames shown: 1492 (PresentX 1492)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14971 MB
xcl-smoke v1
commit: 9015e35965fd2b7f2b54ef5b3407923886eb176f
gpu: AMD Radeon RX 6800
title: 6ca5cab7
seconds: 60
exit: 0x0
frames shown: 1484 (PresentX 1484)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15010 MB

AI use

  • Antigravity (Gemini 4 Neon): implemented the BEGIN_ONLY filter and unit test, rebased onto 426a5a7, ran the tests and paired scripts/smoke.ps1 runs, and drafted this PR description.

@WebIdentity1

Copy link
Copy Markdown

Independent RTX 3090 check of exact head 2adee4589bdf294bb9fbeeee2b481466d7e2ca27 against its immediate parent/main c160d86ef2efe3a07e4dfb473e4fa72eafb413c0.

Windows 10, RTX 3090, driver 591.74, Agility SDK 1.620.2; XCL_ADAPTER=3090, XCL_REQUIRE_GPU=mesh. Clean tracked sources (292 SHA-256 matches after the runs). Native desktop session 1 for full suites; no game files were used.

  • New focused completed_transitions_skips_split_begin_only_barriers test on head: 1 passed / 0 failed / 0 ignored.
  • cargo build --locked --workspace: exit 0 on parent and head.
  • cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-output, without XCL_HEAP_WINDOWS: parent 856 passed / 2 failed / 42 ignored, head 856 passed / 3 failed / 42 ignored across 20 targets. Both failed the existing Recompiler: complete remaining RDNA2 integer CLAMP=1 saturation (#105) #202 CLAMP check and heap_window_out_of_memory_falls_back_to_the_switch_form (requires heap-window opt-in under the strict GPU gate). The extra head failure was d32s8_targets_take_their_own_size_of_video_memory: list.Close() returned E_FAIL at unchanged vram.rs:1010 after allocating 14 D32S8 targets (~936 MB). This observation prevents calling the paired full run regression-clean.
  • Follow-up: the D32S8 test passed 1/0/0 in a fresh head process and 1/0/0 in a fresh parent process. Two fresh four-thread head library runs each gave 809 passed / 1 failed / 22 ignored, with only Recompiler: complete remaining RDNA2 integer CLAMP=1 saturation (#105) #202 CLAMP failing; D32S8 passed both times. A fresh head full-workspace run with XCL_HEAP_WINDOWS=1 gave 858 passed / 1 failed / 42 ignored across 20 targets; only Recompiler: complete remaining RDNA2 integer CLAMP=1 saturation (#105) #202 CLAMP failed and D32S8 passed. No harness timeout. The original D32S8 Close() failure remains unexplained; the follow-ups do not prove it cannot recur.

Four tests returned success via explicit skip paths in each full run: two require native wave64, and two require system D3D12 SDK debug layers unavailable on this host. The new unit test checks transition collection, not actual split-barrier command execution on the GPU. I did not run a retail title or measure frame rate or memory growth.

One comparison caveat for the PR description: the reported AMD smoke baseline 09940bb8 is 130 commits before this PR's parent c160d86e (146 files changed in between). The 405-to-1305 frame difference is a useful lead, but it cannot isolate this one-line behavior change without a smoke run on the immediate parent or a nearby main revision.

Validation/report prepared with Codex (GPT-6); all runs and counts above came from the Windows machine.

@DavidM1911

Copy link
Copy Markdown
Contributor

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.

Thanks!

@JJAutoCompare

Copy link
Copy Markdown

XCL PR #1654 verification

Clean detached head 2adee4589bdf294bb9fbeeee2b481466d7e2ca27 on STOR-WINLAB. AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation x64 build 26200, Intel Arc A770 driver 32.0.101.9175, DXC 1.9.2609.5, rustc 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc).

Tested

  • cargo build --workspace and cargo test --workspace --no-run succeeded outside the GPU lock. The latter built 19 test binaries.
  • cargo test -p xcl --lib completed_transitions_skips_split_begin_only_barriers -- --nocapture passed (1/0/0, zero skips). The new test in crates/xcl/src/hle/d3d12x/list_x.rs verifies that the state tracker receives normal and END_ONLY transitions with the resource, subresource and StateAfter intact. BEGIN_ONLY, aliasing and UAV barriers are excluded.
  • cargo test -p xcl --lib hle::d3d12x::title_textures::tests::transitions_ -- --nocapture passed (2/0/0, zero skips), covering per-subresource states and applying transitions in submission order, including resubmission and reset. Both focused commands ran CPU-only with XCL_ADAPTER=NONE_CPU_ONLY.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 ran once under Invoke-ArcTest.ps1 with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1. Exit 101. All 20 result lines (19 binaries plus doctests) sum to 841 passed, 18 failed and 42 ignored. The three focused tests also passed in this run.

Workspace failures and skips

  • 17 library failures in GPU DXIL and recompiler tests. Thirteen returned CreateComputePipelineState error 0x80070057. Four reported mismatches for FMA contraction, mip sampling, FP16 lane preservation or wave64 reduction.
  • test_title_runs_and_game_folder_is_untouched failed its dynamic depth bias check. The test title drew a blue pixel where it expected green.
  • Six lines start with SKIPPED . Two require wave64, one requires tiled tier 2, one requires heap windows and two require the D3D12 debug layer. The latter include uploads_start_from_each_subresources_state. These skips provide no coverage.

Not tested

Live GPU split-barrier behavior, retail-title smoke comparison, other adapters and opt-in game samples. A matched main run is needed to attribute the failures.

AI use

T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1654-suite.log and published.

@throny throny added the goal:world-load Bears on the retail title getting past world loading label Nov 25, 2026
@AlpPesen
AlpPesen force-pushed the fix/split-barrier-begin-only branch from 2adee45 to 084e81a Compare November 25, 2026 11:07
… states

In list_x::resource_barrier_x, 	itle_textures::note_transitions previously recorded StateAfter for every D3D12_RESOURCE_BARRIER_TYPE_TRANSITION barrier regardless of Flags. A split barrier with D3D12_RESOURCE_BARRIER_FLAG_BEGIN_ONLY (1) only begins the transition and does not move the resource into StateAfter until the matching END_ONLY barrier executes.

Skip BEGIN_ONLY barriers when collecting completed transitions for 	itle_textures::note_transitions, keeping NONE (0) and END_ONLY (2) transitions.

Part of xcl-dev#1488 (XCL-BT-032).

Assisted-by: Antigravity (Gemini 4 Neon)
@AlpPesen
AlpPesen force-pushed the fix/split-barrier-begin-only branch from 084e81a to 9015e35 Compare November 25, 2026 11:34
@thehollowedone

Copy link
Copy Markdown

Independent Windows/NVIDIA run on 9015e35.

Tested
Windows 11 build 26300, RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Rust 1.99.1 MSVC, debug. cargo build --offline --locked --workspace passed. cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture reported 1244 passed, 0 failed, 46 ignored. The split-barrier regression passed. It checks that XCL records complete transitions and split ends, while leaving split begins, aliasing barriers, and UAV barriers out of the texture-state update.

Not tested
Retail smoke, AMD, Linux/Wine, and native wave64. Cargo's passed count includes 25 explicit skip notices (20 wave64, 3 unsupported f16 translator cases, 1 heap-window case, and 1 driver-cache control).

AI-assisted. Codex (GPT-6, exact variant unavailable) ran the tests and drafted this report.

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.

6 participants