D3D12.X: keep PENDING accurate for shadowed entries in recheck_gpu_view_sources #1294
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1294
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1294"
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?
@b3IKK on GitHub · 2026-11-24 14:24 UTC · original
b3IKK:d3d12x/title-textures-pending-leak→main· +120 −18 · 1 files · 1 commits · openTablemaintains the invariant thatPENDINGcounts only active (by_res) entries withpending == true:Table::insertsubtracts 1 when moving a pending entry intoshadowed,Table::remove/retire_rangedo not subtract when removing a shadowed entry, andTable::removeadds 1 when uncovering a pending shadowed entry.recheck_gpu_view_sourcespreviously calledrecheck_source()on bothby_resandshadowedand incrementedPENDINGdirectly for both, permanently leakingPENDINGwhenever a shadowed GPU-view texture's source changed (both when later removed while shadowed and when uncovered and counted a second time), permanently disabling thedirty_len == 0 && PENDING == 0fast path inrefresh_once.This moves source rechecking into
Table::recheck_sources -> (changed, pending_delta)counting onlyby_resentries, and appliesdeltathroughadjust_pending(matchingTable::insert/Table::remove).What is in it
crates/xcl/src/hle/d3d12x/title_textures.rs: addTable::recheck_sources, return(changed, newly_pending)fromrecheck_source, and applypending_deltainrecheck_gpu_view_sources; add unit testrecheck_sources_keeps_pending_exact_for_shadowed_entriescovering both shadowed-removal and uncover-then-remove paths.Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 752 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2no wave64—gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware)cargo test -p xcl --lib recheck_sources_keeps_pending_exact_for_shadowed_entriesanda_lazily_mapped_page_in_a_gpu_view_is_its_own_source: both passRegression run
main:
PR:
Not tested
AI use
title_textures.rs, wrote the fix and regression test, ran the test suite andscripts/smoke.ps1regression runs, and drafted this PR description.@DavidM1911 on GitHub · 2026-11-24 14:33 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:Thanks!
@futurepro62 on GitHub · 2026-11-24 14:39 UTC · original
Full-suite run on NVIDIA and AMD to go with the subset check above. Tested exact head
554cf14(on its base930e8b4).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.recheck_sources_keeps_pending_exact_for_shadowed_entries.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-24 16:02 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib -- --test-threads=1: all passed, 0 failed, 21 ignored. (Parallel runs intermittently abort with 0xc0000005 — same harness flake seen on unmodifiedmain.)Thanks!
@thehollowedone on GitHub · 2026-11-25 10:55 UTC · original · edited 2026-11-25 11:49 UTC
Independent Windows run on 554cf14. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, debug.
cargo build --offline --locked --workspacepassed.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapturereported 752 passed, 0 failed, 41 ignored, with two wave64 skips included in Cargo's pass count.I extended the synthetic GPU mirror test in a scratch copy. Two committed D3D12 textures had independent GPU allocations and overlapping title-memory ranges. I mapped a new source while the older texture was shadowed, let the covering texture's uploads finish, then removed it. The restored texture read back 4,096/4,096 new pixels. The pending upload count was 0 → 0 → 0 before the map, while shadowed, and after the restored texture uploaded.
The same fixture on #1733’s 44089a2 left all 4,096 old pixels in place with counts of 0 → 0 → 0. Restoring the original pending update in that checkout refreshed all pixels and left the count at 0 → 1 → 1.
cargo test --offline --locked -p xcl --lib gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes -- --nocapture --test-threads=1passed 1/0/0 with zero fixture skips on #1294. Synthetic coverage only. AI-assisted. Codex (GPT-6, exact variant unavailable) extended the fixture, ran the tests, and drafted this report.Recheck after #2029 merged. I reran the same native RTX fixture on main at 1a0bbe3, then with each PR merged separately into that revision. Each run used the default streaming recheck setting and advanced no frames.
cargo test --offline --locked -p xcl --lib gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes -- --nocapture --test-threads=1passed with #1294. Main failed the pending-count assertion. #1733 failed the pixel assertion. Zero fixture skips. AI-assisted. Codex (GPT-6, exact variant unavailable) ran the comparison and drafted this update.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.