D3D12.X: clear illegal PC split-barrier flags on UAV and aliasing barriers #3236

Merged
Kalmarv merged 1 commit from upstream-pr/3236 into main 2026-12-02 17:39:50 +00:00
Kalmarv commented 2026-11-28 23:37:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-28T23:37:38Z.


Clear illegal PC split-barrier flags (BEGIN_ONLY/END_ONLY) on Aliasing (Type == 1) and UAV (Type == 2) resource barriers, preserving them only on Transition (Type == 0) barriers.

What is in it

  • crates/xcl/src/hle/d3d12x/list_x.rs: restrict allowed_flags to if ty == 0 { PC_FLAGS } else { 0 } and extend resource_barrier_console_flags_* unit tests.

Tested

  • Hardware / toolchain: NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.1074), AMD Ryzen 9 9950X, Windows 11 Pro (build 26200), rustc 1.99.0, DXC 1.9 (XCL_DXC_DIR), debug for unit tests and release for xcl-smoke.
  • Targeted unit tests: cargo test -p xcl --lib resource_barrier_console_flags -- --nocapture: 3 passed, 0 failed, 0 ignored.
  • Live steady-world run (BISECT1, RTX 5070 Ti, XCL_DIRECT_DXIL=all): exit 0x0, 1.69 fps (matching baseline), 0 removals, 0 crashes.

Regression run
main (f0e8fdd5c3942ddd399d5ee11384c8595c5aacff):

xcl-smoke v1
commit: f0e8fdd5c3942ddd399d5ee11384c8595c5aacff
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 150
exit: 0x0
frames shown: 1695 (PresentX 1695)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 31546 MB

PR head (0dffe8a003611c70f96726e287d7ca18d0d3e075):

xcl-smoke v1
commit: 0dffe8a003611c70f96726e287d7ca18d0d3e075
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 150
exit: 0x0
frames shown: 1884 (PresentX 1884)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 32525 MB

Not tested

  • AMD RDNA / Intel GPUs.
  • Self-copy transitions (0xC00, COPY_SOURCE | COPY_DEST).

AI use

  • Antigravity (Gemini) assisted with implementation, unit tests, and xcl-smoke regression run.
<!-- greyfinch-sync:ivall/xcl:issue:5545688510 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3236). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-28T23:37:38Z. --- Clear illegal PC split-barrier flags (`BEGIN_ONLY`/`END_ONLY`) on `Aliasing` (`Type == 1`) and `UAV` (`Type == 2`) resource barriers, preserving them only on `Transition` (`Type == 0`) barriers. **What is in it** - `crates/xcl/src/hle/d3d12x/list_x.rs`: restrict `allowed_flags` to `if ty == 0 { PC_FLAGS } else { 0 }` and extend `resource_barrier_console_flags_*` unit tests. **Tested** - Hardware / toolchain: NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.1074), AMD Ryzen 9 9950X, Windows 11 Pro (build 26200), `rustc 1.99.0`, DXC 1.9 (`XCL_DXC_DIR`), debug for unit tests and release for `xcl-smoke`. - Targeted unit tests: `cargo test -p xcl --lib resource_barrier_console_flags -- --nocapture`: 3 passed, 0 failed, 0 ignored. - Live steady-world run (`BISECT1`, RTX 5070 Ti, `XCL_DIRECT_DXIL=all`): `exit 0x0`, `1.69 fps` (matching baseline), `0` removals, `0` crashes. **Regression run** main (`f0e8fdd5c3942ddd399d5ee11384c8595c5aacff`): ``` xcl-smoke v1 commit: f0e8fdd5c3942ddd399d5ee11384c8595c5aacff gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 150 exit: 0x0 frames shown: 1695 (PresentX 1695) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 31546 MB ``` PR head (`0dffe8a003611c70f96726e287d7ca18d0d3e075`): ``` xcl-smoke v1 commit: 0dffe8a003611c70f96726e287d7ca18d0d3e075 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 150 exit: 0x0 frames shown: 1884 (PresentX 1884) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 32525 MB ``` **Not tested** - AMD RDNA / Intel GPUs. - Self-copy transitions (`0xC00`, `COPY_SOURCE | COPY_DEST`). **AI use** - Antigravity (Gemini) assisted with implementation, unit tests, and `xcl-smoke` regression run.
Foniass commented 2026-11-29 14:57:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-11-29T14:57:30Z.


merge-check
base: d8bd9a38204667f3ca7dd9eeffcc2f1c937b07b0
head: 0dffe8a003611c70f96726e287d7ca18d0d3e075
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2614 passed, 4 failed, 49 ignored; SKIPPED: 44; failing: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (driver E_OUTOFMEMORY, same on base on this machine)
review: no bug found: it only clears flags the PC refuses on UAV and aliasing barriers. Nothing shows a title emitting split UAV barriers. The PR text has no full-suite counts and no model.
performance: 60 s smoke: 1682 frames (100.6 %), peak commit 16851 MB (93.9 %)
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti (driver 32.0.16.2114), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

