D3D12.X: translate list #146 Enhanced Barriers to legacy ResourceBarrier #1018

Open
raylitebull wants to merge 1 commit from upstream-pr/1025 into main
raylitebull commented 2026-11-24 10:27:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-24T10:27:42Z.


Translate console command list slot #146 (ID3D12GraphicsCommandList7::Barrier(NumBarrierGroups, pBarrierGroups)) into legacy ResourceBarrier calls instead of emitting only a wildcard UAV barrier. Modern Scarlett titles that create resources with barrier layouts (device #127 / #133) rely on #146 for all render-target, depth, shader-resource, and copy layout transitions; dropping those transitions left targets stuck in their initial states.

(The diff is ~950 lines as one self-contained module: ~520 lines for parsing, layout mapping, state tracking, and legacy barrier translation, plus ~395 lines of unit and GPU tests.)

What is in it

  • crates/xcl/src/hle/d3d12x/enhanced_barrier.rs: parses D3D12_BARRIER_GROUP (GLOBAL, TEXTURE, BUFFER) with readable() guards (falling back to the legacy global UAV barrier on unparseable calls), maps D3D12_BARRIER_LAYOUT 0..=31 (including 0x1F) plus access-bit fallback for console-only layouts > 0x1F, tracks whole-resource states for UNDEFINED before layouts, emits aliasing barriers for UNDEFINED placed textures, skips UNORDERED_ACCESS on non-UAV textures and states disallowed on compute/copy lists, forwards emitted transitions to title_textures::note_transitions, and includes 13 unit + GPU tests.
  • crates/xcl/src/hle/d3d12x/device_x.rs, real.rs, list_x.rs, mod.rs: wire slot #146 to enhanced_barrier::barrier_x, align #127/#133 initial layout states with texture-vs-buffer awareness, record initial/legacy barrier states, and clear tracked state on res_release.

Tested

  • AMD Radeon RX 9070 XT (driver 32.0.32015.2008), Intel Core i5-13600KF, Windows 11 Pro 22631, rustc 1.99.1 (58cf8f9c3 2026-10-13), release + test profiles
  • cargo test --workspace -- --test-threads=4: 741 passed, 0 failed, 41 ignored (0 SKIPPED GPU tests)

Regression run

main:

xcl-smoke v1
commit: 6efdabcdaac93ce5cc123a85e85deba5d49cb294
gpu: AMD Radeon RX 9070 XT
title: Game Assets
seconds: 60
exit: 0x0
frames shown: 1512 (PresentX 1512)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14852 MB

PR:

xcl-smoke v1
commit: 1ecefdda3b4627ab8160845942f27ab4e75ce0c5
gpu: AMD Radeon RX 9070 XT
title: Game Assets
seconds: 60
exit: 0x0
frames shown: 1609 (PresentX 1609)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14876 MB

Not tested

  • NVIDIA GPUs, Intel Arc GPUs, Linux / Wine, other retail titles beyond the 60 s smoke run and unit/GPU test suite.

AI use

  • Antigravity (Gemini 4 Neon): rebased the local Enhanced Barriers implementation onto origin/main, cleaned up unused helper/constant warnings, ran the full GPU test suite and 60 s smoke regression check, and drafted this description.
