D3D12.X: do not transfer target supersession to same-view aliases on release #3416
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3416"
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 Kalmarv on 2026-11-29T14:45:52Z.
What changed
same_view(new, old)helper incrates/xcl/src/hle/d3d12x/placements.rs(new.desc.format != 0 && new.va == old.va && new.desc.same_texels(&old.desc)) used by bothRegistry::placeandRegistry::release.Registry::release, excluded same-view aliases (!same_view(q, &old)) when searching for another live overlapping placement to inherit a released placement'ssupersededtarget list.hle::d3d12x::placements::tests::releasing_transient_overlap_remaps_target_with_same_view_aliascovering both creation orders (same-view SRV alias created before or after a transient overlap) and verifying that a second non-same-view overlap still keeps the target superseded without attaching the same-view alias.Why
Commit
2c2bce36excluded same-view aliases (e.g. a UAV target and a same-address/same-texels SRV view of it) from superseding each other inRegistry::place, butRegistry::releasedid not apply the same!same_view(q, &old)predicate when transferring a released placement'ssupersededlist to remaining live overlaps. As a result, if a transient different-layout placement overlapped a UAV target and its same-view SRV alias and was later released or removed,Registry::releasetransferred the UAV target's supersession onto the same-view SRV alias instead of remapping the target. That left the UAV target permanently unmapped (supersededby its own SRV view) until the SRV alias itself was destroyed.Tested
origin/main(3b6a91ed):cargo test -p xcl --lib placements::testsfailed atreleasing_transient_overlap_remaps_target_with_same_view_alias(left: [],right: [1], same-view SRV alias kept UAV target superseded).cargo check --workspace --all-targets: passed with 0 errors and 0 new warnings.cargo test -p xcl --lib placements::tests -- --nocapture: 14 passed, 0 failed.cargo build --workspaceandcargo build --release -p xcl: succeeded.cargo test --workspace -- --test-threads=4(on RTX 5070 Ti with DXC1.9.2609.5):xcl --lib2582 passed, 29 ignored, 4 failed (all 4 are the pre-existingorigin/main3b6a91edsplit-wave64 geometry test failures:gpu::dxil::geometry_tests::gpu_geometry_msg_gs_done_records,gpu::dxil::geometry_tests::msg_gs_done_emits_in_dxil,gpu::dxil::lower_geom::tests::gpu_epilogue_filters_oob_triangles_and_no_store_emits,gpu::dxil::lower_mem::stage_guard_tests::geometry_export_rejected);cargo test --workspace --exclude xcl -- --test-threads=4: 0 failed.xcl-smokeon NVIDIA GeForce RTX 5070 Ti:Baseline (
mainancestor):This PR:
Not tested
origin/main(3b6a91ed) geometry test failures listed above are untouched by this PR.AI use
Used an AI coding assistant to audit
crates/xcl/src/hle/d3d12x/placements.rs, write the causal regression test and fix, and run the build, test, and smoke verification steps.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:01:10Z.
merge-check
base:
d0832e614fhead:
85d7fe0cfamerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2891 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 (placements.rs, +58/-3). No correctness bug:
releasenow uses the samesame_viewexclusion asplace(same newer-then-older order, theformat != 0check on the newer placement only), takes no new lock, and still remaps throughsettle->map_again. Read against main, the test fails without the fix, and case 3 still covers a genuine overlap taking the supersession. Findings: (1) the description overstates the impact: on main a superseded target is already mapped again on its next barrier, copy or descriptor-table bind (note_use->use_again; bind.rs ~1333, list_x.rs ~7000, console_list.rs ~958), so it doesn't stay unmapped until the SRV alias is destroyed. It stays off the shared pages until the title next uses it that way, with the bind scan on meanwhile. (2) AI use names neither tool nor model. (3) Tested gives no SKIPPED count, and its 4 local failures differ from the 6 that fail in this PR's CI run. Those same 6 fail on main's own CI at the PR's base3b6a91ed, and the run here (above) is the check on current main. It merges cleanly alongside #3192, which touches other parts of placements.rs.performance: 60 s smoke of a retail title, main
d0832e61vs this merge (f9b98fe1): 1516 -> 1666 frames shown (109 %; last presents per 2 s: 60 60 60), peak commit 18133 -> 17220 MB, 0 device removals, 0 crashes.verdict: safe to merge (the description should name the AI model, add SKIPPED counts and narrow the impact claim)
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 bmjask on 2026-12-02T14:14:16Z.
@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any.
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.