D3D12.X: a sampled texture in the memory of a written one of another format is copied from it (XCL_ALIAS_COPY=1) #3094

Open
imnicho wants to merge 2 commits from upstream-pr/3094 into main
imnicho commented 2026-11-28 04:43:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by imnicho on 2026-11-28T04:43:24Z.


With XCL_ALIAS_COPY=1, a sampled texture the title places in the memory of a written one of another format is copied from it on the GPU. A retail title reads its sky, its light probes and its bounced light through 59 such pairs; they were stale, and with the copies its room, sky and yard are lit. The default is unchanged (off).

Rebased onto main and reworked for it, with what the reviews asked for. Two commits on main 493dbd3dd: the rework, and what the reviews of that rework (as ee7196a76) asked for; the head is 8a28d3176. The old head 6396870e2 (on nvidia-dev) is what the reports below from before 1 December tested.

Plan comment: https://github.com/xcl-dev/xcl/pull/1989#issuecomment-7232861087

What is in it

The title packs light as R9G9B9E5 into R32_UINT textures with unordered access (a compute program cannot store R9G9B9E5) and samples the same memory through R9G9B9E5 textures it places at the same addresses. On the console the two are one memory. Here the written one is GPU-owned (vram) and the sampled one is a texture of its own, kept in step with the title's memory (title_textures), which nothing writes.

New module hle/d3d12x/alias_copy.rs:

  1. The pairs. create_placed_resource_x tells it of every placed texture (three places: GPU-owned, kept in step, a resource of its own). A pair is a written texture (render target or UAV) and a sampled one at the same address with the same size, levels, layers and texel width and another format. Buffers, depth buffers, multisampled and block-compressed textures are not kept.
  2. When. Where the written texture leaves RENDER_TARGET / UNORDERED_ACCESS, as the PC list gets the transition in resource_barrier_x. On main that one place sees both a legacy ResourceBarrier and the title's enhanced barriers of list #146, which barrier_groups (#3287) makes transitions of and sends the same way. So the first version's own reading of the #146 groups is gone, and the copies are planned from the barriers as the PC gets them, after the console's state bits are dropped (@thehollowedone's first point). With XCL_BARRIER_GROUPS=0 the enhanced barriers move no texture and ask for no copy.
  3. The copy. Through a buffer made at the pair's first copy: each level and layer into the buffer by the written format's footprint and out of it by the sampled one's (list_x::texture_through_buffer, on the PC list past XCL's hooks). The two textures go to the copy states and back from the states the title's transitions left them in. The states are kept by subresource, so a texture the title moves level by level is copied like any other, each level moved from its own state (on ee7196a76 such a texture was left out: 4.7 % of the copies of @KDenKC's run below). On DIRECT and COMPUTE lists; on a COMPUTE list a copy is left out, and counted, when one of the two is in a state such a list cannot name (@KDenKC). No copy is recorded while a texture of the pair is between the two halves of a split transition, where D3D12 lets nothing touch it; such a copy is left out and counted (@thehollowedone).
  4. The buffer. It is made with the table's lock released, so plan of another pair does not wait for the PC's D3D12 (@andrewDoing). It goes with the pair: at the title's last release of one of its textures, late_release::hold_own (new) lets it go once every queue is past the work submitted before (@KDenKC). It also holds a reference to the sampled texture: the title's list names the written texture only, the copy XCL adds to it names the sampled one and the buffer too, and the title may release the sampled texture before it submits that list. Both go when the written texture goes (@thehollowedone).
  5. No read-back of the destination. main reads a texture the GPU wrote back into the title's memory. What a copy puts into the sampled texture gets no GPU writer in title_textures, so it is still not uploaded over and is not read back: XG lays R9G9B9E5 out in more bytes than the R32_UINT texture has under it (0x3c0000 against 0x384000 at 1280x720), and the read-back went over what the title keeps behind the pair. Found and fixed by @claudetools-gh in the comments; this is that fix with the question asked of the texture's own entry instead of the table of buffers.
  6. Off by default. With the switch off nothing is kept and each hook is one atomic load.

The pairs by address and shape and the copy through a buffer are @raylitebull's, from #1989.

Size: 7 files, 508 lines of code and 321 of tests. That is more than a PR should be; about 90 lines of it came with the reviews.