<!-- greyfinch-sync:ivall/xcl:issue:5470397195 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1025). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-24T10:27:42Z. --- Translate console command list slot `#146` (`ID3D12GraphicsCommandList7::Barrier(NumBarrierGroups, pBarrierGroups)`) into legacy `ResourceBarrier` calls instead of emitting only a wildcard UAV barrier. Modern Scarlett titles that create resources with barrier layouts (device `#127` / `#133`) rely on `#146` for all render-target, depth, shader-resource, and copy layout transitions; dropping those transitions left targets stuck in their initial states. (The diff is ~950 lines as one self-contained module: ~520 lines for parsing, layout mapping, state tracking, and legacy barrier translation, plus ~395 lines of unit and GPU tests.) **What is in it** - `crates/xcl/src/hle/d3d12x/enhanced_barrier.rs`: parses `D3D12_BARRIER_GROUP` (`GLOBAL`, `TEXTURE`, `BUFFER`) with `readable()` guards (falling back to the legacy global UAV barrier on unparseable calls), maps `D3D12_BARRIER_LAYOUT` `0..=31` (including `0x1F`) plus access-bit fallback for console-only layouts `> 0x1F`, tracks whole-resource states for `UNDEFINED` before layouts, emits aliasing barriers for `UNDEFINED` placed textures, skips `UNORDERED_ACCESS` on non-UAV textures and states disallowed on compute/copy lists, forwards emitted transitions to `title_textures::note_transitions`, and includes 13 unit + GPU tests. - `crates/xcl/src/hle/d3d12x/device_x.rs`, `real.rs`, `list_x.rs`, `mod.rs`: wire slot `#146` to `enhanced_barrier::barrier_x`, align `#127`/`#133` initial layout states with texture-vs-buffer awareness, record initial/legacy barrier states, and clear tracked state on `res_release`. **Tested** - AMD Radeon RX 9070 XT (driver 32.0.32015.2008), Intel Core i5-13600KF, Windows 11 Pro 22631, `rustc 1.99.1 (58cf8f9c3 2026-10-13)`, release + test profiles - `cargo test --workspace -- --test-threads=4`: 741 passed, 0 failed, 41 ignored (0 SKIPPED GPU tests) **Regression run** main: ``` xcl-smoke v1 commit: 6efdabcdaac93ce5cc123a85e85deba5d49cb294 gpu: AMD Radeon RX 9070 XT title: Game Assets seconds: 60 exit: 0x0 frames shown: 1512 (PresentX 1512) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14852 MB ``` PR: ``` xcl-smoke v1 commit: 1ecefdda3b4627ab8160845942f27ab4e75ce0c5 gpu: AMD Radeon RX 9070 XT title: Game Assets seconds: 60 exit: 0x0 frames shown: 1609 (PresentX 1609) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14876 MB ``` **Not tested** - NVIDIA GPUs, Intel Arc GPUs, Linux / Wine, other retail titles beyond the 60 s smoke run and unit/GPU test suite. **AI use** - Antigravity (Gemini 4 Neon): rebased the local Enhanced Barriers implementation onto `origin/main`, cleaned up unused helper/constant warnings, ran the full GPU test suite and 60 s smoke regression check, and drafted this description.
poucosaudavel commented 2026-11-24 11:06:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by poucosaudavel on 2026-11-24T11:01:31Z.


Test report for the exact head 1ecefdda3b4627ab8160845942f27ab4e75ce0c5, since Not tested lists NVIDIA GPUs.

Tested

  • NVIDIA GeForce RTX 5060 Ti (8 GB, 32-lane waves), driver 610.88; Intel Core Ultra 7 265KF; Windows 11 (build 26200)
  • Rust 1.100.0 (stable-x86_64-pc-windows-msvc), MSVC 14.44, Windows SDK 10.0.26100, debug build
  • Clean worktrees, no local changes: the PR head, and its merge base on main (6efdabcdaac93ce5cc123a85e85deba5d49cb294) as the baseline
  • cargo build --workspace, then cargo test --workspace -- --test-threads=4:
    • PR head: 741 passed, 0 failed, 41 ignored
    • merge base: 727 passed, 0 failed, 41 ignored
  • The 14 extra passes are the new hle::d3d12x::enhanced_barrier::tests::*; no test present on the base is missing or failing on the PR.
  • enhanced_barriers_move_a_render_target_on_the_gpu ran on the NVIDIA adapter (the log shows backend real on the RTX 5060 Ti) and passed.
  • SKIPPED on both, same reason: gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask and gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware (no wave64)

