Kernel.X: preserve GPU texture data when a physical page moves from home (stacked on #1182) #2167
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2177"
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 Filip722 on 2026-11-25T07:53:49Z.
Stacked on #1182 at
5fa695050a0ccaa82298e45799224422f5e2781e. Only the top commit belongs to this PR. Request for a separate PR.A render target created at the address returned by
MapTitlePhysicalPages(NULL, …)could read stale pixels after the same physical page moved to a second address. A 128×128 RGBA8 readback on the RTX 5060 Laptop reproduced the problem in both directions while both textures were alive.What is in it
Tested
4522cc1a8b1347f+).5763f5a. Cross-address reads matched 0/16,384 patterned texels in each direction, while all direct reads and independent-page checks matched 16,384/16,384. With the original fixd3887f2, both directions and all controls matched 16,384/16,384. An independent native Windows tester reproduced this on an RTX 3080 Ti. Proton result · Windows result.244aa780, both alias directions, both direct checks and the independent target again matched 16,384/16,384 texels. All ten exact tests passed individually with one test thread and no reported skips. These included the new mapping lifecycle test, the parent’s updated sparse tile-accounting test and seven neighboring mapping cases.568e7dbran 20 executables, 1,148 passed, 6 failed, 46 ignored. The stacked PR ran 19 executables, 972 passed, 6 failed, 45 ignored. Its parent uses an older main revision with fewer tests. All harnesses completed. Both revisions failed the same six cases covering depth-buffer UAV flags, Opus and XMA2 voice playback, the synthetic title end-to-end test, PLS disk quota and predication.Regression run
Both clean checkouts ran their own
scripts/smoke.ps1against the same offline title for 15 seconds with independent Proton prefixes, an RTX 5060 filter and a 512 MiB coherent window. Wine returned 0 MB for the process commit measurement in both runs.Main
PR head
Not tested
Native Windows on this stacked revision, AMD and Intel adapters, and sustained world rendering. In a longer matched comparison of the earlier PR head and its home-mapping fix, both builds produced black native present-source samples before the external host-memory guard stopped them. Retail use of this specific mapping sequence remains unverified.
AI use
OpenAI Codex (GPT-6.2-Sol, high) wrote the fix and tests, ran them on this laptop, and prepared this PR.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T08:19:06Z.
Native Windows verification of 244aa780 stacked on #1182. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug.
Tested
cargo build --offline --locked --workspace -j 3passed.cargo test --offline --locked --workspace --no-fail-fast -j 3 -- --nocapture --test-threads=4reported 978 passed, 0 failed, 45 ignored. Separately, 23 runtime skip notices (18 no native wave64, three unsupported per-lane forms, one driver-cache toggle, one no heap windows).kernelx.rsfrom 5fa6950, keeping the fixture and parent changes.cargo test --offline --locked -p xcl --lib render_target_at_physical_page_home_inherits_texels_after_move -j 3 -- --nocapture --test-threads=1reported 0 passed, 1 failed, 0 ignored, 0 runtime skips. Both alias directions matched 0/16,384. Both direct writes and the independent texture still matched 16,384/16,384.Not tested
Retail load, memory savings, or other adapters. Synthetic inputs only.
AI use
Codex (GPT-6.2 Sol) ran the tests and control and drafted this report.
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-25T08:33:43Z.
Independent native Windows RX 6800M verification of exact stacked head
244aa780c9519e315725052958923d617eeac8bf(base568e7db7729c8fa6c8f0f4b32d798faaf11462bb, parent5fa695050a0ccaa82298e45799224422f5e2781e). Final worktree is clean.Environment: Windows 11 build 26200; Ryzen 9 5980HX; Radeon RX 6800M, driver
30.0.13002.13003; Rust 1.99.0 MSVC; DXC/DXIL 1.9.2609.5. For the GPU test executable I temporarily set Windows' per-app high-performance GPU preference; the test printedGPU: AMD Radeon RX 6800Min both control and fixed runs.Fixed head:
render_target_at_physical_page_home_inherits_texels_after_movepassed, 1/0/0, with no skip. The A and B direct reads, A-to-B and B-to-A alias reads, and independent-page control each matched 16,384/16,384 patterned texels.mapped_home_page_identity_follows_moves_and_partial_freesalso passed, 1/0/0 with no skip.Test-only negative control: I kept the current GPU fixture and replaced only
crates/xcl/src/hle/kernelx.rswith the parent commit's file, then rebuilt and ran the same GPU test on the RX 6800M. It failed, 0/1/0: A-to-B and B-to-A each matched 0/16,384, while both direct reads and the independent-page control still matched 16,384/16,384. I restoredkernelx.rs, rebuilt, and repeated the green RX 6800M result above. The control and fixed logs both identify the RX 6800M.Scope: Focused debug-build regression and mapping-lifecycle tests. I did not run the full workspace suite or a retail-title smoke on this stacked head; the test demonstrates the synthetic two-target alias sequence, not title-world rendering.
AI use: OpenAI Codex prepared the test-only control, ran the AMD tests, compared per-direction texel counts, restored the exact clean PR head, and drafted this report.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T15:39:37Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-25T16:27:39Z.
RTX 4060 Laptop / Wine integration verification of the top commit
244aa780c9519e315725052958923d617eeac8bf, applied on the updated #1182 (de4d1f676146ac58b4c11037bed9d0c1b5789d0c), rather than replacing it with the older stacked parent.This is a mixed local integration based on
06c9f5505f63f10c5ec49ef932d75b2c28177324, also including #867/#1395, #1069, #1916, #615 and #495. In particular, the port preserves #1916'sAway::sparse_homestracking and its free-time cleanup alongside the new explicit-home identities. This is not a clean-head result or a competing implementation. One obsolete test import was removed after extracting the shared readback helper.Environment: RTX 4060 Laptop 8 GiB, NVIDIA 590.48.01, i7-13620H, 16 GiB RAM; Linux 6.17.0-40-generic, Wine 11.0, stock/assert-enabled vkd3d-proton 3.2.0 (
2576c0b4adfae4a), DXVK 3.1.1-209; Rust 1.98.1 Windows MSVC cross-target. The GPU fixture printed the actual NVIDIA adapter, despite the configured DXGI vendor spoof.Focused tests:
cargo +1.98.1 test -p xcl --lib --target x86_64-pc-windows-msvc <filter> -- --test-threads=1 --nocapture, through Wine, withXCL_REQUIRE_GPU=mesh XCL_DEFER_PRIVATE_HOME_TILES=1:mapped_home_page_identity_follows_moves_and_partial_freesrender_target_at_physical_page_home_inherits_texels_after_moverender_targets_on_one_physical_page_share_its_video_memorya_page_away_moves_on_without_going_homea_page_whose_move_fails_stays_mapped_where_it_wasplaced_title_textures_share_vram_and_preserve_pixelsSix unique tests passed, no failures or skip notices. A→B and B→A each matched 16,384/16,384 patterned texels; both direct writes and the independent-page control also matched 16,384/16,384. Release build passed. After the test-only import cleanup,
cargo test ... --no-runcompiled without warnings. I did not repeat the already reported negative control or run the full suite.Bounded title check: retail 1.0.2.1, offline, Series S profile, saved first-run settings,
XCL_COHERENT_MB=3408 XCL_PSO_PRELOAD=1 XCL_DEFER_PRIVATE_HOME_TILES=1 XCL_PRESS_A_AT=40,55. Account picker and intro artwork rendered, with setup menus skipped. At 100.3 s, the external 7,200 MiB board-usage safety guard observed 7363 MiB and terminated the run (launcher exit 143). Minimum available RAM was 3620.8 MiB, free disk 13.307 GiB. No unhandled-exception or device-loss marker was recorded, but offline dependency errors and command-list resubmission warnings remained. This was a guard stop, not an observed out-of-memory failure; the run did not establish gameplay or stability.Not tested: retail use of this specific alias sequence, memory savings attributable to this fix, sustained world rendering, native Windows, clean PR head, or other GPUs.
AI assistance: omp / openai-codex/gpt-6-astra performed the integration, verification and report. Credit for the fix and fixtures remains with this PR's authors.
Imported from ivall/xcl. Originally posted by Filip722 on 2026-11-25T21:34:56Z.
I applied just this PR's top commit onto #1182 at
d165e20locally, keeping the parent's glyph-atlas test. The Windows MSVC debug build at local commit89802b3passed the home-address GPU readback under Proton Experimental 11.0-20261112 with vkd3d-proton4522cc1a8b1347f+on the RTX 5060 Laptop GPU. Both alias directions, both direct writes and the independent control matched 16,384/16,384 texels each.Under GE-Proton 11-14, the mapping-lifecycle test, the parent's sharing test and the glyph-atlas test each passed. The same home-address fixture stopped during the upload with
E_INVALIDARGon that runtime, before the readback. #1182 still conflicts with current main, so this test was on the updated parent branch. Codex (GPT-6) refreshed and tested the local stack.Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:40:17Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:31:44Z.
Triage (#1607) – head
244aa78Stacked on #1182 (still open); only the top commit
244aa78(mapped_homesinkernelx.rs) belongs here. Main has nomapped_homes.Draft #2706 carries the same commit inside a 7k-line archival integration branch, so it does not supersede this PR.
The lock order in
FreeTitlePhysicalPages(AWAY, then PHYS_BLOCKS) matches the mapper. The kernel test covers moves, an occupied home and partial frees.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 Filip722 on 2026-12-02T10:29:52Z.
Keeping this open. The home-address fix is still absent from main, and #1182 at
d165e20still conflicts with main in the page allocator. The top commit was already exercised locally on that parent (both alias directions matched all 16,384 texels under Proton Experimental, as reported above). Once #1182 has a main-compatible head, this PR can be restacked and the readback repeated without carrying a separate copy of the parent fix.AI use: Codex GPT-6.2-Sol High checked the current branches and drafted this status.
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.