Skip to content

D3D12.X: a split barrier's begin is not a completed transition - #1746

Closed
b3IKK wants to merge 1 commit into
xcl-dev:mainfrom
b3IKK:d3d12x/split-barrier-begin-not-complete
Closed

b3IKK wants to merge 1 commit into
xcl-dev:mainfrom
b3IKK:d3d12x/split-barrier-begin-not-complete

Conversation

@b3IKK

@b3IKK b3IKK commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Addresses XCL-BT-032 from #1488.

resource_barrier_x passed every transition it forwarded to title_textures::note_transitions, which takes the StateAfter as the state the texture is in once the list has run. A split barrier's BEGIN_ONLY (D3D12_RESOURCE_BARRIER_FLAG_BEGIN_ONLY) only starts its transition: the resource is not in the new state — and must not be used — until the matching END_ONLY completes it. The state an upload into a kept-in-step texture started from could therefore belong to a transition that had not finished.

This records a transition for the barriers that complete one (flags NONE or END_ONLY), not for a BEGIN_ONLY. END_ONLY keeps its StateAfter (the console repeats it in the pair).

What is in it

  • crates/xcl/src/hle/d3d12x/list_x.rs: completed_transitions() filters the barriers handed to title_textures::note_transitions (type TRANSITION, flags ≠ BEGIN_ONLY); add test a_split_barriers_begin_is_not_a_completed_transition (NONE + BEGIN_ONLY + END_ONLY → 2 records; a UAV barrier is none). Fails with the filter removed: left: 3, right: 2.

Tested

  • hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1)
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 960 passed, 0 failed, 43 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses, no heap windows, and cannot disable the driver cache (Windows Developer Mode is required))
  • cargo test -p xcl --lib list_x: 29 passed, 0 failed

Regression run

main (c4d37be, clean tree, no local changes):

xcl-smoke v1
commit: c4d37bec1bb4286eb373aea963404a23f13401fa
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1639 (PresentX 1640)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14618 MB

PR (76cdd13, clean tree, no local changes):

xcl-smoke v1
commit: 76cdd130d02d5f16f0a6cde2100dbd071767288f
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1640 (PresentX 1640)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 14605 MB

Not tested

  • a title that uses split barriers around a texture XCL keeps in step (the filter is covered by the unit test; no game here presented such a pair in the smoke run)
  • AMD GPUs and native wave64 hardware
  • other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine

AI use

  • OpenCode, Gemini 4 Neon: checked XCL-BT-032 against note_transitions and the D3D12 split-barrier rules, wrote the fix and test (and confirmed it fails without the filter), rebased onto c4d37be, ran the test suite and scripts/smoke.ps1 regression runs with Scripts: smoke blocks print the game folder's name #677's title hashing, and drafted this PR description.

@futurepro62

futurepro62 commented Nov 24, 2026 •

Copy link
Copy Markdown

Full-suite run, since this PR has no test report yet. Tested exact head 4ab9be9 (on its base c160d86).

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, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip pso_measurement_compiles_an_exact_synthetic_record: 858 passed, 0 failed, 42 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: a_split_barriers_begin_is_not_a_completed_transition.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 859 passed, 0 failed, 42 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • Two tests were skipped with --skip on NVIDIA. Both fail on main 7f7e768 too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns their skips into failures. heap_window_out_of_memory_falls_back_to_the_switch_form skips when XCL_HEAP_WINDOWS is unset (Tests: heap_window_out_of_memory_falls_back_to_the_switch_form fails under XCL_REQUIRE_GPU=mesh (opt-in skip counted as missing coverage) #1651), and shaders::tests::pso_measurement_compiles_an_exact_synthetic_record skips because Developer Mode is off on this PC (it cannot disable the driver cache). The AMD run does not set XCL_REQUIRE_GPU, so there both just print SKIPPED.

Not tested

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

resource_barrier_x passed every transition it forwarded to
title_textures::note_transitions, which takes the StateAfter as the state
the texture is in once the list has run. A split barrier's BEGIN_ONLY
(D3D12_RESOURCE_BARRIER_FLAG_BEGIN_ONLY) only starts its transition: the
resource is not in the new state, and must not be used, until the
END_ONLY completes it - the state uploads into a kept-in-step texture
started from then belonged to a transition that had not finished.

Record a transition for the barriers that complete one (flags NONE or
END_ONLY), not for a BEGIN_ONLY.

Assisted-by: OpenCode (Gemini 4 Neon)
@b3IKK
b3IKK force-pushed the d3d12x/split-barrier-begin-not-complete branch from 4ab9be9 to 76cdd13 Compare November 24, 2026 21:35
@b3IKK

b3IKK commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto c4d37be and re-ran both with the current scripts/smoke.ps1 (#677's hashed itle: line): 960 passed, 0 failed, 43 ignored.

@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, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

@b3IKK

b3IKK commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favour of #1654, which came first and makes the same change (#1607, group D53): a BEGIN_ONLY split barrier is not recorded as a completed transition. #1654 tests the flag bit, which is the better form; this one compared the whole flags word. AI use: OpenCode, Claude Fable 5.2.

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.

3 participants