D3D12.X: a sampled texture in the memory of a written one of another format is copied from it (XCL_ALIAS_COPY=1) #3094
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3094"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
mainand reworked for it, with what the reviews asked for. Two commits onmain493dbd3dd: the rework, and what the reviews of that rework (asee7196a76) asked for; the head is8a28d3176. The old head6396870e2(onnvidia-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:create_placed_resource_xtells 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.resource_barrier_x. Onmainthat one place sees both a legacyResourceBarrierand the title's enhanced barriers of list #146, whichbarrier_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). WithXCL_BARRIER_GROUPS=0the enhanced barriers move no texture and ask for no copy.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 (onee7196a76such 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).planof 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).mainreads a texture the GPU wrote back into the title's memory. What a copy puts into the sampled texture gets no GPU writer intitle_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.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
barrier_groupskeeps 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, asbarrier_groupsdoes 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.Create{ShaderResource,UnorderedAccess}ViewAtXat a written texture's address),CopyResourcebetween format families, a copy back from the sampled texture, a skip of a copy whose written texture has not changed.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, noSKIPPEDline (the crate's outputs cleaned first: see the note under "Not tested").cargo test -p xcl --lib -- --test-threads=4gives no count on this PC: plainmain(d0832e614) ends the test process partway here. After 1,376 testsalloc_pool::tests::a_reset_that_puts_the_allocator_aside_keeps_what_the_gpu_still_readsfails and the process stops withsparse 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 insparse::tests::a_buffer_over_a_remapped_tile_reads_the_new_pageafter 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_xwith 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:
main-based headee7196a76, @KDenKC (RTX 5090, driver 621.40,maind52ff48cwith #3281 and one revert,XCL_PAIR_PAGES=1on 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.main-based trees with the first version ported, by others in the comments: @claudetools-gh (RTX 5070 Ti,main7a649b0ewith 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,maind52ff48cwith 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.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):This PR (
8a28d3176), its second run (the first run of a new binary fills its caches and is not kept, as formain):Not tested
nvidia-devtree, andmainbuilds every pipeline anew; the 60 s runs above do not reach the world. A run of mine onmainwith this head will follow as a comment.nvidia-devthe 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").crates/xcl/tests(eachd3d12_*one takes about 9 minutes here).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
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.
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.The two-mip array hits
make_through'sparts > 64limit. 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.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-28T05:12:21Z.
@imnicho, thanks for this. We ported raylitebull's
amd-devformat_alias.rsontonvidia-devlocally for the same R32_UINT -> R9G9B9E5 problem, so here's what that taught us, read against839b33a1. 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.forgetpushes every departed pair'sThroughinto 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 afterforget) would bound it.Coverage differences, as possible follow-ups on top of yours, not changes this PR needs:
create_placed_resource_x(the threenote_createdcalls). Theamd-devversion also catches readers made withCreate{ShaderResource,UnorderedAccess}ViewAtXat the written texture's address. We haven't measured how many of this title's reads take that path.0xC0may 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 onto54225f58needed 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.
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 withXCL_ADAPTER=Radeonand with=3060, and no result changes from839b33a. 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_xchanges. But the GPU test runs on WARP, so this isn't AMD hardware coverage of the copy.Tested: at the PR head
839b33aagainst its merge-base withnvidia-dev,01b94f5(the diff doesn't apply as a patch on today'snvidia-dev54225f5). 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 withXCL_ADAPTER=Radeonand once with=3060: merge-base 50 passed, 0 failed (list_xonly, sincealias_copyis new); PR 54 passed, 0 failed, 0 ignored, no SKIPPED, both times.alias_copytests, all ok.gpu_a_written_textures_texels_reach_its_sampled_pair_at_the_enhanced_barrierbuilds its device onEnumWarpAdapter, 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 theXCL_ADAPTERcard.Not tested:
XCL_ALIAS_COPY=1in a title, the whole suite, Intel.AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
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.
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.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.
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 --workspacepassed on the merged tree. WithXCL_ALIAS_COPY=1,cargo test --offline --locked -j 4 -p xcl --lib alias_copy::tests -- --nocapture --test-threads=1passed 4/4, no skips. The fullcargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4ran 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 explicitSKIPPEDnotices, 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, anda_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.
0x8 -> 0xC1, the native list receives0x8 -> 0xC0after the buffer-only0x1is removed, but alias-copy state tracking retains0xC1. Its injected copy then requests a transition from the state the native barrier never established. Plan from the normalizedoutbarriers instead, before other features mutate that vector. A WARP debug-layer test should call the actualresource_barrier_xpath and execute the following copy with this state combination.Tex.nowglobally 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 unsubmittedCOPY_DEST -> COPY_SOURCEleaves the GPU inCOPY_DEST, while the planner would useCOPY_SOURCEas 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.
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-devand onnvidia-devalone, and the PR's own tests 3 times by name.Tested
Base:
nvidia-dev54225f5884a94cd23b7aab3f703a7c975070aa77. Head:6396870e2184c80b7fa0404edf419d2f8ee262e1.git merge --no-ffof the head onto the base: clean, no conflicts (list_x.rsauto-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_COPYnot set.cargo build --workspaceandcargo 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 thexcllibrary binary stopped partway through, before printing its result. It exited with code 130088963 (0x7C10003) afterD3D12.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 auma_drivermixed-window test prints. The other 39 result lines:SKIPPEDlines;SKIPPEDlines; the same per-binary results as the merge.FAILEDlines on the merge and 5 on the base: the 4title_texturestests below on both, plushle::d3d12x::list_x::tests::mid_list_write64_wait64_split_avoids_cycle_and_reuses_spareson 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:SKIPPEDlines;SKIPPEDlines, the same in 3 runs.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_memoryand…gpu_retire_queue_holds_heap_until_blocked_queue_passes_mark. Three panic on0x8007000E(E_OUTOFMEMORY) from a D3D12 call, and the other threestream_recheck_*ones on aPoisonErrorafter those panics. All 6 pass alone, one at a time, 3 of 3 times on the base.--exact --test-threads=1).The 26
SKIPPEDlines 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-devand the 3e2etitle tests pass on both trees;gpu_heap_flat_reads_match_guarded_and_root_outputis not innvidia-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, 0SKIPPEDlines:hle::d3d12x::alias_copy::tests::a_sampled_texture_in_the_memory_of_a_written_one_of_another_format_is_its_pairhle::d3d12x::alias_copy::tests::a_written_textures_transition_out_of_a_written_state_asks_for_the_copyhle::d3d12x::alias_copy::tests::an_enhanced_barrier_of_a_written_texture_asks_for_the_copyhle::d3d12x::alias_copy::tests::gpu_a_written_textures_texels_reach_its_sampled_pair_at_the_enhanced_barrierThe 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
xcl-smokeblock: no title was run.XCL_ALIAS_COPY=1: every run here had the switch unset.AI use: Claude Code (Claude Opus 5.5) ran the tests above on the hardware named and wrote this report.
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=50changed, 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 usedXCL_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.
Imported from ivall/xcl. Originally posted by vasanex on 2026-11-28T20:19:58Z.
Test report for
6396870e2on an RTX 3080: the copy lights the world here, and gives a better picture than sharing the memory, which we had tried.Tested
nvidia-dev54225f58with the open PRs our runs need merged (#2905 #2987 #3039 #2815 #2816 #2817 #3037 #609 #2753 #2975 #3052 #2590 #3091 #3092 #2229, and #1319'sput_in) and local changes.cargo test -p xcl --lib -- alias_copy --test-threads=4: 4 passed, 0 failed, 0 ignored, no SKIPPED.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=1in all):XCL_ALIAS_COPY=1(this PR)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
main.AI use
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 globalTex.now. Submitting A later, or resetting A without submitting it, cannot rewrite B's barriers.planupdates that global value while recording;recordreads 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
ID3D12InfoQueueand 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_SOURCEtransition throughresource_barrier_xon 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. WithXCL_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=1failed 0/1/0 on unchanged head.ID3D12InfoQueuereported B's barrier before-state0x800(COPY_SOURCE) while the texture remained in0xC0(shader read). With the test-onlyXCL_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 stockgpu_a_written_textures_texels_reach_its_sampled_pair_at_the_enhanced_barrierWARP 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
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.
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:
It stays opt-in behind
XCL_PAIR_PAGES=1. I'll link the PR here when it is up. If you think it collides withXCL_ALIAS_COPY, tell me.(Claude Code, Claude Opus 5.5, wrote this comment.)
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):RelaxedFormatCastingSupportedtrue; 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.
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 toXCL_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.)
Imported from ivall/xcl. Originally posted by claudetools-gh on 2026-11-29T16:01:39Z.
A data point for
XCL_ALIAS_COPY=1on 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:
main7a649b0ewith #3124, #3192, #3179, #3282, #3306/#3307 and a local PS-export patch on top, then this PR's6396870e.title_textures::note_gpu_writeno longer exists onmain(aeed3468records texture writes per list and publishes them at submit), so the copy now notes its destination withlist_x::note_texture_write(list, r, ALL_SUBRESOURCES).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.XCL_ALIAS_COPYXCL_PAIR_PAGESA 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.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-29T16:03:53Z.
@claudetools-gh one thing that may change the reading:
+0x23cf683is 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,main7db2f391with #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+0x23cf683at 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=1and 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.
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::recordholdsTABLEwhilemake_throughqueries copy footprints and callsCreateCommittedResourceon first use of a scratch buffer.plan_enhancedneeds 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 insidealias_copy::plan_enhanced. Finding both together would help isolate this path from a GPU queue wait. Watchdog discussionGPT-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-fenceswas publishing texture downloads. It did not show the mutex pair from the synthetic test. GitHub's ancestry comparison confirms that7a649b0ealready 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 comparisonNative 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. Wakingxcl-fencesexplicitly, 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
0x398000bytes on this base and the written layout was0x384000. 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 --nocapturepassed 1/1 each with zero skips. OpenAI Codex, GPT-6.2 Sol, assisted with this fixture and report. Retail fixImported from ivall/xcl. Originally posted by vasanex on 2026-11-29T16:26:31Z.
We hit the same abort at
game_scarlett_master.exe+0x23cf683withXCL_ALIAS_COPY=1and 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 (main765b2c5b+ 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-fencesthread is busy, not waiting, inpoll_fence_downloads → complete_fence_downloads → publish_download, inVirtualQueryin one snapshot and inWriteProcessMemory → NtQueryVirtualMemoryin the other. The title's frame thread waits on its fence, which stays hidden until its downloads are published. We did not see thealias_copy::record/plan_enhancedmutex pair andrewDoing describes in these snapshots.Three causes, all in the download path, not in the copy:
write_changed_pagesasked 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.download hold: … not committed.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=1and 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 Nwith N > 0 or a growingpending batchesin 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 base7a649b0e– 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.
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.
mainnow downloads a texture that has a GPU writer back into the title's memory at each fenceSignal: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=1doesn'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
TEXTURESis locked, so no locks are nested. On top of6396870e, withtitle_textures::note_gpu_writereplaced bylist_x::note_texture_write(list, r, ALL_SUBRESOURCES)for currentmain: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.
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
+0x23cf683does 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=1alone 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.
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 ontomaind52ff48c: 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.
Imported from ivall/xcl. Originally posted by imnicho on 2026-11-30T23:55:02Z.
Rebased onto
mainand reworked for it: new headee7196a76(one commit; the old head onnvidia-devwas6396870e2). @CharlyRien, it builds onmaind0832e614now; a report on the new head would be very welcome.What changed, by who asked for it:
resource_barrier_xafter the console's bits are dropped. Onmainthat 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_xwith a D3D12_BARRIER_GROUP) on an adopted list.barrier_groups::LASTkeeps the states it starts from in the same order onmain, 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.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.planof another pair no longer waits forCreateCommittedResource.note_texture_writeas onmain. Thank you for running that crash down.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 againstmain's 1,560 in 60 s, switch off). The whole library suite gives no count on this PC: plainmainends 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-devtree andmainbuilds 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
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.planupdatesTex.nowwhile recording, andrecordbakes that state into native before/restore barriers.barrier_groups::LASTalso 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 andCOPY_SOURCEin the second. CheckID3D12InfoQueueand 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
ExecuteCommandListscannot 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.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-01T02:07:57Z.
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.
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:
resource_barrier_xsends), instead of a sharedLASTin recording order;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;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.
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.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T05:46:33Z.
Two source-level correctness points on current head
ee7196a7, both withXCL_ALIAS_COPY=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) toCOPY_SOURCE(0x800); in a laterResourceBarriercall, move its paired writer W from UAV (0x8) to non-pixel shader resource (0x40); then end R's split.planignores R'sBEGIN_ONLY, leavingTex.nowat shader-read, but W's transition schedules a copy.recordthen inserts a normal transition and write to R before itsEND_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.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_bufferhas nevertheless encoded R and the pair's scratch buffer in that list.forgetretires 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.
Imported from ivall/xcl. Originally posted by imnicho on 2026-12-01T07:54:16Z.
New head
8a28d3176(rebased ontomain493dbd3dd; 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.no_copy_is_recorded_between_the_halves_of_a_split_transitionis your schedule, on the planner and the rulerecordasks; I did not write the fenced GPU version of it.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.Tested on the new head: 13 tests of the module and of
late_releasepassed (the GPU one on WARP), and the regression run in the description (1,505 frames againstmain'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
ee7196a76I 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
mainwith this head. Two tries today on this PC (RTX 5080, i7-7700K, cold caches formain) 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
Imported from ivall/xcl. Originally posted by imnicho on 2026-12-01T08:17:45Z.
CI: the "Build and test" failure on
8a28d3176is before any test of this PR runs. The job's test process ended with0xc0000005(STATUS_ACCESS_VIOLATION) after 34 of the library's 2,788 tests had finished, all of themeh::testsandgpu::agility::tests: the last lines before it are those passing and fivethread dump (13 threads)blocks, witheh::tests::the_process_ends_while_another_thread_holds_the_heapamong the threads named in them. Noalias_copytest had started (none appears in the log), and the module's code is not reached withoutXCL_ALIAS_COPY=1or its own tests.#3089, on the same base
493dbd3dd, passed the same job seven minutes earlier, so this looks like a crash ofmain'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
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.rsis 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.
Imported from ivall/xcl. Originally posted by AAsobu on 2026-12-01T10:21:54Z.
Test report on head
8a28d317(onmain493dbd3d), retail title, NVIDIA wave32.Setup: release build of the head as is (no merge needed),
xcl.exewith 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 byXCL_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.XCL_ALIAS_COPYXCL_ALIAS_COPY=1the 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 onmain: 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.1280x720x1 ... written as format 42 and read as format 67), and no copy was left out in any run.0x887a0006, DRED page fault at GPU VA0x0, nothing allocated or freed there. The list that stopped was at>4(aDrawIndexedInstanced, vs505022186d7aeaa4psc1cffdc3f13a4f2f), with no copy operation around it. 1 of 4 runs with the switch removed the device, 0 of 1 without it; the 4 runs ofmain(d0832e61/493dbd3d, 420 s each, same setup) just before these had none. I cannot tell from this whether the switch causes it.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
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T11:21:00Z.
merge-check
base:
493dbd3dd0head:
8a28d31764merge: 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_COPYunset the default path only gains atomic loads at 6 hook sites. The run below has a second smoke withXCL_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.Throughkeeps a reference to the sampled texture (alias_copy.rs~342), so the title's last release of it never reachesforget(r)(res_releaseacts only at the real last reference); onlyforget(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 inat[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 plannedXCL_SUBMIT_STATESseries), 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 ineh/agility(#1487).performance: 60 s smoke of a retail title, main
493dbd3dvs 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 withXCL_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.
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:res_releasenever takes the title's last release of it for the last, andforgetcomes 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.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.DrawIndexedInstanced, no copy near it) and have not seen one like it in my own runs.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 ifmainis 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 withformat_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
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'sD3D12_TEXTURE_BARRIER_FLAG_DISCARDwith a legacyDiscardResourceafter 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:
DiscardResourcelands 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.
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, not8a28d317as 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.
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.395405e4merged with #3094 (8a28d317), #3282 (ea91c5f4) and #3625 (e3dabe10), release.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.XCL_ALIAS_COPYandXCL_PAIR_PAGESdiffer, and both are switched together, so this does not tell the two PRs apart.XCL_DUMP_TARGETS=2000,1,16after 900 or 1000 s. Sampled texels drawn are out of 230,400.XCL_ALIAS_COPY+XCL_PAIR_PAGESWhat the images show:
Frame rate is about the same either way, and video memory is a little lower with the switches on.
Not checked:
AI use: Claude Code, Claude Opus 5.5 ran the runs and wrote this report.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.