Not in it

  • States are kept in the order the title records its transitions, as barrier_groups keeps the states it starts from. A list recorded and never submitted, and two lists submitted in another order than recorded, are not told apart (@thehollowedone's second point, with the WARP regression that shows it). I have not changed that here: the title's own enhanced barriers name their layouts, and what XCL adds for the copy starts from the last state recorded, as barrier_groups does for a barrier from the undefined layout. @KDenKC has taken the submit-time state model on as PRs of its own, with @thehollowedone's cases as its tests, and will bring the alias copy's part back here as a suggestion.
  • A copy left out between the halves of a split transition is not made up for at the split's end.
  • Views by address (Create{ShaderResource,UnorderedAccess}ViewAtX at a written texture's address), CopyResource between format families, a copy back from the sampled texture, a skip of a copy whose written texture has not changed.
  • #3281 / #3282 (shared pages, XCL_PAIR_PAGES=1) and the castable-format route @KDenKC describes are other ways to the same pairs; with pages shared the copy goes onto memory the view already has.

Tested

On this head (debug, RTX 5080 16 GB, driver 610.47, Windows 10 22H2):

  • cargo test -p xcl --lib -- --test-threads=1 alias_copy late_release: 13 passed, 0 failed, no SKIPPED line (the crate's outputs cleaned first: see the note under "Not tested").
  • cargo test -p xcl --lib -- --test-threads=4 gives no count on this PC: plain main (d0832e614) ends the test process partway here. After 1,376 tests alloc_pool::tests::a_reset_that_puts_the_allocator_aside_keeps_what_the_gpu_still_reads fails and the process stops with sparse upload preparation still failed after bounded retries – the title is stopped before its GPU submission (exit 0x80004005); one test at a time (--test-threads=1 hle::d3d12x) it stops the same way in sparse::tests::a_buffer_over_a_remapped_tile_reads_the_new_page after 739 tests. I did not run this head past that; CI has the whole suite.

The tests:

  • gpu_a_written_textures_texels_reach_its_sampled_pair_at_the_titles_barrier (WARP): an R32_UINT array texture with unordered access, 70 layers and two levels (140 parts) holds a different value in every texel. The title's own call is made on an adopted list: uav_barrier_x with one D3D12_BARRIER_GROUP whose texture barrier takes it from unordered access to shader resource. After it the R9G9B9E5 pair, read back, holds the same bits in every level of every layer. Then the written texture is released as a title does: no entry is left for the pair, and once the queues are past it the buffer's reference count falls to the test's own and the sampled texture loses the buffer's reference.
  • a_written_textures_transition_out_of_a_written_state_asks_for_the_copy: what asks and what does not (a transition into a written state, the first half of a split one, the sampled one's, UAV and aliasing barriers), the states followed level by level, and the copy's moves for a texture in one state and for one whose levels differ.
  • no_copy_is_recorded_between_the_halves_of_a_split_transition: @thehollowedone's schedule (the sampled texture's split begins, the written one leaves unordered access, the split ends): the copy asked for in between is left out, and after the end one may be recorded again.
  • a_copy_starts_from_states_the_list_can_name: what a copy can start from on a DIRECT and on a COMPUTE list.
  • a_sampled_texture_in_the_memory_of_a_written_one_of_another_format_is_its_pair: the pairs.

In the title, on this head: not run by me (see "Not tested"). What there is:

  • On this PR's first main-based head ee7196a76, @KDenKC (RTX 5090, driver 621.40, main d52ff48c with #3281 and one revert, XCL_PAIR_PAGES=1 on as well): two runs in the world for 522 s and 254 s at 2.98 and 5.31 fps, 0 device removals, 0 crashes; 32 pairs, 32,768 copies logged in each, about 1,555 left out for a state not known (the level-by-level case this head now copies), none for the COMPUTE-list or uncopyable cases; by eye the left wall of the first interior is lit in run 1.
  • On main-based trees with the first version ported, by others in the comments: @claudetools-gh (RTX 5070 Ti, main 7a649b0e with other PRs, Series X profile): with the fix of point 5, no crash in 1 run against 3 of 3 before, 32,768 copies recorded, the first interior's window shows the sunset outside where it was black. @CharlyRien (RTX 3090, main d52ff48c with other PRs and #3281): the 1280x720 pairs read the written data and the room behind the window is lit after camera cuts. Neither had #3287's transitions under this module's trigger as this head has.
  • On the first version (nvidia-dev), mine (RTX 5080, Series S profile, the tree of my #1989 report with #3089's commit): 59 pairs in every run, all written as R32_UINT with unordered access and read as R9G9B9E5; one run of 600 s with 586 frames after the world's set-up, 2,110,141 draws, 16,384 copies logged by 484 s and no device loss, its room, window with the sunset sky, yard and fence lit; without the copies the room has its direct light only. Of 13 runs with copies 8 ended 67 to 128 frames after the set-up at that tree's GPU hang, where none of 3 without copies did. Others on that version: @vasanex (RTX 3080, Series S): lit room, yard and sky, mean of the settled frames 35 of 255 against 6; @minimalhipster990 (RTX 4090, Series X): the HDR target's median from 0 to 177-191 on matched frames.

Regression run

scripts/smoke.ps1, 60 s, XCL_PREPARE=0, each built in release from a clean worktree. The switch is off in these runs, as it is by default.

main (d0832e614):

xcl-smoke v1
commit: d0832e614fa7d6ae027bb4feb27ccb9121f54a8f
gpu: NVIDIA GeForce RTX 5080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1560 (PresentX 1560)
presents per 2 s (last 3): 62 62 62
device removals: 0
crashes: 0
peak commit: 12450 MB

This PR (8a28d3176), its second run (the first run of a new binary fills its caches and is not kept, as for main):

xcl-smoke v1
commit: 8a28d31764071ad8cbfc7021d6d1d987e3745b11
gpu: NVIDIA GeForce RTX 5080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1505 (PresentX 1505)
presents per 2 s (last 3): 63 61 60
device removals: 0
crashes: 0
peak commit: 12738 MB

Not tested

  • The title's world on this head. This PC's caches are of the nvidia-dev tree, and main builds every pipeline anew; the 60 s runs above do not reach the world. A run of mine on main with this head will follow as a comment.
  • The module with #3287's real transitions in a title: on nvidia-dev the textures stayed in the states they were made in. The unit and WARP tests cover the states; a title's lists on DIRECT and COMPUTE queues in the order it submits them are not covered (see "Not in it").
  • A COMPUTE list's copy on a GPU, volumes and cubes on a GPU in this PR's test (it copies a 2D array; @andrewDoing's reports have a volume on an RTX 5070 on the first version).
  • AMD and Intel GPUs, Linux / Wine. The D3D12 debug layer is not available on this PC.
  • The integration test binaries of crates/xcl/tests (each d3d12_* one takes about 9 minutes here).
  • A note on my own numbers: I build several worktrees into one target folder, and today cargo twice called a test binary of another worktree up to date. Every count on this page is from a build whose log names this worktree as compiled, with the crate's outputs cleaned first.
  • The copies' cost in frame time.

AI use

Claude Code with Claude Fable 5.2 wrote the code and the tests, ran the suite and the regression runs, and wrote this description.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5536746713 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094). Originally posted by [imnicho](https://github.com/imnicho) on 2026-11-28T04:43:24Z. --- **With `XCL_ALIAS_COPY=1`, a sampled texture the title places in the memory of a written one of another format is copied from it on the GPU. A retail title reads its sky, its light probes and its bounced light through 59 such pairs; they were stale, and with the copies its room, sky and yard are lit. The default is unchanged (off).** **Rebased onto `main` and reworked for it**, with what the reviews asked for. Two commits on `main` `493dbd3dd`: the rework, and what the reviews of that rework (as `ee7196a76`) asked for; the head is `8a28d3176`. The old head `6396870e2` (on `nvidia-dev`) is what the reports below from before 1 December tested. Plan comment: https://github.com/xcl-dev/xcl/pull/1989#issuecomment-7232861087 **What is in it** The title packs light as R9G9B9E5 into R32_UINT textures with unordered access (a compute program cannot store R9G9B9E5) and samples the same memory through R9G9B9E5 textures it places at the same addresses. On the console the two are one memory. Here the written one is GPU-owned (`vram`) and the sampled one is a texture of its own, kept in step with the title's memory (`title_textures`), which nothing writes. New module `hle/d3d12x/alias_copy.rs`: 1. **The pairs.** `create_placed_resource_x` tells it of every placed texture (three places: GPU-owned, kept in step, a resource of its own). A pair is a written texture (render target or UAV) and a sampled one at the same address with the same size, levels, layers and texel width and another format. Buffers, depth buffers, multisampled and block-compressed textures are not kept. 2. **When.** Where the written texture leaves RENDER_TARGET / UNORDERED_ACCESS, as the PC list gets the transition in `resource_barrier_x`. On `main` that one place sees both a legacy `ResourceBarrier` and the title's enhanced barriers of list #146, which `barrier_groups` (#3287) makes transitions of and sends the same way. So the first version's own reading of the #146 groups is gone, and the copies are planned from the barriers as the PC gets them, after the console's state bits are dropped (@thehollowedone's first point). With `XCL_BARRIER_GROUPS=0` the enhanced barriers move no texture and ask for no copy. 3. **The copy.** Through a buffer made at the pair's first copy: each level and layer into the buffer by the written format's footprint and out of it by the sampled one's (`list_x::texture_through_buffer`, on the PC list past XCL's hooks). The two textures go to the copy states and back from the states the title's transitions left them in. The states are kept by subresource, so a texture the title moves level by level is copied like any other, each level moved from its own state (on `ee7196a76` such a texture was left out: 4.7 % of the copies of @KDenKC's run below). On DIRECT and COMPUTE lists; on a COMPUTE list a copy is left out, and counted, when one of the two is in a state such a list cannot name (@KDenKC). No copy is recorded while a texture of the pair is between the two halves of a split transition, where D3D12 lets nothing touch it; such a copy is left out and counted (@thehollowedone). 4. **The buffer.** It is made with the table's lock released, so `plan` of another pair does not wait for the PC's D3D12 (@andrewDoing). It goes with the pair: at the title's last release of one of its textures, `late_release::hold_own` (new) lets it go once every queue is past the work submitted before (@KDenKC). It also holds a reference to the sampled texture: the title's list names the written texture only, the copy XCL adds to it names the sampled one and the buffer too, and the title may release the sampled texture before it submits that list. Both go when the written texture goes (@thehollowedone). 5. **No read-back of the destination.** `main` reads a texture the GPU wrote back into the title's memory. What a copy puts into the sampled texture gets no GPU writer in `title_textures`, so it is still not uploaded over and is not read back: XG lays R9G9B9E5 out in more bytes than the R32_UINT texture has under it (0x3c0000 against 0x384000 at 1280x720), and the read-back went over what the title keeps behind the pair. Found and fixed by @claudetools-gh in the comments; this is that fix with the question asked of the texture's own entry instead of the table of buffers. 6. **Off by default.** With the switch off nothing is kept and each hook is one atomic load. The pairs by address and shape and the copy through a buffer are @raylitebull's, from #1989. Size: 7 files, 508 lines of code and 321 of tests. That is more than a PR should be; about 90 lines of it came with the reviews. **Not in it** - States are kept in the order the title records its transitions, as `barrier_groups` keeps the states it starts from. A list recorded and never submitted, and two lists submitted in another order than recorded, are not told apart (@thehollowedone's second point, with the WARP regression that shows it). I have not changed that here: the title's own enhanced barriers name their layouts, and what XCL adds for the copy starts from the last state recorded, as `barrier_groups` does for a barrier from the undefined layout. @KDenKC has taken the submit-time state model on as PRs of its own, with @thehollowedone's cases as its tests, and will bring the alias copy's part back here as a suggestion. - A copy left out between the halves of a split transition is not made up for at the split's end. - Views by address (`Create{ShaderResource,UnorderedAccess}ViewAtX` at a written texture's address), `CopyResource` between format families, a copy back from the sampled texture, a skip of a copy whose written texture has not changed. - #3281 / #3282 (shared pages, `XCL_PAIR_PAGES=1`) and the castable-format route @KDenKC describes are other ways to the same pairs; with pages shared the copy goes onto memory the view already has. **Tested** On this head (debug, RTX 5080 16 GB, driver 610.47, Windows 10 22H2): - `cargo test -p xcl --lib -- --test-threads=1 alias_copy late_release`: **13 passed, 0 failed**, no `SKIPPED` line (the crate's outputs cleaned first: see the note under "Not tested"). - `cargo test -p xcl --lib -- --test-threads=4` gives no count on this PC: plain `main` (`d0832e614`) ends the test process partway here. After 1,376 tests `alloc_pool::tests::a_reset_that_puts_the_allocator_aside_keeps_what_the_gpu_still_reads` fails and the process stops with `sparse upload preparation still failed after bounded retries – the title is stopped before its GPU submission` (exit 0x80004005); one test at a time (`--test-threads=1 hle::d3d12x`) it stops the same way in `sparse::tests::a_buffer_over_a_remapped_tile_reads_the_new_page` after 739 tests. I did not run this head past that; CI has the whole suite. The tests: - `gpu_a_written_textures_texels_reach_its_sampled_pair_at_the_titles_barrier` (WARP): an R32_UINT array texture with unordered access, 70 layers and two levels (140 parts) holds a different value in every texel. The title's own call is made on an adopted list: `uav_barrier_x` with one D3D12_BARRIER_GROUP whose texture barrier takes it from unordered access to shader resource. After it the R9G9B9E5 pair, read back, holds the same bits in every level of every layer. Then the written texture is released as a title does: no entry is left for the pair, and once the queues are past it the buffer's reference count falls to the test's own and the sampled texture loses the buffer's reference. - `a_written_textures_transition_out_of_a_written_state_asks_for_the_copy`: what asks and what does not (a transition into a written state, the first half of a split one, the sampled one's, UAV and aliasing barriers), the states followed level by level, and the copy's moves for a texture in one state and for one whose levels differ. - `no_copy_is_recorded_between_the_halves_of_a_split_transition`: @thehollowedone's schedule (the sampled texture's split begins, the written one leaves unordered access, the split ends): the copy asked for in between is left out, and after the end one may be recorded again. - `a_copy_starts_from_states_the_list_can_name`: what a copy can start from on a DIRECT and on a COMPUTE list. - `a_sampled_texture_in_the_memory_of_a_written_one_of_another_format_is_its_pair`: the pairs. In the title, on this head: **not run by me** (see "Not tested"). What there is: - On this PR's first `main`-based head `ee7196a76`, @KDenKC (RTX 5090, driver 621.40, `main` d52ff48c with #3281 and one revert, `XCL_PAIR_PAGES=1` on as well): two runs in the world for 522 s and 254 s at 2.98 and 5.31 fps, 0 device removals, 0 crashes; 32 pairs, 32,768 copies logged in each, about 1,555 left out for a state not known (the level-by-level case this head now copies), none for the COMPUTE-list or uncopyable cases; by eye the left wall of the first interior is lit in run 1. - On `main`-based trees with the first version ported, by others in the comments: @claudetools-gh (RTX 5070 Ti, `main` 7a649b0e with other PRs, Series X profile): with the fix of point 5, no crash in 1 run against 3 of 3 before, 32,768 copies recorded, the first interior's window shows the sunset outside where it was black. @CharlyRien (RTX 3090, `main` d52ff48c with other PRs and #3281): the 1280x720 pairs read the written data and the room behind the window is lit after camera cuts. Neither had #3287's transitions under this module's trigger as this head has. - On the first version (`nvidia-dev`), mine (RTX 5080, Series S profile, the tree of [my #1989 report](https://github.com/xcl-dev/xcl/pull/1989#issuecomment-7230125569) with #3089's commit): 59 pairs in every run, all written as R32_UINT with unordered access and read as R9G9B9E5; one run of 600 s with 586 frames after the world's set-up, 2,110,141 draws, 16,384 copies logged by 484 s and no device loss, its room, window with the sunset sky, yard and fence lit; without the copies the room has its direct light only. Of 13 runs with copies 8 ended 67 to 128 frames after the set-up at that tree's GPU hang, where none of 3 without copies did. Others on that version: @vasanex (RTX 3080, Series S): lit room, yard and sky, mean of the settled frames 35 of 255 against 6; @minimalhipster990 (RTX 4090, Series X): the HDR target's median from 0 to 177-191 on matched frames. **Regression run** `scripts/smoke.ps1`, 60 s, `XCL_PREPARE=0`, each built in release from a clean worktree. The switch is off in these runs, as it is by default. `main` (`d0832e614`): ``` xcl-smoke v1 commit: d0832e614fa7d6ae027bb4feb27ccb9121f54a8f gpu: NVIDIA GeForce RTX 5080 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1560 (PresentX 1560) presents per 2 s (last 3): 62 62 62 device removals: 0 crashes: 0 peak commit: 12450 MB ``` This PR (`8a28d3176`), its second run (the first run of a new binary fills its caches and is not kept, as for `main`): ``` xcl-smoke v1 commit: 8a28d31764071ad8cbfc7021d6d1d987e3745b11 gpu: NVIDIA GeForce RTX 5080 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1505 (PresentX 1505) presents per 2 s (last 3): 63 61 60 device removals: 0 crashes: 0 peak commit: 12738 MB ``` **Not tested** - The title's world on this head. This PC's caches are of the `nvidia-dev` tree, and `main` builds every pipeline anew; the 60 s runs above do not reach the world. A run of mine on `main` with this head will follow as a comment. - The module with #3287's real transitions in a title: on `nvidia-dev` the textures stayed in the states they were made in. The unit and WARP tests cover the states; a title's lists on DIRECT and COMPUTE queues in the order it submits them are not covered (see "Not in it"). - A COMPUTE list's copy on a GPU, volumes and cubes on a GPU in this PR's test (it copies a 2D array; @andrewDoing's reports have a volume on an RTX 5070 on the first version). - AMD and Intel GPUs, Linux / Wine. The D3D12 debug layer is not available on this PC. - The integration test binaries of `crates/xcl/tests` (each `d3d12_*` one takes about 9 minutes here). - A note on my own numbers: I build several worktrees into one target folder, and today cargo twice called a test binary of another worktree up to date. Every count on this page is from a build whose log names this worktree as compiled, with the crate's outputs cleaned first. - The copies' cost in frame time. **AI use** Claude Code with Claude Fable 5.2 wrote the code and the tests, ran the suite and the regression runs, and wrote this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
imnicho commented 2026-11-28 04:54:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by imnicho on 2026-11-28T04:54:48Z.


CI: the "Build and test" job's one failure is not in this PR's code. The run shows 1781 passed, 1 failed, 28 ignored. The one is hle::kernelx::tests::a_page_whose_move_fails_stays_mapped_where_it_was (kernelx.rs:4161), a test of page moves this PR does not touch; it passed in my local run of the library suite on the same head (1778 passed, 0 failed) and #2773 is open about the address it uses. This PR's 4 tests pass in the CI run, the WARP one included.

AI use: Claude Code with Claude Fable 5.2 read the CI log and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7234336820 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7234336820). Originally posted by [imnicho](https://github.com/imnicho) on 2026-11-28T04:54:48Z. --- **CI: the "Build and test" job's one failure is not in this PR's code.** The run shows 1781 passed, 1 failed, 28 ignored. The one is `hle::kernelx::tests::a_page_whose_move_fails_stays_mapped_where_it_was` (`kernelx.rs:4161`), a test of page moves this PR does not touch; it passed in my local run of the library suite on the same head (1778 passed, 0 failed) and #2773 is open about the address it uses. This PR's 4 tests pass in the CI run, the WARP one included. AI use: Claude Code with Claude Fable 5.2 read the CI log and wrote this.
andrewDoing commented 2026-11-28 04:59:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-28T04:59:02Z.


I tested larger synthetic shapes on RTX 5070 / NVIDIA 616.92 at head 839b33a1, using a test-only extension of the enhanced-barrier alias-copy fixture. Each run paired an R32_UINT written texture with an R9G9B9E5 sampled texture, used distinct words across the data, and fenced the GPU readback.

Shape Planned jobs Recorded / refused Readback
40×23, 64-layer 2D array, 1 mip (64 subresources) 1 1 / 0 58,880 / 58,880 words matched
Same array, 2 mips (128 subresources) 1 0 / 1 72,960 / 72,960 words mismatched
40×23×64 3D volume, 2 mips (2 subresources) 1 1 / 0 65,920 / 65,920 words matched

The two-mip array hits make_through's parts > 64 limit. As a diagnostic only, changing that limit to 128 let the same array case record and all 72,960 words match. That isolates the observed refusal, but it does not establish that 128 is the right production budget or that the title uses a 64-layer, two-mip pair. The title report lists 64-layer/slice pairs and multi-mip pairs without establishing that they are the same pair.

All focused GPU runs completed without skips and the device remained healthy. No retail title, GPU memory budget, or timing was measured.

AI use: OpenAI Codex with GPT-6.2 Astra built and ran the fixture; Codex reviewed and prepared this report.

<!-- greyfinch-sync:ivall/xcl:comment:7234380204 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7234380204). Originally posted by [andrewDoing](https://github.com/andrewDoing) on 2026-11-28T04:59:02Z. --- I tested larger synthetic shapes on RTX 5070 / NVIDIA 616.92 at head `839b33a1`, using a test-only extension of the enhanced-barrier alias-copy fixture. Each run paired an R32_UINT written texture with an R9G9B9E5 sampled texture, used distinct words across the data, and fenced the GPU readback. | Shape | Planned jobs | Recorded / refused | Readback | | --- | ---: | ---: | --- | | 40×23, 64-layer 2D array, 1 mip (64 subresources) | 1 | 1 / 0 | 58,880 / 58,880 words matched | | Same array, 2 mips (128 subresources) | 1 | 0 / 1 | 72,960 / 72,960 words mismatched | | 40×23×64 3D volume, 2 mips (2 subresources) | 1 | 1 / 0 | 65,920 / 65,920 words matched | The two-mip array hits `make_through`'s `parts > 64` limit. As a diagnostic only, changing that limit to 128 let the same array case record and all 72,960 words match. That isolates the observed refusal, but it does **not** establish that 128 is the right production budget or that the title uses a 64-layer, two-mip pair. The title report lists 64-layer/slice pairs and multi-mip pairs without establishing that they are the same pair. All focused GPU runs completed without skips and the device remained healthy. No retail title, GPU memory budget, or timing was measured. AI use: OpenAI Codex with GPT-6.2 Astra built and ran the fixture; Codex reviewed and prepared this report.
KDenKC commented 2026-11-28 05:12:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-28T05:12:21Z.


@imnicho, thanks for this. We ported raylitebull's amd-dev format_alias.rs onto nvidia-dev locally for the same R32_UINT -> R9G9B9E5 problem, so here's what that taught us, read against 839b33a1. On an RTX 5090 that port took the HDR lighting target, the luminance chain and the final target from black to lit (sky, sun and fog; our G-buffer is still empty for the separate view-window reason in #505). So we expect yours to do the same here, and we'd rather add to this PR than open a second one.

One thing that looks like a defect:

  • Table::gone (alias_copy.rs:96) only grows. forget pushes every departed pair's Through into it (:190-191), and nothing ever drains it, so each pair the title tears down keeps its copy buffer for the life of the process. Keeping them while a list in flight may name them is right. Releasing them once the fence of the last list that recorded a copy with them has passed (or on the next list reset after forget) would bound it.

Coverage differences, as possible follow-ups on top of yours, not changes this PR needs:

  • Pairs are only found through create_placed_resource_x (the three note_created calls). The amd-dev version also catches readers made with Create{ShaderResource,UnorderedAccess}ViewAtX at the written texture's address. We haven't measured how many of this title's reads take that path.
  • It skips a copy when the written texture hasn't changed since the last one (a per-pair activity stamp).
  • On COMPUTE lists it checks that the state it transitions from is valid on that list type before recording. If a pair is copied on a compute list here, the transition from 0xC0 may need the same guard; we haven't seen it hit.

Checked and fine: the split-barrier test is bitwise (b[1] & BEGIN_ONLY, :229), so the console hint bits that #3090 now keeps don't break it. That was the one place our own rebase onto 54225f58 needed a fix.

We're glad to send any of the follow-ups as small PRs stacked on this one if you'd like them.

AI use: an agent swarm: Claude Opus 5.5, GPT-6.2-Sol and Gemini 4 Neon.

<!-- greyfinch-sync:ivall/xcl:comment:7234523530 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7234523530). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-11-28T05:12:21Z. --- @imnicho, thanks for this. We ported raylitebull's `amd-dev` `format_alias.rs` onto `nvidia-dev` locally for the same R32_UINT -> R9G9B9E5 problem, so here's what that taught us, read against `839b33a1`. On an RTX 5090 that port took the HDR lighting target, the luminance chain and the final target from black to lit (sky, sun and fog; our G-buffer is still empty for the separate view-window reason in #505). So we expect yours to do the same here, and we'd rather add to this PR than open a second one. **One thing that looks like a defect:** - `Table::gone` (`alias_copy.rs:96`) only grows. `forget` pushes every departed pair's `Through` into it (`:190-191`), and nothing ever drains it, so each pair the title tears down keeps its copy buffer for the life of the process. Keeping them while a list in flight may name them is right. Releasing them once the fence of the last list that recorded a copy with them has passed (or on the next list reset after `forget`) would bound it. **Coverage differences, as possible follow-ups on top of yours, not changes this PR needs:** - Pairs are only found through `create_placed_resource_x` (the three `note_created` calls). The `amd-dev` version also catches readers made with `Create{ShaderResource,UnorderedAccess}ViewAtX` at the written texture's address. We haven't measured how many of this title's reads take that path. - It skips a copy when the written texture hasn't changed since the last one (a per-pair activity stamp). - On COMPUTE lists it checks that the state it transitions from is valid on that list type before recording. If a pair is copied on a compute list here, the transition from `0xC0` may need the same guard; we haven't seen it hit. **Checked and fine:** the split-barrier test is bitwise (`b[1] & BEGIN_ONLY`, `:229`), so the console hint bits that #3090 now keeps don't break it. That was the one place our own rebase onto `54225f58` needed a fix. We're glad to send any of the follow-ups as small PRs stacked on this one if you'd like them. AI use: an agent swarm: Claude Opus 5.5, GPT-6.2-Sol and Gemini 4 Neon.
DarkPanda69 commented 2026-11-28 05:16:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DarkPanda69 on 2026-11-28T05:16:07Z.


Update for head 6396870 (the limit of 64 parts removed): same command, same merge-base, 54 passed, 0 failed, 0 ignored, no SKIPPED with XCL_ADAPTER=Radeon and with =3060, and no result changes from 839b33a. The 70-layer test still runs on WARP, so the same caveat applies.

Run on an RX 9070 XT and an RTX 3060 in the same PC: the four new tests pass, and nothing in list_x changes. But the GPU test runs on WARP, so this isn't AMD hardware coverage of the copy.

Tested: at the PR head 839b33a against its merge-base with nvidia-dev, 01b94f5 (the diff doesn't apply as a patch on today's nvidia-dev 54225f5). Debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X. RX 9070 XT driver 32.0.32029.2010; RTX 3060 driver 32.0.16.1088.

  • cargo test -p xcl --lib -- hle::d3d12x::alias_copy hle::d3d12x::list_x::tests:: --test-threads=1 --nocapture, once with XCL_ADAPTER=Radeon and once with =3060: merge-base 50 passed, 0 failed (list_x only, since alias_copy is new); PR 54 passed, 0 failed, 0 ignored, no SKIPPED, both times.
  • The only changes are the four new alias_copy tests, all ok.
  • gpu_a_written_textures_texels_reach_its_sampled_pair_at_the_enhanced_barrier builds its device on EnumWarpAdapter, so it ran on WARP both times, not on either card. If you want a hardware data point for the copy, I can run that test on the RX 9070 XT and the RTX 3060 with the device swapped to the XCL_ADAPTER card.

Not tested: XCL_ALIAS_COPY=1 in a title, the whole suite, Intel.

AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7234562836 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7234562836). Originally posted by [DarkPanda69](https://github.com/DarkPanda69) on 2026-11-28T05:16:07Z. --- **Update for head `6396870`** (the limit of 64 parts removed): same command, same merge-base, 54 passed, 0 failed, 0 ignored, no SKIPPED with `XCL_ADAPTER=Radeon` and with `=3060`, and no result changes from `839b33a`. The 70-layer test still runs on WARP, so the same caveat applies. Run on an RX 9070 XT and an RTX 3060 in the same PC: the four new tests pass, and nothing in `list_x` changes. But the GPU test runs on WARP, so this isn't AMD hardware coverage of the copy. **Tested:** at the PR head `839b33a` against its merge-base with `nvidia-dev`, `01b94f5` (the diff doesn't apply as a patch on today's `nvidia-dev` `54225f5`). Debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X. RX 9070 XT driver 32.0.32029.2010; RTX 3060 driver 32.0.16.1088. - `cargo test -p xcl --lib -- hle::d3d12x::alias_copy hle::d3d12x::list_x::tests:: --test-threads=1 --nocapture`, once with `XCL_ADAPTER=Radeon` and once with `=3060`: merge-base 50 passed, 0 failed (`list_x` only, since `alias_copy` is new); PR 54 passed, 0 failed, 0 ignored, no SKIPPED, both times. - The only changes are the four new `alias_copy` tests, all ok. - `gpu_a_written_textures_texels_reach_its_sampled_pair_at_the_enhanced_barrier` builds its device on `EnumWarpAdapter`, so it ran on WARP both times, not on either card. If you want a hardware data point for the copy, I can run that test on the RX 9070 XT and the RTX 3060 with the device swapped to the `XCL_ADAPTER` card. **Not tested:** `XCL_ALIAS_COPY=1` in a title, the whole suite, Intel. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
imnicho commented 2026-11-28 05:46:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by imnicho on 2026-11-28T05:46:36Z.


@andrewDoing thank you, that was a real hole: the limit of 64 parts was an arbitrary one of mine, and a pair past it was silently left stale (counted under "pairs that cannot be copied", nothing more). The head is now 6396870e2: the limit is gone, and the PR's own WARP test is an array of 70 layers with two levels (140 parts) instead of two levels of one layer. In the title's runs that counter stayed at 0, so none of its 59 pairs was past 64. The description has the new head's smoke block; the library suite's counts are from the commit before (839b33a1f), with the module's 4 tests run again on the head.

AI use: Claude Code with Claude Fable 5.2 made the change and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7234877896 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7234877896). Originally posted by [imnicho](https://github.com/imnicho) on 2026-11-28T05:46:36Z. --- @andrewDoing thank you, that was a real hole: the limit of 64 parts was an arbitrary one of mine, and a pair past it was silently left stale (counted under "pairs that cannot be copied", nothing more). The head is now `6396870e2`: the limit is gone, and the PR's own WARP test is an array of 70 layers with two levels (140 parts) instead of two levels of one layer. In the title's runs that counter stayed at 0, so none of its 59 pairs was past 64. The description has the new head's smoke block; the library suite's counts are from the commit before (`839b33a1f`), with the module's 4 tests run again on the head. AI use: Claude Code with Claude Fable 5.2 made the change and wrote this.
andrewDoing commented 2026-11-28 05:56:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-28T05:56:44Z.


I reran the three native RTX 5070 / NVIDIA 616.92 alias-copy controls from my earlier report on updated head 6396870e2184c80b7fa0404edf419d2f8ee262e1, using the same test overlay and production enhanced-barrier planner/recorder.

  • 64-layer 2D array, two mips: 1 recorded / 0 refused, all 72,960 / 72,960 words matched. The earlier head recorded none, refused one, and all words mismatched.
  • 64-layer array, one mip: 58,880 / 58,880 matched.
  • 64-deep 3D volume, two mips: 65,920 / 65,920 matched.

All three fenced readbacks passed without skips. This validates the synthetic subresource boundary and controls; the title's use of the exact two-mip array shape, performance, and memory budget remain unmeasured.

AI use: OpenAI Codex with GPT-6.2 Astra ran the tests; Codex reviewed and prepared this report.

<!-- greyfinch-sync:ivall/xcl:comment:7234982176 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7234982176). Originally posted by [andrewDoing](https://github.com/andrewDoing) on 2026-11-28T05:56:44Z. --- I reran the three native RTX 5070 / NVIDIA 616.92 alias-copy controls from my earlier report on updated head `6396870e2184c80b7fa0404edf419d2f8ee262e1`, using the same test overlay and production enhanced-barrier planner/recorder. - 64-layer 2D array, two mips: **1 recorded / 0 refused**, all **72,960 / 72,960 words matched**. The earlier head recorded none, refused one, and all words mismatched. - 64-layer array, one mip: **58,880 / 58,880 matched**. - 64-deep 3D volume, two mips: **65,920 / 65,920 matched**. All three fenced readbacks passed without skips. This validates the synthetic subresource boundary and controls; the title's use of the exact two-mip array shape, performance, and memory budget remain unmeasured. AI use: OpenAI Codex with GPT-6.2 Astra ran the tests; Codex reviewed and prepared this report.
thehollowedone commented 2026-11-28 07:13:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-28T07:13:49Z.


merge-check
base: 54225f5 (nvidia-dev)
head: 6396870e21 (6396870)
merge: clean, five files, +675/-2

Independent Windows check: cargo build --offline --locked -j 4 --workspace passed on the merged tree. With XCL_ALIAS_COPY=1, cargo test --offline --locked -j 4 -p xcl --lib alias_copy::tests -- --nocapture --test-threads=1 passed 4/4, no skips. The full cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4 ran on both trees: head merged onto base 1,911 passed / 3 failed / 48 ignored, base 1,907 passed / 3 failed / 48 ignored. Both printed 26 explicit SKIPPED notices, which are included in Cargo's passing counts. The same three library tests failed on both: console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, a_held_submit_goes_on_when_the_hold_ends_and_at_once_inside_a_timed_call, and a_thread_in_the_driver_is_seen_until_it_returns. These failures do not distinguish this PR from the base.

verdict: not yet

Review verdict: not yet. I traced two state mismatches in the opt-in path. These are source-level findings; I have not run a GPU regression for either boundary.

  1. Legacy planning sees raw console barriers before texture states are normalized. For a texture transition 0x8 -> 0xC1, the native list receives 0x8 -> 0xC0 after the buffer-only 0x1 is removed, but alias-copy state tracking retains 0xC1. Its injected copy then requests a transition from the state the native barrier never established. Plan from the normalized out barriers instead, before other features mutate that vector. A WARP debug-layer test should call the actual resource_barrier_x path and execute the following copy with this state combination.
  2. The planner updates Tex.now globally while recording. Recording a transition on list A and then resetting A without submission still changes the state used to build the injected transitions on list B. For example, an unsubmitted COPY_DEST -> COPY_SOURCE leaves the GPU in COPY_DEST, while the planner would use COPY_SOURCE as B's before-state. Keep pending states with the recording list, discard them on reset, and commit them in queue submission order. A two-list reset/cancel test under the debug layer would guard this lifecycle.

The PR's WARP fixture verifies its copy path; this check did not measure title visuals, title performance, or paired smoke. Hardware: Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), rustc 1.99.1. AI use: Codex (GPT-6.2 Sol) ran the builds and tests and checked the source paths; Codex (GPT-6.2 Astra) independently reviewed the state invariants.

<!-- greyfinch-sync:ivall/xcl:comment:7235800050 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7235800050). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-28T07:13:49Z. --- merge-check base: [`54225f5`](https://github.com/xcl-dev/xcl/commit/54225f5884a94cd23b7aab3f703a7c975070aa77) (`nvidia-dev`) head: 6396870e2184c80b7fa0404edf419d2f8ee262e1 ([6396870](https://github.com/xcl-dev/xcl/commit/6396870e2184c80b7fa0404edf419d2f8ee262e1)) merge: clean, five files, +675/-2 **Independent Windows check:** `cargo build --offline --locked -j 4 --workspace` passed on the merged tree. With `XCL_ALIAS_COPY=1`, `cargo test --offline --locked -j 4 -p xcl --lib alias_copy::tests -- --nocapture --test-threads=1` passed 4/4, no skips. The full `cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4` ran on both trees: head merged onto base **1,911 passed / 3 failed / 48 ignored**, base **1,907 passed / 3 failed / 48 ignored**. Both printed 26 explicit `SKIPPED` notices, which are included in Cargo's passing counts. The same three library tests failed on both: `console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk`, `a_held_submit_goes_on_when_the_hold_ends_and_at_once_inside_a_timed_call`, and `a_thread_in_the_driver_is_seen_until_it_returns`. These failures do not distinguish this PR from the base. verdict: not yet **Review verdict: not yet.** I traced two state mismatches in the opt-in path. These are source-level findings; I have not run a GPU regression for either boundary. 1. [Legacy planning](https://github.com/xcl-dev/xcl/blob/6396870e2184c80b7fa0404edf419d2f8ee262e1/crates/xcl/src/hle/d3d12x/list_x.rs#L4789) sees raw console barriers before [texture states are normalized](https://github.com/xcl-dev/xcl/blob/6396870e2184c80b7fa0404edf419d2f8ee262e1/crates/xcl/src/hle/d3d12x/list_x.rs#L4852-L4855). For a texture transition `0x8 -> 0xC1`, the native list receives `0x8 -> 0xC0` after the buffer-only `0x1` is removed, but [alias-copy state tracking](https://github.com/xcl-dev/xcl/blob/6396870e2184c80b7fa0404edf419d2f8ee262e1/crates/xcl/src/hle/d3d12x/alias_copy.rs#L220-L235) retains `0xC1`. Its injected copy then requests a transition from the state the native barrier never established. Plan from the normalized `out` barriers instead, before other features mutate that vector. A WARP debug-layer test should call the actual `resource_barrier_x` path and execute the following copy with this state combination. 2. [The planner updates `Tex.now` globally while recording](https://github.com/xcl-dev/xcl/blob/6396870e2184c80b7fa0404edf419d2f8ee262e1/crates/xcl/src/hle/d3d12x/alias_copy.rs#L225-L231). Recording a transition on list A and then resetting A without submission still changes the state used to build the injected transitions on list B. For example, an unsubmitted `COPY_DEST -> COPY_SOURCE` leaves the GPU in `COPY_DEST`, while the planner would use `COPY_SOURCE` as B's before-state. Keep pending states with the recording list, discard them on reset, and commit them in queue submission order. A two-list reset/cancel test under the debug layer would guard this lifecycle. The PR's WARP fixture verifies its copy path; this check did not measure title visuals, title performance, or paired smoke. Hardware: Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), rustc 1.99.1. AI use: Codex (GPT-6.2 Sol) ran the builds and tests and checked the source paths; Codex (GPT-6.2 Astra) independently reviewed the state invariants.
upipibi commented 2026-11-28 09:10:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-28T09:10:32Z.


Test report for #3094 on NVIDIA: the whole workspace suite on this PR merged onto today's nvidia-dev and on nvidia-dev alone, and the PR's own tests 3 times by name.

Tested

  • Base: nvidia-dev 54225f5884a94cd23b7aab3f703a7c975070aa77. Head: 6396870e2184c80b7fa0404edf419d2f8ee262e1. git merge --no-ff of the head onto the base: clean, no conflicts (list_x.rs auto-merged); the merge (d6fa58fc, local) differs from the base by 5 files, +675/-2.

  • RTX 3070 8 GB (Ampere, 32-lane waves), driver 616.56, Windows 11 Pro 10.0.26100, Rust 1.100.0 MSVC, debug. Each tree in its own worktree and target dir; XCL_ALIAS_COPY not set.

  • cargo build --workspace and cargo build --workspace --tests: both exit 0 on both trees, 9 and 10 warnings, the same count as the base.

  • cargo test --workspace --no-fail-fast -- --test-threads=4, once on each tree. On both trees the xcl library binary stopped partway through, before printing its result. It exited with code 130088963 (0x7C10003) after D3D12.X: coherent window could not be restored at ... (268435456 bytes, got 0x0, Windows error 487) after CreateCommandQueue: ... (0x8007000E); stopping before guest memory is used, which a uma_driver mixed-window test prints. The other 39 result lines:

    • merge: 132 passed, 0 failed, 20 ignored, 26 SKIPPED lines;
    • base: 132 passed, 0 failed, 20 ignored, 26 SKIPPED lines; the same per-binary results as the merge.
    • Before the stop, the library binary printed 4 FAILED lines on the merge and 5 on the base: the 4 title_textures tests below on both, plus hle::d3d12x::list_x::tests::mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares on the base only. That test passed in the base's 3 library re-runs and 3 of 3 times alone, and it passed in the merge's run.
  • Because of that stop, the library binary was run again on each tree with the two mixed-window tests skipped: cargo test -p xcl --lib -- --test-threads=4 --skip hle::d3d12x::uma_driver::tests::a_refused_gpu_upload_segment_becomes_custom --skip hle::d3d12x::uma_driver::tests::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment:

    • merge: 1774 passed, 6 failed, 28 ignored (2 filtered out), 26 SKIPPED lines;
    • base: 1770 passed, 6 failed, 28 ignored (2 filtered out), 26 SKIPPED lines, the same in 3 runs.
    • The 6 failures have the same names on both trees: hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels, …stream_recheck_keeps_the_whole_upload_baseline_over_partial_uploads, …stream_recheck_partial_upload_without_an_entry_queues_a_whole_upload, …stream_recheck_schedule_catches_late_writes_and_resets_milestones, hle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memory and …gpu_retire_queue_holds_heap_until_blocked_queue_passes_mark. Three panic on 0x8007000E (E_OUTOFMEMORY) from a D3D12 call, and the other three stream_recheck_* ones on a PoisonError after those panics. All 6 pass alone, one at a time, 3 of 3 times on the base.
    • The two skipped mixed-window tests pass alone on both trees: 2 passed, 0 failed, 3 of 3 times each (--exact --test-threads=1).
    • Together with the other 39 result lines of the workspace run: merge 1906 passed, 6 failed, 48 ignored, base 1902 passed, 6 failed, 48 ignored. The difference of 4 is the PR's new tests: the merge lists 1810 library tests, the base 1806.
  • The 26 SKIPPED lines are the same on both trees: 21 "no wave64", 3 f16/f32 per-lane forms refused after #1426, 1 "no heap windows", 1 "cannot disable the driver cache".

  • None of the 9 tests in #3093 fail here. The 5 split-wave64 tests present on nvidia-dev and the 3 e2e title tests pass on both trees; gpu_heap_flat_reads_match_guarded_and_root_output is not in nvidia-dev's test list.

  • The PR's own tests, by exact name, 3 runs: cargo test -p xcl --lib -- <the 4 names> --exact --test-threads=1 --nocapture. 4 passed, 0 failed, 0 ignored in each of the 3 runs, 0 SKIPPED lines:

    • hle::d3d12x::alias_copy::tests::a_sampled_texture_in_the_memory_of_a_written_one_of_another_format_is_its_pair
    • hle::d3d12x::alias_copy::tests::a_written_textures_transition_out_of_a_written_state_asks_for_the_copy
    • hle::d3d12x::alias_copy::tests::an_enhanced_barrier_of_a_written_texture_asks_for_the_copy
    • hle::d3d12x::alias_copy::tests::gpu_a_written_textures_texels_reach_its_sampled_pair_at_the_enhanced_barrier

    The GPU test's fixture makes its device on WARP (EnumWarpAdapter), so these runs do not test the copy on the RTX 3070 itself.

Not tested

  • No xcl-smoke block: no title was run.
  • XCL_ALIAS_COPY=1: every run here had the switch unset.
  • The PR's GPU test on the RTX 3070 rather than WARP.
  • A release build, AMD or Intel GPUs, Linux / Wine.

AI use: Claude Code (Claude Opus 5.5) ran the tests above on the hardware named and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7237065238 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7237065238). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-28T09:10:32Z. --- Test report for #3094 on NVIDIA: the whole workspace suite on this PR merged onto today's `nvidia-dev` and on `nvidia-dev` alone, and the PR's own tests 3 times by name. **Tested** - Base: `nvidia-dev` `54225f5884a94cd23b7aab3f703a7c975070aa77`. Head: `6396870e2184c80b7fa0404edf419d2f8ee262e1`. `git merge --no-ff` of the head onto the base: clean, no conflicts (`list_x.rs` auto-merged); the merge (`d6fa58fc`, local) differs from the base by 5 files, +675/-2. - RTX 3070 8 GB (Ampere, 32-lane waves), driver 616.56, Windows 11 Pro 10.0.26100, Rust 1.100.0 MSVC, debug. Each tree in its own worktree and target dir; `XCL_ALIAS_COPY` not set. - `cargo build --workspace` and `cargo build --workspace --tests`: both exit 0 on both trees, 9 and 10 warnings, the same count as the base. - `cargo test --workspace --no-fail-fast -- --test-threads=4`, once on each tree. On both trees the `xcl` library binary stopped partway through, before printing its result. It exited with code 130088963 (`0x7C10003`) after `D3D12.X: coherent window could not be restored at ... (268435456 bytes, got 0x0, Windows error 487) after CreateCommandQueue: ... (0x8007000E); stopping before guest memory is used`, which a `uma_driver` mixed-window test prints. The other 39 result lines: - merge: **132 passed, 0 failed, 20 ignored**, 26 `SKIPPED` lines; - base: **132 passed, 0 failed, 20 ignored**, 26 `SKIPPED` lines; the same per-binary results as the merge. - Before the stop, the library binary printed 4 `FAILED` lines on the merge and 5 on the base: the 4 `title_textures` tests below on both, plus `hle::d3d12x::list_x::tests::mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares` on the base only. That test passed in the base's 3 library re-runs and 3 of 3 times alone, and it passed in the merge's run. - Because of that stop, the library binary was run again on each tree with the two mixed-window tests skipped: `cargo test -p xcl --lib -- --test-threads=4 --skip hle::d3d12x::uma_driver::tests::a_refused_gpu_upload_segment_becomes_custom --skip hle::d3d12x::uma_driver::tests::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment`: - merge: **1774 passed, 6 failed, 28 ignored** (2 filtered out), 26 `SKIPPED` lines; - base: **1770 passed, 6 failed, 28 ignored** (2 filtered out), 26 `SKIPPED` lines, the same in 3 runs. - The 6 failures have the same names on both trees: `hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels`, `…stream_recheck_keeps_the_whole_upload_baseline_over_partial_uploads`, `…stream_recheck_partial_upload_without_an_entry_queues_a_whole_upload`, `…stream_recheck_schedule_catches_late_writes_and_resets_milestones`, `hle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memory` and `…gpu_retire_queue_holds_heap_until_blocked_queue_passes_mark`. Three panic on `0x8007000E` (E_OUTOFMEMORY) from a D3D12 call, and the other three `stream_recheck_*` ones on a `PoisonError` after those panics. All 6 pass alone, one at a time, 3 of 3 times on the base. - The two skipped mixed-window tests pass alone on both trees: 2 passed, 0 failed, 3 of 3 times each (`--exact --test-threads=1`). - Together with the other 39 result lines of the workspace run: merge **1906 passed, 6 failed, 48 ignored**, base **1902 passed, 6 failed, 48 ignored**. The difference of 4 is the PR's new tests: the merge lists 1810 library tests, the base 1806. - The 26 `SKIPPED` lines are the same on both trees: 21 "no wave64", 3 f16/f32 per-lane forms refused after #1426, 1 "no heap windows", 1 "cannot disable the driver cache". - None of the 9 tests in #3093 fail here. The 5 split-wave64 tests present on `nvidia-dev` and the 3 `e2e` title tests pass on both trees; `gpu_heap_flat_reads_match_guarded_and_root_output` is not in `nvidia-dev`'s test list. - The PR's own tests, by exact name, 3 runs: `cargo test -p xcl --lib -- <the 4 names> --exact --test-threads=1 --nocapture`. **4 passed, 0 failed, 0 ignored** in each of the 3 runs, 0 `SKIPPED` lines: - `hle::d3d12x::alias_copy::tests::a_sampled_texture_in_the_memory_of_a_written_one_of_another_format_is_its_pair` - `hle::d3d12x::alias_copy::tests::a_written_textures_transition_out_of_a_written_state_asks_for_the_copy` - `hle::d3d12x::alias_copy::tests::an_enhanced_barrier_of_a_written_texture_asks_for_the_copy` - `hle::d3d12x::alias_copy::tests::gpu_a_written_textures_texels_reach_its_sampled_pair_at_the_enhanced_barrier` The GPU test's fixture makes its device on WARP (`EnumWarpAdapter`), so these runs do not test the copy on the RTX 3070 itself. **Not tested** - No `xcl-smoke` block: no title was run. - `XCL_ALIAS_COPY=1`: every run here had the switch unset. - The PR's GPU test on the RTX 3070 rather than WARP. - A release build, AMD or Intel GPUs, Linux / Wine. AI use: Claude Code (Claude Opus 5.5) ran the tests above on the hardware named and wrote this report.
minimalhipster990 commented 2026-11-28 10:52:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by minimalhipster990 on 2026-11-28T10:52:39Z.


RTX 4090, Series X profile, clean head 6396870e2184c80b7fa0404edf419d2f8ee262e1. The courtyard reaches the G-buffer and the swapchain on the unmodified PR executable. With alias copies enabled, the log reaches at least 16,384 enhanced-barrier copies and zero legacy copies at that checkpoint.

Copies off/on at the same 50 ms graphics wait. I matched the first three heavy frames using features in the base-color dump, then compared the format-10 FP16 target on pixels where the aligned base colors agreed within 8/255 in every channel. In the first pair (BMP 1908 off / 1899 on), 157 features agreed with 0.05-pixel median residual at 640×360. Both HDR targets ran 168 draws, with 487/486 stand-ins off/on. Across 60,341 matching scene pixels the median brightness in XCL’s tone-mapped 8-bit HDR preview was 0 off / 182 on. Both final images were still nearly black. The next two matched HDR pairs gave 0 / 177 and 0 / 191. By the third pair (1910 off / 1901 on), the median of the whole presented image was 21 / 197. The off image shows a dark yard with a few lights. With copies on, people and tables are visible in bright haze. This supports the courtyard lighting change on Ada. Exposure and geometry are still visibly broken. The cell interior and the copies' frame-time cost remain unmeasured here.

Getting past the loading artwork. I used the same checkpoint, A presses at 25/30/35/40/62/64 s and a fresh verified copy of the same populated XCL cache (4,946 files) for each 360 s run. With copies on and the default graphics pipeline wait, the last interval with a present ended at 116.07 s. One thread spent 241.62 of the remaining 243.93 s inside 59 logged graphics pipeline waits. With just XCL_GFX_PSO_WAIT_MS=50 changed, the recorder completed a world frame at 152.91 s. Earlier cold-cache (395 s) and populated-cache (600 s) off/on pairs with the default wait had also ended with loading artwork as their last sampled image.

Where the world first appears. In capture_1900/frame.jsonl, stream entry 1104 is the first recorded indirect mesh dispatch, writing 2560×1440 depth. Entry 22539 is the first recorded mesh dispatch with six 2560×1440 color targets (formats 29/28/28/28/34/28). Both ran on lists submitted to the queue of PresentX 1900. Three earlier list references have missing or partial recordings. In the corresponding BMP sample 1899, courtyard tables and figures are already visible in the base color and HDR target while the final image is black. Sample 1901 presents the courtyard with strongly overexposed lighting. The capture also contains 291 stand-ins, 347 deferred and 450 skipped operations out of 19,406 recorded draws/dispatches.

Reproduction settings. Windows 11 build 26300, RTX 4090 24 GB, NVIDIA 621.40, Ryzen 7 5800X3D, 32 GB RAM. XCL_DEVICE_TYPE=anaconda XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_DIRECT_DXIL=1 XCL_COHERENT_MB=3990 XCL_COHERENT_HEAPS=sparse XCL_TEXTURE_LEVEL_PAGES=1 XCL_PAGE_BUDGET_MB=1024 XCL_VIEW_POOL_MB=1024 XCL_CS_PSO_WAIT_MS=200 XCL_TWO_PASS_MB=3072. Capture used XCL_CAPTURE_FRAME=500,80 XCL_DUMP_TARGETS=500,3,8 XCL_DUMP_AFTER_S=80 XCL_FRAME_DUMP=12. Network and preparation were disabled. The NVIDIA driver cache remained driver-managed. The 50 ms pair completed 360 s with 2,417 frames shown off and 2,361 on, both exit 0 with no logged device removal. This report covers the retail title.

OpenAI Codex (GPT-6) assisted with building the head, running the title, verifying the traces and images, and writing this report.

<!-- greyfinch-sync:ivall/xcl:comment:7238179939 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7238179939). Originally posted by [minimalhipster990](https://github.com/minimalhipster990) on 2026-11-28T10:52:39Z. --- **RTX 4090, Series X profile, clean head `6396870e2184c80b7fa0404edf419d2f8ee262e1`.** The courtyard reaches the G-buffer and the swapchain on the unmodified PR executable. With alias copies enabled, the log reaches at least **16,384 enhanced-barrier copies** and zero legacy copies at that checkpoint. **Copies off/on at the same 50 ms graphics wait.** I matched the first three heavy frames using features in the base-color dump, then compared the format-10 FP16 target on pixels where the aligned base colors agreed within 8/255 in every channel. In the first pair (BMP 1908 off / 1899 on), 157 features agreed with 0.05-pixel median residual at 640×360. Both HDR targets ran 168 draws, with 487/486 stand-ins off/on. Across 60,341 matching scene pixels the median brightness in XCL’s tone-mapped 8-bit HDR preview was **0 off / 182 on**. Both final images were still nearly black. The next two matched HDR pairs gave **0 / 177** and **0 / 191**. By the third pair (1910 off / 1901 on), the median of the whole presented image was **21 / 197**. The off image shows a dark yard with a few lights. With copies on, people and tables are visible in bright haze. This supports the courtyard lighting change on Ada. Exposure and geometry are still visibly broken. The cell interior and the copies' frame-time cost remain unmeasured here. **Getting past the loading artwork.** I used the same checkpoint, A presses at 25/30/35/40/62/64 s and a fresh verified copy of the same populated XCL cache (4,946 files) for each 360 s run. With copies on and the default graphics pipeline wait, the last interval with a present ended at 116.07 s. One thread spent 241.62 of the remaining 243.93 s inside 59 logged graphics pipeline waits. With just `XCL_GFX_PSO_WAIT_MS=50` changed, the recorder completed a world frame at 152.91 s. Earlier cold-cache (395 s) and populated-cache (600 s) off/on pairs with the default wait had also ended with loading artwork as their last sampled image. **Where the world first appears.** In `capture_1900/frame.jsonl`, stream entry 1104 is the first recorded indirect mesh dispatch, writing 2560×1440 depth. Entry 22539 is the first recorded mesh dispatch with six 2560×1440 color targets (formats 29/28/28/28/34/28). Both ran on lists submitted to the queue of PresentX 1900. Three earlier list references have missing or partial recordings. In the corresponding BMP sample 1899, courtyard tables and figures are already visible in the base color and HDR target while the final image is black. Sample 1901 presents the courtyard with strongly overexposed lighting. The capture also contains 291 stand-ins, 347 deferred and 450 skipped operations out of 19,406 recorded draws/dispatches. **Reproduction settings.** Windows 11 build 26300, RTX 4090 24 GB, NVIDIA 621.40, Ryzen 7 5800X3D, 32 GB RAM. `XCL_DEVICE_TYPE=anaconda XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_DIRECT_DXIL=1 XCL_COHERENT_MB=3990 XCL_COHERENT_HEAPS=sparse XCL_TEXTURE_LEVEL_PAGES=1 XCL_PAGE_BUDGET_MB=1024 XCL_VIEW_POOL_MB=1024 XCL_CS_PSO_WAIT_MS=200 XCL_TWO_PASS_MB=3072`. Capture used `XCL_CAPTURE_FRAME=500,80 XCL_DUMP_TARGETS=500,3,8 XCL_DUMP_AFTER_S=80 XCL_FRAME_DUMP=12`. Network and preparation were disabled. The NVIDIA driver cache remained driver-managed. The 50 ms pair completed 360 s with 2,417 frames shown off and 2,361 on, both exit 0 with no logged device removal. This report covers the retail title. OpenAI Codex (GPT-6) assisted with building the head, running the title, verifying the traces and images, and writing this report.
vasanex commented 2026-11-28 20:19:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by vasanex on 2026-11-28T20:19:58Z.


Test report for 6396870e2 on an RTX 3080: the copy lights the world here, and gives a better picture than sharing the memory, which we had tried.

Tested

  • NVIDIA GeForce RTX 3080 10 GB, driver 621.40, AMD Ryzen 9 7950X, 64 GB, Windows 11 Pro build 26200, Rust 1.100.0; unit tests in debug, title runs in release.
  • The PR's diff applied (cleanly) onto nvidia-dev 54225f58 with the open PRs our runs need merged (#2905 #2987 #3039 #2815 #2816 #2817 #3037 #609 #2753 #2975 #3052 #2590 #3091 #3092 #2229, and #1319's put_in) and local changes.
  • cargo test -p xcl --lib -- alias_copy --test-threads=4: 4 passed, 0 failed, 0 ignored, no SKIPPED.
  • Retail title, Series S profile, 760 s per run, one build, three runs that differ only in the switches (XCL_UMA_DRIVER=mixed:1536:1792 XCL_SPARSE_SYSMEM=1 XCL_TEXTURE_SYSMEM=1 XCL_TEXTURE_LEVEL_PAGES=1 XCL_UMA_WINDOWS=16 XCL_HEAP_WINDOWS=1 XCL_SMALL_TEXTURES=1 XCL_DIRECT_DXIL=1 in all):
neither XCL_ALIAS_COPY=1 (this PR) shared memory (local)
world reached at 513 s 510 s 537 s
logged – 32 or more pairs, 8192 or more copies at enhanced barriers, 0 at legacy transitions, 0 left out (the lines are logged at powers of two) 32 sampled textures on the tiles of their written ones, 5 volumes by the first description's size
the world's picture dark: only what the sun hits directly, black sky (mean of the settled frames 6 of 255) lit: room, yard, blue sky (mean 35) lit: room darker, yard and sky brighter and hazier (mean 50)
presents in the last 60 s 72 74 74
local video memory at the end 7490 MB 7777 MB 7527 MB
device removals / crashes 0 / 0 0 / 0 0 / 0

The copy does what the description says on this card: the same scene goes from black with sunlit edges to a lit room and sky, at the same frame rate (about 1.1 presents a second in the world in all three runs; the frame is bound elsewhere). A first run with the copy on reached the world at 449 s, fell back to the title's loading screen after about a minute and crashed at 689 s when the title read a page XCL had moved to its other mapping 207 ms before (the limit of #1031); the copy was at work in it too (1024 or more copies), and I have no sign that it had a part in that.

For comparison: one memory for both. Before finding this PR we had the same pairs dark on this card and tried the console's own arrangement locally: the sampled texture is given the video-memory tiles of the written texture at its address (a written texture at an address off the 64 KiB pages is still put on the title's shared pages, and a sampled texture of the same shape placed there later is mapped to the same tiles), so nothing is copied. That is the table's third column. It lights the scene too, but the picture is worse than with this PR's copy: through the window the copy gives a clear sky gradient, a sharp fence and tower and a plant on the sill, where the shared memory gives a washed-out, hazy view, dot patterns on the window frame and no plant. With both on (the sharing takes the 2D pairs, the copy is left with 5 to 7 pairs, the 40x23x64 volumes among them) the picture is the hazy one again. So on this card the copy is the better of the two, and sharing tiles between the two formats is not the same thing as it looks on paper; I have not found out why (the tile shapes of the two formats, or the moment a pair's content is taken).

Not tested

  • AMD and Intel GPUs; other titles; main.
  • The cost of the copies per frame beyond the presents counted above.

AI use

  • Claude Code (Claude Fable 5.2) wrote the local sharing change used for the comparison, ran the tests and the title runs and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7245208402 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7245208402). Originally posted by [vasanex](https://github.com/vasanex) on 2026-11-28T20:19:58Z. --- Test report for `6396870e2` on an RTX 3080: the copy lights the world here, and gives a better picture than sharing the memory, which we had tried. **Tested** - NVIDIA GeForce RTX 3080 10 GB, driver 621.40, AMD Ryzen 9 7950X, 64 GB, Windows 11 Pro build 26200, Rust 1.100.0; unit tests in debug, title runs in release. - The PR's diff applied (cleanly) onto `nvidia-dev` `54225f58` with the open PRs our runs need merged (#2905 #2987 #3039 #2815 #2816 #2817 #3037 #609 #2753 #2975 #3052 #2590 #3091 #3092 #2229, and #1319's `put_in`) and local changes. - `cargo test -p xcl --lib -- alias_copy --test-threads=4`: 4 passed, 0 failed, 0 ignored, no SKIPPED. - Retail title, Series S profile, 760 s per run, one build, three runs that differ only in the switches (`XCL_UMA_DRIVER=mixed:1536:1792 XCL_SPARSE_SYSMEM=1 XCL_TEXTURE_SYSMEM=1 XCL_TEXTURE_LEVEL_PAGES=1 XCL_UMA_WINDOWS=16 XCL_HEAP_WINDOWS=1 XCL_SMALL_TEXTURES=1 XCL_DIRECT_DXIL=1` in all): | | neither | `XCL_ALIAS_COPY=1` (this PR) | shared memory (local) | |---|---|---|---| | world reached at | 513 s | 510 s | 537 s | | logged | – | 32 or more pairs, 8192 or more copies at enhanced barriers, 0 at legacy transitions, 0 left out (the lines are logged at powers of two) | 32 sampled textures on the tiles of their written ones, 5 volumes by the first description's size | | the world's picture | dark: only what the sun hits directly, black sky (mean of the settled frames 6 of 255) | lit: room, yard, blue sky (mean 35) | lit: room darker, yard and sky brighter and hazier (mean 50) | | presents in the last 60 s | 72 | 74 | 74 | | local video memory at the end | 7490 MB | 7777 MB | 7527 MB | | device removals / crashes | 0 / 0 | 0 / 0 | 0 / 0 | The copy does what the description says on this card: the same scene goes from black with sunlit edges to a lit room and sky, at the same frame rate (about 1.1 presents a second in the world in all three runs; the frame is bound elsewhere). A first run with the copy on reached the world at 449 s, fell back to the title's loading screen after about a minute and crashed at 689 s when the title read a page XCL had moved to its other mapping 207 ms before (the limit of #1031); the copy was at work in it too (1024 or more copies), and I have no sign that it had a part in that. **For comparison: one memory for both.** Before finding this PR we had the same pairs dark on this card and tried the console's own arrangement locally: the sampled texture is given the video-memory tiles of the written texture at its address (a written texture at an address off the 64 KiB pages is still put on the title's shared pages, and a sampled texture of the same shape placed there later is mapped to the same tiles), so nothing is copied. That is the table's third column. It lights the scene too, but the picture is worse than with this PR's copy: through the window the copy gives a clear sky gradient, a sharp fence and tower and a plant on the sill, where the shared memory gives a washed-out, hazy view, dot patterns on the window frame and no plant. With both on (the sharing takes the 2D pairs, the copy is left with 5 to 7 pairs, the 40x23x64 volumes among them) the picture is the hazy one again. So on this card the copy is the better of the two, and sharing tiles between the two formats is not the same thing as it looks on paper; I have not found out why (the tile shapes of the two formats, or the moment a pair's content is taken). **Not tested** - AMD and Intel GPUs; other titles; `main`. - The cost of the copies per frame beyond the presents counted above. **AI use** - Claude Code (Claude Fable 5.2) wrote the local sharing change used for the comparison, ran the tests and the title runs and drafted this report.
thehollowedone commented 2026-11-28 21:29:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-28T21:29:35Z.


Follow-up to my merge check, item 2, on unchanged head 6396870e: list-local state alone would not finish the fix. If list A records a sampled-texture transition and list B records an alias copy before A is submitted, B's copy barriers are already encoded from the state A wrote into the global Tex.now. Submitting A later, or resetting A without submitting it, cannot rewrite B's barriers. plan updates that global value while recording; record reads it when it emits the native barriers. The later visual reports do not exercise this ordering.

A focused regression can use two adopted DIRECT lists and independent allocators on WARP with the D3D12 debug layer: record a sampled-texture transition on A, then record the enhanced-barrier copy on B, reset A without submission, and submit only B. The native before-state encoded for B should match the state the device actually has; inspect ID3D12InfoQueue and a fenced readback. Also run the control with A submitted before B is recorded. The eventual state owner needs to account for recording, successful reset, and actual submission order (including kickoff segments); otherwise a cached global or list-local state can still describe work the GPU never executed. This is a source-level follow-up; I have not run this two-list GPU regression.

Measured WARP follow-up on the same head. Windows 11 build 26300, WARP software adapter with Graphics Tools debug layer (host RTX 3080 Ti / NVIDIA 621.35), rustc 1.99.1. The temporary regression records the sampled texture's shader-read → COPY_SOURCE transition through resource_barrier_x on adopted list A, closes and resets A without submitting it, then uses the PR's enhanced-barrier planner and native copy recorder on list B. Only B is submitted and fenced. With XCL_ALIAS_COPY=1, cargo test --offline --locked -j 4 -p xcl --lib gpu_reset_list_does_not_change_another_lists_alias_copy_before_state -- --nocapture --test-threads=1 failed 0/1/0 on unchanged head. ID3D12InfoQueue reported B's barrier before-state 0x800 (COPY_SOURCE) while the texture remained in 0xC0 (shader read). With the test-only XCL_ALIAS_SUBMIT_A_CONTROL=1, A was submitted and fenced before B was recorded; the same test passed 1/0/0, with no error or skip. The PR's stock gpu_a_written_textures_texels_reach_its_sampled_pair_at_the_enhanced_barrier WARP fixture also passed 1/0/0 with the switch on. The diff below is a temporary regression only, not a production fix. I did not run the full workspace suite or paired title smoke on this test overlay.

Temporary two-list WARP regression diff
diff --git a/crates/xcl/src/hle/d3d12x/alias_copy.rs b/crates/xcl/src/hle/d3d12x/alias_copy.rs
index 50e68b76..ab193813 100644
--- a/crates/xcl/src/hle/d3d12x/alias_copy.rs
+++ b/crates/xcl/src/hle/d3d12x/alias_copy.rs
@@ -508,6 +508,89 @@ mod tests {
         forget(r);
     }
 
+    #[test]
+    fn gpu_reset_list_does_not_change_another_lists_alias_copy_before_state() {
+        use super::super::real::{adopt, Kind};
+        use windows::Win32::Graphics::Direct3D::D3D_FEATURE_LEVEL_11_0;
+        use windows::Win32::Graphics::Dxgi::{CreateDXGIFactory1, IDXGIAdapter, IDXGIFactory4};
+        unsafe {
+            let skip = || crate::gpu::recomp::runner::skip_test("no WARP device or D3D12 debug layer");
+            let Ok(debug) = crate::gpu::agility::configuration_interface::<ID3D12Debug>(&CLSID_D3D12Debug) else { return skip() };
+            debug.EnableDebugLayer();
+            let Ok(factory) = CreateDXGIFactory1::<IDXGIFactory4>() else { return skip() };
+            let Ok(warp) = factory.EnumWarpAdapter::<IDXGIAdapter>() else { return skip() };
+            let mut device: Option<ID3D12Device> = None;
+            if D3D12CreateDevice(&warp, D3D_FEATURE_LEVEL_11_0, &mut device).is_err() { return skip() }
+            let dev = device.unwrap();
+            let q: ID3D12InfoQueue = dev.cast().expect("debug info queue");
+            let queue: ID3D12CommandQueue = dev.CreateCommandQueue(&D3D12_COMMAND_QUEUE_DESC { Type: D3D12_COMMAND_LIST_TYPE_DIRECT, ..Default::default() }).unwrap();
+            let a_alloc: ID3D12CommandAllocator = dev.CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT).unwrap();
+            let b_alloc: ID3D12CommandAllocator = dev.CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT).unwrap();
+            let a: ID3D12GraphicsCommandList = dev.CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, &a_alloc, None).unwrap();
+            let b: ID3D12GraphicsCommandList = dev.CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, &b_alloc, None).unwrap();
+            let (written_desc, sampled_desc) = (texture(42, 16, 8, 1, 4), texture(67, 16, 8, 1, 0));
+            let committed = |desc: &D3D12_RESOURCE_DESC, state: D3D12_RESOURCE_STATES| {
+                let mut out: Option<ID3D12Resource> = None;
+                dev.CreateCommittedResource(&D3D12_HEAP_PROPERTIES { Type: D3D12_HEAP_TYPE_DEFAULT, ..Default::default() }, D3D12_HEAP_FLAG_NONE, desc, state, None, &mut out).unwrap();
+                out.unwrap()
+            };
+            let read = D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE | D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE;
+            let written = committed(&written_desc, D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
+            let sampled = committed(&sampled_desc, read);
+            let (w, r) = (written.as_raw() as usize, sampled.as_raw() as usize);
+            let va = 0x7AC0_0000_5000usize;
+            keep(dev.as_raw() as usize, w, va, &written_desc, D3D12_RESOURCE_STATE_UNORDERED_ACCESS.0 as u32);
+            keep(dev.as_raw() as usize, r, va, &sampled_desc, read.0 as u32);
+            for (list, alloc) in [(&a, &a_alloc), (&b, &b_alloc)] {
+                adopt(list.as_raw(), Kind::CommandList);
+                super::super::list_x::on_create(list.as_raw(), alloc.as_raw() as usize, 0, D3D12_COMMAND_LIST_TYPE_DIRECT);
+            }
+            q.ClearStoredMessages();
+
+            // A's transition is discarded; only B runs on the native queue.
+            let tr = [0, 0, r as u32, (r as u64 >> 32) as u32, ALL, read.0 as u32, COPY_SOURCE, 0];
+            super::super::list_x::resource_barrier_x(a.as_raw(), 1, &tr);
+            let close: unsafe extern "system" fn(*mut c_void) -> i32 = std::mem::transmute(*(*(a.as_raw() as *const *const usize)).add(9));
+            assert!(close(a.as_raw()) >= 0);
+            if std::env::var_os("XCL_ALIAS_SUBMIT_A_CONTROL").is_some() {
+                let raw = a.as_raw();
+                let execute: unsafe extern "system" fn(*mut c_void, u32, *const *mut c_void) = std::mem::transmute(*(*(queue.as_raw() as *const *const usize)).add(10));
+                execute(queue.as_raw(), 1, &raw);
+                let fence: ID3D12Fence = dev.CreateFence(0, D3D12_FENCE_FLAG_NONE).unwrap();
+                queue.Signal(&fence, 1).unwrap();
+                crate::gpu::fence::wait(&fence, 1, &dev, None, 5000).unwrap();
+            }
+            assert!(super::super::list_x::reset_x(a.as_raw(), a_alloc.as_raw() as usize, 0) >= 0);
+
+            let words: [u32; 16] = [0x1000, 0x1000, 0x10, 0x80, 3, 6, w as u32, (w as u64 >> 32) as u32, u32::MAX, 0, 0, 0, 0, 0, 0, 0];
+            let group: [u64; 2] = [1 | 1 << 32, words.as_ptr() as u64];
+            let jobs = plan_enhanced(1, group.as_ptr() as usize);
+            assert_eq!(jobs, [(w, r, 0)]);
+            record(b.as_raw(), &jobs);
+            assert!(close(b.as_raw()) >= 0);
+            let raw = b.as_raw();
+            let execute: unsafe extern "system" fn(*mut c_void, u32, *const *mut c_void) = std::mem::transmute(*(*(queue.as_raw() as *const *const usize)).add(10));
+            execute(queue.as_raw(), 1, &raw);
+            let fence: ID3D12Fence = dev.CreateFence(0, D3D12_FENCE_FLAG_NONE).unwrap();
+            queue.Signal(&fence, 1).unwrap();
+            crate::gpu::fence::wait(&fence, 1, &dev, None, 5000).unwrap();
+            let mut errors = Vec::new();
+            for i in 0..q.GetNumStoredMessages() {
+                let mut len = 0usize;
+                if q.GetMessage(i, None, &mut len).is_err() || len == 0 { continue }
+                let mut bytes = vec![0u64; len.div_ceil(8)];
+                let m = bytes.as_mut_ptr() as *mut D3D12_MESSAGE;
+                if q.GetMessage(i, Some(m), &mut len).is_ok() && matches!((*m).Severity, D3D12_MESSAGE_SEVERITY_ERROR | D3D12_MESSAGE_SEVERITY_CORRUPTION) {
+                    let text = std::slice::from_raw_parts((*m).pDescription as *const u8, (*m).DescriptionByteLength.saturating_sub(1));
+                    errors.push(String::from_utf8_lossy(text).into_owned());
+                }
+            }
+            forget(w);
+            forget(r);
+            assert!(errors.is_empty(), "only B ran, but its native barriers had debug errors: {errors:?}");
+        }
+    }
+
     /// The copy on a GPU (WARP): an R32_UINT array texture with unordered access, 70 layers and
     /// two levels (140 parts) holds a pattern; after the enhanced barrier that ends its writing,
     /// its R9G9B9E5 pair, read back, holds the same bytes in every level of every layer.

AI use: Codex (GPT-6.2 Sol) wrote and ran the temporary GPU regression and checked the debug output; Codex (GPT-6.2 Astra) independently traced the list lifecycle.

<!-- greyfinch-sync:ivall/xcl:comment:7246057545 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7246057545). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-28T21:29:35Z. --- Follow-up to [my merge check](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7235800050), item 2, on unchanged head [`6396870e`](https://github.com/xcl-dev/xcl/commit/6396870e2184c80b7fa0404edf419d2f8ee262e1): list-local state alone would not finish the fix. If list A records a sampled-texture transition and list B records an alias copy **before A is submitted**, B's copy barriers are already encoded from the state A wrote into the global `Tex.now`. Submitting A later, or resetting A without submitting it, cannot rewrite B's barriers. `plan` updates that global value while recording; `record` reads it when it emits the native barriers. The later visual reports do not exercise this ordering. A focused regression can use two adopted DIRECT lists and independent allocators on WARP with the D3D12 debug layer: record a sampled-texture transition on A, then record the enhanced-barrier copy on B, reset A without submission, and submit only B. The native before-state encoded for B should match the state the device actually has; inspect `ID3D12InfoQueue` and a fenced readback. Also run the control with A submitted before B is recorded. The eventual state owner needs to account for recording, successful reset, and actual submission order (including kickoff segments); otherwise a cached global or list-local state can still describe work the GPU never executed. This is a source-level follow-up; I have not run this two-list GPU regression. **Measured WARP follow-up on the same head.** Windows 11 build 26300, WARP software adapter with Graphics Tools debug layer (host RTX 3080 Ti / NVIDIA 621.35), rustc 1.99.1. The temporary regression records the sampled texture's shader-read → `COPY_SOURCE` transition through `resource_barrier_x` on adopted list A, closes and resets A without submitting it, then uses the PR's enhanced-barrier planner and native copy recorder on list B. Only B is submitted and fenced. With `XCL_ALIAS_COPY=1`, `cargo test --offline --locked -j 4 -p xcl --lib gpu_reset_list_does_not_change_another_lists_alias_copy_before_state -- --nocapture --test-threads=1` **failed 0/1/0** on unchanged head. `ID3D12InfoQueue` reported B's barrier before-state `0x800` (`COPY_SOURCE`) while the texture remained in `0xC0` (shader read). With the test-only `XCL_ALIAS_SUBMIT_A_CONTROL=1`, A was submitted and fenced before B was recorded; the same test **passed 1/0/0**, with no error or skip. The PR's stock `gpu_a_written_textures_texels_reach_its_sampled_pair_at_the_enhanced_barrier` WARP fixture also passed **1/0/0** with the switch on. The diff below is a temporary regression only, not a production fix. I did not run the full workspace suite or paired title smoke on this test overlay. <details><summary>Temporary two-list WARP regression diff</summary> ```diff diff --git a/crates/xcl/src/hle/d3d12x/alias_copy.rs b/crates/xcl/src/hle/d3d12x/alias_copy.rs index 50e68b76..ab193813 100644 --- a/crates/xcl/src/hle/d3d12x/alias_copy.rs +++ b/crates/xcl/src/hle/d3d12x/alias_copy.rs @@ -508,6 +508,89 @@ mod tests { forget(r); } + #[test] + fn gpu_reset_list_does_not_change_another_lists_alias_copy_before_state() { + use super::super::real::{adopt, Kind}; + use windows::Win32::Graphics::Direct3D::D3D_FEATURE_LEVEL_11_0; + use windows::Win32::Graphics::Dxgi::{CreateDXGIFactory1, IDXGIAdapter, IDXGIFactory4}; + unsafe { + let skip = || crate::gpu::recomp::runner::skip_test("no WARP device or D3D12 debug layer"); + let Ok(debug) = crate::gpu::agility::configuration_interface::<ID3D12Debug>(&CLSID_D3D12Debug) else { return skip() }; + debug.EnableDebugLayer(); + let Ok(factory) = CreateDXGIFactory1::<IDXGIFactory4>() else { return skip() }; + let Ok(warp) = factory.EnumWarpAdapter::<IDXGIAdapter>() else { return skip() }; + let mut device: Option<ID3D12Device> = None; + if D3D12CreateDevice(&warp, D3D_FEATURE_LEVEL_11_0, &mut device).is_err() { return skip() } + let dev = device.unwrap(); + let q: ID3D12InfoQueue = dev.cast().expect("debug info queue"); + let queue: ID3D12CommandQueue = dev.CreateCommandQueue(&D3D12_COMMAND_QUEUE_DESC { Type: D3D12_COMMAND_LIST_TYPE_DIRECT, ..Default::default() }).unwrap(); + let a_alloc: ID3D12CommandAllocator = dev.CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT).unwrap(); + let b_alloc: ID3D12CommandAllocator = dev.CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT).unwrap(); + let a: ID3D12GraphicsCommandList = dev.CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, &a_alloc, None).unwrap(); + let b: ID3D12GraphicsCommandList = dev.CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, &b_alloc, None).unwrap(); + let (written_desc, sampled_desc) = (texture(42, 16, 8, 1, 4), texture(67, 16, 8, 1, 0)); + let committed = |desc: &D3D12_RESOURCE_DESC, state: D3D12_RESOURCE_STATES| { + let mut out: Option<ID3D12Resource> = None; + dev.CreateCommittedResource(&D3D12_HEAP_PROPERTIES { Type: D3D12_HEAP_TYPE_DEFAULT, ..Default::default() }, D3D12_HEAP_FLAG_NONE, desc, state, None, &mut out).unwrap(); + out.unwrap() + }; + let read = D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE | D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE; + let written = committed(&written_desc, D3D12_RESOURCE_STATE_UNORDERED_ACCESS); + let sampled = committed(&sampled_desc, read); + let (w, r) = (written.as_raw() as usize, sampled.as_raw() as usize); + let va = 0x7AC0_0000_5000usize; + keep(dev.as_raw() as usize, w, va, &written_desc, D3D12_RESOURCE_STATE_UNORDERED_ACCESS.0 as u32); + keep(dev.as_raw() as usize, r, va, &sampled_desc, read.0 as u32); + for (list, alloc) in [(&a, &a_alloc), (&b, &b_alloc)] { + adopt(list.as_raw(), Kind::CommandList); + super::super::list_x::on_create(list.as_raw(), alloc.as_raw() as usize, 0, D3D12_COMMAND_LIST_TYPE_DIRECT); + } + q.ClearStoredMessages(); + + // A's transition is discarded; only B runs on the native queue. + let tr = [0, 0, r as u32, (r as u64 >> 32) as u32, ALL, read.0 as u32, COPY_SOURCE, 0]; + super::super::list_x::resource_barrier_x(a.as_raw(), 1, &tr); + let close: unsafe extern "system" fn(*mut c_void) -> i32 = std::mem::transmute(*(*(a.as_raw() as *const *const usize)).add(9)); + assert!(close(a.as_raw()) >= 0); + if std::env::var_os("XCL_ALIAS_SUBMIT_A_CONTROL").is_some() { + let raw = a.as_raw(); + let execute: unsafe extern "system" fn(*mut c_void, u32, *const *mut c_void) = std::mem::transmute(*(*(queue.as_raw() as *const *const usize)).add(10)); + execute(queue.as_raw(), 1, &raw); + let fence: ID3D12Fence = dev.CreateFence(0, D3D12_FENCE_FLAG_NONE).unwrap(); + queue.Signal(&fence, 1).unwrap(); + crate::gpu::fence::wait(&fence, 1, &dev, None, 5000).unwrap(); + } + assert!(super::super::list_x::reset_x(a.as_raw(), a_alloc.as_raw() as usize, 0) >= 0); + + let words: [u32; 16] = [0x1000, 0x1000, 0x10, 0x80, 3, 6, w as u32, (w as u64 >> 32) as u32, u32::MAX, 0, 0, 0, 0, 0, 0, 0]; + let group: [u64; 2] = [1 | 1 << 32, words.as_ptr() as u64]; + let jobs = plan_enhanced(1, group.as_ptr() as usize); + assert_eq!(jobs, [(w, r, 0)]); + record(b.as_raw(), &jobs); + assert!(close(b.as_raw()) >= 0); + let raw = b.as_raw(); + let execute: unsafe extern "system" fn(*mut c_void, u32, *const *mut c_void) = std::mem::transmute(*(*(queue.as_raw() as *const *const usize)).add(10)); + execute(queue.as_raw(), 1, &raw); + let fence: ID3D12Fence = dev.CreateFence(0, D3D12_FENCE_FLAG_NONE).unwrap(); + queue.Signal(&fence, 1).unwrap(); + crate::gpu::fence::wait(&fence, 1, &dev, None, 5000).unwrap(); + let mut errors = Vec::new(); + for i in 0..q.GetNumStoredMessages() { + let mut len = 0usize; + if q.GetMessage(i, None, &mut len).is_err() || len == 0 { continue } + let mut bytes = vec![0u64; len.div_ceil(8)]; + let m = bytes.as_mut_ptr() as *mut D3D12_MESSAGE; + if q.GetMessage(i, Some(m), &mut len).is_ok() && matches!((*m).Severity, D3D12_MESSAGE_SEVERITY_ERROR | D3D12_MESSAGE_SEVERITY_CORRUPTION) { + let text = std::slice::from_raw_parts((*m).pDescription as *const u8, (*m).DescriptionByteLength.saturating_sub(1)); + errors.push(String::from_utf8_lossy(text).into_owned()); + } + } + forget(w); + forget(r); + assert!(errors.is_empty(), "only B ran, but its native barriers had debug errors: {errors:?}"); + } + } + /// The copy on a GPU (WARP): an R32_UINT array texture with unordered access, 70 layers and /// two levels (140 parts) holds a pattern; after the enhanced barrier that ends its writing, /// its R9G9B9E5 pair, read back, holds the same bytes in every level of every layer. ``` </details> AI use: Codex (GPT-6.2 Sol) wrote and ran the temporary GPU regression and checked the debug output; Codex (GPT-6.2 Astra) independently traced the list lifecycle.
Pipodi commented 2026-11-28 23:47:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Pipodi on 2026-11-28T23:47:14Z.


A heads-up so we don't duplicate work: I am preparing a PR against main for the same same-address pairs (an R9G9B9E5 view over the R32_UINT texture a compute pass writes), with a different mechanism. Instead of copying, both descriptions share the written texture's pages:

  • the view's range is capped to the written texture's console size (0x384000, where XG gives the view 0x3c0000), so the next texture placed after it no longer supersedes and unmaps it;
  • a GPU-owned texture whose address is not 64 KiB-aligned but meets its console alignment goes on the shared pages too.

It stays opt-in behind XCL_PAIR_PAGES=1. I'll link the PR here when it is up. If you think it collides with XCL_ALIAS_COPY, tell me.

(Claude Code, Claude Opus 5.5, wrote this comment.)

<!-- greyfinch-sync:ivall/xcl:comment:7247662808 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7247662808). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-11-28T23:47:14Z. --- A heads-up so we don't duplicate work: I am preparing a PR against main for the same same-address pairs (an R9G9B9E5 view over the R32_UINT texture a compute pass writes), with a different mechanism. Instead of copying, both descriptions share the written texture's pages: - the view's range is capped to the written texture's console size (0x384000, where XG gives the view 0x3c0000), so the next texture placed after it no longer supersedes and unmaps it; - a GPU-owned texture whose address is not 64 KiB-aligned but meets its console alignment goes on the shared pages too. It stays opt-in behind `XCL_PAIR_PAGES=1`. I'll link the PR here when it is up. If you think it collides with `XCL_ALIAS_COPY`, tell me. (Claude Code, Claude Opus 5.5, wrote this comment.)
KDenKC commented 2026-11-29 00:42:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-29T00:42:35Z.