Not tested

  • No scripts/smoke.ps1 regression run on a retail title: this covers the test suite only.
  • Release build of the PR head; AMD, Intel; Linux / Wine.

AI use

  • Claude Code (Claude Opus 5.5) ran the builds and tests and wrote this report from their output.
<!-- greyfinch-sync:ivall/xcl:comment:7129555142 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1025#issuecomment-7129555142). Originally posted by [poucosaudavel](https://github.com/poucosaudavel) on 2026-11-24T11:01:31Z. --- Test report for the exact head `1ecefdda3b4627ab8160845942f27ab4e75ce0c5`, since **Not tested** lists NVIDIA GPUs. **Tested** - NVIDIA GeForce RTX 5060 Ti (8 GB, 32-lane waves), driver 610.88; Intel Core Ultra 7 265KF; Windows 11 (build 26200) - Rust 1.100.0 (stable-x86_64-pc-windows-msvc), MSVC 14.44, Windows SDK 10.0.26100, debug build - Clean worktrees, no local changes: the PR head, and its merge base on `main` (`6efdabcdaac93ce5cc123a85e85deba5d49cb294`) as the baseline - `cargo build --workspace`, then `cargo test --workspace -- --test-threads=4`: - PR head: 741 passed, 0 failed, 41 ignored - merge base: 727 passed, 0 failed, 41 ignored - The 14 extra passes are the new `hle::d3d12x::enhanced_barrier::tests::*`; no test present on the base is missing or failing on the PR. - `enhanced_barriers_move_a_render_target_on_the_gpu` ran on the NVIDIA adapter (the log shows backend `real` on the RTX 5060 Ti) and passed. - SKIPPED on both, same reason: `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` (no wave64) **Not tested** - No `scripts/smoke.ps1` regression run on a retail title: this covers the test suite only. - Release build of the PR head; AMD, Intel; Linux / Wine. **AI use** - Claude Code (Claude Opus 5.5) ran the builds and tests and wrote this report from their output.
itsonewi commented 2026-11-24 11:06:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by itsonewi on 2026-11-24T11:06:51Z.

Review: COMMENTED


Global barriers with AccessBefore = NO_ACCESS emit nothing

Access::orders_earlier_work() returns false when access_before == NO_ACCESS, so the Item::Global arm of translate contributes no UAV barrier in that case. A global barrier is the enhanced-barrier form of a legacy NULL UAV barrier (D3D12 enhanced-barriers spec, "UAV Barriers": "Legacy Resource Barriers support NULL UAV barriers. These are equivalent to enhanced Barrier global barriers."), and SyncBefore = ALL with AccessBefore = NO_ACCESS is valid: only SyncBefore = NONE requires AccessBefore = NO_ACCESS, not the reverse.

The old #146 handler (list_x::uav_barrier_x) always emitted a NULL UAV barrier, so an XboxBvhBuilder global barrier that carries no access bits now emits nothing. The 60 s "Game Assets" smoke run does not reach the BVH builder, and the NVIDIA suite run in the thread covers the tests, not that path.

Could you either emit a UAV barrier for a global barrier with SyncBefore != SYNC_NONE (or for every global barrier, as before), or explain why a no-access global barrier needs no legacy barrier? The test unordered_access_gets_one_uav_barrier_for_all_resources covers AccessBefore = 0x10, and the NO_ACCESS case only with SyncBefore = NONE; a test with SyncBefore = ALL, AccessBefore = NO_ACCESS would pin the answer.

The rest of what I checked reads correctly: the struct offsets, the layout table, the subresource index formula, and the UAV-before/after rules match the spec.

Prepared with AI assistance; I checked each point against the code and the D3D12 enhanced-barriers spec.

