D3D12.X: XCL_CAST_LIST=1 shares one texture between R32_UINT and R9G9B9E5 #3340
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3340"
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 KDenKC on 2026-11-29T09:29:32Z.
What and why
The title writes packed light through an R32_UINT UAV and reads the same console address through an R9G9B9E5 texture. With
XCL_CAST_LIST=1, when the device supports enhanced barriers, relaxed format casting, and the needed sampled format, the written 2D texture is created with both formats and a matching sampled view is made on that resource. This avoids a separate read texture for this pair. The switch is off by default; unsupported devices and unmatched views keep the existing independent-resource path.Stacked on #3281. The two commits underneath add the
XCL_PAIR_PAGES=1placement support; the three commits at the top are this PR's cast-list route, lifecycle fixes, and barrier routing.The follow-ups preserve legacy resource states, handle
MipLevels == 0as the full mip chain, and bind a title-provided cast list to the allocation at its canonical address. The owner lookup selects the newest live compatible writer that is still current in placements, retaining older writers while they remain live. Releasing or superseding a writer updates the view and pair-page cap lifecycle. Barriers submitted on a known cast-list reader are routed to its writer with per-subresource state tracking; after a writer is released, the reader's barriers remain on the reader until a new view establishes another writer. Reader-first resources remain independent. Related: #3094 #3282. The independent-resource path remains available; the copy route in #3094 is a natural fallback if both changes land.What is in it
cast_list.rs: opt-in capability checks, current-writer selection, pair lifecycle, and reader-to-writer barrier routing.vram.rs,placements.rs,title_textures.rs,texture_upload.rs: pair-page placement, view handling, and cap lifecycle.real.rs,list_x.rs, and GPU tests: hook integration and regression coverage.Tested
RTX 3090 VM, Windows, debug,
XCL_NETWORK=0, combined heade435d2d8:cast_list: 9 passed, 0 failed.list_x: 116 passed, 0 failed.vramon parent1f6c4de0: 79 passed, 0 failed, 1 ignored (churn_update_tile_mappings_timing).d3d12x: 1,229 passed, 4 failed, 3 ignored; the four failures are the same title-texture tests that fail on main.1c8b5514on this VM:placed_title_textures_share_vram_and_preserve_pixels, the threestream_recheck_*tests, andtest_title_runs_and_game_folder_is_untouched. The VM skipped 28 tests for unavailable capabilities.Regression run
Pending: the rig is paused. No smoke blocks are claimed for
e435d2d8; older blocks do not validate this head.Not tested
XCL_CAST_LIST=1on this head.AI use
An agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen (tools: Claude Code, Codex, Antigravity).
Generated with Claude Code
https://claude.ai/code/session_013oPUFCA9W9F8Qb5MPK33bR
Imported from ivall/xcl. Originally posted by claudetools-gh on 2026-11-29T16:12:28Z.
A data point from an RTX 5070 Ti (driver 621.40), retail title, Series X profile: with
XCL_CAST_LIST=1the NVIDIA user-mode driver crashed in 2 of 2 runs at world entry, 143–145 s after start. Both crashes are access violations insidenvwgf2umx.dll:+0x47f82c, a read at 0xe800;+0x4f6835, a read at 0x20.Both happen on a title thread right after it creates a two-pass argument scratch buffer. Without the switch, 0 of 1 on the same binary: that run reaches the world.
The feature itself works here:
gpu_one_texture_written_r32_uint_reads_as_r9g9b9e5_by_its_cast_list,decode_matches_the_format);Tree:
main7a649b0ewith #3124, #3192, #3179, #3282 (so #3281 underneath), #3306/#3307 and a local PS-export patch, then5b064eb4on top. It applied cleanly.XCL_PAIR_PAGES=1 XCL_CAST_LIST=1 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.The same
+0x47f82ccrash happened once before, without cast lists, in an earlier run withXCL_DEPTH_UAV_TWIN=1. That suggests the driver trips over a resource created through one of the newer paths rather than over this PR's views as such, but I can't tell which resource from here. I don't have a debugger on this machine; XCL's own dump doesn't include the crashing thread's stack.Not tested: driver 621.24 or earlier, other NVIDIA generations, this PR without the rest of the stack. 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:14:39Z.
@claudetools-gh thanks, this is very useful, and the first crash looks familiar:
nvwgf2umx.dll+0x47f82c, a read at0xe800, on a title thread right after a two-pass argument scratch is created, is exactly the crash we saw on plainmain7db2f391(no cast list, no PR of ours) on an RTX 5090: five title threads created their argument scratch and made the first two-passExecuteIndirect(DispatchMesh)calls of the run in the same millisecond, and the crash hit one of them. That moment is the race in #3317 (from your entry 6 on #2952): two threads build the per-device indirect scaling pipeline at once, the second insert drops the first pair, and the first thread's list keeps a freed pipeline. Your tree has #3124, #3192, #3179, #3282, #3306/#3307 but not #3317, and you saw the same+0x47f82conce without cast lists too.So my reading is that the cast list is not the cause but shifts the timing at world entry enough to hit the race more often. It is a reading, not proof: could you run the same binary with #3317 (
d848cc4c, one commit, applies onmain) added, withXCL_CAST_LIST=1? If both crashes go away, it is the race; if+0x4f6835(the read at 0x20) stays, that one is something else and I'll look at the cast list's resources for 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 KDenKC on 2026-11-29T19:36:21Z.
Follow-up to the crash report above: it was #3317's race, not this change. claudetools-gh reran the same tree with #3317 added and
XCL_CAST_LIST=1instead of the alias copy: no driver crash, and the cast list filled the light probes (the window's sky and yard lit, 1.09 presents/s against 1.02 with the copy; 1 of 1): https://github.com/xcl-dev/xcl/issues/505#issuecomment-7261395245. The description now says so under Not tested and links #3317 as needed with this on NVIDIA.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 Foniass on 2026-12-01T09:41:15Z.
merge-check
base:
7d86c5d2b7head:
b25dbd80b0merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2906 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 (+1084/-19; it carries #3281 under it). With
XCL_CAST_LISTunset nothing changes: oneOnceLockor atomic load per hook, plus a 0x38-byte description copy per placed texture. Findings: (1) The title's own cast list (#127) is a second, wider change.for_writer(cast_list.rs~146) applies the title's list to any GPU-owned texture placed throughvram::place, depth and render targets included.read_state(~113) then turns every read-only state into COMMON, DEPTH_READ and RESOLVE_SOURCE included, which is wrong for a depth buffer bound read-only or a resolve source. The R32/R9G9B9E5 pair doesn't need it. Whether the title passes a list for a depth texture is unverified. (2) The tests don't drive XCL's code.cast_tests.rsbuilds the D3D12 route by hand and only callsread_state, so they pass with thevram/real/list_xchanges removed. Nothing testsplace_on_pages,Pages::settle, the SRV redirect indev_create_srv_inneror the barrier rewrite. (3)device_can(~118) checks relaxed casting,ID3D12Device10and R9G9B9E5 sampling, but not enhanced-barrier support. A refused create falls back cleanly, but a failedsettle(vram.rs~2494) leaves the texture in COMMON while the title tracks UNORDERED_ACCESS (unverified). (4) With the switch on,is_writer(~197) takes a global mutex on every transition barrier once a writer exists. (5) Size and stack. It is 1,103 lines with #3281's commits, and those are an older copy of #3281's current head (d427662e/7233f964vs3f252d43/b0192a85), so it needs a rebase. The description gives the size but not why it can't be split. A split:cast_tests.rsalone;cast_list.rsnot yet called; the reserved creator andsettle; the hooks; the #127 pass-through. (6) #3094 (XCL_ALIAS_COPY) is another route to the same problem, and a maintainer should pick one. #3136 drops the same #127 arguments inreal.rs, so the two conflict. From #3281:pair_pages()(vram.rs~2322) reads the environment on every placement and everytitle_textures::register. Fine: both formats are 32 bits per element and the runtime accepted the list on WARP and on the author's card.CastingFullyTypedFormatSupportedisn't needed with a cast list. Writers are keyed by canonical address and device, forgotten before recycling, and never pooled. The PR's red CI isstandin::...concurrent_shell_miss..., fixed on main.performance: 60 s smoke of a retail title, main
7d86c5d2vs this merge (50ec45d9): 1663 -> 1682 frames shown (101 %; last presents per 2 s: 60 60 60), peak commit 17153 -> 17627 MB, 0 device removals, 0 crashes. The switch is off in this run, so it checks only that nothing changes by default; the cast-list path is unmeasured.verdict: not yet: rebase onto #3281's current head (this carries an older copy of it), and split it: 1,103 lines with no reason given for passing 800. The #127 pass-through (finding 1) is a separate, wider change that turns depth reads into COMMON
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 Foniass on 2026-12-01T09:49:58Z.
Triage (#1607) – head
b25dbd8Stacked on #3281: the two XCL_PAIR_PAGES commits under it are #3281's, so only the top commit (
cast_list.rs, thevram/real/list_xhooks,cast_tests.rs) belongs here. #3094 fixes the same stale R9G9B9E5-over-R32_UINT read in a different way: it copies the written texture into the sampled one through a buffer (XCL_ALIAS_COPY). This PR makes the two one PC texture through a relaxed-format cast list. Those are different approaches, not duplicates. #3491 (draft) is stacked on this PR and extends it to volumes. 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 Foniass on 2026-12-01T21:06:40Z.
Follow-up review (head
8a2d7518, sinceb25dbd8, diff read, not a merge-check; checks red):read_stateis gone, so read-only states are no longer sent as COMMON, andwiden_state(cast_list.rs~122) only adds the shader-resource states. Butfor_writer(~166-189) still gives the title's list to any GPU-owned texture placed in COMMON, RENDER_TARGET, UNORDERED_ACCESS or COPY_DEST, which the R32_UINT/R9G9B9E5 pair does not need.cast_tests.rs(~162, ~193, ~231) makes the texture in layout COMMON and sends its own legacy barriers; it never callslayout_of,widen_state,place_on_pagesor the SRV redirect.device_candoes not check enhanced-barrier support: still open (cast_list.rs~142-162 readsRelaxedFormatCastingSupportedbut notEnhancedBarriersSupported).is_writertakes a global mutex on every transition barrier once a writer exists: still open (cast_list.rs~223, fromlist_x.rs~6445).pair_pages()(vram.rs~2394) still reads the environment on every call.New:
8a2d7518is a rebase of a commit from 29 Nov, older thanb25dbd80:layout_of(cast_list.rs~109) makes the written texture in its initial state's layout (UNORDERED_ACCESS, RENDER_TARGET, COPY_DEST),vram.rs~2490 passes that toCreateReservedResource2, and the title's barriers on it still go out as legacy ones (list_x.rs~6452). The description's own run shows this route giving debug-layer error 1350 and the 5090 hanging after it.Pages::settleandread_state, none of which exist at8a2d7518, and thexcl-smokeblocks are forb25dbd80, which is whyPR descriptionis red.Fine: with
XCL_CAST_LISTunset every hook stops at aOnceLockor atomic check; a refusedCreateReservedResource2falls back to the old create; writers are keyed by device and canonical address and forgotten inres_releasebefore recycling.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T01:13:17Z.
Code review location:
crates/xcl/src/hle/d3d12x/cast_list.rs; line 114The pushed head doesn't match the description. The body describes a later head (
b25dbd80) that creates the written texture in COMMON, settles it withPages::settleand sends read states viaread_state, but neither function exists on this branch. Here the texture is created in the layout of its initial state (layout_ofmaps 0x8 to UNORDERED_ACCESS, plus RENDER_TARGET and COPY_DEST). With XCL_CAST_LIST=1 and the light UAV placed in UNORDERED_ACCESS (the usual case),place_on_pagescalls CreateReservedResource2 with that layout, and the title then uses legacy ResourceBarrier on it. That's the debug layer error 1350 / RTX 5090 hang route the body says was fixed. What was tested isn't what would merge.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T01:13:17Z.
Review: COMMENTED
Review of
8a2d7518: 7 finding(s). 7 are inline.These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T01:13:18Z.
Code review location:
crates/xcl/src/hle/d3d12x/cast_list.rs; line 127Read states are still widened (e.g. SRV|COPY_SOURCE), which are the GENERIC_READ-style layouts the PR body says cause debug layer error 1334. If the writer is moved to NPS on a DIRECT list, it's sent as 0xC0. A later submission that reads it with no barrier expects COMMON at the start, so it gets error 1334, and the driver may skip the decompression or cache flushes the next submission needs.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T01:13:18Z.
Code review location:
crates/xcl/src/hle/d3d12x/list_x.rs; line 6445widen_stateadds NPS|PS on DIRECT lists but only NPS on COMPUTE lists, so the same texture's tracked state depends on list type. If a DIRECT list moves the writer UA->NPS (sent 0x8->0xC0) and a later COMPUTE list moves it NPS->UA (sent 0x40->0x8), the texture is really in 0xC0, so the before-state mismatches. That's a debug layer error, and the PS read state is never flushed. The reverse order mismatches too, andnote_other_listonly logs it.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T01:13:18Z.
Code review location:
crates/xcl/src/hle/d3d12x/real.rs; line 3276Views of the sampled (reader) texture are moved onto the writer, but the title's barriers on the reader resource aren't. On the console the title writes the R32_UINT texture as UAV and transitions only the R9G9B9E5 alias to PIXEL_SHADER_RESOURCE before sampling. On the PC that transition goes to the reader object, the writer stays in UNORDERED_ACCESS, and the redirected SRV samples a UA-state resource. That's a debug layer error, and on hardware with compressed or cached UAV data it can read stale texels. Barriers on a redirected reader need to go to the writer.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T01:13:18Z.
Code review location:
crates/xcl/src/hle/d3d12x/cast_list.rs; line 232The redirect only happens when the SRV is created. If the title places the reader, creates its R9G9B9E5 SRV and only then places the writer,
view_on_writerfinds no writer and the view stays on the stale reader for good. If the writer is recreated at the same address (resize/reallocation) while the title keeps its reader descriptor,resource_gone(writer)nulls the descriptor and the title samples zeros (black light), where on the console the alias would see the new writer's data.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T01:13:18Z.
Code review location:
crates/xcl/src/hle/d3d12x/cast_list.rs; line 56Shape::oftreats MipLevels 0 ("full chain") as 1, andwhole_viewbuilds a null-desc view with that many mips. A reader or writer created with MipLevels=0 gets a 1-mip shape, so a rebuilt null-desc SRV has MipLevels=1 and every lower mip the title samples reads out of range. MipLevels=0 on one side and an explicit full count on the other also fail to match, so no redirect happens. The non-redirected path usesr.MipLevelsor u32::MAX.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T01:13:18Z.
Code review location:
crates/xcl/src/hle/d3d12x/real.rs; line 3849Not certain about this one: the #127 cast list stays in a thread-local for the whole of
dev_create_committed_resource_layout_x. Any GPU-owned texture XCL itself creates throughplace_on_pageson that thread during the call (display target path, helper or twin textures) picks up the title's cast list viafor_writer, gets registered inmade, and has its barriers widened, or CreateReservedResource2 is tried with an incompatible list.Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-02T04:08:36Z.
@bmjask thanks for the review. The refreshed head is
4bb5c9a9, based on main1c8b5514and stacked on #3281.2–3. The follow-up removes read-state widening and the per-list-type widening; the title's legacy state words are preserved. This addresses both the GENERIC_READ-style expansion and the DIRECT/COMPUTE before-state mismatch.
4–5. Agreed, the reader's barriers have to reach the writer for the redirect to be correct. That routing (barriers on the reader handle applied to the writer it is redirected to) is a follow-up we have written and are testing; it is not a PR yet. Until it lands, the redirect stays behind
XCL_CAST_LIST=1, off by default. Views created before the writer exists stay on the independent reader, as onmain; the #3094 copy route is the natural fallback for those.MipLevels == 0is normalized to the full chain for the texture dimension, covered byzero_mip_count_means_the_full_chain_for_the_texture_dimension.title_cast_list_is_limited_to_its_bound_resource_address.On the 3090 VM, debug,
XCL_NETWORK=0, head4bb5c9a9:cast_tests2/2;cast_list4/4;vram81 passed, 0 failed, 1 ignored;list_x114/114. The workspace suite reported 2,920 passed, 5 failed, 51 ignored, with no crash. The five failures match main1c8b5514:placed_title_textures_share_vram_and_preserve_pixels, the threestream_recheck_*tests, andtest_title_runs_and_game_folder_is_untouched. Twenty-eight capability-dependent tests were skipped. No smoke pair has run on this head; the rig is paused.The cast route is off by default. A title run with
XCL_CAST_LIST=1and the debug layer on this head remains untested.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 Foniass on 2026-12-02T04:12:37Z.
Follow-up review (head
4bb5c9a9, since8a2d7518, diff read, not a merge-check; checks red):XCL_CAST_LIST=1on this head shows the earlier debug-layer error and the 5090 hang are gone.is_writertakes a global mutex on every transition barrier: fixed; thelist_x.rshook is gone andis_writeris test-only (cast_list.rs~225).title_address,real.rs~2029;take_title_formats,cast_list.rs~123) and the state widening is gone, butfor_writer(~168-190) still gives every GPU-owned #127 texture in COMMON, RENDER_TARGET, UNORDERED_ACCESS or COPY_DEST its list and records it as a writer readers are redirected to.cast_tests.rsstill makes its own resource and moves the writer itself (~262, ~288, ~292), never callingfor_writer,place_on_pagesorview_on_writer, and never sends a barrier on a separate reader.device_candoes not check enhanced-barrier support: still open (~144-165).pair_pages()reads the environment once (vram.rs~2412).42efa87bis #3281's first commit, butb383ccfbis an older copy of #3281's headb02b2c34(without theown_tiles_offallback and the cappedpublish_download), so a rebase onto #3281 is still needed.4bb5c9a9, but Regression run has noxcl-smokeblocks (the reasonPR descriptionis red).New:
real.rs~3277) no longer uses, so the writer stays in whatever state the title last gave the R32_UINT texture, e.g. UNORDERED_ACCESS after its compute writes; and a writer in NON_PIXEL_SHADER_RESOURCE is wrong for a pixel-shader read. With the switch on that is a debug-layer error and can read stale texels; the PR thread agrees the reader's barriers must reach the writer.4bb5c9a9is a fixup ofa07d7403. It deletes thelist_x.rshook andwiden_statethata07d7403adds, soa07d7403's message still describes the widening and its tests, and themadecomment incast_list.rs~78 still says "their barriers are widened". It should be squashed with the message rewritten.010007f2isa07d7403without4bb5c9a9, so it still has the widening and the per-barrieris_writer, and it conflicts with this head incast_tests.rs,cast_list.rsandvram.rs.Fine: with
XCL_CAST_LISTunset every hook stops at aOnceLockor atomic check; the #127 list is taken only at its own canonical address and cleared by the guard;MipLevels == 0is the full chain for the dimension, with a test; a refusedCreateReservedResource2falls back to the old create.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T04:19:46Z.
Code review location:
crates/xcl/src/hle/d3d12x/cast_list.rs; line 231view_on_writerredirects to any live writer at (dev, va) of the same shape without checking that it's still current in placements. With XCL_CAST_LIST=1 and XCL_PAIR_PAGES unset, the 1280x720 R9G9B9E5 reader (0x3c0000, 60 pages) is placed over the R32_UINT writer (0x384000, 57 pages). The overlap isAround, so the writer is superseded and its tiles go tolate_release::hold_unmap, yet the reader's SRV is still made on the writer and samples tiles being unmapped (zeros). The same stale redirect happens when the title has reused that memory for another texture while holding the old writer.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T04:19:46Z.
Code review location:
crates/xcl/src/hle/d3d12x/cast_list.rs; line 200made()overwriteswriters[(dev, va)]when a newer cast writer is placed at the same address, anddrop_resof the newer one removes the only (dev, va) entry while the older writer is still inmade. With writer A at va, writer B placed at the same va, and then B released while A is kept, later R9G9B9E5 readers at va are no longer redirected to A. They fall back to the independent texture, which reads the wrong data.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T04:19:46Z.
Code review location:
crates/xcl/src/hle/d3d12x/vram.rs; line 2588The XCL_PAIR_PAGES cap is decided once at placement (Target.capped, Entry.cap) and never lifted when the partner writer is released or superseded. If a view capped to 57 of 60 tiles keeps being CPU-filled after the title releases the writer,
written_in/dirty_onstill ignore pages past the cap andown_tiles_ofstill stops every upload at tile 57. The view's last 3 tiles keep whatever the shared extra pages hold for the rest of its life.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T04:19:46Z.
Review: COMMENTED
Review of
4bb5c9a9: 3 finding(s).Re-review at
4bb5c9a9. The state widening is gone, which resolves my earlier points about widened read states and states that differ by list type. Still open from my earlier review: the title's barriers on the reader still don't reach the writer its SRVs now sample (real.rs~3277). With the widening removed there's now no UAV->SRV transition at all, so the redirected SRV reads the writer in UNORDERED_ACCESS/COPY_SOURCE. Also still open: releasing the writer nulls views of a reader the title still holds (cast_list.rs~277, viaconsole_heap::resource_gone(writer)). New findings: 3 are inline.These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-02T05:57:52Z.
@bmjask @Foniass thanks for the follow-ups; this covers both reviews. This revision is rebased on #3281's current head
b02b2c34and main1c8b5514.The registry now selects the newest live compatible writer only while it is still current in placements, and retains older live writers so releasing a newer one falls back correctly. It narrows cast-list use to the title's bound #127 address and compatible resource, and checks enhanced-barrier support alongside relaxed casting, sampled-format support, and Device10. Pair-page caps expand when their partner is released or superseded, but only if the tail is free.
The barrier-routing commit is included in
e435d2d8: barriers on a reader whose view resolves to a writer route through that writer with per-subresource state tracking; a released writer stops receiving the reader's barriers until a new view resolves again. The tests cover that path through the fakeresource_barrier_xharness and ensure a released writer's reader stays independent.Regression coverage includes
casting_requires_enhanced_barriers_relaxed_casting_sampling_and_device10,title_cast_list_is_limited_to_its_bound_resource_address,view_uses_a_current_writer_and_falls_back_to_an_older_live_one,a_released_pair_cap_expands_only_when_its_tail_is_free,gpu_register_takes_the_cap_from_the_pair,a_readers_read_moves_are_its_owners,a_readers_owner_follows_release_and_a_new_view,a_barrier_on_a_cast_list_reader_moves_its_writer, anda_barrier_on_a_reader_of_a_released_writer_stays_on_the_reader.On the RTX 3090 VM, focused results were
cast_list9/0,list_x116/0,vram79/0/1 ignored, andd3d12x1,229 passed / 4 failed / 3 ignored. The workspace suite was 2,920 passed / 5 failed / 51 ignored, with the same five failures as main1c8b5514and no crash. The rig smoke pair for this head is queued; no retail-title result is claimed yet.The independent-resource path remains available when the cast list is unsupported. Related: #3094 #3136 #3282; the copy path in #3094 remains a natural fallback if both land.
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 Foniass on 2026-12-02T06:00:44Z.
Follow-up review (head
e435d2d8, since4bb5c9a9, diff read, not a merge-check; checks red):made,cast_list.rs~263), so a writer made in UNORDERED_ACCESS that the title never moves has no known state, every reader barrier on it is dropped (~402), and it is still sampled in UNORDERED_ACCESS.1a38d2c6/b02b2c34.device_candoes not check enhanced-barrier support: fixed (~219, ~235, with a test).is_writertakes a global mutex on every transition barrier: open again. Once a cast-made texture exists,route_transition(~360, fromlist_x.rs~6445) locksTABLEinowner_of(~94) and again inis_writer(~296) on every transition.a_barrier_on_a_cast_list_reader_moves_its_writergoes throughresource_barrier_xandview_uses_a_current_writer_and_falls_back_to_an_older_live_onethroughview_on_writer, butcast_tests.rsstill never callsfor_writer,place_on_pagesor the SRV redirect.20d1d945is still separate, and73f24089's message and thecast_list.rs~80 comment still describe the widening; this PR's own commits are 1,277 lines with no reason given; Not tested still lists a title run withXCL_CAST_LIST=1; the smoke blocks are missing (the reasonPR descriptionis red); #3491 still sits on the old commits.New:
route_withmoves the writer into the reader's read state and records it (~394-398), but the writer's own transitions are sent unchanged (~379 keepsb[5]). If the title moved the writer to UNORDERED_ACCESS once, writes it by compute every frame and moves only the R9G9B9E5 texture to PIXEL_SHADER_RESOURCE, the next compute pass writes the writer through a UAV while it is in PIXEL_SHADER_RESOURCE, and its next transition names UNORDERED_ACCESS as the before state: debug-layer errors and missing synchronisation.1f6c4de0drops theLIGHTlist fromfor_writer(~245;LIGHTis now#[cfg(test)]), so a texture gets a cast list only when the title passes one through #127. The PR title, description and thedevice_canlog line (~229) still say a written R32_UINT texture is made with R9G9B9E5, and nothing shows the title passes R9G9B9E5 through #127 for that texture.CLOSED_STATES(~149) is merged in the order lists close (real.rs~4148), not the order they run, and for every queue at once, soto = s | b[6](~396) can carry PIXEL_SHADER_RESOURCE from a direct list into a move on a COMPUTE list, or shader-resource states onto a COPY list, where they are invalid.1f6c4de0also changes #3281's cap.vram::pair_cap(~723) recomputes the cap from current partners andrefresh_pair_caps(title_textures.rs~778) is called fromplacements.rs~520 / ~535 / ~612, which changes behaviour withXCL_PAIR_PAGES=1alone; that belongs in #3281.Fine: with
XCL_CAST_LISTunset,route_transition,closedandresetstop at theMADEatomic; writers are kept per address, newest current first with fallback to an older live one, with a test; per-subresource tracking and a reader split's first half are handled and tested;drop_resclears the writer from the reader map and both state maps.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
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.