@Pipodi thanks for the heads-up; it does overlap with what we're about to build, so here is where we are, to split the work rather than duplicate it.

We went the other way from both the copy and shared pages: one resource, two views, through D3D12's castable-format list. The texture the compute pass writes as R32_UINT is created with a narrow cast list ([R32_UINT, R9G9B9E5_SHAREDEXP]), and the R9G9B9E5 description placed at its address resolves to that same resource, its SRVs made with the R9G9B9E5 format. A test-only fixture on an RTX 5090 (621.24, debug layer on): RelaxedFormatCastingSupported true; one 256x256 texture written through an R32_UINT UAV and read through an R9G9B9E5 SRV, all 65,536 texels bit-exact on the committed route and on the reserved one (CreateReservedResource2, 64KB_UNDEFINED_SWIZZLE, tiles mapped on a second queue). The fixture's own debug-layer messages (root-descriptor flags, a queue released early) are being fixed; none was about the cast.

Why we didn't take shared pages for this pair: D3D12 doesn't promise that two placed textures of different formats over the same memory see each other's texels with the undefined swizzle layout, even at the same bits per texel; the cast list is the route it does define. Your range cap (0x384000 vs XG's 0x3c0000, so the next placement no longer supersedes the writer) looks needed either way, though: our version needs the reader to find the live writer too.