<!-- greyfinch-sync:ivall/xcl:review:6038082227 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1025#pullrequestreview-6038082227). Originally posted by [itsonewi](https://github.com/itsonewi) on 2026-11-24T11:06:51Z. **Review:** COMMENTED --- **Global barriers with `AccessBefore = NO_ACCESS` emit nothing** `Access::orders_earlier_work()` returns false when `access_before == NO_ACCESS`, so the `Item::Global` arm of `translate` contributes no UAV barrier in that case. A global barrier is the enhanced-barrier form of a legacy NULL UAV barrier (D3D12 enhanced-barriers spec, "UAV Barriers": "Legacy Resource Barriers support NULL UAV barriers. These are equivalent to enhanced Barrier global barriers."), and `SyncBefore = ALL` with `AccessBefore = NO_ACCESS` is valid: only `SyncBefore = NONE` requires `AccessBefore = NO_ACCESS`, not the reverse. The old `#146` handler (`list_x::uav_barrier_x`) always emitted a NULL UAV barrier, so an XboxBvhBuilder global barrier that carries no access bits now emits nothing. The 60 s "Game Assets" smoke run does not reach the BVH builder, and the NVIDIA suite run in the thread covers the tests, not that path. Could you either emit a UAV barrier for a global barrier with `SyncBefore != SYNC_NONE` (or for every global barrier, as before), or explain why a no-access global barrier needs no legacy barrier? The test `unordered_access_gets_one_uav_barrier_for_all_resources` covers `AccessBefore = 0x10`, and the `NO_ACCESS` case only with `SyncBefore = NONE`; a test with `SyncBefore = ALL, AccessBefore = NO_ACCESS` would pin the answer. The rest of what I checked reads correctly: the struct offsets, the layout table, the subresource index formula, and the UAV-before/after rules match the spec. *Prepared with AI assistance; I checked each point against the code and the D3D12 enhanced-barriers spec.*
DavidM1911 commented 2026-11-24 12:05:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T11:21:53Z.


Independent verification, merged onto current main 384f7f7 locally (clean merge).

Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti + Radeon iGPU; Rust stable MSVC, debug.

  • cargo test -p xcl --lib enhanced: 14 passed, 0 failed — all enhanced_barrier::tests, including the GPU test enhanced_barriers_move_a_render_target_on_the_gpu (ran on the default adapter, RTX 3060 Ti).

AI use: test runs by Devin (Cognition, SWE-2); no code changes.

<!-- greyfinch-sync:ivall/xcl:comment:7130000957 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1025#issuecomment-7130000957). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T11:21:53Z. --- Independent verification, merged onto current `main` `384f7f7` locally (clean merge). **Machine:** Windows 11, Ryzen 9 7900X + RTX 3060 Ti + Radeon iGPU; Rust stable MSVC, debug. - `cargo test -p xcl --lib enhanced`: **14 passed, 0 failed** — all `enhanced_barrier::tests`, including the GPU test `enhanced_barriers_move_a_render_target_on_the_gpu` (ran on the default adapter, RTX 3060 Ti). AI use: test runs by Devin (Cognition, SWE-2); no code changes.
IvyNotFound commented 2026-11-24 15:05:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by IvyNotFound on 2026-11-24T14:30:50Z.


Retail run into world loading on an RTX 5080: 1ecefdd merged onto main 930e8b4 – no crash or device removal, the barriers are translated, the frames after loading stay black as on main, and the #505 GPU-wait stalls come at least as often

Tested

  • NVIDIA GeForce RTX 5080 16 GB, driver 621.24; Ryzen 7 7800X3D; Windows 11 25H2 (26200.9974); rustc 1.100.0 MSVC; DXC 1.9.2602.17.
  • main 930e8b4 + this PR's head 1ecefdd (clean merge, local commit bbace0e).
  • cargo test -p xcl --lib enhanced (debug): 14 passed, 0 failed (the GPU test ran on the RTX 5080).
  • Retail title of #505, release, scripts/smoke.ps1 -Seconds 140, XCL_PRESS_A_AT=15, XCL_PSO_WAIT_MS=50 (so it gets past the first ListX #101 into world loading), XCL_FRAME_DUMP=2. Two runs of the PR, compared with one of main with the same settings.