Merge-check run and written with Claude Code (Claude Opus 5.5): a test merge onto the base above, the full suite, and a 60 s scripts/smoke.ps1 run of a retail title against main on the same machine. The 4 fuzz_validate_and_gpu_* failures happen on main on this machine too.

<!-- greyfinch-sync:ivall/xcl:comment:7257707592 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3236#issuecomment-7257707592). Originally posted by [Foniass](https://github.com/Foniass) on 2026-11-29T14:57:30Z. --- ```text merge-check base: d8bd9a38204667f3ca7dd9eeffcc2f1c937b07b0 head: 0dffe8a003611c70f96726e287d7ca18d0d3e075 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2614 passed, 4 failed, 49 ignored; SKIPPED: 44; failing: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (driver E_OUTOFMEMORY, same on base on this machine) review: no bug found: it only clears flags the PC refuses on UAV and aliasing barriers. Nothing shows a title emitting split UAV barriers. The PR text has no full-suite counts and no model. performance: 60 s smoke: 1682 frames (100.6 %), peak commit 16851 MB (93.9 %) verdict: safe to merge hardware / tool and model: RTX 5070 Ti (driver 32.0.16.2114), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 ``` Merge-check run and written with Claude Code (Claude Opus 5.5): a test merge onto the base above, the full suite, and a 60 s `scripts/smoke.ps1` run of a retail title against main on the same machine. The 4 `fuzz_validate_and_gpu_*` failures happen on main on this machine too.
fromthemoonx commented 2026-12-01 18:36:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-01T18:36:01Z.


