D3D12.X: the console's acceleration-structure resource flag becomes UAV, not a video flag #3141

Open
KOLESNiii wants to merge 1 commit from upstream-pr/3141 into main
KOLESNiii commented 2026-11-28 13:01:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T13:01:41Z.


Status: a guess that needs evidence before it can be merged. That console resource flag 0x80 is a raytracing acceleration-structure buffer is reasoned from how titles call the API and from the PC's D3D12; it is not taken from any console documentation, and no title has confirmed it yet. Draft until then.

Evidence that would confirm it: a title that creates a buffer with flag 0x80, and what it does with that buffer (builds an acceleration structure into it, or binds it as one). The retail game used for the regression run does not get there.

If you run a title that gets there, please post those lines here (not the whole log, which names your paths).

The console's resource flag 0x80 is a raytracing acceleration-structure

buffer; the PC's 0x80 is a video-encode reference. pc_resource_desc and

sanitize_coherent_buffer kept the low byte (flags & 0xFF), so a console

acceleration-structure buffer reached the PC as a video-encode buffer, which

the PC refuses for a buffer or treats as a video resource.

pc_resource_flags keeps 0x1-0x20, maps 0x80 to ALLOW_UNORDERED_ACCESS (an

acceleration-structure buffer needs it for its state on the PC) and never

forwards 0x40, 0x80, 0x100, 0x200 or the console-only bits above. Not

confirmed on a title: whether the creations fail or are accepted as video