main 930e8b4 PR, run 1 PR, run 2
exit / device removals / crashes 0x0 / 0 / 0 0x0 / 0 / 0 0x0 / 0 / 0
frames shown 1434 1392 1395
peak commit 33 004 MB 37 236 MB 41 830 MB
GPU queue.Wait … did not complete within 5000 ms 19, first at 118.6 s 27, first at 109.8 s 55, first at 120.6 s
Write64 cycle breaks 13 17 32
  • The translation is active from the title's first barriers: Barrier: 1 groups, 2 barriers (2 texture) → 2 legacy barriers at 3.1 s.
  • From ~68–92 s, on compute lists: Barrier: N transitions a list of type 2 cannot make – left out (N = 1, 4, 7).
  • The frames the title presents after loading are the loading screen fading, then all black (mean 0.0 / 255), as on main (#505).
  • More stalls and a higher peak commit in both runs than in the main run. My earlier main runs of the same title reached up to 43 GB peak commit and 13–34 timeouts (https://github.com/ivall/xcl/issues/505#issuecomment-7130913073), so two runs do not show that this PR causes it. Run 2's peak is 127 % of this main run's.

Not tested

  • the whole suite at this merge
  • whether the left-out compute-list transitions matter (they are skipped by design here)

Note for whoever merges: #1063 (mine, stacked on #1027) also acts on this slot's calls, in list_x::uav_barrier_x. It adds depth ↔ twin copies after the global UAV barrier. With this PR the slot goes to enhanced_barrier::barrier_x instead, so whichever lands second needs the other's hook.

AI use

  • Claude Code, Claude Opus 5.5: merged and built the PR, ran the tests and the runs, read the logs and frame dumps, and wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7134498498 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1025#issuecomment-7134498498). Originally posted by [IvyNotFound](https://github.com/IvyNotFound) on 2026-11-24T14:30:50Z. --- **Retail run into world loading on an RTX 5080: `1ecefdd` merged onto `main` `930e8b4` – no crash or device removal, the barriers are translated, the frames after loading stay black as on `main`, and the #505 GPU-wait stalls come at least as often** **Tested** - NVIDIA GeForce RTX 5080 16 GB, driver 621.24; Ryzen 7 7800X3D; Windows 11 25H2 (26200.9974); rustc 1.100.0 MSVC; DXC 1.9.2602.17. - `main` `930e8b4` + this PR's head `1ecefdd` (clean merge, local commit `bbace0e`). - `cargo test -p xcl --lib enhanced` (debug): 14 passed, 0 failed (the GPU test ran on the RTX 5080). - Retail title of #505, release, `scripts/smoke.ps1 -Seconds 140`, `XCL_PRESS_A_AT=15`, `XCL_PSO_WAIT_MS=50` (so it gets past the first `ListX #101` into world loading), `XCL_FRAME_DUMP=2`. Two runs of the PR, compared with one of `main` with the same settings. | | `main` `930e8b4` | PR, run 1 | PR, run 2 | |---|---|---|---| | exit / device removals / crashes | 0x0 / 0 / 0 | 0x0 / 0 / 0 | 0x0 / 0 / 0 | | frames shown | 1434 | 1392 | 1395 | | peak commit | 33 004 MB | 37 236 MB | 41 830 MB | | `GPU queue.Wait … did not complete within 5000 ms` | 19, first at 118.6 s | 27, first at 109.8 s | 55, first at 120.6 s | | Write64 cycle breaks | 13 | 17 | 32 | - The translation is active from the title's first barriers: `Barrier: 1 groups, 2 barriers (2 texture) → 2 legacy barriers` at 3.1 s. - From ~68–92 s, on compute lists: `Barrier: N transitions a list of type 2 cannot make – left out` (N = 1, 4, 7). - The frames the title presents after loading are the loading screen fading, then all black (mean 0.0 / 255), as on `main` (#505). - More stalls and a higher peak commit in both runs than in the `main` run. My earlier `main` runs of the same title reached up to 43 GB peak commit and 13–34 timeouts (https://github.com/ivall/xcl/issues/505#issuecomment-7130913073), so two runs do not show that this PR causes it. Run 2's peak is 127 % of this `main` run's. **Not tested** - the whole suite at this merge - whether the left-out compute-list transitions matter (they are skipped by design here) Note for whoever merges: #1063 (mine, stacked on #1027) also acts on this slot's calls, in `list_x::uav_barrier_x`. It adds depth ↔ twin copies after the global UAV barrier. With this PR the slot goes to `enhanced_barrier::barrier_x` instead, so whichever lands second needs the other's hook. **AI use** - Claude Code, Claude Opus 5.5: merged and built the PR, ran the tests and the runs, read the logs and frame dumps, and wrote this report.
deepdev237 commented 2026-11-24 15:06:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by deepdev237 on 2026-11-24T14:46:02Z.


Parser observation from a retail run on AMD RDNA4

Tested

  • AMD Radeon RX 9060 XT (RDNA4, driver 32.0.32015.7029), Ryzen 9 5950X, Windows 11 build 26300, Rust 1.100.0 MSVC, release.
  • A local diagnostic based on 930e8b49c1c2ec683d22c724a398b39111cd0e56 (Git tree 391b7fe28b4f99bce3d9183b99f794f50e592f1c) reused the slot #146 parser from 1ecefdda3b4627ab8160845942f27ab4e75ce0c5. It retained the existing PC global UAV barrier forwarding.
  • xcl.exe run "<retail-title>" with XCL_NETWORK=0, XCL_DRED=1, XCL_PSO_WAIT_MS=50 and XCL_TRACE_INDIRECT_BARRIERS=1: all 80 traced indirect calls matched slot #146 BUFFER records on the same resource, with whole-buffer access 0x10 → 0x290 before and 0x200 → 0x10 afterward.
  • At 248.285 s DRED reported DXGI_ERROR_DEVICE_HUNG. The only started, unfinished list was 11 of 17 operations complete, with EXECUTEINDIRECT next and no usable page-fault address.

Not tested — The full #1025 head or its native barrier translation. These are the title's declared access masks. The diagnostic did not read back the dispatch arguments from the GPU.

AI use — OpenAI Codex (gpt-6.2-sol) ran the tests, checked the local receipts and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7134912952 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1025#issuecomment-7134912952). Originally posted by [deepdev237](https://github.com/deepdev237) on 2026-11-24T14:46:02Z. --- **Parser observation from a retail run on AMD RDNA4** **Tested** - AMD Radeon RX 9060 XT (RDNA4, driver `32.0.32015.7029`), Ryzen 9 5950X, Windows 11 build 26300, Rust 1.100.0 MSVC, release. - A local diagnostic based on `930e8b49c1c2ec683d22c724a398b39111cd0e56` (Git tree `391b7fe28b4f99bce3d9183b99f794f50e592f1c`) reused the slot #146 parser from `1ecefdda3b4627ab8160845942f27ab4e75ce0c5`. It retained the existing PC global UAV barrier forwarding. - `xcl.exe run "<retail-title>"` with `XCL_NETWORK=0`, `XCL_DRED=1`, `XCL_PSO_WAIT_MS=50` and `XCL_TRACE_INDIRECT_BARRIERS=1`: all **80** traced indirect calls matched slot #146 BUFFER records on the same resource, with whole-buffer access `0x10 → 0x290` before and `0x200 → 0x10` afterward. - At 248.285 s DRED reported `DXGI_ERROR_DEVICE_HUNG`. The only started, unfinished list was 11 of 17 operations complete, with `EXECUTEINDIRECT` next and no usable page-fault address. **Not tested** — The full #1025 head or its native barrier translation. These are the title's declared access masks. The diagnostic did not read back the dispatch arguments from the GPU. **AI use** — OpenAI Codex (`gpt-6.2-sol`) ran the tests, checked the local receipts and wrote this report.
github-actions[bot] commented 2026-11-27 21:26:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-27T21:26:19Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7228443783 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1025#issuecomment-7228443783). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-27T21:26:19Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
CharlyRien commented 2026-11-28 04:41:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by CharlyRien on 2026-11-28T04:41:22Z.


A note from a separate translation of #146 on our side (not a run of this PR's head), about the read layouts of depth buffers.

What we saw (RTX 3090, the retail title, one run per setting, our own #146 translation, not this PR's code)

  • With a depth buffer's read layouts mapped like this PR does (SHADER_RESOURCE → 0xC0, GENERIC_READ / direct-queue generic read → 0x8C0), the frames lost detail: posters and wall details gone, mean luminance 21 against 35 for the same tree without the translation.
  • With DEPTH_READ (0x20) added to those states for depth buffers on a direct list (0xE0, 0x8E0), the image matched the run without the translation (luminance 35.3 against 34.9, the same posters), with 0 failed Close and the same frame pace (2.89 presents/s over 120 s of world).
  • The title reads its depth through a read-only depth view while it writes stencil; the PC wants DEPTH_READ for a read-only DSV. (That is our reading, not something we measured separately.)

In this PR (read in enhanced_barrier.rs, layout_state): layouts 6 / 21 give 0xC0 and 1 / 19 / 31 give 0x8C0 for textures, with no DEPTH_READ for a depth buffer, and layout 5 (DEPTH_STENCIL_READ) gives 0x20 alone. So a depth buffer moved to a shader-resource or generic-read layout ends up without DEPTH_READ, as in our first runs. A compute or copy list cannot name DEPTH_READ; there we kept the other read bits.

Setup: our lab tree (merge base b49be18 of main plus 240 local commits that are not public; our own #146 translation behind a switch, XCL_BARRIERS=1), RTX 3090 24 GB (Resizable BAR off), driver 616.56, Ryzen 9 5950X, 32 GB RAM, Windows 11 22631.

Not tested

  • This PR's head itself on our title: the numbers above come from our translation with and without the extra bit.
  • AMD, Intel.

AI use: Claude Code, model Claude Opus 5.5, wrote this note from our run logs and a reading of the diff. The person running these tests asked for this post.

<!-- greyfinch-sync:ivall/xcl:comment:7234196854 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1025#issuecomment-7234196854). Originally posted by [CharlyRien](https://github.com/CharlyRien) on 2026-11-28T04:41:22Z. --- A note from a separate translation of #146 on our side (not a run of this PR's head), about the read layouts of depth buffers. **What we saw** (RTX 3090, the retail title, one run per setting, our own #146 translation, not this PR's code) - With a depth buffer's read layouts mapped like this PR does (`SHADER_RESOURCE` → `0xC0`, `GENERIC_READ` / direct-queue generic read → `0x8C0`), the frames lost detail: posters and wall details gone, mean luminance 21 against 35 for the same tree without the translation. - With `DEPTH_READ` (`0x20`) added to those states for depth buffers on a direct list (`0xE0`, `0x8E0`), the image matched the run without the translation (luminance 35.3 against 34.9, the same posters), with 0 failed `Close` and the same frame pace (2.89 presents/s over 120 s of world). - The title reads its depth through a read-only depth view while it writes stencil; the PC wants `DEPTH_READ` for a read-only DSV. (That is our reading, not something we measured separately.) **In this PR** (read in `enhanced_barrier.rs`, `layout_state`): layouts 6 / 21 give `0xC0` and 1 / 19 / 31 give `0x8C0` for textures, with no `DEPTH_READ` for a depth buffer, and layout 5 (`DEPTH_STENCIL_READ`) gives `0x20` alone. So a depth buffer moved to a shader-resource or generic-read layout ends up without `DEPTH_READ`, as in our first runs. A compute or copy list cannot name `DEPTH_READ`; there we kept the other read bits. **Setup:** our lab tree (merge base `b49be18` of `main` plus 240 local commits that are not public; our own #146 translation behind a switch, `XCL_BARRIERS=1`), RTX 3090 24 GB (Resizable BAR off), driver 616.56, Ryzen 9 5950X, 32 GB RAM, Windows 11 22631. **Not tested** - This PR's head itself on our title: the numbers above come from our translation with and without the extra bit. - AMD, Intel. **AI use:** Claude Code, model Claude Opus 5.5, wrote this note from our run logs and a reading of the diff. The person running these tests asked for this post.
Foniass commented 2026-12-01 06:39:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:39:54Z.


Review (head 1ecefdda, diff read, not a merge-check; draft and conflicting, so not built or run):

  • Superseded. Main translates #146 texture barriers into legacy transitions in barrier_groups.rs (2b75212d, merged in #3287, plus bd5ee498), a port of this author's own amd-dev commits a68f609f / fdd1ac2d, and emits a global UAV barrier on every #146 call (list_x.rs ~5032).
  • Rebased as is, this would take over slot 146 (real.rs ~1026) and call the PC ResourceBarrier directly (enhanced_barrier.rs ~501 / ~511), skipping list_x::resource_barrier_x and with it capture, depth_uav::plan_barriers, the lut3d and placement notes and barrier_groups::note_legacy_state, and dropping main's depth / stencil plane tracking. Its STATES table tracks whole resources only (~358, ~401), so after a per-subresource transition a later barrier from UNDEFINED starts from a stale state.
  • What remains overlaps open PRs: #3238 / #839 (layout_state) and #3558 (UNDEFINED start state).

Fine: the bounded readable() parsing and the unit tests. Recommendation: close as superseded; if seeding the tracked state at #127 / #133 creation or the aliasing barrier for placed textures is still needed, a small PR on top of barrier_groups.rs.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7303130858 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1025#issuecomment-7303130858). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:39:54Z. --- Review (head 1ecefdda, diff read, not a merge-check; draft and conflicting, so not built or run): - **Superseded.** Main translates #146 texture barriers into legacy transitions in `barrier_groups.rs` (2b75212d, merged in #3287, plus bd5ee498), a port of this author's own amd-dev commits a68f609f / fdd1ac2d, and emits a global UAV barrier on every #146 call (`list_x.rs` ~5032). - Rebased as is, this would take over slot 146 (`real.rs` ~1026) and call the PC `ResourceBarrier` directly (`enhanced_barrier.rs` ~501 / ~511), skipping `list_x::resource_barrier_x` and with it capture, `depth_uav::plan_barriers`, the lut3d and placement notes and `barrier_groups::note_legacy_state`, and dropping main's depth / stencil plane tracking. Its `STATES` table tracks whole resources only (~358, ~401), so after a per-subresource transition a later barrier from UNDEFINED starts from a stale state. - What remains overlaps open PRs: #3238 / #839 (`layout_state`) and #3558 (UNDEFINED start state). Fine: the bounded `readable()` parsing and the unit tests. Recommendation: close as superseded; if seeding the tracked state at #127 / #133 creation or the aliasing barrier for placed textures is still needed, a small PR on top of `barrier_groups.rs`. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1025:upstream-pr/1025'
git switch 'upstream-pr/1025'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1025'
git switch 'upstream-pr/1025'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1025'
git switch 'upstream-pr/1025'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1025'
git switch 'main'
git merge --squash 'upstream-pr/1025'
git switch 'main'
git merge --ff-only 'upstream-pr/1025'
git switch 'main'
git merge 'upstream-pr/1025'
git push origin 'main'
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!1018
No description provided.