Proposal: you keep the range/alignment part; we put the cast list on top of it, or the other way round if you'd rather. Either way one PR series, not two. What do you prefer?

AI use: an agent swarm: Claude Opus 5.5, GPT-6.2-Sol and Gemini 4 Neon.

<!-- greyfinch-sync:ivall/xcl:comment:7248297588 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7248297588). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-11-29T00:42:35Z. --- @Pipodi thanks for the heads-up; it does overlap with what we're about to build, so here is where we are, to split the work rather than duplicate it. We went the other way from both the copy and shared pages: **one resource, two views, through D3D12's castable-format list.** The texture the compute pass writes as R32_UINT is created with a narrow cast list (`[R32_UINT, R9G9B9E5_SHAREDEXP]`), and the R9G9B9E5 description placed at its address resolves to that same resource, its SRVs made with the R9G9B9E5 format. A test-only fixture on an RTX 5090 (621.24, debug layer on): `RelaxedFormatCastingSupported` true; one 256x256 texture written through an R32_UINT UAV and read through an R9G9B9E5 SRV, **all 65,536 texels bit-exact** on the committed route and on the reserved one (`CreateReservedResource2`, `64KB_UNDEFINED_SWIZZLE`, tiles mapped on a second queue). The fixture's own debug-layer messages (root-descriptor flags, a queue released early) are being fixed; none was about the cast. Why we didn't take shared pages for this pair: D3D12 doesn't promise that two placed textures of different formats over the same memory see each other's texels with the undefined swizzle layout, even at the same bits per texel; the cast list is the route it does define. Your range cap (0x384000 vs XG's 0x3c0000, so the next placement no longer supersedes the writer) looks needed either way, though: our version needs the reader to find the live writer too. Proposal: you keep the range/alignment part; we put the cast list on top of it, or the other way round if you'd rather. Either way one PR series, not two. What do you prefer? AI use: an agent swarm: Claude Opus 5.5, GPT-6.2-Sol and Gemini 4 Neon.
Pipodi commented 2026-11-29 04:07:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Pipodi on 2026-11-29T04:07:02Z.


Follow-up to my note above: the page-sharing approach is up as #3281 (caps the view to the written texture's console size) and #3282 (stacked: puts the GPU-owned texture at the 16 KiB-aligned address on the shared pages), both opt-in behind XCL_PAIR_PAGES=1. They are an alternative to XCL_ALIAS_COPY: with both switches on, the copy would go onto memory the view already shares.

(Claude Code, Claude Opus 5.5, wrote this comment.)

<!-- greyfinch-sync:ivall/xcl:comment:7250457557 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7250457557). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-11-29T04:07:02Z. --- Follow-up to my note above: the page-sharing approach is up as #3281 (caps the view to the written texture's console size) and #3282 (stacked: puts the GPU-owned texture at the 16 KiB-aligned address on the shared pages), both opt-in behind `XCL_PAIR_PAGES=1`. They are an alternative to `XCL_ALIAS_COPY`: with both switches on, the copy would go onto memory the view already shares. (Claude Code, Claude Opus 5.5, wrote this comment.)
claudetools-gh commented 2026-11-29 16:01:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by claudetools-gh on 2026-11-29T16:01:39Z.


A data point for XCL_ALIAS_COPY=1 on a retail title: with it on, the title crashes in its own code before reaching the world, 3 of 3 runs. All three crash at the same instruction (game_scarlett_master.exe+0x23cf683, a write to address 0, 0xc0000005), 163–247 s after start. Without it, 0 of 1 on the same binary: that run reaches the world.

The copies do run before the crash: "512 copies at enhanced barriers and 0 at legacy transitions so far", with nothing left out for an unknown state, for another list kind, or as a pair that cannot be copied.