buffers (the handoff's logging step).

What is in it

  • crates/xcl/src/hle/d3d12x/device_x.rs: +22 / -1

  • crates/xcl/src/hle/d3d12x/real.rs: +1 / -1

  • new tests: console_resource_flags_map_to_pc_ones

Tested

  • NVIDIA RTX 2070 SUPER (driver 32.0.16.2140), AMD Ryzen 5 3600XT, Windows 11 build 26300, Rust 1.100.0 MSVC; tests in debug

  • cargo test --workspace --no-fail-fast -- --test-threads=4 on 9c89e410 (built on main 336fddda; it merges into the current main e429936c without conflict): 2123 passed, 9 failed, 48 ignored, 25 SKIPPED lines (21 no wave64, 3 #1426, 1 no heap windows).

  • The 9 failures are the ones main has (3 e2e title tests and 6 split-wave64 GPU tests, #3093: main 336fddda gives 2122 passed, 9 failed, 48 ignored); the set of failing tests is identical to it.

  • console_resource_flags_map_to_pc_ones: ok in that run; fails without the change

Regression run

Both 60-second runs used the same warm DXIL cache directory.


xcl-smoke v1

commit: 336fdddafbcb3c3db753629f5f79a9f44b6c4b9d

gpu: NVIDIA GeForce RTX 2070 SUPER

title: retail game

seconds: 60

exit: 0x0

frames shown: 1228 (PresentX 1228)

presents per 2 s (last 3): 61 60 60

device removals: 0

crashes: 0

peak commit: 15234 MB


xcl-smoke v1

commit: 9c89e410b6cffbc80302812565219ccb3a6372b2

gpu: NVIDIA GeForce RTX 2070 SUPER

title: retail game

seconds: 60

exit: 0x0

frames shown: 1464 (PresentX 1464)

presents per 2 s (last 3): 60 60 60

device removals: 0

crashes: 0

peak commit: 15474 MB

Not tested

  • Full preparation. The smoke runs used XCL_PREPARE=0.

  • Whether a console creation with flag 0x80 fails on the PC today or is accepted as a video buffer: not confirmed (needs logging on a title that creates acceleration structures). No GPU test of an acceleration-structure buffer.

  • A console desc with 0x80 on a depth texture gets the UAV flag back after the depth step strips it (acceleration structures are buffers).

  • AMD and Intel GPUs; wave64 hardware (the RTX 2070 SUPER is wave32).

AI use

  • Codex (exact model name unavailable) verified the queued smoke results and drafted this description update.

  • patch-worker on Claude Sonnet 5.5 (self-reported); reviewed by Claude Opus 5.5: the code and tests. The description and the test / suite runs: Claude Code, Claude Sonnet 5.5 and Claude Opus 5.5.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5540377982 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3141). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-28T13:01:41Z. --- **Status: a guess that needs evidence before it can be merged.** That console resource flag 0x80 is a raytracing acceleration-structure buffer is reasoned from how titles call the API and from the PC's D3D12; it is not taken from any console documentation, and no title has confirmed it yet. Draft until then. **Evidence that would confirm it:** a title that creates a buffer with flag 0x80, and what it does with that buffer (builds an acceleration structure into it, or binds it as one). The retail game used for the regression run does not get there. If you run a title that gets there, please post those lines here (not the whole log, which names your paths). The console's resource flag 0x80 is a raytracing acceleration-structure buffer; the PC's 0x80 is a video-encode reference. pc_resource_desc and sanitize_coherent_buffer kept the low byte (flags & 0xFF), so a console acceleration-structure buffer reached the PC as a video-encode buffer, which the PC refuses for a buffer or treats as a video resource. pc_resource_flags keeps 0x1-0x20, maps 0x80 to ALLOW_UNORDERED_ACCESS (an acceleration-structure buffer needs it for its state on the PC) and never forwards 0x40, 0x80, 0x100, 0x200 or the console-only bits above. Not confirmed on a title: whether the creations fail or are accepted as video buffers (the handoff's logging step). **What is in it** - `crates/xcl/src/hle/d3d12x/device_x.rs`: +22 / -1 - `crates/xcl/src/hle/d3d12x/real.rs`: +1 / -1 - new tests: `console_resource_flags_map_to_pc_ones` **Tested** - NVIDIA RTX 2070 SUPER (driver 32.0.16.2140), AMD Ryzen 5 3600XT, Windows 11 build 26300, Rust 1.100.0 MSVC; tests in debug - `cargo test --workspace --no-fail-fast -- --test-threads=4` on `9c89e410` (built on `main` `336fddda`; it merges into the current `main` `e429936c` without conflict): 2123 passed, 9 failed, 48 ignored, 25 `SKIPPED` lines (21 no wave64, 3 #1426, 1 no heap windows). - The 9 failures are the ones `main` has (3 `e2e` title tests and 6 split-wave64 GPU tests, #3093: `main` `336fddda` gives 2122 passed, 9 failed, 48 ignored); the set of failing tests is identical to it. - `console_resource_flags_map_to_pc_ones`: ok in that run; fails without the change **Regression run** Both 60-second runs used the same warm DXIL cache directory. ``` xcl-smoke v1 commit: 336fdddafbcb3c3db753629f5f79a9f44b6c4b9d gpu: NVIDIA GeForce RTX 2070 SUPER title: retail game seconds: 60 exit: 0x0 frames shown: 1228 (PresentX 1228) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 15234 MB ``` ``` xcl-smoke v1 commit: 9c89e410b6cffbc80302812565219ccb3a6372b2 gpu: NVIDIA GeForce RTX 2070 SUPER title: retail game seconds: 60 exit: 0x0 frames shown: 1464 (PresentX 1464) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15474 MB ``` **Not tested** - Full preparation. The smoke runs used `XCL_PREPARE=0`. - Whether a console creation with flag 0x80 fails on the PC today or is accepted as a video buffer: not confirmed (needs logging on a title that creates acceleration structures). No GPU test of an acceleration-structure buffer. - A console desc with 0x80 on a depth texture gets the UAV flag back after the depth step strips it (acceleration structures are buffers). - AMD and Intel GPUs; wave64 hardware (the RTX 2070 SUPER is wave32). **AI use** - Codex (exact model name unavailable) verified the queued smoke results and drafted this description update. - patch-worker on Claude Sonnet 5.5 (self-reported); reviewed by Claude Opus 5.5: the code and tests. The description and the test / suite runs: Claude Code, Claude Sonnet 5.5 and Claude Opus 5.5. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Foniass commented 2026-12-01 09:35:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:35:29Z.


Triage (#1607) – head 0da61c6

No open or merged PR changes how the console's resource flag 0x80 is mapped; on main pc_resource_desc and sanitize_coherent_buffer pass it through as the PC's video-encode flag (& 0xFF).
device_x.rs pc_resource_desc: pc_resource_flags runs after the depth and texture-format UAV filters, so a texture carrying 0x80 would get ALLOW_UNORDERED_ACCESS back after they removed it. That is harmless if 0x80 only ever appears on buffers (acceleration structures are buffers), but applying the mapping before those filters would be safer.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7306921022 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3141#issuecomment-7306921022). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:35:29Z. --- **Triage (#1607)** – head 0da61c6 No open or merged PR changes how the console's resource flag 0x80 is mapped; on main `pc_resource_desc` and `sanitize_coherent_buffer` pass it through as the PC's video-encode flag (`& 0xFF`). device_x.rs `pc_resource_desc`: `pc_resource_flags` runs after the depth and texture-format UAV filters, so a texture carrying 0x80 would get ALLOW_UNORDERED_ACCESS back after they removed it. That is harmless if 0x80 only ever appears on buffers (acceleration structures are buffers), but applying the mapping before those filters would be safer. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Foniass commented 2026-12-01 10:10:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T10:10:57Z.


Review (head 0da61c6, diff read, not a merge-check; draft, PR description red: the smoke blocks name 9c89e410):

  • The UAV flag comes back after the filters that remove it. pc_resource_flags maps 0x80 to ALLOW_UNORDERED_ACCESS (device_x.rs ~881). It runs when the flags are written (~873), after the depth filter (~859) and the format / multisample filter (~867) have taken 4 out. A depth buffer, or a texture whose format can't be a UAV, that carries 0x80 gets ALLOW_UNORDERED_ACCESS back, and the PC refuses it (E_INVALIDARG; the 599 / 0x887A0001 case the comment above describes). Applying the mapping before those filters avoids it. Whether 0x80 ever appears on textures is unknown.
  • A default-path change for every title. 0x40 and 0x80 are no longer passed through; on main, 0x40 reached the PC as its video-decode flag.
  • The meanings aren't backed by an observation. 0x80 as an acceleration-structure buffer, 0x100 / 0x200 as texture-compatibility flags, and 0x40 as console-only (~877-880) cite no title call; HANDOFF records only high bits (0x300005, 0x20004). Please say how they were obtained.
  • Nit: the new test sits above use super::*; (~1471). #3414 rewrites the same flags code.

Fine: 0x1-0x20 pass through unchanged, and sanitize_coherent_buffer uses the same helper.

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

<!-- greyfinch-sync:ivall/xcl:comment:7307795643 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3141#issuecomment-7307795643). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T10:10:57Z. --- Review (head 0da61c6, diff read, not a merge-check; draft, `PR description` red: the smoke blocks name 9c89e410): - **The UAV flag comes back after the filters that remove it.** `pc_resource_flags` maps 0x80 to ALLOW_UNORDERED_ACCESS (`device_x.rs` ~881). It runs when the flags are written (~873), after the depth filter (~859) and the format / multisample filter (~867) have taken 4 out. A depth buffer, or a texture whose format can't be a UAV, that carries 0x80 gets ALLOW_UNORDERED_ACCESS back, and the PC refuses it (E_INVALIDARG; the 599 / 0x887A0001 case the comment above describes). Applying the mapping before those filters avoids it. Whether 0x80 ever appears on textures is unknown. - **A default-path change for every title.** 0x40 and 0x80 are no longer passed through; on main, 0x40 reached the PC as its video-decode flag. - **The meanings aren't backed by an observation.** 0x80 as an acceleration-structure buffer, 0x100 / 0x200 as texture-compatibility flags, and 0x40 as console-only (~877-880) cite no title call; HANDOFF records only high bits (0x300005, 0x20004). Please say how they were obtained. - Nit: the new test sits above `use super::*;` (~1471). #3414 rewrites the same flags code. Fine: 0x1-0x20 pass through unchanged, and `sanitize_coherent_buffer` uses the same helper. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
KOLESNiii commented 2026-12-02 15:10:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-12-02T15:10:03Z.


@Foniass fixed: pc_resource_desc now maps the flags with pc_resource_flags first, so the depth filter and the format / multisample filter see the UAV flag a console 0x80 turns into, and take it out again (device_x.rs). New test a_console_0x80_does_not_bring_back_a_filtered_uav_flag: a D32 depth buffer with 0x82, a BC1 texture and a 4x MSAA texture with 0x80 end up without ALLOW_UNORDERED_ACCESS, and a buffer keeps it. It fails on the previous head. The nit is fixed too: use super::*; is now at the top of the test module. New head 7747e07b (rebased onto main df0cfef6). 0x40 no longer reaching the PC is the PR author's call. How the slot / field meanings were obtained is a question for the PR author, who will answer it here; I have not changed them.

— Claude Code (Claude Opus 5.5), on behalf of the PR author

<!-- greyfinch-sync:ivall/xcl:comment:7349847388 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3141#issuecomment-7349847388). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-12-02T15:10:03Z. --- @Foniass fixed: `pc_resource_desc` now maps the flags with `pc_resource_flags` first, so the depth filter and the format / multisample filter see the UAV flag a console 0x80 turns into, and take it out again (`device_x.rs`). New test `a_console_0x80_does_not_bring_back_a_filtered_uav_flag`: a D32 depth buffer with 0x82, a BC1 texture and a 4x MSAA texture with 0x80 end up without ALLOW_UNORDERED_ACCESS, and a buffer keeps it. It fails on the previous head. The nit is fixed too: `use super::*;` is now at the top of the test module. New head `7747e07b` (rebased onto `main` df0cfef6). 0x40 no longer reaching the PC is the PR author's call. How the slot / field meanings were obtained is a question for the PR author, who will answer it here; I have not changed them. — Claude Code (Claude Opus 5.5), on behalf of the PR author
Foniass commented 2026-12-02 15:11:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T15:11:37Z.


Follow-up review (head 7747e07b, since 0da61c6, diff read, not a merge-check; draft, checks red):

  • Earlier points: unchanged otherwise. This push also maps the console flags before the filters in pc_resource_desc (device_x.rs), so a console 0x80 on a depth buffer, a block-compressed or a multisampled texture no longer brings back the UAV flag the filters take out, with a test (a_console_0x80_does_not_bring_back_a_filtered_uav_flag).

New: none.

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

<!-- greyfinch-sync:ivall/xcl:comment:7349898458 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3141#issuecomment-7349898458). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-02T15:11:37Z. --- Follow-up review (head 7747e07b, since 0da61c6, diff read, not a merge-check; draft, checks red): - **Earlier points:** unchanged otherwise. This push also maps the console flags before the filters in `pc_resource_desc` (`device_x.rs`), so a console 0x80 on a depth buffer, a block-compressed or a multisampled texture no longer brings back the UAV flag the filters take out, with a test (`a_console_0x80_does_not_bring_back_a_filtered_uav_flag`). New: none. 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/3141:upstream-pr/3141'
git switch 'upstream-pr/3141'

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