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

Open
github-bot wants to merge 1 commit from github-bot/gh-1654 into main AGit
Owner

@⁠AlpPesen on GitHub · 2026-11-24 18:46 UTC · original
AlpPesen:fix/split-barrier-begin-only → main · +49 −3 · 1 files · 1 commits · open

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 3080 Ti, RTX 3060 Ti, and Intel Arc A770 before rebasing onto e1d84b7.

Not tested

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

Regression run

xcl-smoke v1
commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea
gpu: AMD Radeon RX 6800
title: 6ca5cab7
seconds: 60
exit: 0x0
frames shown: 1499 (PresentX 1499)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13951 MB
xcl-smoke v1
commit: f0d0bacc73c1f0b9e5defa577809e88c2a8d73cd
gpu: AMD Radeon RX 6800
title: 6ca5cab7
seconds: 60
exit: 0x0
frames shown: 1500 (PresentX 1500)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13979 MB

AI use

  • Antigravity (Gemini 4 Neon): implemented the BEGIN_ONLY filter and unit test, rebased onto e1d84b7, ran the test and paired scripts/smoke.ps1 runs, and drafted this PR description.
**@⁠AlpPesen** on GitHub · 2026-11-24 18:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/1654) `AlpPesen:fix/split-barrier-begin-only` → `main` · +49 −3 · 1 files · 1 commits · open 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 3080 Ti, RTX 3060 Ti, and Intel Arc A770 before rebasing onto `e1d84b7`. **Not tested** - Linux/Wine or wave32-only GPUs after rebase onto `e1d84b7`. **Regression run** ``` xcl-smoke v1 commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea gpu: AMD Radeon RX 6800 title: 6ca5cab7 seconds: 60 exit: 0x0 frames shown: 1499 (PresentX 1499) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13951 MB ``` ``` xcl-smoke v1 commit: f0d0bacc73c1f0b9e5defa577809e88c2a8d73cd gpu: AMD Radeon RX 6800 title: 6ca5cab7 seconds: 60 exit: 0x0 frames shown: 1500 (PresentX 1500) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13979 MB ``` **AI use** - Antigravity (Gemini 4 Neon): implemented the `BEGIN_ONLY` filter and unit test, rebased onto `e1d84b7`, ran the test and paired `scripts/smoke.ps1` runs, and drafted this PR description.
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 #1488 (XCL-BT-032).

Assisted-by: Antigravity (Gemini 4 Neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:00:40 +00:00
Author
Owner

@⁠WebIdentity1 on GitHub · 2026-11-24 19:48 UTC · original

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 #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 #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 #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.

**@⁠WebIdentity1** on GitHub · 2026-11-24 19:48 UTC · [original](https://github.com/xcl-dev/xcl/pull/1654#issuecomment-7142623154) 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 #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 #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 #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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 21:16 UTC · original

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

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

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 21:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/1654#issuecomment-7144715715) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~22 ignored. Thanks!
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 04:55 UTC · original

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.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 04:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/1654#issuecomment-7153288699) # 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.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-25 12:06 UTC · original

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.

**@⁠thehollowedone** on GitHub · 2026-11-25 12:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/1654#issuecomment-7161929469) Independent Windows/NVIDIA run on [9015e35](https://github.com/xcl-dev/xcl/commit/9015e35965fd2b7f2b54ef5b3407923886eb176f). **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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 06:07 UTC · original

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 06:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/1654#issuecomment-7184118684) Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1654/head:github-bot/gh-1654'
git switch 'github-bot/gh-1654'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1654'
git switch 'github-bot/gh-1654'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1654'
git switch 'github-bot/gh-1654'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1654'
git switch 'main'
git merge --squash 'github-bot/gh-1654'
git switch 'main'
git merge --ff-only 'github-bot/gh-1654'
git switch 'main'
git merge 'github-bot/gh-1654'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.