D3D12.X: a new texture leaves the undefined layout from its creation state #3527
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3527"
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 afpruivo on 2026-11-30T13:54:34Z.
A barrier group's texture barrier from the undefined layout started at the state a barrier group last moved the texture to, so a texture no group had moved yet got no PC transition. A render target or depth buffer made in COMMON then stayed in COMMON while the title drew into or cleared it, and its next barrier named a state the PC texture was not in (debug layer 538 and 527). Each texture now has one record from creation to release, seeded with the PC state it was made in, and a barrier from the undefined layout starts each subresource there. Fixes #3489.
This is the starting state only. Barrier states still follow the order the title records its lists, not the order the GPU runs them (#3094; KDenKC's submit-time series, #3559 / #3599); that series needs each texture's creation state for its first move, which this record gives.
What is in it (one commit, on
mainc53e9696)crates/xcl/src/hle/d3d12x/barrier_groups.rs:LASTis the one record per texture. Each of its two planes (colour or depth, stencil) isAll(state),Each([state per subresource])when the plane's subresources differ, orUnknown;applymoves it, in order, and makes a planeAllagain when its subresources agree.note_createdseeds both planes at creation, whether or not the title has used barrier groups yet (most render targets and depth buffers are made at load, before the first group); buffers are not recorded.Barriercall, a barrier starts where the barriers before it in the call left the texture.END_ONLY), so the PC list gets both.legal()and the depth UAV park (pc_state). A move the PC would refuse is not recorded, and neither are the moves a refused transition stands for (same texture and subresource); the texture's other moves are.ResourceBarriercall (the title's own, and the ones made of a barrier group) are recorded together (note_legacy_states), under one lock per texture, so a recordforgetremoved on release is not put back.device_x.rs,real.rs:note_createdat the creation points that calldepth_uav::note_created, theCreatePlacedResourcethe PC accepts on the first try, display targets made through the layout form ofCreateCommittedResource(#127),CreateReservedResource/CreateReservedResource1, andCreateCommittedResource1/2andCreatePlacedResource1(creator!, from their initial-state argument).list_x.rs:resource_barrier_xhands a call's transitions tonote_legacy_statestogether.sharded.rs:Sharded::update, a change of a value that is there, under its part's lock (nothing is made when there is none).a_texture_is_tracked_from_creation_through_legacy_and_group_barriers_to_release(WARP textures through the creation, legacy, barrier-group and release hooks: creation before any group, a legacy move first, depth then stencil, release and reuse of the pointer, a compute list's legal state recorded and a refused move not, a 2-level D24S8 depth plane moved by a group one word per level, a legacy move of one level followed by a group that moves each level from where it is, and a group with one level's move refused and the other's sent),each_subresource_keeps_its_own_state_until_a_plane_is_in_one_again,a_barrier_starts_where_the_one_before_it_in_the_same_call_left_the_texture,the_halves_of_a_split_barrier_from_the_undefined_layout_start_at_the_same_state,an_update_changes_only_a_value_that_is_there, and the updateda_new_texture_leaves_the_undefined_layout_from_the_state_it_was_made_inandthe_undefined_layout_moves_nothing_and_is_left_from_where_the_texture_was.The diff is +442/-142, about half of it tests; the record and its tests are one change.
Tested
NVIDIA GeForce RTX 3090 24 GB (driver 621.40), Intel Core i5-13600K, 32 GB, Windows 11 build 26300, Rust 1.100.1; debug for the suite, release for the title runs.
cargo test --workspace --no-fail-fast -- --test-threads=4on8bd724ee, with Windows' own D3D12 (XCL_D3D12_DIRset to an empty folder, see below): 3011 passed, 0 failed, 52 ignored; SKIPPED: 26 (22 no wave64 on this 32-lane GPU, 2 no xgameruntime.dll, 2 no heap windows). Onf6ef500dand1e702297: 3009 passed, 2 failed, the 2 being one test counted twice,gpu_two_pass_cache_e2e::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs(#3441), which fails 3 of 6 runs onmainc53e9696on this card and is fixed by #3185.cargo test -p xcl --lib barrier_groups: 13 passed.With the Agility SDK 1.620 in
%LOCALAPPDATA%\XCL\D3D12, the lib test binary did not finish on this machine on the earlier base0d61b2c2either (the #3488 stop, "sparse upload preparation still failed after bounded retries"); not caused by this PR.Debug-layer runs of the retail title (on the earlier head
b948e19dandmain493dbd3d, 300 s, Agility SDK 1.620, same input script; XCL logs the first 8 messages of each id).mainended at 121 s with an access violation ind3d12.dllunder the debug layer, so the table compares the first 121 s:main493dbd3db948e19dThe
b948e19drun went on to 300 s and, after the loading screens, logged six more 538s thatmaindid not reach. Not rerun on this head.Regression run
main:
this PR:
Not tested
8bd724ee); the table above is fromb948e19d.smoke.ps1sends no input); the title uses barrier groups there already.ResourceBarriercall, oneGetDescand insert per texture made, a small array for a plane whose subresources differ) beyond the smoke run.CreateCommittedResourcewith the console's layout, reserved resources, theCreatePlacedResourcethe PC accepts on the first try, and thedepth_uav/device_xplacement points): they take the console's descriptors and need the title.CreateCommittedResource1/2andCreatePlacedResource1are tested through the hooked device (the_device_hooks_record_a_texture_made_through_create_committed_resource1_2_and_create_placed_resource1, WARP).AI use
b948e19dand this update were made and posted by Claude Code while I was away, under the standing approval I gave it for this session.🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by Gevroska on 2026-11-30T15:43:16Z.
@afpruivo I found a creation-order case on
94c9514dthat the current test misses. I ran the same firstUNDEFINED → RENDER_TARGETbarrier on two synthetic textures created inCOMMON. The result depended on when I created the texture:LASTstill recordedRENDER_TARGET.COMMON → RENDER_TARGETtransition emitted.The creation hook only starts recording initial states after the first batch has been counted. The existing test seeds the creation state directly, so it covers the second case. Could you add a regression that calls the creation hook before processing any barriers?
I reproduced both outcomes in two fresh Windows CPU test processes using the state-tracking and translation functions extracted from the PR head. I didn’t run this through D3D12 or establish that the textures in #3489 were created in that order.
I used Codex GPT-6.2 Sol to build and run the fixture. A separate GPT-6.2 Sol agent reviewed the source and results. Codex GPT-6.2 Astra drafted this comment.
I reviewed and approved this comment before posting.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T03:35:37Z.
Following the creation-order reproduction, I traced two more ways the starting state is lost on head
94c9514d:COMMON, then an all-subresource legacy barrier moves it toCOPY_DESTbefore the first texture-barrier batch, both hooks return whileCOUNTS[0] == 0. The first groupUNDEFINED → RENDER_TARGETtherefore emits noCOPY_DEST → RENDER_TARGETtransition. Moving the counter increment earlier cannot recover the state already discarded.CREATEDwhenLASTis absent. A later all-subresource legacy transition only restoresCREATEDif it already exists, so the now-known whole-resource state remains untracked. Also, after a first depth-only group,start_statesselectsLASTwholesale; its unset stencil plane does not fall back to the creation state.Please track each texture's initial state from creation through final release, independent of the statistics counter. Preserve the state of each untouched plane, and let a whole-resource legacy transition reestablish a known state after a partial one. A single per-resource record seeded with both planes would keep those updates together;
forgetmust remove it on release. A lifecycle regression should exercise the actual creation, legacy, group and release hooks, including creation before the first group, partial then whole legacy transitions, depth then stencil, and pointer reuse. The current test supplies the starting state directly, so it misses these paths.This is a source trace; I did not run a new GPU or title test. AI use: Codex (GPT-6.2 Sol) traced the calls and drafted this note; Codex (GPT-6.2 Astra) independently checked the lifecycle.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:42:57Z.
Review (head
94c9514d, diff read, not a merge-check; draft, so not built or run):note_createdreturns whileCOUNTS[0]is 0 (barrier_groups.rs~283), and that counter only goes up at the end of the first barrier-group call (~458), so for render targets and depth buffers made at load a barrier from undefined still sends nothing. The unit test seeds the state map directly, so it doesn't cover the gate. (The gate exists soforget, gated the same way, drops every entry; recording unconditionally and forgetting unconditionally would fix both.)[Some(a), None](~427), so a later stencil-only barrier from undefined still sends nothing; a per-planelast[p].or(created)would fix that.real.rs~4469 without being recorded (consistent withdepth_uav, but it's left out).layout_state, which doesn't clash since this stores the PC's actual creation state.Fine: the last-moved state still wins,
forgetand pointer reuse are handled, legacy full and partial transitions are kept in step, the smoke runs are within limits, and AI use names the model.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 Foniass on 2026-12-01T10:09:45Z.
Triage (#1607) – head
0d61b2c#3558 works on the same barriers (#3489) differently: it sends moves from the undefined layout as enhanced barriers with no before-state (opt-in
XCL_BARRIER_UNDEFINED_NATIVE), while this PR starts them from the texture's creation state. These are different approaches, not duplicates.barrier_groups.rs::note_creatednow records the creation state of every texture whether or not the title has used barrier groups yet, so render targets and depth buffers made at load are covered, andforgetdrops the record unconditionally.0d61b2c2also counts and logs barriers from the undefined layout that ask for a discard, which XCL does not send.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 afpruivo on 2026-12-01T10:31:17Z.
Thank you @Gevroska, @thehollowedone and @Foniass. All of your points held up against the code, and the new head
0d61b2c2(rebased onmain493dbd3d) addresses them:forgetalways drops it. The new WARP test creates a texture before any group and fails with the old gate (no transition instead ofCOMMON → RENDER_TARGET), as in Gevroska's reproduction.CREATEDis gone;LASTis seeded on both planes at creation, so a stencil-only barrier after a depth-only one starts from the creation state.CreatePlacedResourceaccepted on the first try (Foniass): recorded now (buffers are skipped).a_texture_is_tracked_from_creation_through_legacy_and_group_barriers_to_releaseruns creation, legacy, barrier-group and release calls on WARP textures, including pointer reuse.On the title (RTX 3090, debug layer, 300 s): the draw and the depth clears in COMMON and the RENDER_TARGET-vs-COMMON 527 that #3489 reported are gone in both runs of this head. ClearRenderTargetView in COMMON still happens later in loading; a run that logged barriers finding no record of their texture logged none, so those are recorded textures in a different state on the GPU: the recording-order limit KDenKC's submit-time series is for, plus per-level moves. Numbers in the description.
The run also showed the title asks for
D3D12_TEXTURE_BARRIER_FLAG_DISCARDon most of its moves from the undefined layout, which XCL does not send; that is outside this PR.AI use: Claude Code (Claude Opus 5.5) wrote the change, ran the tests and the runs, and drafted this reply; I checked each point.
Imported from ivall/xcl. Originally posted by Aniseto on 2026-12-01T10:43:19Z.
Ran the
barrier_groupstests at0d61b2c2on an NVIDIA Blackwell desktop part with 16 GB of VRAM. The PR is a draft; this is a synthetic check of its test group only.Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build,
XCL_ADAPTER=NVIDIA, detached worktree at the exact PR head, no local patches.All 11 tests pass here, the same count as the description, including the creation-to-release tracking case and the partial-then-whole legacy move case. The description's WARP fixtures and title runs were not repeated.
Not tested: the full workspace suite, a retail title, the debug-layer 538/527 symptom, WARP as a separate device, AMD adapters, Wine, release profile, game data.
AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T12:30:35Z.
merge-check
base:
493dbd3dd0head:
0d61b2c268merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2903 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 (+195/-17). It fixes #3489: textures are now recorded in
barrier_groups::LASTfrom their creation state, so a texture whose first move is a legacy barrier leaves the undefined layout correctly. All three earlier reviews are addressed: textures made before the first barrier group are recorded, both planes are seeded, a whole-texture legacy transition sets a known state again,forgetalways drops the record, and the placed resource accepted on the first try is recorded. Findings: (1) A diagnostic is bundled in.note_discards, theFROM_UNDEFINEDcounters,Texture.flagsand default-on info logs (barrier_groups.rs~126-127, ~429, ~476-513) are unrelated to #3489; CONTRIBUTING puts diagnostics in their own PR. (2) New default-path cost for every title.note_legacy_state(~307-311) used to return at once whileCOUNTS[0] == 0. Now every legacy transition does aLAST.getand aLAST.insert(two shard locks), every texture creation aGetDescand an insert, and every barrier-group call runs the discard diagnostic. The smoke below is capped at 60 presents per second, so it can't show a small per-barrier cost. (3) Not covered: the title'sCreateReservedResource(1)textures are still not recorded (real.rs~4638). The WARP test callsnote_createddirectly, so a wrong state at any of the 7 real creation hooks (real.rs~3930, ~4487, ~4527, ~4568;device_x.rs~1293, ~1317, ~1336) wouldn't be caught. Fine:place_console_texturegoes throughcreate_placed_resource_x,vram::placemakes fresh resources, and the reserved pool reuses only textures whose final state matches the new creation state. #3558 handles the same barriers another way (opt-in) and the two compose. #3559's harness makes its WARP textures with plainCreateCommittedResource, so its workaround stays needed unless it callsnote_created.performance: 60 s smoke of a retail title, main
493dbd3dvs this merge (0d61b2c2): 1670 -> 1674 frames shown (100 %; last presents per 2 s: 60 60 60), peak commit 17083 -> 17254 MB, 0 device removals, 0 crashes. The first run of this merge lost the lib test binary to a misaligned-pointer abort that also hit an unrelated PR's run on a background thread, so it looks like a flake on main; this is the rerun. The discard diagnostic logged 2 lines at boot here.verdict: not yet: the discard diagnostic and its default-on info lines (finding 1) belong in their own PR; with that split out, the fix itself passes here. The per-barrier cost on titles that never use barrier groups (finding 2) is worth a note in the description
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 AAsobu on 2026-12-01T13:40:47Z.
merge-check
base:
b2b1f109d2head:
0d61b2c268merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2905 passed, 0 failed, 51 ignored; SKIPPED: 28 (22 no wave64, 2 no heap windows, 3 no D3D12 debug layer / d3d12SDKLayers.dll, 1 no GPU_UPLOAD heaps); failing: none. The PR's 3 tests ran and pass,
a_texture_is_tracked_from_creation_through_legacy_and_group_barriers_to_releaseon WARP (not skipped).review: read the whole diff (+195/-17:
barrier_groups.rs, thenote_createdcalls indevice_x.rsandreal.rs).LASTis now seeded at creation from every texture-creating path (placed GPU-owned / kept in step / own, committed, heap-placed, own memory) and kept on legacy transitions whether or not a barrier group came first, so a group's move fromUNDEFINEDstarts from where the PC texture really is; buffers are left out;forgetnow always removes. Findings: (1) as Foniass noted,note_discardsand its info lines are a diagnostic in the same PR as the fix; on this title it logged 25 lines in each 300 s run (bounded: the first 4, then at powers of two), e.g.render targets 5277/6412, depth 314/550, unordered access 10795/10795barriers fromUNDEFINEDasking for a discard, so it is cheap but belongs in its own PR. (2) Nothing in the diff makes the recorded state follow submission order rather than recording order (the description's own limit), which afpruivo's discard experiment on this head also points at.performance: retail title, in the world. Release builds of
mainb2b1f109(A) and this merge (B), runs A, B, A, B of 300 s,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. From world entry + 30 s: presents per 2 s A 0.83 / 1.05, B 1.03 / 1.08 (A1 was the first run of a new binary and still building driver pipelines); draws per 2 s A 3049 / 4287, B 3190 / 4088; peak process commit A 41,647 / 42,492 MB, B 41,124 / 42,134 MB; peak VRAM A 16,694 / 17,182 MB, B 16,507 / 17,108 MB; 0 device removals; skipped draws A 0 / 0, B 0 / 6. On screen (the user watched all four and took shots of the same scenes): no difference between A and B; one scene came out brighter in an A run than in a B run, but the same scene's brightness also changed between the two A runs, so I do not count it.verdict: not yet: the discard diagnostic (finding 1) should be its own PR, as Foniass asked; the fix itself passes here with no frame-time, memory or picture change on this title
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), results checked by me
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T11:18:27Z.
Code review location:
crates/xcl/src/hle/d3d12x/barrier_groups.rs; line 313legacy_movedkeeps one state per plane, so a legacy transition of one subresource (one mip or slice) moves the whole plane's recorded state, and this now runs on every texture from creation. A 4-mip render target made in COMMON gets a legacy barrier moving subresource 1 to COPY_DEST, so the record says plane 0 = COPY_DEST. A full-texture UNDEFINED->RENDER_TARGET barrier then sends one ALL_SUBRESOURCES COPY_DEST->RENDER_TARGET while mips 0, 2 and 3 are still in COMMON: 527, and those mips are never moved. That matches the PR's own leftover subresource-3 errors. Keeping per-subresource state, or dropping the record (back to untracked) when a single subresource moves, would avoid it.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T11:18:27Z.
Code review location:
crates/xcl/src/hle/d3d12x/barrier_groups.rs; line 298Not certain about this one: every non-buffer texture is now seeded with its creation state and moved by legacy transitions in recording order, but D3D12's implicit promotion and decay aren't modelled, so textures that used to be untracked (nothing sent) now get a definite but wrong before-state. A sampled texture made in COMMON and written by CopyTextureRegion on a direct list with no barrier is promoted to COPY_DEST (a write state, so it doesn't decay). A texture moved COMMON->COPY_DEST on a copy queue decays back to COMMON after ExecuteCommandLists. In either case the next barrier from UNDEFINED sends the wrong before-state (527), where before nothing was sent.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T11:18:27Z.
Code review location:
crates/xcl/src/hle/d3d12x/barrier_groups.rs; line 307Not certain about this one:
note_legacy_statereads with LAST.get and writes with LAST.insert, taking the shard lock twice, and it's no longer behind the COUNTS gate, so it now races withforget()and other recording threads. If thread A records a legacy transition and calls LAST.get, and thread B releases the texture soforget()removes the record, then A's insert puts back a record for a freed pointer. A texture later made at that address through a path that doesn't record (display target, reserved resource) inherits the stale state, and its first barrier sends a wrong before-state. Two threads on the same texture can also lose an update. An update-if-present under one shard lock would fix both.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T11:18:27Z.
Review: COMMENTED
Review of
0d61b2c2: 5 finding(s). 3 are inline. These are on lines outside the diff:crates/xcl/src/hle/d3d12x/real.rs:3848: Display targets made through the layout form of CreateCommittedResource (#127 ->create_display_target), and textures from CreateReservedResource/CreateReservedResource1, never callbarrier_groups::note_created, so #3489 isn't fixed for them. A title using barrier groups that creates its back-buffer targets with a barrier layout (#127, ALLOW_DISPLAY) goes throughcreate_display_target, which callsdev_create_committed_resourceand returns without recording. The first UNDEFINED->RENDER_TARGET barrier finds no record and sends nothing, so the PC texture stays in COMMON while the title draws into it: debug layer 538, then 527 on its next barrier. Recording in one place every PC resource creation passes through (the creator!/adopt(Kind::Resource) path) would cover these and any future path.crates/xcl/src/hle/d3d12x/barrier_groups.rs:423: Themovedclosure stores the state beforelegal()adjusts it (compute lists drop PIXEL_SHADER_RESOURCE 0x80, and DEPTH_READ is removed on non-depth textures), and it also stores transitions thatrefused()drops. So the record differs from what was actually sent to the PC, and the next barrier from UNDEFINED uses it. A texture made in COMMON gets UNDEFINED->SHADER_RESOURCE on a compute list: the PC receives COMMON->0x40, but LAST holds 0xC0. A later UNDEFINED->RENDER_TARGET on a direct list sends 0xC0->RENDER_TARGET while the texture is in 0x40, which is debug layer 527. Since every texture is now seeded at creation, this path runs for all of them. Storing the legalized state, and nothing for refused transitions, would fix it.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-02T14:11:57Z.
@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any.
Imported from ivall/xcl. Originally posted by afpruivo on 2026-12-02T15:22:02Z.
@bmjask thank you for the review. All five findings checked against
0d61b2c2; four were right and are fixed in the one commit, now7c10aff7(force-pushed; description updated):real.rs~3848): right.create_display_target(#127 with ALLOW_DISPLAY) andCreateReservedResource/CreateReservedResource1now callbarrier_groups::note_createdwith the PC state they were made in. I kept the calls next to the existing ones at the creation points rather than moving them all intocreator!/adopt, to keep this PR small; one place for all of them would be a good follow-up. No test of its own: those paths need the title; the smoke run goes through them.legal(), and refused transitions (barrier_groups.rs~423): right. Your compute-list case is now in the WARP test: UNDEFINED → SHADER_RESOURCE on a compute list sends0 → 0x40and records 0x40; a later UNDEFINED → RENDER_TARGET on a direct list sends0x40 → RENDER_TARGET. The moves are collected duringtransitions_ofand recorded after the legalising pass, with the samepc_state(legal state, or the depth UAV park) the words get; a texture with a refused transition in the call keeps its old record. The test fails with the old order.Tested on
7c10aff7: whole suite 2903 passed, 2 failed (one flaky e2e test counted twice, also flaky on the base), 51 ignored, 26 SKIPPED; smoke pair in the description (1591 vs 1494 frames, 17357 vs 16992 MB). The suite ran with Windows' own D3D12: with the Agility SDK 1.620 the lib tests do not finish on my RTX 3090, on the base as well; details in Tested.AI use: findings checked and fixes written with Claude Code (Claude Opus 5.5), checked by me.
Imported from ivall/xcl. Originally posted by afpruivo on 2026-12-02T15:22:03Z.
Code review location:
crates/xcl/src/hle/d3d12x/barrier_groups.rs; line 313Right, and it was the subresource-3 leftover in my own debug runs. A legacy move of some of a plane's subresources now leaves that plane unknown (
None) instead of moving it, so a later barrier from the undefined layout sends nothing for that plane, as for an untracked texture, until a transition of all of it; a plane with one subresource still takes the state. I chose this over per-subresource state to match #3599, which marks such a texture mixed and keeps today's behaviour.a_legacy_move_of_some_subresources_then_of_all_leaves_a_known_statecovers it and fails with the old rule.Imported from ivall/xcl. Originally posted by afpruivo on 2026-12-02T15:22:06Z.
Code review location:
crates/xcl/src/hle/d3d12x/barrier_groups.rs; line 298The cases are real, but I left them out of this PR. Before it, those textures were untracked and the barrier from the undefined layout sent nothing, which is also wrong (538 instead of 527), so this trades one error for another rather than adding one. Promotion and decay depend on when a list is submitted and on which queue, which a record kept in recording order cannot know; KDenKC's #3599 models decay at submission (
Queued::applywith a decay rule), and #3558 removes the before-state for these moves altogether. Listed under Not tested.Imported from ivall/xcl. Originally posted by afpruivo on 2026-12-02T15:22:08Z.
Code review location:
crates/xcl/src/hle/d3d12x/barrier_groups.rs; line 307Right.
note_legacy_statenow uses a newSharded::update, which changes the value only if it is there, under one shard lock, so a recordforgetremoved is not put back and two updates of one texture cannot lose each other.an_update_changes_only_a_value_that_is_theretests the helper; the race itself has no test.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T15:28:14Z.
Follow-up review (head
7c10aff7, since94c9514, diff read, not a merge-check):note_created(barrier_groups.rs~288) andforget(~327) no longer depend onCOUNTS[0], with a WARP test.created, ~281) and a group moves only the plane it touches, tested.CreatePlacedResourceand reserved resources not recorded: fixed (real.rs~4486, ~4653); the real creation hooks are still not covered by a test, as Not tested says.Texture.flags,FROM_UNDEFINED,note_discardsand its default-on info lines (~127, ~405, ~438, ~493-530) belong in their own PR.Sharded::update(~311), but every legacy transition still does a lookup and every texture creation aGetDescand an insert, unmeasured.New:
uav_barrier_xpasses the words fromtransitionstoresource_barrier_x(list_x.rs~5036), which callsnote_legacy_statefor each, and the new rule inlegacy_moved(~320) sets a plane to unknown for any single-subresource word when the plane has more than one subresource. A whole-plane barrier on a depth-stencil texture with mips or array slices (a D24S8 shadow-map array) goes out as one word per subresource, so the plane's record, just set at ~466, becomesNone; the title's next barrier from the undefined layout on that plane then sends nothing and the texture stays in its old state while depth is written into it, the #3489 case, whichmainand0d61b2c2handled. The tests use 1-mip, 1-slice textures and never send group words throughresource_barrier_x.Fine: refused transitions are left out of the record and the legalized state is recorded (the compute-list case is tested);
Sharded::updatekeeps a recordforgetremoved from coming back; reserved, display-target and first-try placed textures are recorded.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-02T15:45:26Z.
Review: COMMENTED
Review of
7c10aff7: 5 finding(s) (3 high, 2 medium), most severe first.Re-review at
7c10aff7. Display targets and reserved resources are now recorded, a partially moved plane becomes unknown instead of taking the subresource's state, and moves are recorded from the legalised word. That addresses the main points of my earlier review. The new deferred recording brings these:crates/xcl/src/hle/d3d12x/barrier_groups.rs:436: Barrier-group moves are now saved tomovesand written to LAST only after the whole call, buttransitions_of'slast()reads LAST in the middle of the call, so a later barrier on the same texture in the same ResourceBarrier call sta.... (inline)crates/xcl/src/hle/d3d12x/barrier_groups.rs:462: If any one transition of a texture is refused, every move for that texture in the call is dropped, yet its other transitions in the same call are still kept byretain_mutand sent to the PC, so the record stays at the old state while t.... (inline)crates/xcl/src/hle/d3d12x/barrier_groups.rs:320: A legacy transition of one subresource on a plane with more than one subresource always sets that plane to None (unknown), even when the title moves every subresource of the plane one at a time. (inline)crates/xcl/src/hle/d3d12x/barrier_groups.rs:225: see below.crates/xcl/src/hle/d3d12x/real.rs:4440: see below.On lines outside the diff:
Medium
crates/xcl/src/hle/d3d12x/barrier_groups.rs:225: A barrier from UNDEFINED whose plane is unknown (None) sends nothing but still recordsSome(after), which breaks the rule that a partially moved plane stays unknown until a transition of all of it. After a legacy move of mip 1 only to COPY_DEST (plane 0 None, PC with mip 0 in COMMON and mip 1 in COPY_DEST), a barrier group UNDEFINED -> RT sends nothing and records RT. A following UNDEFINED -> SR then sends RT -> SR with ALL_SUBRESOURCES while the PC texture is in COMMON/COPY_DEST (527). Keeping the plane None when nothing was sent would fix it.Medium
crates/xcl/src/hle/d3d12x/real.rs:4440: Textures made through CreateCommittedResource2 and CreatePlacedResource1 (plaincreator!hooks, real.rs:4440 and 4610), and any other creation path that doesn't callnote_created, still aren't seeded, so #3489 remains for them. A render target made with CreateCommittedResource2 in COMMON whose first barrier group is UNDEFINED -> RENDER_TARGET has no record, nothing is sent, and it's drawn into in COMMON (538).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-02T15:45:26Z.
Code review location:
crates/xcl/src/hle/d3d12x/barrier_groups.rs; line 436High: Barrier-group moves are now saved to
movesand written to LAST only after the whole call, buttransitions_of'slast()reads LAST in the middle of the call, so a later barrier on the same texture in the same ResourceBarrier call starts from the state before the call. With a texture recorded in COMMON and one call holding barrier A (RENDER_TARGET -> SHADER_RESOURCE, or UNDEFINED -> COPY_DEST) and then barrier B (UNDEFINED -> UNORDERED_ACCESS) on the same plane, B'sprevis still COMMON. The word sent is COMMON -> UAV while the PC texture is in SHADER_RESOURCE/COPY_DEST after A, which is debug layer 527/538. The old code wrote LAST insidemoved, and the test helperrunstill does, so the tests miss it. Keeping a per-call overlay thatlast()consults first would fix it.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T15:45:26Z.
Code review location:
crates/xcl/src/hle/d3d12x/barrier_groups.rs; line 462High: If any one transition of a texture is refused, every move for that texture in the call is dropped, yet its other transitions in the same call are still kept by
retain_mutand sent to the PC, so the record stays at the old state while the PC texture has moved. On a compute list, if barrier 1 moves T COMMON -> SHADER_RESOURCE (legal, sent, so the PC is now in 0x40) and barrier 2 moves T's other subresources to a render target (refused), T goes intorefused_resand the record stays COMMON. The next barrier from UNDEFINED sends COMMON -> X while the PC is in 0x40 (527). Dropping only the refused transition's move would keep the record in step.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T15:45:26Z.
Code review location:
crates/xcl/src/hle/d3d12x/barrier_groups.rs; line 320High: A legacy transition of one subresource on a plane with more than one subresource always sets that plane to None (unknown), even when the title moves every subresource of the plane one at a time. Before this PR the plane was set to
after. In a mip-generation loop that moves mips 0..N-1 one by one to UNORDERED_ACCESS, never ALL_SUBRESOURCES, the plane stays None. The next barrier group UNDEFINED -> RENDER_TARGET then sends nothing (the old code sent UAV -> RT), and the title draws into a texture in UAV: error 538. Tracking which subresources moved, and restoring a known state once all of them share one, would cover it.Imported from ivall/xcl. Originally posted by afpruivo on 2026-12-02T16:56:36Z.
@Foniass thank you, the new one was right, and it came from my fix for bmjask's per-plane point.
b948e19d(force-pushed; description updated).resource_barrier_xnow collects a call's transitions and records them together (barrier_groups::note_legacy_states): one of all subresources sets both planes; a plane is set when the call moves every subresource of it to one state; only a real partial move (some subresources, or several states) leaves it unknown. So a group's one-word-per-subresource move of a whole plane keeps the state the group recorded, and a title that moves each level of a plane in one call gets a known state too. The WARP test now has your case: a 2-level D24S8 texture, a depth-plane barrier group from the undefined layout (two words), those words recorded asresource_barrier_xrecords them, then a second group from the undefined layout: it sendsDEPTH_WRITE → SHADER_RESOURCEfor both levels; with the per-word rule of7c10aff7it sent nothing.a_legacy_move_of_some_subresources_then_of_all_leaves_a_known_statehas the all-levels and split-states cases.ResourceBarriercall, oneGetDescand insert per texture made). Listed under Not tested.Tested on
b948e19d:cargo test --workspace --no-fail-fast -- --test-threads=42904 passed, 0 failed, 51 ignored, 26 SKIPPED (with Windows' own D3D12, as in the description); smoke pair in the description.AI use: checked and fixed with Claude Code (Claude Opus 5.5), checked by me.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T16:58:15Z.
Follow-up review (head
b948e19d, since7c10aff7, diff read, not a merge-check):resource_barrier_xnow collects a call's transitions and records them together (note_legacy_states,list_x.rs~6455), andlegacy_moved(barrier_groups.rs~324-343) sets a plane when the call moves every subresource of it to one state, so a group's per-level words for a whole plane leave it known. The WARP test now sends a 2-level D24S8 depth-plane group through that path and checks the next barrier from the undefined layout starts atDEPTH_WRITE, and the unit test covers the mixed-state case.New: none.
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-02T17:24:16Z.
Code review location:
crates/xcl/src/hle/d3d12x/barrier_groups.rs; line 337High:
legacy_moved's whole-plane test requires every entry for the plane to have the final after state, rather than checking each subresource's last state, so two transitions of the same subresource in one call make the plane unknown even though it ends wholly in one state. A 1-mip texture (plane_stride 1) given ResourceBarrier with sub 0 COMMON->COPY_DEST and then sub 0 COPY_DEST->SHADER_RESOURCE (or a BEGIN_ONLY/END_ONLY pair) in one call getssome[0] = [(0,COPY_DEST),(0,SHADER_RESOURCE)],all(m.1 == last)is false, and plane 0 becomes None. The next UNDEFINED->RENDER_TARGET then sends nothing and the texture stays in SHADER_RESOURCE (538). Keeping only each subresource's last state before the test would fix it.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T17:24:16Z.
Review: COMMENTED
Review of
b948e19d: 1 finding(s) (1 high), most severe first.Re-review at
b948e19d. The points from my last review all look still open at this head: moves recorded only after the call (a later barrier in the same call starts from the old state,barrier_groups.rs~456), one refused transition dropping every move of the texture (~482), a plane moved one subresource at a time staying unknown so the next UNDEFINED barrier sends nothing (~341, error 538), an UNDEFINED barrier on an unknown plane recording a state it never sent (~228), and CreateCommittedResource1/2 / CreatePlacedResource1 still not recorded (real.rs~4439, ~4610). One new case:crates/xcl/src/hle/d3d12x/barrier_groups.rs:337:legacy_moved's whole-plane test requires every entry for the plane to have the final after state, rather than checking each subresource's last state, so two transitions of the same subresource in one call make the plane unknown even th.... (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 afpruivo on 2026-12-02T23:02:21Z.
@bmjask @Foniass thank you both. I checked each point of bmjask's review of
b948e19dagainst the code; all six were right. They share a cause: the record held one state per plane, so any move of part of a plane had no good answer. It now holds a state per subresource where a plane's subresources differ, so the fixes are one change. It is in the one commit, now504f4e14, rebased ontomainc53e9696(force-pushed; description updated).barrier_groups.rs~456): right.transitions_of'slastnow sees the call's moves so far (the record with the moves noted before it applied), soUNDEFINED→RENDER_TARGETthenUNDEFINED→SHADER_RESOURCEin one call sendsCOMMON→RT, thenRT→SR. Test:a_barrier_starts_where_the_one_before_it_in_the_same_call_left_the_texture.ALL_SUBRESOURCESword), and a move whose state after the PC refuses is never noted. WARP test: on a compute list, level 0 to RENDER_TARGET (refused) and level 1 to SHADER_RESOURCE in one group; the next group sends0: COMMON→RTand1: 0x40→RT.All(state),Each([state per subresource])orUnknown; a move of one subresource makes anAllplaneEach, and a plane whose subresources are in one state again isAllagain. A barrier from the undefined layout starts each subresource from its own state. WARP test: a legacy move of level 1 to COPY_DEST, then a groupUNDEFINED→RTsends0: COMMON→RT,1: COPY_DEST→RT; the group after it is oneALL_SUBRESOURCESword again.CreateCommittedResource1/2andCreatePlacedResource1not recorded (real.rs~4439, ~4610): right. Thecreator!wrapper records them from their fourth argument, the initial state. Not covered by a test (they are pass-throughs of the PC's own methods).each_subresource_keeps_its_own_state_until_a_plane_is_in_one_again.@Foniass, as promised: the discard diagnostic is out of this PR (
Texture.flags,FROM_UNDEFINED,note_discardsand its info lines). It will be its own PR once this one is settled. Default-path cost: unchanged in kind (one shard lock per tracked texture perResourceBarriercall, oneGetDescand insert per texture made; a plane whose subresources differ now keeps a small array). Still not measured beyond the smoke run, as Not tested says.Tested:
cargo test --workspace --no-fail-fast -- --test-threads=43009 passed, 0 failed, 52 ignored, 26 SKIPPED (with Windows' own D3D12, as in the description; one671f910, the same tree as504f4e14); smoke pair againstmainc53e9696in the description (1592 vs 1573 frames, peak commit 17151 vs 15794 MB, no removals or crashes).AI use: checked and fixed with Claude Code (Claude Opus 5.5) while I was away; posted by it under my account with my standing approval for this session.
Imported from ivall/xcl. Originally posted by afpruivo on 2026-12-02T23:02:28Z.
Code review location:
crates/xcl/src/hle/d3d12x/barrier_groups.rs; line 337Right, fixed in
504f4e14: moves are applied in order per subresource (apply), so the last state of each subresource counts and a 1-level texture moved COMMON→COPY_DEST→SHADER_RESOURCE in one call ends in SHADER_RESOURCE (unit testeach_subresource_keeps_its_own_state_until_a_plane_is_in_one_again). Details in the reply on the PR. (Claude Code, Claude Opus 5.5)Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T23:09:52Z.
Follow-up review of
504f4e14, sinceb948e19d(code reading only, not a merge-check) · 1 high, 1 mediumIn short: Since
b948e19dthe PR was rebased ontoc53e9696and its record rewritten:Plane::Each), or unknown;CreateCommittedResource1/2andCreatePlacedResource1are recorded;One new problem: a split barrier from the undefined layout now sends a begin half with no end half on a texture's first move.
High
A split barrier from the undefined layout sends
BEGIN_ONLYand neverEND_ONLY.transitions_of(barrier_groups.rs~203-233), the begin half (SyncAfter=SYNC_SPLIT) starts from the record, which is now the creation state, for exampleCOMMON. It sendsCOMMON -> RENDER_TARGETwithBEGIN_ONLYand records the move throughmoved(~496).UNDEFINED -> RENDER_TARGETlayouts. It reads the record, nowRENDER_TARGET, findss == a(~211) orbefore == a(~230), and sends nothing.mainan untracked texture got neither half.the_halves_of_a_split_barrier_are_the_pcs_begin_and_endonly covers explicit before-layouts.Fix: record a split move from the undefined layout on its
END_ONLYhalf, not itsBEGIN_ONLYhalf, so both halves start from the same state. Add a test of a split barrier from the undefined layout on a created texture.Medium
note_createddirectly. A wrong state or a missed record atreal.rs~3856, ~3931, ~4367 (the newcreator!hook), ~4494, ~4534, ~4575, ~4672, or atdevice_x.rs~1293, ~1317, ~1336, would not be caught. Not tested says so.Checked and fine
Texture.flags,FROM_UNDEFINED,note_discards) is gone.transitions, and again when its words pass throughresource_barrier_x, gives the same record, since each move sets an absolute state.Plane::Eachis indexed bysub % stride, with the stride fromGetDescat creation. A plane goes back toAllwhen its subresources agree.Sharded::updatecreates no record, so a legacy transition cannot undoforget. Tested.ALLword. The two-level compute-list case is tested.creator!hook reads the fourth argument as the initial state, which is right for all three methods.Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T23:13:42Z.
Review: COMMENTED
Review of
504f4e14: 2 finding(s) (2 high), most severe first.crates/xcl/src/hle/d3d12x/barrier_groups.rs:276:applyleaves aPlane::Unknownplane unknown after a move of one of its subresources, even when the plane has only that subresource (stride == 1) or when the moves together cover the whole plane, whereas the old code recorded a per-pl.... (inline)crates/xcl/src/hle/d3d12x/barrier_groups.rs:486: The refused-move filter removes every move in the call for the same texture and subresource, plus any ALL move of that texture (r.1 == ALL || m.1 == ALL), including moves from earlier barriers whose words were sent to the PC. (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-02T23:13:42Z.
Code review location:
crates/xcl/src/hle/d3d12x/barrier_groups.rs; line 276High:
applyleaves aPlane::Unknownplane unknown after a move of one of its subresources, even when the plane has only that subresource (stride == 1) or when the moves together cover the whole plane, whereas the old code recorded a per-plane state from any explicit move. Take a D24S8 depth buffer with nonote_createdrecord (e.g. made throughdev_create_committed_resource_xwithpc_full == None, or any creation path this PR doesn't hook) that the title moves per plane, DEPTH_WRITE->SHADER_RESOURCE on plane 0 and then plane 1.subresources()returns Some([0]) and Some([1]), andmovedreachesapply, but thePlane::Unknown => {}arm does nothing. Every later barrier from UNDEFINED on that texture then sends no transition, so it stays SHADER_RESOURCE on the PC while the title writes depth to it (debug layer 538/527). On main this worked. SettingPlane::All(after)for stride 1, and turning Unknown into All once every subresource has been moved, would restore it.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T23:13:42Z.
Code review location:
crates/xcl/src/hle/d3d12x/barrier_groups.rs; line 486High: The refused-move filter removes every move in the call for the same texture and subresource, plus any ALL move of that texture (
r.1 == ALL || m.1 == ALL), including moves from earlier barriers whose words were sent to the PC. If one Barrier call holds UNDEFINED->RENDER_TARGET on ALL (sent) and then a barrier on the same texture with an out-of-range subresource or a state the PC refuses,refused_atholds (res, sub) and them.1 == ALLclause drops the first, legitimately sent move. For a texture with no record yet, nothing is recorded, and the follow-upnote_legacy_statesusesupdate, which creates nothing. The PC texture is in RENDER_TARGET with no record of it, so the next barrier from UNDEFINED sends nothing (538 on draw). Removing only the moves that the refused word itself stands for (by barrier index, not by (res, sub)) would fix it.Imported from ivall/xcl. Originally posted by afpruivo on 2026-12-02T23:20:20Z.
@Foniass thank you, the split case was right.
BEGIN_ONLYand neverEND_ONLY: fixed in the one commit, now1e702297(force-pushed; description updated). Intransitions_of, a barrier from the undefined layout whose first half ends inSYNC_SPLITsends itsBEGIN_ONLYword from the record but does not record the move; theEND_ONLYhalf starts from the same state and records it. New testthe_halves_of_a_split_barrier_from_the_undefined_layout_start_at_the_same_state(a texture made in COMMON: beginCOMMON→RT, endCOMMON→RT, then the record is RT); it fails without the change (the record is already RT after the begin half).Tested on
1e702297:cargo test --workspace --no-fail-fast -- --test-threads=43009 passed, 2 failed (the #3441 test, counted twice; it fails 3 of 6 onmainhere, #3185 fixes it), 52 ignored, 26 SKIPPED; smoke againstmainc53e9696: 1495 vs 1573 frames, peak commit 16997 vs 15794 MB, no removals or crashes.AI use: Claude Code (Claude Opus 5.5) checked and fixed this and wrote the reply while I was away; posted with my standing approval for this session.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T23:22:21Z.
Follow-up review of
1e702297, since504f4e14(code reading only, not a merge-check) · 1 mediumIn short: This push fixes the High finding from my last review. For a split barrier from the undefined layout, the move is now recorded with the
END_ONLYhalf, not theBEGIN_ONLYhalf (transitions_of,barrier_groups.rs~203-212). Both halves therefore start from the same recorded state, and the PC list gets a matching begin and end. A test covers it. The creation-hook test point is unchanged.Medium
note_createddirectly. A wrong state or a missed record at thereal.rscreation hooks (~3856, ~3931, ~4367, ~4494, ~4534, ~4575, ~4672) or atdevice_x.rs~1293, ~1317, ~1336 would not be caught. Not tested says so.Checked and fine
BEGIN_ONLYand neverEND_ONLY. The wrappermovedskips the record whenflags == BEGIN_ONLY, only on the path from the undefined layout. A split barrier with an explicit before-layout still records its move as before.the_halves_of_a_split_barrier_from_the_undefined_layout_start_at_the_same_statechecks the begin half sends0 -> RENDER_TARGETwithBEGIN_ONLYand leaves the record at 0, and that the end half sends0 -> RENDER_TARGETwithEND_ONLYand recordsRENDER_TARGET.504f4e14.Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by afpruivo on 2026-12-02T23:33:01Z.
@bmjask thank you, both were right. Fixed in the one commit, now
f6ef500d(force-pushed; description updated).apply, ~283): right. A plane that is not known now becomes known one subresource at a time: a move of one subresource makes the planeEach, with the subresources not moved yet marked not known (they still send nothing from the undefined layout), and the plane isAllonce every subresource has been moved to one state. A one-subresource plane isAllat once, so a D24S8 buffer XCL saw no creation of, moved plane 0 and then plane 1, is known on both planes. Unit test ineach_subresource_keeps_its_own_state_until_a_plane_is_in_one_again.UNDEFINED→SHADER_RESOURCEon the whole texture (sent) and then a barrier from a render target on it (refused) in one group; the nextUNDEFINED→RENDER_TARGETsends0x40→RT. Without the change it sendsCOMMON→RT.Both tests fail without the change and pass with it.
Tested on
f6ef500d:cargo test --workspace --no-fail-fast -- --test-threads=43009 passed, 2 failed (the #3441 test, counted twice, as on the previous head), 52 ignored, 26 SKIPPED; smoke againstmainc53e9696: 1502 vs 1573 frames, peak commit 17034 vs 15794 MB, no removals or crashes.AI use: Claude Code (Claude Opus 5.5) checked and fixed this and wrote the reply while I was away; posted with my standing approval for this session.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T23:35:52Z.
Follow-up review of
f6ef500d, since1e702297(code reading only, not a merge-check) · 1 mediumIn short: This push tightens the record in two places. A refused transition now drops only the moves of the barrier it was made of: each transition word carries its barrier's index in its padding dword (word 7), cleared before the word is sent. Earlier, sent moves of the same subresource in the call were dropped too. And moving one subresource of a plane that is not known now makes that subresource known, while the others stay not known. Both have tests. The creation-hook test point is unchanged.
Medium
note_createddirectly. A wrong state or a missed record at thereal.rscreation hooks (~3856, ~3931, ~4367, ~4494, ~4534, ~4575, ~4672) or atdevice_x.rs~1293, ~1317, ~1336 would not be caught.Checked and fine
StateAfterinD3D12_RESOURCE_BARRIER.transitionsreads the index withstd::mem::take(&mut w[7])(barrier_groups.rs~482) for every word it keeps, so the PC list gets 0 there as before.moves.retainnow drops a move only when its barrier index and texture match a refused word and the subresource matches (or either isALL). The new compute-list case sends a whole-texture move, refuses a later render-target barrier on it, and records only the sent move.Plane::EachusesNOT_KNOWN(u32::MAX) for subresources not moved since the plane was unknown.offilters it, and a plane whose entries are allNOT_KNOWNgoes back toUnknown. A plane with stride 1 becomesAll(after)directly. The tests cover one subresource moved, the whole plane moved, and a depth buffer moved a plane at a time.Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by afpruivo on 2026-12-02T23:47:45Z.
@Foniass on the creation-hook point: a first test through the real hook is in, in the one commit, now
da071dc9(force-pushed; description updated).the_device_hook_records_a_texture_made_through_create_committed_resource1adopts a WARP device as XCL does, makes a render target throughreal::dev_create_committed_resource1in COPY_DEST, and checks that the record holds COPY_DEST on both planes. It fails with the hook'snote_createdtaken out (left: None). The other hooks (display targets, reserved resources,CreateCommittedResource2,CreatePlacedResource1, thedepth_uavpoints) are still not tested; Not tested says so.Tested on
da071dc9:cargo test --workspace --no-fail-fast -- --test-threads=43011 passed, 0 failed, 52 ignored, 26 SKIPPED; smoke againstmainc53e9696: 1511 vs 1573 frames, peak commit 16680 vs 15794 MB, no removals or crashes.AI use: Claude Code (Claude Opus 5.5) wrote the test, ran these and wrote this while I was away; posted with my standing approval for this session.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T23:50:12Z.
Follow-up review of
da071dc9, sincef6ef500d(code reading only, not a merge-check) · 1 mediumIn short: This push adds a test that goes through a real device hook. On WARP,
dev_create_committed_resource1makes a render-target texture inCOPY_DEST, and the test checks the record holds that state. That covers the newcreator!hook. The other creation hooks are still reached only throughnote_created. Nothing blocks it.Medium
CreateCommittedResource1is now covered. The others are not:CreateCommittedResource,CreatePlacedResource,CreatePlacedResource1,CreateCommittedResource2and the console placement paths atdevice_x.rs~1293, ~1317, ~1336. A wrong argument index or a missed record there would not be caught. The same WARP pattern would cover them.Checked and fine
the_device_hook_records_a_texture_made_through_create_committed_resource1skips throughskip_testwithout a WARP device and adopts the device before calling the hook. It readsLASTfor the new texture and callsforgetat the end, so no record is left for other tests.creator!hook reads.NOT_KNOWNsubresources, and split barriers from the undefined layout.Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by afpruivo on 2026-12-03T00:34:51Z.
@Foniass thanks. The device-hook test now covers
CreateCommittedResource2andCreatePlacedResource1too (samecreator!hook, aD3D12_RESOURCE_DESC1, made in SHADER_RESOURCE, a placed one on its own heap). It is in the one commit, now8bd724ee(force-pushed; description updated). The remaining paths (dev_create_committed_resource_x,dev_create_placed_resource_x, reserved resources and thedevice_xplacement points) take the console's descriptor layouts and run inside the title's state, so they are still only reached throughnote_created. Not tested says so.Tested on
8bd724ee:cargo test --workspace --no-fail-fast -- --test-threads=43011 passed, 0 failed, 52 ignored, 26 SKIPPED. Smoke againstmainc53e9696: 1668 vs 1573 frames, peak commit 17592 vs 15794 MB, no removals or crashes.AI use: Claude Code (Claude Opus 5.5) extended the test, ran these and wrote this while I was away; posted with my standing approval for this session.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T00:37:18Z.
Follow-up review of
8bd724ee, sinceda071dc9(code reading only, not a merge-check) · 1 mediumIn short: This push extends the WARP test to the other two methods of the
creator!hook:CreateCommittedResource2andCreatePlacedResource1(on an RT/DS heap). Each is checked to record the texture in the state passed as the fourth argument. All three hooks that the PR adds are now tested through the device. The older creation paths are still reached only throughnote_created. Nothing blocks it.Medium
CreateCommittedResource1/2andCreatePlacedResource1are now covered.CreateCommittedResource,CreatePlacedResourceand the console placement paths atdevice_x.rs~1293, ~1317, ~1336 are not. The same WARP pattern would cover the first two; the console paths need a placed resource throughcreate_placed_resource_x.Checked and fine
D3D12_RESOURCE_DESC1from the same 16x16 RGBA8 render-target desc. It creates the placed texture on a 1 MiBALLOW_ONLY_RT_DS_TEXTURESheap, which fits a render target, and checksPlane::All(SHADER_RESOURCE)for both new resources before callingforget.CreateCommittedResource1case from the last push is unchanged.Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by afpruivo on 2026-12-03T00:41:01Z.
@Foniass on the older paths: I tried the same WARP pattern on the console
CreateCommittedResource(dev_create_committed_resource_x) andCreatePlacedResource(dev_create_placed_resource_x) with a 2D texture. Both record the texture, and the placed one fails without itsnote_created(left: None). But which branch they take depends on process-wide state. The committed one went throughplace_console_texture, not the branch at ~3931, because the test binary may already have unified-memory windows open from other tests. So the test's coverage would depend on test order. I left those out of the PR rather than add an order-dependent test. They stay under Not tested. The plain PCCreateCommittedResource/CreatePlacedResourcemethods (thecreator!slots) record nothing themselves: XCL records at the console wrappers that call them.AI use: Claude Code (Claude Opus 5.5) tried this and wrote this while I was away; posted with my standing approval for this session.
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.