Tree:

  • main 7a649b0e with #3124, #3192, #3179, #3282, #3306/#3307 and a local PS-export patch on top, then this PR's 6396870e.
  • One adaptation: title_textures::note_gpu_write no longer exists on main (aeed3468 records texture writes per list and publishes them at submit), so the copy now notes its destination with list_x::note_texture_write(list, r, ALL_SUBRESOURCES).
  • Env: XCL_UMA_WINDOWS=16 XCL_UMA_DRIVER=mixed:1536:1792 XCL_TEXTURE_LEVEL_PAGES=1 XCL_CS_PSO_WAIT_MS=0 XCL_TWO_PASS_MB=3072 XCL_PLACE_RETIRE=0 XCL_HEAP_WINDOWS=1, Series X profile.
run XCL_ALIAS_COPY XCL_PAIR_PAGES result
A 1 0 crash at +0x23cf683, 247 s
B 1 0 same crash, 163 s
C 1 1 same crash, 165 s
D 0 1 no crash, reaches the world (25 min)

A null write in the title's own code after a GPU-side copy suggests that one of the copies writes into memory the CPU later reads as a pointer: either a pair picked on memory that is no longer a texture, or a sampled texture whose bytes go back to the title's view. That is my reading only; I did not trace which copy it is.

Not tested: this PR alone on main (without the other PRs), AMD. RTX 5070 Ti, driver 621.40, Windows 11.
AI use: Claude Code with Claude Opus 5.5 ran the runs and wrote this. AI-assisted.