merge-check
base: 6bfb5c5153
head: 0dffe8a003
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2904 passed, 0 failed, 51 ignored (base: 2904 passed, 0 failed, 51 ignored); SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps), the same set as base; failing: none from this PR. The whole-suite run ended the lib binary with 0xc0000005 during eh::tests::thread_dumps_while_threads_run_and_exit (#3586, on main too; this PR touches only list_x.rs). The counts are the lib binary run on its own (2756 passed, 0 failed, 31 ignored) plus the other binaries (148 passed, 0 failed, 20 ignored).
review: read the whole diff (list_x.rs, +12 -4). No correctness problem found.

  • resource_barrier_x now keeps BEGIN_ONLY / END_ONLY only on transition barriers (type 0). UAV (2) and aliasing (1) barriers reach the PC with flags 0.
  • A console split UAV or aliasing pair therefore becomes two whole barriers. That is more synchronization, never less, and duplicate UAV barriers already collapse.
  • resource_barrier_console_flags_* (3 tests): 3 of 3 runs passed.
  • Mutation: allowed_flags = PC_FLAGS for every type (main's behaviour) fails resource_barrier_console_flags_keep_uav_ordering_and_aliasing. Good.
  • Not checked here: what the D3D12 debug layer says about split flags on UAV / aliasing barriers. No retail title was run here.
    performance: none measurable: one comparison per barrier; a split UAV / aliasing pair costs one extra barrier.
    verdict: safe to merge
    hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
<!-- greyfinch-sync:ivall/xcl:comment:7321199762 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3236#issuecomment-7321199762). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-12-01T18:36:01Z. --- merge-check base: 6bfb5c5153ccc23517daf30aa1071ddb0fadb53c head: 0dffe8a003611c70f96726e287d7ca18d0d3e075 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2904 passed, 0 failed, 51 ignored (base: 2904 passed, 0 failed, 51 ignored); SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps), the same set as base; failing: none from this PR. The whole-suite run ended the lib binary with 0xc0000005 during `eh::tests::thread_dumps_while_threads_run_and_exit` (#3586, on main too; this PR touches only `list_x.rs`). The counts are the lib binary run on its own (2756 passed, 0 failed, 31 ignored) plus the other binaries (148 passed, 0 failed, 20 ignored). review: read the whole diff (`list_x.rs`, +12 -4). No correctness problem found. - `resource_barrier_x` now keeps `BEGIN_ONLY` / `END_ONLY` only on transition barriers (type 0). UAV (2) and aliasing (1) barriers reach the PC with flags 0. - A console split UAV or aliasing pair therefore becomes two whole barriers. That is more synchronization, never less, and duplicate UAV barriers already collapse. - `resource_barrier_console_flags_*` (3 tests): 3 of 3 runs passed. - Mutation: `allowed_flags = PC_FLAGS` for every type (main's behaviour) fails `resource_barrier_console_flags_keep_uav_ordering_and_aliasing`. Good. - Not checked here: what the D3D12 debug layer says about split flags on UAV / aliasing barriers. No retail title was run here. performance: none measurable: one comparison per barrier; a split UAV / aliasing pair costs one extra barrier. verdict: safe to merge hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
Decodere commented 2026-12-02 10:34:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T10:34:04Z.


merge-check
base: 1c8b551475
head: 0dffe8a003
merge: clean (trial-merge commit e289ce37db0ce29381c8fbf65411d03662e2eaef, git diff --check clean)
build: cargo build --workspace ok; cargo build --release -p xcl ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture (43 targets): 2908 passed, 1 failed, 51 ignored. All 4 targeted resource-barrier tests in hle::d3d12x::list_x::tests passed with 0 skips (resource_barrier_console_flags_keep_transition_and_split_bits, resource_barrier_console_flags_keep_uav_ordering_and_aliasing, resource_barrier_console_flags_leave_existing_filters_in_place, gpu_resource_barrier_console_hint_preserves_texture_copy), covering the 4 new BEGIN_ONLY/END_ONLY clearing assertions on UAV and aliasing barriers. The single failure is the pre-existing Issue #3441 flake in tests/gpu_two_pass_cache_e2e.rs::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (line 584, left: 1, right: 0), reproduced identically on clean base 1c8b5514 and unrelated to list_x.rs. 28 SKIPPED lines (host environment only: 22 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 2 no heap windows, 1 cannot disable the driver cache (Windows Developer Mode required)).
review: Read the full merged diff (+12/-4 in crates/xcl/src/hle/d3d12x/list_x.rs::resource_barrier_x and tests). Sets allowed_flags = if ty == 0 { PC_FLAGS } else { 0 } so D3D12_RESOURCE_BARRIER_FLAG_BEGIN_ONLY and END_ONLY are preserved only on transition barriers (ty == 0) and cleared to 0 (with capped warn logging) on aliasing (ty == 1) and UAV (ty == 2) barriers, matching PC D3D12 validation rules while preserving console barrier ordering. Unit test assertions cover flags 1 and 2 on both ty == 2 and ty == 1. Minimal, exact, no scope creep or UB.
performance: 60 s retail smoke (title: 29640639): 1652 frames (+13.0% vs 1c8b5514 baseline 1462 frames), 14669 MB peak commit (-8.6% vs 16043 MB baseline), 0 device removals, 0 crashes.

xcl-smoke v1
commit: e289ce37db0ce29381c8fbf65411d03662e2eaef
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1652 (PresentX 1652)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 14669 MB

verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7342659047 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3236#issuecomment-7342659047). Originally posted by [Decodere](https://github.com/Decodere) on 2026-12-02T10:34:04Z. --- merge-check base: 1c8b551475e1e7bfe48f94448492a4c3544a2e0f head: 0dffe8a003611c70f96726e287d7ca18d0d3e075 merge: clean (trial-merge commit e289ce37db0ce29381c8fbf65411d03662e2eaef, git diff --check clean) build: cargo build --workspace ok; cargo build --release -p xcl ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture (43 targets): 2908 passed, 1 failed, 51 ignored. All 4 targeted resource-barrier tests in hle::d3d12x::list_x::tests passed with 0 skips (resource_barrier_console_flags_keep_transition_and_split_bits, resource_barrier_console_flags_keep_uav_ordering_and_aliasing, resource_barrier_console_flags_leave_existing_filters_in_place, gpu_resource_barrier_console_hint_preserves_texture_copy), covering the 4 new BEGIN_ONLY/END_ONLY clearing assertions on UAV and aliasing barriers. The single failure is the pre-existing Issue #3441 flake in tests/gpu_two_pass_cache_e2e.rs::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (line 584, left: 1, right: 0), reproduced identically on clean base 1c8b5514 and unrelated to list_x.rs. 28 SKIPPED lines (host environment only: 22 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 2 no heap windows, 1 cannot disable the driver cache (Windows Developer Mode required)). review: Read the full merged diff (+12/-4 in crates/xcl/src/hle/d3d12x/list_x.rs::resource_barrier_x and tests). Sets `allowed_flags = if ty == 0 { PC_FLAGS } else { 0 }` so `D3D12_RESOURCE_BARRIER_FLAG_BEGIN_ONLY` and `END_ONLY` are preserved only on transition barriers (`ty == 0`) and cleared to 0 (with capped warn logging) on aliasing (`ty == 1`) and UAV (`ty == 2`) barriers, matching PC D3D12 validation rules while preserving console barrier ordering. Unit test assertions cover flags 1 and 2 on both `ty == 2` and `ty == 1`. Minimal, exact, no scope creep or UB. performance: 60 s retail smoke (title: 29640639): 1652 frames (+13.0% vs 1c8b5514 baseline 1462 frames), 14669 MB peak commit (-8.6% vs 16043 MB baseline), 0 device removals, 0 crashes. ``` xcl-smoke v1 commit: e289ce37db0ce29381c8fbf65411d03662e2eaef gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1652 (PresentX 1652) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 14669 MB ``` verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!3236
No description provided.