<!-- greyfinch-sync:ivall/xcl:comment:7258557458 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7258557458). Originally posted by [claudetools-gh](https://github.com/claudetools-gh) on 2026-11-29T16:01:39Z. --- A data point for `XCL_ALIAS_COPY=1` on a retail title: **with it on, the title crashes in its own code before reaching the world, 3 of 3 runs.** All three crash at the same instruction (`game_scarlett_master.exe+0x23cf683`, a write to address 0, `0xc0000005`), 163–247 s after start. **Without it, 0 of 1** on the same binary: that run reaches the world. The copies do run before the crash: "512 copies at enhanced barriers and 0 at legacy transitions so far", with nothing left out for an unknown state, for another list kind, or as a pair that cannot be copied. Tree: - `main` 7a649b0e with #3124, #3192, #3179, #3282, #3306/#3307 and a local PS-export patch on top, then this PR's 6396870e. - One adaptation: `title_textures::note_gpu_write` no longer exists on `main` (aeed3468 records texture writes per list and publishes them at submit), so the copy now notes its destination with `list_x::note_texture_write(list, r, ALL_SUBRESOURCES)`. - Env: `XCL_UMA_WINDOWS=16 XCL_UMA_DRIVER=mixed:1536:1792 XCL_TEXTURE_LEVEL_PAGES=1 XCL_CS_PSO_WAIT_MS=0 XCL_TWO_PASS_MB=3072 XCL_PLACE_RETIRE=0 XCL_HEAP_WINDOWS=1`, Series X profile. | run | `XCL_ALIAS_COPY` | `XCL_PAIR_PAGES` | result | |---|---|---|---| | A | 1 | 0 | crash at +0x23cf683, 247 s | | B | 1 | 0 | same crash, 163 s | | C | 1 | 1 | same crash, 165 s | | D | 0 | 1 | no crash, reaches the world (25 min) | A null write in the title's own code after a GPU-side copy suggests that one of the copies writes into memory the CPU later reads as a pointer: either a pair picked on memory that is no longer a texture, or a sampled texture whose bytes go back to the title's view. That is my reading only; I did not trace which copy it is. Not tested: this PR alone on `main` (without the other PRs), AMD. RTX 5070 Ti, driver 621.40, Windows 11. AI use: Claude Code with Claude Opus 5.5 ran the runs and wrote this. AI-assisted.
KDenKC commented 2026-11-29 16:03:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-29T16:03:53Z.


@claudetools-gh one thing that may change the reading: +0x23cf683 is not a stray write from bad data. It is the title's own frame-heartbeat watchdog: the instruction there writes a fixed value to address 0 on purpose when the frame loop has not reported for about 30 s (we traced it in the title's code; Joori, afpruivo, tiagonleal and others have reported the same address on #505, #1833 and #675 after 30 s stalls from cold compiles, 5 s queue-wait timeouts and lock cycles, all with no device removal). So the question your runs raise is why the frames stop for 30 s with the copies on, not which copy writes a pointer.

That fits our one data point with XCL_ALIAS_COPY=1 (RTX 5090, 621.24, main 7db2f391 with #3179, #3192, #3094, #3169 and a #3200 port): the title drew its first world frames, then from 1,546.7 s showed 0 presents, 0 submits and 0 dispatches for 24 s with no compile running and no wait logged, and aborted at +0x23cf683 at 1,570.9 s. The log has a 'list reset while its last submit is on the GPU' line right after the first copies, and we suspected the copy then but did not prove it (a large target dump on the same first frame was the other suspect). Your 3 of 3 against 0 of 1 points at the copy.

A cheap way to see which: a run with XCL_ALIAS_COPY=1 and a debugger attached (or thread stacks taken during the 30 s) shows where the title's frame thread waits when the heartbeat stops.

AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 3.8 Flash.

<!-- greyfinch-sync:ivall/xcl:comment:7258587542 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7258587542). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-11-29T16:03:53Z. --- @claudetools-gh one thing that may change the reading: `+0x23cf683` is not a stray write from bad data. It is the title's own frame-heartbeat watchdog: the instruction there writes a fixed value to address 0 on purpose when the frame loop has not reported for about 30 s (we traced it in the title's code; Joori, afpruivo, tiagonleal and others have reported the same address on #505, #1833 and #675 after 30 s stalls from cold compiles, 5 s queue-wait timeouts and lock cycles, all with no device removal). So the question your runs raise is why the frames stop for 30 s with the copies on, not which copy writes a pointer. That fits our one data point with `XCL_ALIAS_COPY=1` (RTX 5090, 621.24, `main` 7db2f391 with #3179, #3192, #3094, #3169 and a #3200 port): the title drew its first world frames, then from 1,546.7 s showed 0 presents, 0 submits and 0 dispatches for 24 s with no compile running and no wait logged, and aborted at `+0x23cf683` at 1,570.9 s. The log has a 'list reset while its last submit is on the GPU' line right after the first copies, and we suspected the copy then but did not prove it (a large target dump on the same first frame was the other suspect). Your 3 of 3 against 0 of 1 points at the copy. A cheap way to see which: a run with `XCL_ALIAS_COPY=1` and a debugger attached (or thread stacks taken during the 30 s) shows where the title's frame thread waits when the heartbeat stops. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 3.8 Flash.
andrewDoing commented 2026-11-29 16:12:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-29T16:12:32Z.


One place to look in the watchdog thread capture is the mutex shared by alias copy recording and barrier planning. On 6396870e, alias_copy::record holds TABLE while make_through queries copy footprints and calls CreateCommittedResource on first use of a scratch buffer. plan_enhanced needs the same mutex even for a different texture pair.

I checked this on an RTX 5070 with a synthetic two-pair test on that head. A test-only gate paused pair A's recorder on entry to make_through. Pair B planned successfully before the gate, could not finish planning during the 150 ms hold, and returned the expected job after release. Recording A a second time reused the buffer and bypassed the creation gate. The fixture recorded on a native D3D12 command list without submitting it. The gate establishes the CPU-side dependency. The 150 ms was injected and gives no estimate of driver latency or title impact.

In the next watchdog capture, check for a thread in alias_copy::record → make_through → footprint query or committed-resource creation, and another thread waiting inside alias_copy::plan_enhanced. Finding both together would help isolate this path from a GPU queue wait. Watchdog discussion

GPT-6.2 Sol assisted with the test and report.

Follow-up after the retail stack capture: the capture showed the title waiting on its fence while xcl-fences was publishing texture downloads. It did not show the mutex pair from the synthetic test. GitHub's ancestry comparison confirms that 7a649b0e already contains the #3237 merge (cd679bd1, 14 commits ahead and 0 behind). The slow per-page path fixed by #3237 is therefore already addressed in that base. The remaining distinction is whether the other run logged a held download or an accumulating batch count before the stall. Retail stack capture · Commit comparison

Native synthetic reproduction on main 0fe06eb0, RTX 5070 (616.92), Ryzen 7 5700X3D. A real D3D12 texture readback finished, but its reserved-only destination kept the title's mirrored fence at 0 while native completion was 1. I committed the destination after the first failed publication. For the next 200 ms, there was no further publication attempt and the mirrored fence stayed at 0. Waking xcl-fences explicitly, with no additional GPU work, published all 4,096 expected texels and advanced the mirror to 1. The focused test passed in four fresh processes with zero skips. Only the fixture and an attempt counter were added to main. This reproduces the missing retry wake independently of alias copies and provides a test for preserving the texture data when the destination later becomes writable. Title behavior and the policy for permanently invalid destinations remain open.

Synthetic follow-up to the retail fix on main 0fe06eb0, RTX 5070 (616.92), Ryzen 7 5700X3D. I tested the case where the sampled view already had a valid download writer before a replacement GPU write. Skipping the new writer stamp left a prepared readback eligible. On this fixture, it published into 40,960 adjacent canary bytes. In the control, retiring the prior writer for the single rewritten mip while preserving GPU-written status rejected the old snapshot as stale, produced no fresh download, and preserved every canary. A later genuine write on the same view became downloadable again.

The fixture used a native D3D12 upload in place of the alias recorder. The view was 0x398000 bytes on this base and the written layout was 0x384000. This isolates writer lifetime and does not establish whether the retail title reaches this sequence. In three separate optimized test processes, cargo test --release --offline --locked -p xcl --lib gpu_alias_copy_requires_invalidating_an_older_download_writer -- --test-threads=1 --nocapture passed 1/1 each with zero skips. OpenAI Codex, GPT-6.2 Sol, assisted with this fixture and report. Retail fix

<!-- greyfinch-sync:ivall/xcl:comment:7258703360 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7258703360). Originally posted by [andrewDoing](https://github.com/andrewDoing) on 2026-11-29T16:12:32Z. --- One place to look in the watchdog thread capture is the mutex shared by alias copy recording and barrier planning. On `6396870e`, `alias_copy::record` holds `TABLE` while `make_through` queries copy footprints and calls `CreateCommittedResource` on first use of a scratch buffer. `plan_enhanced` needs the same mutex even for a different texture pair. I checked this on an RTX 5070 with a synthetic two-pair test on that head. A test-only gate paused pair A's recorder on entry to `make_through`. Pair B planned successfully before the gate, could not finish planning during the 150 ms hold, and returned the expected job after release. Recording A a second time reused the buffer and bypassed the creation gate. The fixture recorded on a native D3D12 command list without submitting it. The gate establishes the CPU-side dependency. The 150 ms was injected and gives no estimate of driver latency or title impact. In the next watchdog capture, check for a thread in `alias_copy::record` → `make_through` → footprint query or committed-resource creation, and another thread waiting inside `alias_copy::plan_enhanced`. Finding both together would help isolate this path from a GPU queue wait. [Watchdog discussion](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7258587542) GPT-6.2 Sol assisted with the test and report. **Follow-up after the retail stack capture:** the capture showed the title waiting on its fence while `xcl-fences` was publishing texture downloads. It did not show the mutex pair from the synthetic test. GitHub's ancestry comparison confirms that `7a649b0e` already contains the #3237 merge (`cd679bd1`, 14 commits ahead and 0 behind). The slow per-page path fixed by #3237 is therefore already addressed in that base. The remaining distinction is whether the other run logged a held download or an accumulating batch count before the stall. [Retail stack capture](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7258905421) · [Commit comparison](https://github.com/xcl-dev/xcl/compare/cd679bd182fbd9c409869aeb4b5338e25e5ce36e...7a649b0e7341c1daf1bcf2f3101e9518a8a8c16f) **Native synthetic reproduction on main `0fe06eb0`, RTX 5070 (616.92), Ryzen 7 5700X3D.** A real D3D12 texture readback finished, but its reserved-only destination kept the title's mirrored fence at 0 while native completion was 1. I committed the destination after the first failed publication. For the next 200 ms, there was no further publication attempt and the mirrored fence stayed at 0. Waking `xcl-fences` explicitly, with no additional GPU work, published all 4,096 expected texels and advanced the mirror to 1. The focused test passed in four fresh processes with zero skips. Only the fixture and an attempt counter were added to main. This reproduces the missing retry wake independently of alias copies and provides a test for preserving the texture data when the destination later becomes writable. Title behavior and the policy for permanently invalid destinations remain open. **Synthetic follow-up to the retail fix on main `0fe06eb0`**, RTX 5070 (616.92), Ryzen 7 5700X3D. I tested the case where the sampled view already had a valid download writer before a replacement GPU write. Skipping the new writer stamp left a prepared readback eligible. On this fixture, it published into 40,960 adjacent canary bytes. In the control, retiring the prior writer for the single rewritten mip while preserving GPU-written status rejected the old snapshot as stale, produced no fresh download, and preserved every canary. A later genuine write on the same view became downloadable again. The fixture used a native D3D12 upload in place of the alias recorder. The view was `0x398000` bytes on this base and the written layout was `0x384000`. This isolates writer lifetime and does not establish whether the retail title reaches this sequence. In three separate optimized test processes, `cargo test --release --offline --locked -p xcl --lib gpu_alias_copy_requires_invalidating_an_older_download_writer -- --test-threads=1 --nocapture` passed 1/1 each with zero skips. OpenAI Codex, GPT-6.2 Sol, assisted with this fixture and report. [Retail fix](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7260231129)
vasanex commented 2026-11-29 16:26:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by vasanex on 2026-11-29T16:26:31Z.


We hit the same abort at game_scarlett_master.exe+0x23cf683 with XCL_ALIAS_COPY=1 and took thread stacks during the stall, so here is where the frame loop was waiting in our case. Not this PR on its own base: a private stack (main 765b2c5b + open PRs + local patches, #3094 ported) on an RTX 3080 10 GB, the same retail title.

What we saw: with the copies on and main's texture downloads on, the title reached the scene start and then stopped submitting; the title's watchdog ended it 30–60 s later (+0x23cf683, write to address 0; e.g. at 561.6 s and 569.6 s in two runs, scene start about 30 s before). With texture downloads off (a local switch) the same build ran on. So in our runs the copies were not the direct cause: they make the sampled textures GPU-written, which gives the downloads more to do, and the downloads were what held the title's fence.

Stacks during the stall (cdb, 4 s and 14 s after the last submit): the xcl-fences thread is busy, not waiting, in poll_fence_downloads → complete_fence_downloads → publish_download, in VirtualQuery in one snapshot and in WriteProcessMemory → NtQueryVirtualMemory in the other. The title's frame thread waits on its fence, which stays hidden until its downloads are published. We did not see the alias_copy::record / plan_enhanced mutex pair andrewDoing describes in these snapshots.

Three causes, all in the download path, not in the copy:

  1. write_changed_pages asked Windows about every changed 4 KiB page and wrote each with its own call; each call walks the region. One title fence's 25 downloads took about 30 s. This is what #3237 (merged) fixes; main before it has the per-page loop.
  2. A download whose destination pages are reserved but not committed can never be written; the fence stayed hidden and was retried for ever. Log line: download hold: … not committed.
  3. A held download was only asked about again on the next fence event; with the title waiting on that fence there is none.

With all three fixed locally (run-wise writes as in #3237; downloads to uncommitted pages dropped and counted; held downloads re-polled on a timer) the same build with XCL_ALIAS_COPY=1 and downloads on no longer stalls: of seven runs since, none stopped submitting and none had a held download (8,329 downloads prepared, 0 held, in one of them). Three ran to their end in the scene (700–900 s); two ended in a device removal (0x887a0006) about 100 s into the world, both with the render-target dump switch on; one was cut short by us at 621 s; one went on into the next mission's loading screen and crashed there in the title's code at another address. Those are other failures, not explained yet.

A cheap check on your trees: if the abort is this, the log shows download stats: … held N with N > 0 or a growing pending batches in the seconds before the frames stop, and a run with the copies on but on a base that has #3237 should get further than one without it. claudetools-gh's base 7a649b0e – does it have #3237?

Not tested: #3094 on its own base; AMD; whether causes 2 and 3 occur on cards with more video memory.

Hardware: RTX 3080 10 GB, NVIDIA 621.40, Ryzen 9 7950X, 64 GB, Windows 11 (26200). AI use: Claude Code (Claude Fable 5.2) ran the title, took the stacks and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7258905421 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7258905421). Originally posted by [vasanex](https://github.com/vasanex) on 2026-11-29T16:26:31Z. --- We hit the same abort at `game_scarlett_master.exe+0x23cf683` with `XCL_ALIAS_COPY=1` and took thread stacks during the stall, so here is where the frame loop was waiting in our case. **Not this PR on its own base:** a private stack (main `765b2c5b` + open PRs + local patches, #3094 ported) on an RTX 3080 10 GB, the same retail title. **What we saw:** with the copies on and main's texture downloads on, the title reached the scene start and then stopped submitting; the title's watchdog ended it 30–60 s later (`+0x23cf683`, write to address 0; e.g. at 561.6 s and 569.6 s in two runs, scene start about 30 s before). With texture downloads off (a local switch) the same build ran on. So in our runs the copies were not the direct cause: they make the sampled textures GPU-written, which gives the downloads more to do, and the downloads were what held the title's fence. **Stacks during the stall** (cdb, 4 s and 14 s after the last submit): the `xcl-fences` thread is busy, not waiting, in `poll_fence_downloads → complete_fence_downloads → publish_download`, in `VirtualQuery` in one snapshot and in `WriteProcessMemory → NtQueryVirtualMemory` in the other. The title's frame thread waits on its fence, which stays hidden until its downloads are published. We did not see the `alias_copy::record` / `plan_enhanced` mutex pair andrewDoing describes in these snapshots. **Three causes, all in the download path, not in the copy:** 1. `write_changed_pages` asked Windows about every changed 4 KiB page and wrote each with its own call; each call walks the region. One title fence's 25 downloads took about 30 s. This is what #3237 (merged) fixes; main before it has the per-page loop. 2. A download whose destination pages are reserved but not committed can never be written; the fence stayed hidden and was retried for ever. Log line: `download hold: … not committed`. 3. A held download was only asked about again on the next fence event; with the title waiting on that fence there is none. With all three fixed locally (run-wise writes as in #3237; downloads to uncommitted pages dropped and counted; held downloads re-polled on a timer) the same build with `XCL_ALIAS_COPY=1` and downloads on no longer stalls: of seven runs since, none stopped submitting and none had a held download (8,329 downloads prepared, 0 held, in one of them). Three ran to their end in the scene (700–900 s); two ended in a device removal (`0x887a0006`) about 100 s into the world, both with the render-target dump switch on; one was cut short by us at 621 s; one went on into the next mission's loading screen and crashed there in the title's code at another address. Those are other failures, not explained yet. **A cheap check on your trees:** if the abort is this, the log shows `download stats: … held N` with N > 0 or a growing `pending batches` in the seconds before the frames stop, and a run with the copies on but on a base that has #3237 should get further than one without it. claudetools-gh's base `7a649b0e` – does it have #3237? **Not tested:** #3094 on its own base; AMD; whether causes 2 and 3 occur on cards with more video memory. Hardware: RTX 3080 10 GB, NVIDIA 621.40, Ryzen 9 7950X, 64 GB, Windows 11 (26200). AI use: Claude Code (Claude Fable 5.2) ran the title, took the stacks and wrote this.
claudetools-gh commented 2026-11-29 18:07:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by claudetools-gh on 2026-11-29T18:07:32Z.


Follow-up to my crash report above: the crash is fixed, and with it this PR lights the scene.

Cause. main now downloads a texture that has a GPU writer back into the title's memory at each fence Signal: prepare_downloads → publish_download → write_changed_pages (the per-list write provenance, aeed3468). The copy's destination, the R9G9B9E5 texture, got a writer like any other GPU write. Its download is sized by its own layout, and XG makes that layout larger than the R32_UINT texture under it: 0x3c0000 against 0x384000 at 1280x720, the mismatch #3281 describes. So each download overwrote the first 0x3c000 bytes of whatever the title placed at +0x384000, and the title then wrote through a pointer that had become 0. Your branch predates those downloads, which is why you didn't see it. XCL_PAIR_PAGES=1 doesn't help, because the download path doesn't use the capped extent.

Fix (18 lines): the copy's destination is still marked GPU-written, so nothing is uploaded over it, but it gets no writer, so it is never downloaded. The R32_UINT texture keeps its normal download. The lookup happens before TEXTURES is locked, so no locks are nested. On top of 6396870e, with title_textures::note_gpu_write replaced by list_x::note_texture_write(list, r, ALL_SUBRESOURCES) for current main:

diff --git a/crates/xcl/src/hle/d3d12x/alias_copy.rs b/crates/xcl/src/hle/d3d12x/alias_copy.rs
--- a/crates/xcl/src/hle/d3d12x/alias_copy.rs
+++ b/crates/xcl/src/hle/d3d12x/alias_copy.rs
@@ -193,6 +193,18 @@ pub(super) fn forget(res: usize) {
     }
 }
 
+/// Whether `res` is the sampled texture of a pair copies go into: what the GPU puts there is
+/// the written texture's texels in another layout, larger than the memory under it (XG sizes
+/// R9G9B9E5 at 0x3c0000 where R32_UINT is 0x384000 at 1280x720), so it must not be downloaded
+/// into the title's memory like a texture the title's own work wrote (`title_textures`).
+pub(super) fn is_copy_destination(res: usize) -> bool {
+    if KEPT.load(Ordering::Relaxed) == 0 {
+        return false;
+    }
+    let g = TABLE.lock().unwrap();
+    g.as_ref().is_some_and(|t| t.through.iter().any(|(k, v)| k.1 == res && v.is_some()))
+}
+
 /// The sampled textures in the memory of the written texture `res`.
 fn sampled_of(t: &Table, res: usize) -> Vec<usize> {
     let Some(x) = t.by_res.get(&res).filter(|x| x.written) else { return Vec::new() };
diff --git a/crates/xcl/src/hle/d3d12x/title_textures.rs b/crates/xcl/src/hle/d3d12x/title_textures.rs
--- a/crates/xcl/src/hle/d3d12x/title_textures.rs
+++ b/crates/xcl/src/hle/d3d12x/title_textures.rs
@@ -957,12 +957,14 @@ pub(super) fn publish_submission_effects(queue: Option<WriterQueueId>, writes: &
         return;
     }
     let mut newly_written = Vec::new();
+    // (alias copy destinations, asked before `TEXTURES` is held: marked written, not downloaded)
+    let copy_dest: Vec<bool> = writes.iter().map(|w| super::alias_copy::on() && super::alias_copy::is_copy_destination(w.res)).collect();
     {
         let mut t = TEXTURES.lock().unwrap();
         // (the stamp is for the queue's page mappings: with them off, a publish takes no call count)
         let call = crate::hle::kernelx::mirrors::page_mappings().then(crate::hle::kernelx::mirrors::calls);
         if let Some(queue) = queue {
-            for &write in writes {
+            for (i, &write) in writes.iter().enumerate() {
                 let Some(e) = t.get_mut(write.res).filter(|e| e.generation == write.generation) else { continue };
                 let n = subresource_count(&e.tex);
                 if write.subresource != D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES && !(n <= 1 && write.subresource == 0) && write.subresource as usize >= n {
@@ -970,7 +972,9 @@ pub(super) fn publish_submission_effects(queue: Option<WriterQueueId>, writes: &
                 }
                 let epoch = NEXT_GPU_EPOCH.fetch_add(1, Ordering::Relaxed) + 1;
                 let writer = GpuWriter { epoch, queue };
-                apply_gpu_writer(&mut e.gpu_writers, n, write.subresource, writer);
+                if !copy_dest[i] {
+                    apply_gpu_writer(&mut e.gpu_writers, n, write.subresource, writer);
+                }
                 if let Some(call) = call {
                     // (`Entry::written_call`: a mapping changed by a later call is newer than this write)
                     e.written_call = call;

Result: same binary otherwise, same env plus XCL_ALIAS_COPY=1 XCL_DEPTH_UAV_TWIN=1. No crash (0 of 1, against 3 of 3 before), 32,768 copies recorded at enhanced barriers, none left out. The first interior scene of the prologue changes from "a black wedge where the window is" to the sunset outside: sky, yard, tower and buildings lit, with fog. The interior is lit through the window. Without the copies, that view was black.

Not tested: more than one run with the fix, AMD, a unit test for the new path (building a pair in the table needs a D3D12 device). RTX 5070 Ti, 621.40. AI use: Claude Code with Claude Opus 5.5; a tracer agent found the download path, and I wrote the fix and ran the runs. AI-assisted.

<!-- greyfinch-sync:ivall/xcl:comment:7260231129 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7260231129). Originally posted by [claudetools-gh](https://github.com/claudetools-gh) on 2026-11-29T18:07:32Z. --- Follow-up to my crash report above: **the crash is fixed, and with it this PR lights the scene.** **Cause.** `main` now downloads a texture that has a GPU writer back into the title's memory at each fence `Signal`: `prepare_downloads` → `publish_download` → `write_changed_pages` (the per-list write provenance, aeed3468). The copy's destination, the R9G9B9E5 texture, got a writer like any other GPU write. Its download is sized by its own layout, and XG makes that layout larger than the R32_UINT texture under it: 0x3c0000 against 0x384000 at 1280x720, the mismatch #3281 describes. So each download overwrote the first 0x3c000 bytes of whatever the title placed at +0x384000, and the title then wrote through a pointer that had become 0. Your branch predates those downloads, which is why you didn't see it. `XCL_PAIR_PAGES=1` doesn't help, because the download path doesn't use the capped extent. **Fix (18 lines):** the copy's destination is still marked GPU-written, so nothing is uploaded over it, but it gets no writer, so it is never downloaded. The R32_UINT texture keeps its normal download. The lookup happens before `TEXTURES` is locked, so no locks are nested. On top of 6396870e, with `title_textures::note_gpu_write` replaced by `list_x::note_texture_write(list, r, ALL_SUBRESOURCES)` for current `main`: ```diff diff --git a/crates/xcl/src/hle/d3d12x/alias_copy.rs b/crates/xcl/src/hle/d3d12x/alias_copy.rs --- a/crates/xcl/src/hle/d3d12x/alias_copy.rs +++ b/crates/xcl/src/hle/d3d12x/alias_copy.rs @@ -193,6 +193,18 @@ pub(super) fn forget(res: usize) { } } +/// Whether `res` is the sampled texture of a pair copies go into: what the GPU puts there is +/// the written texture's texels in another layout, larger than the memory under it (XG sizes +/// R9G9B9E5 at 0x3c0000 where R32_UINT is 0x384000 at 1280x720), so it must not be downloaded +/// into the title's memory like a texture the title's own work wrote (`title_textures`). +pub(super) fn is_copy_destination(res: usize) -> bool { + if KEPT.load(Ordering::Relaxed) == 0 { + return false; + } + let g = TABLE.lock().unwrap(); + g.as_ref().is_some_and(|t| t.through.iter().any(|(k, v)| k.1 == res && v.is_some())) +} + /// The sampled textures in the memory of the written texture `res`. fn sampled_of(t: &Table, res: usize) -> Vec<usize> { let Some(x) = t.by_res.get(&res).filter(|x| x.written) else { return Vec::new() }; diff --git a/crates/xcl/src/hle/d3d12x/title_textures.rs b/crates/xcl/src/hle/d3d12x/title_textures.rs --- a/crates/xcl/src/hle/d3d12x/title_textures.rs +++ b/crates/xcl/src/hle/d3d12x/title_textures.rs @@ -957,12 +957,14 @@ pub(super) fn publish_submission_effects(queue: Option<WriterQueueId>, writes: & return; } let mut newly_written = Vec::new(); + // (alias copy destinations, asked before `TEXTURES` is held: marked written, not downloaded) + let copy_dest: Vec<bool> = writes.iter().map(|w| super::alias_copy::on() && super::alias_copy::is_copy_destination(w.res)).collect(); { let mut t = TEXTURES.lock().unwrap(); // (the stamp is for the queue's page mappings: with them off, a publish takes no call count) let call = crate::hle::kernelx::mirrors::page_mappings().then(crate::hle::kernelx::mirrors::calls); if let Some(queue) = queue { - for &write in writes { + for (i, &write) in writes.iter().enumerate() { let Some(e) = t.get_mut(write.res).filter(|e| e.generation == write.generation) else { continue }; let n = subresource_count(&e.tex); if write.subresource != D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES && !(n <= 1 && write.subresource == 0) && write.subresource as usize >= n { @@ -970,7 +972,9 @@ pub(super) fn publish_submission_effects(queue: Option<WriterQueueId>, writes: & } let epoch = NEXT_GPU_EPOCH.fetch_add(1, Ordering::Relaxed) + 1; let writer = GpuWriter { epoch, queue }; - apply_gpu_writer(&mut e.gpu_writers, n, write.subresource, writer); + if !copy_dest[i] { + apply_gpu_writer(&mut e.gpu_writers, n, write.subresource, writer); + } if let Some(call) = call { // (`Entry::written_call`: a mapping changed by a later call is newer than this write) e.written_call = call; ``` **Result:** same binary otherwise, same env plus `XCL_ALIAS_COPY=1 XCL_DEPTH_UAV_TWIN=1`. **No crash** (0 of 1, against 3 of 3 before), 32,768 copies recorded at enhanced barriers, none left out. The first interior scene of the prologue changes from "a black wedge where the window is" to the sunset outside: sky, yard, tower and buildings lit, with fog. The interior is lit through the window. Without the copies, that view was black. Not tested: more than one run with the fix, AMD, a unit test for the new path (building a pair in the table needs a D3D12 device). RTX 5070 Ti, 621.40. AI use: Claude Code with Claude Opus 5.5; a tracer agent found the download path, and I wrote the fix and ran the runs. AI-assisted.
KDenKC commented 2026-11-29 18:30:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-29T18:30:12Z.


@claudetools-gh thanks, that's a clean root cause, and it corrects part of what I wrote above. The instruction at +0x23cf683 does write a fixed value to address 0 on purpose, but I called it the 30-second frame-heartbeat abort as if that were the only way in; your runs show the title reaching the same deliberate abort after a download wrote 0x3c000 bytes over the memory it had placed at +0x384000. So it is the title's fatal path, reached by a long stall (vasanex's stacks) or, here, by corrupted title memory; the address alone does not tell which.

For anyone stacking this: the oversize is the same 0x3c0000 vs 0x384000 at 1280x720 that #3281 caps for views, and as you note the download path does not use that capped extent, so XCL_PAIR_PAGES=1 alone does not protect it.

AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 3.8 Flash.

<!-- greyfinch-sync:ivall/xcl:comment:7260533657 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7260533657). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-11-29T18:30:12Z. --- @claudetools-gh thanks, that's a clean root cause, and it corrects part of what I wrote above. The instruction at `+0x23cf683` does write a fixed value to address 0 on purpose, but I called it the 30-second frame-heartbeat abort as if that were the only way in; your runs show the title reaching the same deliberate abort after a download wrote 0x3c000 bytes over the memory it had placed at +0x384000. So it is the title's fatal path, reached by a long stall (vasanex's stacks) or, here, by corrupted title memory; the address alone does not tell which. For anyone stacking this: the oversize is the same 0x3c0000 vs 0x384000 at 1280x720 that #3281 caps for views, and as you note the download path does not use that capped extent, so `XCL_PAIR_PAGES=1` alone does not protect it. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 3.8 Flash.
CharlyRien commented 2026-11-30 05:57:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by CharlyRien on 2026-11-30T05:57:42Z.


This now conflicts with main. We still carry it in our stack (rebased onto main d52ff48c: our port of this PR's alias copy, plus #3281), RTX 3090, the retail title: with #3281 the 1280x720 R32_UINT → R9G9B9E5 pairs (TAA history, bounced light / probes) read the written data, and the room behind the window is lit instead of black after camera cuts (with the alias copy on; see https://github.com/xcl-dev/xcl/pull/3281#issuecomment-7269873202).

Would you rebase it onto current main? Once it builds there I can post a test report on the new head (suite counts + an in-game run).

AI use: found and written with Claude Code (Claude Opus 5.5), checked and posted by me.

<!-- greyfinch-sync:ivall/xcl:comment:7270169055 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7270169055). Originally posted by [CharlyRien](https://github.com/CharlyRien) on 2026-11-30T05:57:42Z. --- This now conflicts with `main`. We still carry it in our stack (rebased onto `main` d52ff48c: our port of this PR's alias copy, plus #3281), RTX 3090, the retail title: with #3281 the 1280x720 R32_UINT → R9G9B9E5 pairs (TAA history, bounced light / probes) read the written data, and the room behind the window is lit instead of black after camera cuts (with the alias copy on; see https://github.com/xcl-dev/xcl/pull/3281#issuecomment-7269873202). Would you rebase it onto current `main`? Once it builds there I can post a test report on the new head (suite counts + an in-game run). AI use: found and written with Claude Code (Claude Opus 5.5), checked and posted by me.
imnicho commented 2026-11-30 23:55:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by imnicho on 2026-11-30T23:55:02Z.


Rebased onto main and reworked for it: new head ee7196a76 (one commit; the old head on nvidia-dev was 6396870e2). @CharlyRien, it builds on main d0832e614 now; a report on the new head would be very welcome.

What changed, by who asked for it:

  • @thehollowedone, point 1 (planning from the console's barriers): the copies are planned from the barriers as the PC gets them, in resource_barrier_x after the console's bits are dropped. On main that is also where #3287's transitions of the title's enhanced barriers arrive, so the module's own reading of the #146 groups is gone. One trigger is left: a written texture leaving RENDER_TARGET / UNORDERED_ACCESS. The WARP test now makes the title's own call (uav_barrier_x with a D3D12_BARRIER_GROUP) on an adopted list.
  • @thehollowedone, point 2 (states kept in recording order): not changed, and the description says so under "Not in it". Your two-list regression is right about what it shows. barrier_groups::LAST keeps the states it starts from in the same order on main, and I think the fix is one state owner for both rather than something in this module, so I have not grown this PR by it. If the maintainers want it here first, I will do it here.
  • @KDenKC: the buffer of a pair that went is released (late_release::hold_own, once the queues are past it), and on a COMPUTE list a copy from a state such a list cannot name is left out and counted. Views by address and the skip of an unchanged texture are still open, as follow-ups of yours if you want them.
  • @andrewDoing: the buffer is made with the table's lock released, so plan of another pair no longer waits for CreateCommittedResource.
  • @claudetools-gh: your read-back fix is in (point 5 of the description), with the question asked of the texture's own entry instead of a walk of the buffers, and note_texture_write as on main. Thank you for running that crash down.
  • @Pipodi, @KDenKC (#3281 / #3282, #3340): I see no collision. With pages shared the copy goes onto memory the view already has, and if one of those routes lands for these pairs this switch simply stays off.

Tested on the new head: the module's and late_release's tests (12 passed, the GPU one on WARP), and the two regression runs in the description (1,455 frames against main's 1,560 in 60 s, switch off). The whole library suite gives no count on this PC: plain main ends the test process partway here (details in the description), so CI is the suite's word on this head.

Not run by me: the title's world on this head. My caches are of the nvidia-dev tree and main builds every pipeline anew. That run is next, and I will post it here.

AI use: Claude Code with Claude Fable 5.2 did the rework and wrote this comment.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:comment:7295677853 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7295677853). Originally posted by [imnicho](https://github.com/imnicho) on 2026-11-30T23:55:02Z. --- **Rebased onto `main` and reworked for it: new head `ee7196a76`** (one commit; the old head on `nvidia-dev` was `6396870e2`). @CharlyRien, it builds on `main` `d0832e614` now; a report on the new head would be very welcome. What changed, by who asked for it: - **@thehollowedone, point 1** (planning from the console's barriers): the copies are planned from the barriers as the PC gets them, in `resource_barrier_x` after the console's bits are dropped. On `main` that is also where #3287's transitions of the title's enhanced barriers arrive, so the module's own reading of the #146 groups is gone. One trigger is left: a written texture leaving RENDER_TARGET / UNORDERED_ACCESS. The WARP test now makes the title's own call (`uav_barrier_x` with a D3D12_BARRIER_GROUP) on an adopted list. - **@thehollowedone, point 2** (states kept in recording order): not changed, and the description says so under "Not in it". Your two-list regression is right about what it shows. `barrier_groups::LAST` keeps the states it starts from in the same order on `main`, and I think the fix is one state owner for both rather than something in this module, so I have not grown this PR by it. If the maintainers want it here first, I will do it here. - **@KDenKC**: the buffer of a pair that went is released (`late_release::hold_own`, once the queues are past it), and on a COMPUTE list a copy from a state such a list cannot name is left out and counted. Views by address and the skip of an unchanged texture are still open, as follow-ups of yours if you want them. - **@andrewDoing**: the buffer is made with the table's lock released, so `plan` of another pair no longer waits for `CreateCommittedResource`. - **@claudetools-gh**: your read-back fix is in (point 5 of the description), with the question asked of the texture's own entry instead of a walk of the buffers, and `note_texture_write` as on `main`. Thank you for running that crash down. - **@Pipodi, @KDenKC** (#3281 / #3282, #3340): I see no collision. With pages shared the copy goes onto memory the view already has, and if one of those routes lands for these pairs this switch simply stays off. Tested on the new head: the module's and `late_release`'s tests (12 passed, the GPU one on WARP), and the two regression runs in the description (1,455 frames against `main`'s 1,560 in 60 s, switch off). The whole library suite gives no count on this PC: plain `main` ends the test process partway here (details in the description), so CI is the suite's word on this head. **Not run by me: the title's world on this head.** My caches are of the `nvidia-dev` tree and `main` builds every pipeline anew. That run is next, and I will post it here. AI use: Claude Code with Claude Fable 5.2 did the rework and wrote this comment. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
thehollowedone commented 2026-12-01 01:20:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T01:20:09Z.


Follow-up on current head ee7196a76, to clarify the remaining two-list state issue: a single shared state owner would not, by itself, make the copy correct. plan updates Tex.now while recording, and record bakes that state into native before/restore barriers. barrier_groups::LAST also follows recording order. Once list B is closed, publishing a better global value at submission cannot change B's encoded barriers.

A focused discriminator on this head: record B's alias copy while its sampled texture is in shader-read, then record A moving that texture to COPY_SOURCE. In separate fresh WARP/debug-layer runs, submit B alone, and submit A then the already-closed B on the same DIRECT queue. B's recording is identical, but its copy must start and restore from shader-read in the first run and COPY_SOURCE in the second. Check ID3D12InfoQueue and a fenced readback. Our earlier WARP regression tested a different reset/cancel schedule on the prior head; this two-order control has not been run here.

For a complete fix, keep each recording's transitions private until submission and resolve the copy's inherited states at its exact position in the queue's accepted segment order, including KickoffX and repeat submissions. That may require submit-time materialization or an equivalent repair between native segments: a state-only update at ExecuteCommandLists cannot rewrite a copy already recorded inside B. Please include reset, failed submission, and repeat-submit cases in the regression. The existing deferred recorder consumes operations before the queue's submission lock, so it cannot be reused unchanged for this state-dependent pass.

This is a source trace of the new head, not a fresh GPU or title run. AI use: OpenAI Codex (GPT-6.2 Sol) checked the current recording/submission path; OpenAI Codex (GPT-6.2 Astra) independently traced the state-lifetime design.

<!-- greyfinch-sync:ivall/xcl:comment:7297382882 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7297382882). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-12-01T01:20:09Z. --- Follow-up on current head [`ee7196a76`](https://github.com/xcl-dev/xcl/commit/ee7196a76222f4a4c08d8219f75202bc17f967cd), to clarify [the remaining two-list state issue](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7246057545): a single shared state owner would not, by itself, make the copy correct. [`plan` updates `Tex.now` while recording](https://github.com/xcl-dev/xcl/blob/ee7196a76222f4a4c08d8219f75202bc17f967cd/crates/xcl/src/hle/d3d12x/alias_copy.rs#L243-L281), and [`record` bakes that state into native before/restore barriers](https://github.com/xcl-dev/xcl/blob/ee7196a76222f4a4c08d8219f75202bc17f967cd/crates/xcl/src/hle/d3d12x/alias_copy.rs#L358-L420). `barrier_groups::LAST` also follows recording order. Once list B is closed, publishing a better global value at submission cannot change B's encoded barriers. A focused discriminator on this head: record B's alias copy while its sampled texture is in shader-read, then record A moving that texture to `COPY_SOURCE`. In separate fresh WARP/debug-layer runs, submit **B alone**, and submit **A then the already-closed B** on the same DIRECT queue. B's recording is identical, but its copy must start and restore from shader-read in the first run and `COPY_SOURCE` in the second. Check `ID3D12InfoQueue` and a fenced readback. [Our earlier WARP regression](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7246057545) tested a different reset/cancel schedule on the prior head; this two-order control has not been run here. For a complete fix, keep each recording's transitions private until submission and resolve the copy's inherited states at its exact position in the queue's accepted segment order, including KickoffX and repeat submissions. That may require submit-time materialization or an equivalent repair between native segments: a state-only update at [`ExecuteCommandLists`](https://github.com/xcl-dev/xcl/blob/ee7196a76222f4a4c08d8219f75202bc17f967cd/crates/xcl/src/hle/d3d12x/real.rs#L11981-L12054) cannot rewrite a copy already recorded inside B. Please include reset, failed submission, and repeat-submit cases in the regression. The existing deferred recorder consumes operations before the queue's submission lock, so it cannot be reused unchanged for this state-dependent pass. This is a source trace of the new head, not a fresh GPU or title run. AI use: OpenAI Codex (GPT-6.2 Sol) checked the current recording/submission path; OpenAI Codex (GPT-6.2 Astra) independently traced the state-lifetime design.
KDenKC commented 2026-12-01 02:07:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-01T02:07:57Z.


test report: #3094 head ee7196a76222f4a4c08d8219f75202bc17f967cd on the retail title (2 runs)
tree: 0d82a705 = our base ecfd86c8 with our earlier local port of #3094 reverted (75d06976) and ee7196a7 cherry-picked (clean pick; a merge would also have brought in 21 newer main commits, so the PR's commit alone).
  ecfd86c8 = main d52ff48c + #3281's two commits (f232cc0f, 7c9915b2; XCL_PAIR_PAGES) + a local input filter of our test harness (keys only, d15ed1fa) + our port of #3094 (025e7cf7) + 16f2f5c1 (#3261) reverted.
  Why #3261 is reverted: its compact form of one compute program (record 95cc13288a27a96e) hangs at the title's first world frames on RTX 50-series, so the world is not reached reliably without it (#505, #3516).
hardware: NVIDIA GeForce RTX 5090 32 GB, driver 621.40, Ryzen 7 9800X3D; release build of 0d82a705
switches (both runs, the same): uma=mixed:1536:1792 XCL_UMA_WINDOWS=16 XCL_HEAP_WINDOWS=1 XCL_CS_PSO_WAIT_MS=0 XCL_PLACE_RETIRE=0 XCL_DEPTH_UAV_TWIN=1 XCL_ALIAS_COPY=1 XCL_PAIR_PAGES=1 XCL_TEXTURE_LEVEL_PAGES=1 XCL_TWO_PASS_MB=3072 XCL_HUGE_PSO_CONCURRENCY=4 XCL_NETWORK=0 XCL_GPU_TIMES=0 XCL_FRAME_DUMP=60; input: Enter as A every 4 s.
build/tests of the tree (RTX 3090 VM, debug): builds (debug + release); alias_copy::tests 4 passed incl. gpu_a_written_textures_texels_reach_its_sampled_pair_at_the_titles_barrier, late_release::tests 8 passed; the only failures are main's own 4 title_textures tests (placed_title_textures_share_vram_and_preserve_pixels and the 3 stream_recheck_*).

run 1: world entry at 1787.3 s uptime, 522 s in the world: world 2.98 fps, 0 device removals, 0 crashes, peak commit 40917 MB, commit growth after world+30 s 22.2 MB/s (29125 -> 40314 MB over 504 s).
  Its launch preparation took 1711.9 s: its seed cache's driver blobs were made on 621.24, and 621.40 refused them all, so they were compiled again; not the PR (run 2 below: 458.2 s).
run 2: world entry at 531.6 s uptime, 254 s in the world: world 5.31 fps, 0 device removals, 0 crashes, peak commit 40185 MB, commit growth after world+30 s 29.9 MB/s (32685 -> 39624 MB over 231 s).

alias copy, both runs alike (raw lines, run 1 / run 2):
  [ 1712.521] D3D12.X: alias copies are on (XCL_ALIAS_COPY=1): a sampled texture placed in the memory of a written one of another format is copied from it where the title stops writing that one
  [ 1713.366] D3D12.X: alias copy: at 0x135c980000 a 1280x720x1 texture of 1 levels is written as format 42 and read as format 67 (1 such pairs so far)
  pairs found: 32 in each run (the last line of each: "(32 such pairs so far)"), all written as format 42 (R32_UINT) and read as 67 (R9G9B9E5)
  [ 2273.398] D3D12.X: alias copy: 0xbfe67a160 (in state 0xc0) into 0xdaf146fb0 (in state 0x0); 32768 copies so far, left out: 1555 for a state not known, 0 on a list of another kind, 0 of pairs that cannot be copied, 0 from a state a compute list cannot name
  [  764.659] D3D12.X: alias copy: 0x9c8a6a680 (in state 0xc0) into 0x9c897b820 (in state 0x0); 32768 copies so far, left out: 1559 for a state not known, 0 on a list of another kind, 0 of pairs that cannot be copied, 0 from a state a compute list cannot name
  so ~4.7 % of the copies were left out for a state not known (the module's recording-order limit), none for the COMPUTE-list or uncopyable cases.

what we see (by eye, no frames posted): run 1, the left wall of the first interior scene is lit. Run 2 not reviewed by eye.
compared with: not compared. The closest earlier run (our base ecfd86c8 with the same switches, 01:09) ran on driver 621.24, before the update to 621.40, so its fps, commit and preparation are not like for like; no base run on 621.40 with these switches exists yet.
not tested: AMD / Intel; the switch off on this tree; a run longer than 522 s in the world; whether the copies change what is drawn beyond the cell wall (no frame comparison here).
tool and model: Claude Code, Claude Opus 5.5 (built the tree, read the logs, wrote this); runs by Claude Sonnet 5.5 on the rig.

AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 3.8 Flash.

<!-- greyfinch-sync:ivall/xcl:comment:7298275073 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7298275073). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-01T02:07:57Z. --- ```text test report: #3094 head ee7196a76222f4a4c08d8219f75202bc17f967cd on the retail title (2 runs) tree: 0d82a705 = our base ecfd86c8 with our earlier local port of #3094 reverted (75d06976) and ee7196a7 cherry-picked (clean pick; a merge would also have brought in 21 newer main commits, so the PR's commit alone). ecfd86c8 = main d52ff48c + #3281's two commits (f232cc0f, 7c9915b2; XCL_PAIR_PAGES) + a local input filter of our test harness (keys only, d15ed1fa) + our port of #3094 (025e7cf7) + 16f2f5c1 (#3261) reverted. Why #3261 is reverted: its compact form of one compute program (record 95cc13288a27a96e) hangs at the title's first world frames on RTX 50-series, so the world is not reached reliably without it (#505, #3516). hardware: NVIDIA GeForce RTX 5090 32 GB, driver 621.40, Ryzen 7 9800X3D; release build of 0d82a705 switches (both runs, the same): uma=mixed:1536:1792 XCL_UMA_WINDOWS=16 XCL_HEAP_WINDOWS=1 XCL_CS_PSO_WAIT_MS=0 XCL_PLACE_RETIRE=0 XCL_DEPTH_UAV_TWIN=1 XCL_ALIAS_COPY=1 XCL_PAIR_PAGES=1 XCL_TEXTURE_LEVEL_PAGES=1 XCL_TWO_PASS_MB=3072 XCL_HUGE_PSO_CONCURRENCY=4 XCL_NETWORK=0 XCL_GPU_TIMES=0 XCL_FRAME_DUMP=60; input: Enter as A every 4 s. build/tests of the tree (RTX 3090 VM, debug): builds (debug + release); alias_copy::tests 4 passed incl. gpu_a_written_textures_texels_reach_its_sampled_pair_at_the_titles_barrier, late_release::tests 8 passed; the only failures are main's own 4 title_textures tests (placed_title_textures_share_vram_and_preserve_pixels and the 3 stream_recheck_*). run 1: world entry at 1787.3 s uptime, 522 s in the world: world 2.98 fps, 0 device removals, 0 crashes, peak commit 40917 MB, commit growth after world+30 s 22.2 MB/s (29125 -> 40314 MB over 504 s). Its launch preparation took 1711.9 s: its seed cache's driver blobs were made on 621.24, and 621.40 refused them all, so they were compiled again; not the PR (run 2 below: 458.2 s). run 2: world entry at 531.6 s uptime, 254 s in the world: world 5.31 fps, 0 device removals, 0 crashes, peak commit 40185 MB, commit growth after world+30 s 29.9 MB/s (32685 -> 39624 MB over 231 s). alias copy, both runs alike (raw lines, run 1 / run 2): [ 1712.521] D3D12.X: alias copies are on (XCL_ALIAS_COPY=1): a sampled texture placed in the memory of a written one of another format is copied from it where the title stops writing that one [ 1713.366] D3D12.X: alias copy: at 0x135c980000 a 1280x720x1 texture of 1 levels is written as format 42 and read as format 67 (1 such pairs so far) pairs found: 32 in each run (the last line of each: "(32 such pairs so far)"), all written as format 42 (R32_UINT) and read as 67 (R9G9B9E5) [ 2273.398] D3D12.X: alias copy: 0xbfe67a160 (in state 0xc0) into 0xdaf146fb0 (in state 0x0); 32768 copies so far, left out: 1555 for a state not known, 0 on a list of another kind, 0 of pairs that cannot be copied, 0 from a state a compute list cannot name [ 764.659] D3D12.X: alias copy: 0x9c8a6a680 (in state 0xc0) into 0x9c897b820 (in state 0x0); 32768 copies so far, left out: 1559 for a state not known, 0 on a list of another kind, 0 of pairs that cannot be copied, 0 from a state a compute list cannot name so ~4.7 % of the copies were left out for a state not known (the module's recording-order limit), none for the COMPUTE-list or uncopyable cases. what we see (by eye, no frames posted): run 1, the left wall of the first interior scene is lit. Run 2 not reviewed by eye. compared with: not compared. The closest earlier run (our base ecfd86c8 with the same switches, 01:09) ran on driver 621.24, before the update to 621.40, so its fps, commit and preparation are not like for like; no base run on 621.40 with these switches exists yet. not tested: AMD / Intel; the switch off on this tree; a run longer than 522 s in the world; whether the copies change what is drawn beyond the cell wall (no frame comparison here). tool and model: Claude Code, Claude Opus 5.5 (built the tree, read the logs, wrote this); runs by Claude Sonnet 5.5 on the rig. ``` AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 3.8 Flash.
KDenKC commented 2026-12-01 02:13:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-01T02:13:01Z.


@thehollowedone @imnicho on the remaining two-list state issue (7297382882): we'll take the submit-time version on, outside this PR, so #3094 doesn't grow. The plan, in short:

  • each recording keeps its own first and current state per resource (from the final words resource_barrier_x sends), instead of a shared LAST in recording order;
  • at ExecuteCommandLists, per chunk in queue order, a small fix-up list of XCL's own moves each resource from the queue's state to the recording's first state, right before it, in the same call; the queue's state then takes the chunk's final state. Repeat submits get their own fix-up, a reset recording is forgotten, a failed chunk applies nothing, and KickoffX segments chain;
  • split into small PRs: a WARP harness first (your two-order discriminator, plus reset, failed-submit, repeat-submit and KickoffX cases), then the state model, the fix-up pool, the switch (XCL_SUBMIT_STATES=1) with those regressions going from red to green, and the alias copy's states last. For that last part, imnicho, we'd bring it to you as a suggestion with our test rather than touching this PR.

If either of you already has this in progress, say so and we'll test yours instead. thehollowedone, the regression cases are yours: they'll be credited in each PR that uses them.

AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 3.8 Flash.

<!-- greyfinch-sync:ivall/xcl:comment:7298369429 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7298369429). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-01T02:13:01Z. --- @thehollowedone @imnicho on the remaining two-list state issue (7297382882): we'll take the submit-time version on, outside this PR, so #3094 doesn't grow. The plan, in short: - each recording keeps its own first and current state per resource (from the final words `resource_barrier_x` sends), instead of a shared `LAST` in recording order; - at `ExecuteCommandLists`, per chunk in queue order, a small fix-up list of XCL's own moves each resource from the queue's state to the recording's first state, right before it, in the same call; the queue's state then takes the chunk's final state. Repeat submits get their own fix-up, a reset recording is forgotten, a failed chunk applies nothing, and KickoffX segments chain; - split into small PRs: a WARP harness first (your two-order discriminator, plus reset, failed-submit, repeat-submit and KickoffX cases), then the state model, the fix-up pool, the switch (`XCL_SUBMIT_STATES=1`) with those regressions going from red to green, and the alias copy's states last. For that last part, imnicho, we'd bring it to you as a suggestion with our test rather than touching this PR. If either of you already has this in progress, say so and we'll test yours instead. thehollowedone, the regression cases are yours: they'll be credited in each PR that uses them. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 3.8 Flash.
thehollowedone commented 2026-12-01 02:21:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T02:21:37Z.


Thanks for taking this on. I have no submit-time state implementation in progress, so please proceed with the split you described. The two-order discriminator on current #3094 head is available for the WARP harness; the important case records B while its texture is in the old state, then submits A before B, so B's already-encoded barriers must be corrected at submission. The reset, repeat-submit, failed-chunk and KickoffX cases you listed are useful boundaries for that model.

I can review the focused harness and source once it is posted. AI use: Codex (GPT-6.2 Sol) checked the current discussion and drafted this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7298527666 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7298527666). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-12-01T02:21:37Z. --- Thanks for taking this on. I have no submit-time state implementation in progress, so please proceed with the split you described. The [two-order discriminator on current #3094 head](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7297382882) is available for the WARP harness; the important case records B while its texture is in the old state, then submits A before B, so B's already-encoded barriers must be corrected at submission. The reset, repeat-submit, failed-chunk and KickoffX cases you listed are useful boundaries for that model. I can review the focused harness and source once it is posted. AI use: Codex (GPT-6.2 Sol) checked the current discussion and drafted this reply.
thehollowedone commented 2026-12-01 05:46:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T05:46:33Z.


Two source-level correctness points on current head ee7196a7, both with XCL_ALIAS_COPY=1:

  1. A copy can run inside a pending split barrier on its destination. On one DIRECT list, begin a split transition of sampled texture R from shader-read (0xC0) to COPY_SOURCE (0x800); in a later ResourceBarrier call, move its paired writer W from UAV (0x8) to non-pixel shader resource (0x40); then end R's split. plan ignores R's BEGIN_ONLY, leaving Tex.now at shader-read, but W's transition schedules a copy. record then inserts a normal transition and write to R before its END_ONLY. D3D12 forbids reads, writes and other transitions while a split barrier is pending. Track pending splits by resource/subresource and place the copy only after the matching end at a legal point in submission order. A focused single-list regression should assert no copy between the halves and a fenced copy/readback after the end. The earlier split-flag comment checks the bit mask, not this interleaving.

  2. A closed list can outlive resources XCL injected into it. The title can record a list that names only W, close it, release its last reference to R, and submit the list later. XCL's texture_through_buffer has nevertheless encoded R and the pair's scratch buffer in that list. forget retires the scratch against work already submitted, and the normal last-release path may retire R while the queue is idle. Neither protects a future submission of the closed list. D3D12 command lists do not retain the resources passed to their methods. Hold strong references to XCL's injected destination and scratch with the recording, carry them through each submission until its fence completes, and release an unsubmitted recording on reset/destruction. A regression should close, release R, drain idle retirements, then submit and read back; also cover reset without submission. The existing GPU test releases the pair only after completion.

I have not run either schedule on a GPU, so these are source/API-contract findings, not observed title failures. AI use: OpenAI Codex (GPT-6.2 Sol) traced the call and lifetime paths; OpenAI Codex (GPT-6.2 Astra) independently checked the schedules and existing discussion.

<!-- greyfinch-sync:ivall/xcl:comment:7302125159 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7302125159). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-12-01T05:46:33Z. --- Two source-level correctness points on current head [`ee7196a7`](https://github.com/xcl-dev/xcl/commit/ee7196a76222f4a4c08d8219f75202bc17f967cd), both with `XCL_ALIAS_COPY=1`: 1. **A copy can run inside a pending split barrier on its destination.** On one DIRECT list, begin a split transition of sampled texture R from shader-read (`0xC0`) to `COPY_SOURCE` (`0x800`); in a later `ResourceBarrier` call, move its paired writer W from UAV (`0x8`) to non-pixel shader resource (`0x40`); then end R's split. [`plan`](https://github.com/xcl-dev/xcl/blob/ee7196a76222f4a4c08d8219f75202bc17f967cd/crates/xcl/src/hle/d3d12x/alias_copy.rs#L249-L273) ignores R's `BEGIN_ONLY`, leaving `Tex.now` at shader-read, but W's transition schedules a copy. [`record`](https://github.com/xcl-dev/xcl/blob/ee7196a76222f4a4c08d8219f75202bc17f967cd/crates/xcl/src/hle/d3d12x/alias_copy.rs#L403-L420) then inserts a normal transition and write to R *before* its `END_ONLY`. [D3D12 forbids reads, writes and other transitions while a split barrier is pending](https://learn.microsoft.com/en-us/windows/win32/direct3d12/using-resource-barriers-to-synchronize-resource-states-in-direct3d-12#split-barriers). Track pending splits by resource/subresource and place the copy only after the matching end at a legal point in submission order. A focused single-list regression should assert no copy between the halves and a fenced copy/readback after the end. The earlier [split-flag comment](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7234523530) checks the bit mask, not this interleaving. 2. **A closed list can outlive resources XCL injected into it.** The title can record a list that names only W, close it, release its last reference to R, and submit the list later. XCL's [`texture_through_buffer`](https://github.com/xcl-dev/xcl/blob/ee7196a76222f4a4c08d8219f75202bc17f967cd/crates/xcl/src/hle/d3d12x/list_x.rs#L6499-L6522) has nevertheless encoded R and the pair's scratch buffer in that list. [`forget`](https://github.com/xcl-dev/xcl/blob/ee7196a76222f4a4c08d8219f75202bc17f967cd/crates/xcl/src/hle/d3d12x/alias_copy.rs#L193-L215) retires the scratch against work already submitted, and the normal last-release path may retire R while the queue is idle. Neither protects a *future* submission of the closed list. [D3D12 command lists do not retain the resources passed to their methods](https://learn.microsoft.com/en-us/windows/win32/direct3d12/recording-command-lists-and-bundles#reference-counting). Hold strong references to XCL's injected destination and scratch with the recording, carry them through each submission until its fence completes, and release an unsubmitted recording on reset/destruction. A regression should close, release R, drain idle retirements, then submit and read back; also cover reset without submission. The existing GPU test releases the pair only after completion. I have not run either schedule on a GPU, so these are source/API-contract findings, not observed title failures. AI use: OpenAI Codex (GPT-6.2 Sol) traced the call and lifetime paths; OpenAI Codex (GPT-6.2 Astra) independently checked the schedules and existing discussion.
imnicho commented 2026-12-01 07:54:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by imnicho on 2026-12-01T07:54:16Z.


New head 8a28d3176 (rebased onto main 493dbd3dd; the second commit is this round).

@KDenKC thank you for the two runs on ee7196a76, and for taking the submit-time state model on outside this PR. Your count of copies left out "for a state not known" was the most useful line in the report: that was the title moving a texture level by level, and it is gone now.

  • States by subresource. The states the title's transitions leave a texture in are kept for each level of each layer. A texture moved level by level is copied like any other, each level moved to the copy state from its own state and back. The counter you read (about 1,555 of 32,768, 4.7 %) no longer exists; if you run this head, the first "left out" number in the log line is now copies between the halves of a split transition, and I would expect 0 there.
  • @thehollowedone, split barriers (a copy inside a pending split on its destination): the first half of a split marks what it names as between the halves until the second, and no copy is recorded while a texture of the pair is there. It is left out and counted, not made up for at the split's end (said under "Not in it"). no_copy_is_recorded_between_the_halves_of_a_split_transition is your schedule, on the planner and the rule record asks; I did not write the fenced GPU version of it.
  • @thehollowedone, a closed list outliving what XCL added to it: the pair's buffer now holds a reference to the sampled texture, and both are let go (through late_release) when the written texture goes. The title's list names the written texture, so by the rule you quote the title keeps that one until the list has run, and with it now the other two. I chose this over references held by the recording because it needs nothing new in the list state; the cost is that a sampled texture the title releases early lives on until its writer goes. The WARP test checks the reference is there after the copy and gone after the writer's release.
  • The two-order state case (B recorded before A is submitted): unchanged, as agreed above; @KDenKC's series is the place for it, and I will take the alias copy's part from there.

Tested on the new head: 13 tests of the module and of late_release passed (the GPU one on WARP), and the regression run in the description (1,505 frames against main's 1,560 in 60 s, switch off).

One correction to my own process, which the description now carries too: I build several worktrees into one target folder, and today cargo twice called a test binary of another worktree up to date. The test counts I posted here before came from builds whose logs show this worktree compiled; the regression block of ee7196a76 I can no longer check that way, and it is replaced by one I can. I now clean the crate's outputs before every build and check that the log names the worktree.

Still not run by me: the title's world on main with this head. Two tries today on this PC (RTX 5080, i7-7700K, cold caches for main) both stopped drawing about 30 s after the world's set-up (31 s and 29 s), behind first-time driver compiles of 19 to 93 s each, with the title's threads in its own no-frames path in a thread dump of the second, before any picture worth reporting. I am warming the caches and will post the run when it gets through.

AI use: Claude Code with Claude Fable 5.2 wrote the changes and this comment.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:comment:7304627874 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7304627874). Originally posted by [imnicho](https://github.com/imnicho) on 2026-12-01T07:54:16Z. --- **New head `8a28d3176`** (rebased onto `main` `493dbd3dd`; the second commit is this round). @KDenKC thank you for the two runs on `ee7196a76`, and for taking the submit-time state model on outside this PR. Your count of copies left out "for a state not known" was the most useful line in the report: that was the title moving a texture level by level, and it is gone now. - **States by subresource.** The states the title's transitions leave a texture in are kept for each level of each layer. A texture moved level by level is copied like any other, each level moved to the copy state from its own state and back. The counter you read (about 1,555 of 32,768, 4.7 %) no longer exists; if you run this head, the first "left out" number in the log line is now copies between the halves of a split transition, and I would expect 0 there. - **@thehollowedone, split barriers** (a copy inside a pending split on its destination): the first half of a split marks what it names as between the halves until the second, and no copy is recorded while a texture of the pair is there. It is left out and counted, not made up for at the split's end (said under "Not in it"). `no_copy_is_recorded_between_the_halves_of_a_split_transition` is your schedule, on the planner and the rule `record` asks; I did not write the fenced GPU version of it. - **@thehollowedone, a closed list outliving what XCL added to it**: the pair's buffer now holds a reference to the sampled texture, and both are let go (through `late_release`) when the written texture goes. The title's list names the written texture, so by the rule you quote the title keeps that one until the list has run, and with it now the other two. I chose this over references held by the recording because it needs nothing new in the list state; the cost is that a sampled texture the title releases early lives on until its writer goes. The WARP test checks the reference is there after the copy and gone after the writer's release. - **The two-order state case** (B recorded before A is submitted): unchanged, as agreed above; @KDenKC's series is the place for it, and I will take the alias copy's part from there. Tested on the new head: 13 tests of the module and of `late_release` passed (the GPU one on WARP), and the regression run in the description (1,505 frames against `main`'s 1,560 in 60 s, switch off). One correction to my own process, which the description now carries too: I build several worktrees into one target folder, and today cargo twice called a test binary of another worktree up to date. The test counts I posted here before came from builds whose logs show this worktree compiled; the regression block of `ee7196a76` I can no longer check that way, and it is replaced by one I can. I now clean the crate's outputs before every build and check that the log names the worktree. Still not run by me: the title's world on `main` with this head. Two tries today on this PC (RTX 5080, i7-7700K, cold caches for `main`) both stopped drawing about 30 s after the world's set-up (31 s and 29 s), behind first-time driver compiles of 19 to 93 s each, with the title's threads in its own no-frames path in a thread dump of the second, before any picture worth reporting. I am warming the caches and will post the run when it gets through. AI use: Claude Code with Claude Fable 5.2 wrote the changes and this comment. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
imnicho commented 2026-12-01 08:17:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by imnicho on 2026-12-01T08:17:45Z.


CI: the "Build and test" failure on 8a28d3176 is before any test of this PR runs. The job's test process ended with 0xc0000005 (STATUS_ACCESS_VIOLATION) after 34 of the library's 2,788 tests had finished, all of them eh::tests and gpu::agility::tests: the last lines before it are those passing and five thread dump (13 threads) blocks, with eh::tests::the_process_ends_while_another_thread_holds_the_heap among the threads named in them. No alias_copy test had started (none appears in the log), and the module's code is not reached without XCL_ALIAS_COPY=1 or its own tests.

#3089, on the same base 493dbd3dd, passed the same job seven minutes earlier, so this looks like a crash of main's own that comes and goes. I cannot re-run the job; a re-run by someone who can, or my next push, should show it.

AI use: Claude Code with Claude Fable 5.2 read the job log and wrote this note.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:comment:7305129047 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7305129047). Originally posted by [imnicho](https://github.com/imnicho) on 2026-12-01T08:17:45Z. --- **CI: the "Build and test" failure on `8a28d3176` is before any test of this PR runs.** The job's test process ended with `0xc0000005` (STATUS_ACCESS_VIOLATION) after 34 of the library's 2,788 tests had finished, all of them `eh::tests` and `gpu::agility::tests`: the last lines before it are those passing and five `thread dump (13 threads)` blocks, with `eh::tests::the_process_ends_while_another_thread_holds_the_heap` among the threads named in them. No `alias_copy` test had started (none appears in the log), and the module's code is not reached without `XCL_ALIAS_COPY=1` or its own tests. #3089, on the same base `493dbd3dd`, passed the same job seven minutes earlier, so this looks like a crash of `main`'s own that comes and goes. I cannot re-run the job; a re-run by someone who can, or my next push, should show it. AI use: Claude Code with Claude Fable 5.2 read the job log and wrote this note. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Foniass commented 2026-12-01 09:29:16 +00:00 (Migrated from github.com)

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


Triage (#1607) – head 8a28d31

#3340 (stacked on #3281/#3282) targets the same R32_UINT to R9G9B9E5 pairs another way: one PC texture with both formats in its cast list, instead of a GPU copy at the title's barriers. #1989's format_alias.rs is the origin of the pair detection and buffer copy. Nothing equivalent is on main. Off by default.
No problems found in the diff.
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:7306771775 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7306771775). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:29:16Z. --- **Triage (#1607)** – head 8a28d31 #3340 (stacked on #3281/#3282) targets the same R32_UINT to R9G9B9E5 pairs another way: one PC texture with both formats in its cast list, instead of a GPU copy at the title's barriers. #1989's `format_alias.rs` is the origin of the pair detection and buffer copy. Nothing equivalent is on main. Off by default. No problems found in the diff. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
AAsobu commented 2026-12-01 10:21:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by AAsobu on 2026-12-01T10:21:54Z.


Test report on head 8a28d317 (on main 493dbd3d), retail title, NVIDIA wave32.

Setup: release build of the head as is (no merge needed), xcl.exe with the #2590 profile at 2048 MB. Env: XCL_PREPARE=0 XCL_DIRECT_DXIL=1 XCL_DXC_THREADS=4 XCL_NETWORK=0 XCL_DRED=1 XCL_ACTIVITY=1 XCL_PSO_WAIT_MS=1000 XCL_TEXTURE_LEVEL_PAGES=1 XCL_HUGE_PSO_CONCURRENCY=4 XCL_HUGE_PSO_WANTED_CONCURRENCY=4, start prompt by XCL_PRESS_A_AT, no input. 5 runs of 300 s; world entry (first two-pass mesh dispatch) at 111-133 s. Not run: the test suite.

run XCL_ALIAS_COPY caches device removal copies at the end (left out) presents / draws per 2 s
1 1 XCL cold for this build none 2,048 (0 / 0 / 0 / 0) still compiling
2 unset warm none – 1.00 / 1466 (entry +20..68 s)
3 1 warm yes, at 182 s 1,024 (0 / 0 / 0 / 0) 0.92 / 1330 (entry +20..68 s)
4 1 warm none 4,096 (0 / 0 / 0 / 0) 1.02 / 4014 (entry +20 s to end)
5 1 warm none 4,096 (0 / 0 / 0 / 0) 1.07 / 4252 (entry +20 s to end)
  • On screen: with XCL_ALIAS_COPY=1 the sky is drawn for the first time on this machine: a blue sky with clouds in one shot, a sunset sky with lit clouds over the horizon in others, in all 4 runs with the switch. With it unset (run 2) the scene looked as on main: flat grey or black. The ground and everything below the horizon stay near black in every run, and other shots (e.g. the scene with the first subtitle) stay black with the switch too.
  • The log has the pairs the PR describes (1280x720x1 ... written as format 42 and read as format 67), and no copy was left out in any run.
  • Removal in run 3: 0x887a0006, DRED page fault at GPU VA 0x0, nothing allocated or freed there. The list that stopped was at >4 (a DrawIndexedInstanced, vs 505022186d7aeaa4 ps c1cffdc3f13a4f2f), with no copy operation around it. 1 of 4 runs with the switch removed the device, 0 of 1 without it; the 4 runs of main (d0832e61 / 493dbd3d, 420 s each, same setup) just before these had none. I cannot tell from this whether the switch causes it.
  • Frame rate and draws are the same with and without the switch.
  • On Foniass's finding 1 (pairs that leak and keep growing), in these runs: the log line N such pairs so far (written at 1-8 and at each power of two) reached 32 at 10-13 s in every run with the switch (1, 3, 4, 5) and never 64, though runs 1, 4 and 5 then spent 167-189 s in the world (run 3: 70 s, up to its removal). So here the pairs stayed between 32 and 63 and did not grow with time in the world. Peak process commit with the switch: 42,172 and 44,095 MB (runs 4 and 5), against 41,924 MB without it (run 2), the same binary; within the ~2 GB run-to-run spread. This is one part of the world and one title, so it does not rule the leak out.

hardware / tool and model: NVIDIA GeForce RTX 3090 24 GB (driver 621.24, wave32 only), Intel Core i5-10600K, 32 GB, Windows 11 Home build 26300, rustc 1.100.0 / Claude Code (Claude Opus 5.5), screen observations by the user, numbers from the logs checked by me

<!-- greyfinch-sync:ivall/xcl:comment:7308076424 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7308076424). Originally posted by [AAsobu](https://github.com/AAsobu) on 2026-12-01T10:21:54Z. --- Test report on head [`8a28d317`](https://github.com/xcl-dev/xcl/commit/8a28d31764071ad8cbfc7021d6d1d987e3745b11) (on `main` `493dbd3d`), retail title, NVIDIA wave32. **Setup:** release build of the head as is (no merge needed), `xcl.exe` with the #2590 profile at 2048 MB. Env: `XCL_PREPARE=0 XCL_DIRECT_DXIL=1 XCL_DXC_THREADS=4 XCL_NETWORK=0 XCL_DRED=1 XCL_ACTIVITY=1 XCL_PSO_WAIT_MS=1000 XCL_TEXTURE_LEVEL_PAGES=1 XCL_HUGE_PSO_CONCURRENCY=4 XCL_HUGE_PSO_WANTED_CONCURRENCY=4`, start prompt by `XCL_PRESS_A_AT`, no input. 5 runs of 300 s; world entry (first two-pass mesh dispatch) at 111-133 s. Not run: the test suite. | run | `XCL_ALIAS_COPY` | caches | device removal | copies at the end (left out) | presents / draws per 2 s | |---|---|---|---|---|---| | 1 | 1 | XCL cold for this build | none | 2,048 (0 / 0 / 0 / 0) | still compiling | | 2 | unset | warm | none | – | 1.00 / 1466 (entry +20..68 s) | | 3 | 1 | warm | **yes, at 182 s** | 1,024 (0 / 0 / 0 / 0) | 0.92 / 1330 (entry +20..68 s) | | 4 | 1 | warm | none | 4,096 (0 / 0 / 0 / 0) | 1.02 / 4014 (entry +20 s to end) | | 5 | 1 | warm | none | 4,096 (0 / 0 / 0 / 0) | 1.07 / 4252 (entry +20 s to end) | - **On screen:** with `XCL_ALIAS_COPY=1` the sky is drawn for the first time on this machine: a blue sky with clouds in one shot, a sunset sky with lit clouds over the horizon in others, in all 4 runs with the switch. With it unset (run 2) the scene looked as on `main`: flat grey or black. The ground and everything below the horizon stay near black in every run, and other shots (e.g. the scene with the first subtitle) stay black with the switch too. - The log has the pairs the PR describes (`1280x720x1 ... written as format 42 and read as format 67`), and no copy was left out in any run. - **Removal in run 3:** `0x887a0006`, DRED page fault at GPU VA `0x0`, nothing allocated or freed there. The list that stopped was at `>4` (a `DrawIndexedInstanced`, vs `505022186d7aeaa4` ps `c1cffdc3f13a4f2f`), with no copy operation around it. 1 of 4 runs with the switch removed the device, 0 of 1 without it; the 4 runs of `main` (`d0832e61` / `493dbd3d`, 420 s each, same setup) just before these had none. I cannot tell from this whether the switch causes it. - Frame rate and draws are the same with and without the switch. - **On Foniass's finding 1 (pairs that leak and keep growing), in these runs:** the log line `N such pairs so far` (written at 1-8 and at each power of two) reached 32 at 10-13 s in every run with the switch (1, 3, 4, 5) and never 64, though runs 1, 4 and 5 then spent 167-189 s in the world (run 3: 70 s, up to its removal). So here the pairs stayed between 32 and 63 and did not grow with time in the world. Peak process commit with the switch: 42,172 and 44,095 MB (runs 4 and 5), against 41,924 MB without it (run 2), the same binary; within the ~2 GB run-to-run spread. This is one part of the world and one title, so it does not rule the leak out. hardware / tool and model: NVIDIA GeForce RTX 3090 24 GB (driver 621.24, wave32 only), Intel Core i5-10600K, 32 GB, Windows 11 Home build 26300, rustc 1.100.0 / Claude Code (Claude Opus 5.5), screen observations by the user, numbers from the logs checked by me
Foniass commented 2026-12-01 11:21:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T11:21:00Z.


merge-check
base: 493dbd3dd0
head: 8a28d31764
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2905 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read the whole diff (+829/-2). With XCL_ALIAS_COPY unset the default path only gains atomic loads at 6 hook sites. The run below has a second smoke with XCL_ALIAS_COPY=1, which in 60 s doesn't reach the world, so it only shows that turning it on breaks nothing at boot. Findings, switch on: (1) Pairs can leak and keep being copied. Through keeps a reference to the sampled texture (alias_copy.rs ~342), so the title's last release of it never reaches forget(r) (res_release acts only at the real last reference); only forget(w) frees it (~202-227). If the written texture lives on and the title places new sampled textures at the same address, every old one stays in at[va] with its buffer and is copied into at every transition (sampled_of), so memory and copies grow without bound (from reading). (2) One staging buffer per pair, shared by all lists (~427-428), assumed COMMON at the start: two lists on DIRECT and COMPUTE copying the same pair at the same time race on it and on the destination's state. (3) A copy at every move out of RT / UAV, with no check that the texture changed: two whole copies each time, plus a DEFAULT buffer per pair the size of the texture (about 3.5 MB at 720p, 32-59 pairs). Frame time isn't measured. (4) The pairing rule (~185) takes any written and sampled texture of the same shape and texel width at one address, not only R32_UINT / R9G9B9E5. (5) States are kept in recording order (moved to the planned XCL_SUBMIT_STATES series), and AAsobu's 1 device removal in 4 runs with the switch on is unexplained. (6) Size: the description says it's large but not why it can't be split; a split would be (a) pairs and state tracking with unit tests, not hooked, then (b) texture_through_buffer, record, the hooks and the WARP test. Fine: the copy itself is legal, texture to buffer by the R32_UINT footprint and buffer to texture by the R9G9B9E5 one, with offsets, pitches and sizes checked equal. It's recorded on the writer's list right after its transition, so it follows the writes. The earlier review points (split barriers, a closed list outliving XCL's additions, the 64-part limit, per-level moves, the read-back overrun) are addressed. #3340 (XCL_CAST_LIST) and #3281 / #3282 (XCL_PAIR_PAGES) solve the same pairs another way; a maintainer should pick one. The PR's red CI is the lib-binary access violation in eh / agility (#1487).
performance: 60 s smoke of a retail title, main 493dbd3d vs this merge (8a28d317): 1670 -> 1676 frames shown (100 %; last presents per 2 s: 60 60 60), peak commit 17083 -> 17283 MB, 0 device removals, 0 crashes. A second 60 s run of the same merge with XCL_ALIAS_COPY=1: 1682 frames shown (last presents per 2 s: 60 60 60), peak commit 17640 MB, 0 device removals, 0 crashes. The log shows pairs being made from 2 s in (R32_UINT written, R9G9B9E5 read, 1280x720; last line (32 such pairs so far)), so the copy path runs here, at boot only.
verdict: not yet: with the switch on, pairs can leak and keep being copied when the title places new sampled textures at a live writer's address (finding 1), and the one staging buffer per pair races between lists on DIRECT and COMPUTE (finding 2); split it as suggested and bound the pair lifetime
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7309517165 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7309517165). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T11:21:00Z. --- merge-check base: 493dbd3dd0cd50b4c3e8d28f73ab9b504fcd8158 head: 8a28d31764071ad8cbfc7021d6d1d987e3745b11 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2905 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none review: read the whole diff (+829/-2). With `XCL_ALIAS_COPY` unset the default path only gains atomic loads at 6 hook sites. The run below has a second smoke with `XCL_ALIAS_COPY=1`, which in 60 s doesn't reach the world, so it only shows that turning it on breaks nothing at boot. Findings, switch on: (1) **Pairs can leak and keep being copied.** `Through` keeps a reference to the sampled texture (`alias_copy.rs` ~342), so the title's last release of it never reaches `forget(r)` (`res_release` acts only at the real last reference); only `forget(w)` frees it (~202-227). If the written texture lives on and the title places new sampled textures at the same address, every old one stays in `at[va]` with its buffer and is copied into at every transition (`sampled_of`), so memory and copies grow without bound (from reading). (2) **One staging buffer per pair, shared by all lists** (~427-428), assumed COMMON at the start: two lists on DIRECT and COMPUTE copying the same pair at the same time race on it and on the destination's state. (3) **A copy at every move out of RT / UAV**, with no check that the texture changed: two whole copies each time, plus a DEFAULT buffer per pair the size of the texture (about 3.5 MB at 720p, 32-59 pairs). Frame time isn't measured. (4) The pairing rule (~185) takes any written and sampled texture of the same shape and texel width at one address, not only R32_UINT / R9G9B9E5. (5) States are kept in recording order (moved to the planned `XCL_SUBMIT_STATES` series), and AAsobu's 1 device removal in 4 runs with the switch on is unexplained. (6) Size: the description says it's large but not why it can't be split; a split would be (a) pairs and state tracking with unit tests, not hooked, then (b) `texture_through_buffer`, `record`, the hooks and the WARP test. Fine: the copy itself is legal, texture to buffer by the R32_UINT footprint and buffer to texture by the R9G9B9E5 one, with offsets, pitches and sizes checked equal. It's recorded on the writer's list right after its transition, so it follows the writes. The earlier review points (split barriers, a closed list outliving XCL's additions, the 64-part limit, per-level moves, the read-back overrun) are addressed. #3340 (`XCL_CAST_LIST`) and #3281 / #3282 (`XCL_PAIR_PAGES`) solve the same pairs another way; a maintainer should pick one. The PR's red CI is the lib-binary access violation in `eh` / `agility` (#1487). performance: 60 s smoke of a retail title, main 493dbd3d vs this merge (8a28d317): 1670 -> 1676 frames shown (100 %; last presents per 2 s: 60 60 60), peak commit 17083 -> 17283 MB, 0 device removals, 0 crashes. A second 60 s run of the same merge with `XCL_ALIAS_COPY=1`: 1682 frames shown (last presents per 2 s: 60 60 60), peak commit 17640 MB, 0 device removals, 0 crashes. The log shows pairs being made from 2 s in (R32_UINT written, R9G9B9E5 read, 1280x720; last line (32 such pairs so far)), so the copy path runs here, at boot only. verdict: not yet: with the switch on, pairs can leak and keep being copied when the title places new sampled textures at a live writer's address (finding 1), and the one staging buffer per pair races between lists on DIRECT and COMPUTE (finding 2); split it as suggested and bound the pair lifetime hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 AI-written and posted by Foniass without a human check of each point.
imnicho commented 2026-12-01 12:17:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by imnicho on 2026-12-01T12:17:32Z.


@Foniass thank you for the read and the second regression run, and @AAsobu for the five runs: the sky drawn in all four runs with the switch on is the first report of that picture from a machine this was not written on.

On the findings, on 8a28d3176:

  1. Pairs that outlive their sampled texture: right. The buffer's reference keeps the sampled texture's count above one, so res_release never takes the title's last release of it for the last, and forget comes only with the writer. A writer that lives on while the title places new sampled textures at its address collects all of them, each with its buffer, each copied into. @AAsobu's count stayed between 32 and 63 in the world, so it did not grow there, but nothing in the code bounds it.
  2. One buffer a pair for every list: right for two lists that run on two queues at once. Both come from the same choice (the pair owns the buffer and the reference), and both go away if the recording owns them instead: the pair keeps only the two layouts, and the list that records a copy keeps the buffer and a reference to the sampled texture until its next Reset. I looked at list_x's copy scratch for this; it cannot grow within a recording, and one list copies pairs of several sizes, so it would need a change there too.
  3. No frame-time measure from me. @AAsobu's table has the same presents and draws per 2 s with and without the switch. A check that the writer was written since the last copy is not in it, as the description says.
  4. The rule is meant to be that wide: on the console the two are one memory whatever the two formats are, and a pair whose two layouts differ in any offset, pitch or size is left out and counted.
  5. No more to say than the description does; I cannot explain the one removal in @AAsobu's run 3 (a page fault at 0 in a DrawIndexedInstanced, no copy near it) and have not seen one like it in my own runs.
  6. The split you lay out is the right one.

What I will do, and one thing I would like settled first. The draft #3547 brings amd-dev's format_alias.rs, on by default there, which keeps the same pairs in step (with a check for a writer not written since the last copy), and #3340 and #3281 / #3282 do it a third and a fourth way. I would rather not put a fifth round of this PR, as two new PRs, in front of reviewers if main is about to get one of the others. So I am holding the rework of findings 1 and 2 and the split until it is clear whether #3547 goes in with format_alias.rs; if it does not, I will push them as (a) pairs and states with their unit tests, not hooked, then (b) the copy, the hooks and the WARP test. Meanwhile this machine (RTX 5080) is running #3547's branch, where results on NVIDIA were asked for.

Nothing was built or run for this comment.

AI use: Claude Code with Claude Fable 5.2 read the review against the code and wrote this comment.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:comment:7310923849 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7310923849). Originally posted by [imnicho](https://github.com/imnicho) on 2026-12-01T12:17:32Z. --- @Foniass thank you for the read and the second regression run, and @AAsobu for the five runs: the sky drawn in all four runs with the switch on is the first report of that picture from a machine this was not written on. On the findings, on `8a28d3176`: 1. **Pairs that outlive their sampled texture: right.** The buffer's reference keeps the sampled texture's count above one, so `res_release` never takes the title's last release of it for the last, and `forget` comes only with the writer. A writer that lives on while the title places new sampled textures at its address collects all of them, each with its buffer, each copied into. @AAsobu's count stayed between 32 and 63 in the world, so it did not grow there, but nothing in the code bounds it. 2. **One buffer a pair for every list: right** for two lists that run on two queues at once. Both come from the same choice (the pair owns the buffer and the reference), and both go away if the recording owns them instead: the pair keeps only the two layouts, and the list that records a copy keeps the buffer and a reference to the sampled texture until its next Reset. I looked at `list_x`'s copy scratch for this; it cannot grow within a recording, and one list copies pairs of several sizes, so it would need a change there too. 3. No frame-time measure from me. @AAsobu's table has the same presents and draws per 2 s with and without the switch. A check that the writer was written since the last copy is not in it, as the description says. 4. The rule is meant to be that wide: on the console the two are one memory whatever the two formats are, and a pair whose two layouts differ in any offset, pitch or size is left out and counted. 5. No more to say than the description does; I cannot explain the one removal in @AAsobu's run 3 (a page fault at 0 in a `DrawIndexedInstanced`, no copy near it) and have not seen one like it in my own runs. 6. The split you lay out is the right one. **What I will do, and one thing I would like settled first.** The draft #3547 brings amd-dev's `format_alias.rs`, on by default there, which keeps the same pairs in step (with a check for a writer not written since the last copy), and #3340 and #3281 / #3282 do it a third and a fourth way. I would rather not put a fifth round of this PR, as two new PRs, in front of reviewers if `main` is about to get one of the others. So I am holding the rework of findings 1 and 2 and the split until it is clear whether #3547 goes in with `format_alias.rs`; if it does not, I will push them as (a) pairs and states with their unit tests, not hooked, then (b) the copy, the hooks and the WARP test. Meanwhile this machine (RTX 5080) is running #3547's branch, where results on NVIDIA were asked for. Nothing was built or run for this comment. AI use: Claude Code with Claude Fable 5.2 read the review against the code and wrote this comment. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
afpruivo commented 2026-12-01 13:04:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by afpruivo on 2026-12-01T13:04:01Z.


A measurement that may help parts B/C. On #3527's head (0d61b2c2) I tried following the title's
D3D12_TEXTURE_BARRIER_FLAG_DISCARD with a legacy DiscardResource after the transition. This is a local switch, not a PR.

RTX 3090, debug layer, 300 s, same input script, same binary, switch off vs on:

  • error 1422 (RT/DS used uninitialised): same pace (≥ 32 by ~110–115 s in both). Its first ones are at 3 s, before any barrier group.
  • error 538: 32 → ≥ 16 384. DiscardResource lands on textures the PC has in COMMON while the recorded state is RENDER_TARGET, so the transition was dropped as a no-op.

So a legacy discard can't be right until the before-state follows submission order. The native route (an enhanced barrier from UNDEFINED with the flag, as in #3558) wouldn't need a before-state.

AI use: Claude Code (Claude Opus 5.5) wrote the switch, ran the runs and drafted this.

<!-- greyfinch-sync:ivall/xcl:comment:7312054500 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7312054500). Originally posted by [afpruivo](https://github.com/afpruivo) on 2026-12-01T13:04:01Z. --- A measurement that may help parts B/C. On #3527's head (0d61b2c2) I tried following the title's `D3D12_TEXTURE_BARRIER_FLAG_DISCARD` with a legacy `DiscardResource` after the transition. This is a local switch, not a PR. RTX 3090, debug layer, 300 s, same input script, same binary, switch off vs on: - error 1422 (RT/DS used uninitialised): same pace (≥ 32 by ~110–115 s in both). Its first ones are at 3 s, before any barrier group. - error 538: 32 → ≥ 16 384. `DiscardResource` lands on textures the PC has in COMMON while the recorded state is RENDER_TARGET, so the transition was dropped as a no-op. So a legacy discard can't be right until the before-state follows submission order. The native route (an enhanced barrier from UNDEFINED with the flag, as in #3558) wouldn't need a before-state. AI use: Claude Code (Claude Opus 5.5) wrote the switch, ran the runs and drafted this.
KDenKC commented 2026-12-01 13:35:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-01T13:35:53Z.


On an RTX 5090 in the retail title's first interior scene, a port of this PR's alias copy (XCL_ALIAS_COPY=1; our port of the earlier head, not 8a28d317 as is) together with #3282 (XCL_PAIR_PAGES=1) ends the window's alternate-frame black box: neither does it alone. The details and the before/after numbers are in the test report on #3282 (https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7311679501) and its addendum.

AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.

<!-- greyfinch-sync:ivall/xcl:comment:7312874819 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7312874819). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-01T13:35:53Z. --- On an RTX 5090 in the retail title's first interior scene, a port of this PR's alias copy (`XCL_ALIAS_COPY=1`; our port of the earlier head, not 8a28d317 as is) together with #3282 (`XCL_PAIR_PAGES=1`) ends the window's alternate-frame black box: neither does it alone. The details and the before/after numbers are in the test report on #3282 (https://github.com/xcl-dev/xcl/pull/3282#issuecomment-7311679501) and its addendum. AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen.
BBareth commented 2026-12-03 08:05:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-12-03T08:05:16Z.


Test report: #3094 (8a28d317) and #3282 (ea91c5f4) together, in a retail title's gameplay.

  • Tree: main 395405e4 merged with #3094 (8a28d317), #3282 (ea91c5f4) and #3625 (e3dabe10), release.
  • Hardware: RTX 5070 Ti, driver 32.0.16.2124; i7-12700K; Windows 11 Pro 26200.
  • Settings in every run:
    • The 16-window layout: XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_VIEW_REACH_MB=36 XCL_MIRROR_FILL_MB=128. Without it, this title's world draws nothing and no comparison is possible.
    • XCL_TWO_PASS_MB=4096 XCL_TEXTURE_LEVEL_PAGES=1 XCL_WAVE64_SPIN=0.
  • Runs: 1300 s each with warm shader caches, A pressed once at 70 s. The last ~17 minutes are in the first gameplay scene. The binary is the same in every run; only XCL_ALIAS_COPY and XCL_PAIR_PAGES differ, and both are switched together, so this does not tell the two PRs apart.
  • Targets: dumped with XCL_DUMP_TARGETS=2000,1,16 after 900 or 1000 s. Sampled texels drawn are out of 230,400.
XCL_ALIAS_COPY + XCL_PAIR_PAGES HDR target (fmt 10) fmt 42 target presents per minute, 360–1200 s (median) video memory over budget at 240–300 s frames removals / crashes
off 89,421 (39 %) 43,600 88 3,390 MB 4874 0 / 0
on, run 1 230,400 (100 %) 119,263 85 2,372 MB 4665 0 / 0
on, run 2 230,400 (100 %) 136,786 92 2,535 MB 4800 0 / 0

What the images show:

  • Both switches off: the HDR target is mostly black. Only the window frame and parts of the room are lit, and the view through the window has no sky.
  • Both switches on, in both runs: the lit scene, with the sky, the buildings outside and the sunlit furniture.
  • Unchanged either way: the G-buffer targets (RGBA8) have the same number of drawn texels within 1 %. The difference is in the lighting and the targets built from it, not the geometry.
  • Same in all three runs: a speckled patch over one window and a few black blocks on a wall.

Frame rate is about the same either way, and video memory is a little lower with the switches on.

Not checked:

  • each switch on its own;
  • AMD;
  • the 4-window default layout;
  • runs longer than 1300 s.

AI use: Claude Code, Claude Opus 5.5 ran the runs and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7371805133 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3094#issuecomment-7371805133). Originally posted by [BBareth](https://github.com/BBareth) on 2026-12-03T08:05:16Z. --- Test report: #3094 (8a28d317) and #3282 (ea91c5f4) together, in a retail title's gameplay. - **Tree:** main 395405e4 merged with #3094 (8a28d317), #3282 (ea91c5f4) and #3625 (e3dabe10), release. - **Hardware:** RTX 5070 Ti, driver 32.0.16.2124; i7-12700K; Windows 11 Pro 26200. - **Settings in every run:** - The 16-window layout: `XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_VIEW_REACH_MB=36 XCL_MIRROR_FILL_MB=128`. Without it, this title's world draws nothing and no comparison is possible. - `XCL_TWO_PASS_MB=4096 XCL_TEXTURE_LEVEL_PAGES=1 XCL_WAVE64_SPIN=0`. - **Runs:** 1300 s each with warm shader caches, A pressed once at 70 s. The last ~17 minutes are in the first gameplay scene. The binary is the same in every run; only `XCL_ALIAS_COPY` and `XCL_PAIR_PAGES` differ, and both are switched together, so this does not tell the two PRs apart. - **Targets:** dumped with `XCL_DUMP_TARGETS=2000,1,16` after 900 or 1000 s. Sampled texels drawn are out of 230,400. | `XCL_ALIAS_COPY` + `XCL_PAIR_PAGES` | HDR target (fmt 10) | fmt 42 target | presents per minute, 360–1200 s (median) | video memory over budget at 240–300 s | frames | removals / crashes | |---|---|---|---|---|---|---| | off | 89,421 (39 %) | 43,600 | 88 | 3,390 MB | 4874 | 0 / 0 | | on, run 1 | 230,400 (100 %) | 119,263 | 85 | 2,372 MB | 4665 | 0 / 0 | | on, run 2 | 230,400 (100 %) | 136,786 | 92 | 2,535 MB | 4800 | 0 / 0 | **What the images show:** - **Both switches off:** the HDR target is mostly black. Only the window frame and parts of the room are lit, and the view through the window has no sky. - **Both switches on, in both runs:** the lit scene, with the sky, the buildings outside and the sunlit furniture. - **Unchanged either way:** the G-buffer targets (RGBA8) have the same number of drawn texels within 1 %. The difference is in the lighting and the targets built from it, not the geometry. - **Same in all three runs:** a speckled patch over one window and a few black blocks on a wall. Frame rate is about the same either way, and video memory is a little lower with the switches on. **Not checked:** - each switch on its own; - AMD; - the 4-window default layout; - runs longer than 1300 s. AI use: Claude Code, Claude Opus 5.5 ran the runs and wrote this report.
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/3094:upstream-pr/3094'
git switch 'upstream-pr/3094'

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