kernelx: with XCL_PAGE_ALIAS=1 the queue's page mappings show real pages #2308
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!2308
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2308"
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?
@adiologydev on GitHub · 2026-11-25 13:27 UTC · original
adiologydev:kernelx/page-mappings-alias→main· +1871 −19 · 10 files · 7 commits · openStacked on #2307 and on #1055; only the top two commits (
31fe59c,64ad64c) belong here.4f34c8dis #1055's commit (@Xeltax's, unchanged apart from one conflict with today'smaininVirtualFree: bothmirrors::released(a)andforget_title_mappings(a, n)kept). Fourth part of the plan on #1031.The queue's
CopyPageMappingsBatchXmaps pool pages into GPU views; on the console a GPU-view page then shows the physical page mapped at its pool page at the time of the call. #1055 decodes the calls and keeps a record of them. WithXCL_PAGE_ALIAS=1(#2307) the GPU view is a reservation of views, so the decoded mappings can be made for real.What is in it
31fe59ccrates/xcl/src/hle/kernelx.rs:mirrors::decode_batches– #1055's checked decoding, apart from its record (apply_batchesrecords as before). No change in behaviour.64ad64ckernelx/alias.rs,d3d12x/real.rs,kernelx.rs: with the switch, the queue method makes each GPU-view page a view of the physical page mapped at its pool page now, or unmaps it (kind 2, or nothing at the pool page), and bumps the GPU-view generation so textures there look again.title_texturesalready reads a texture at its own address when a physical page is mapped there. Without the switch the call is recorded as in #1055. Test: a page written through the CPU view reads back in the GPU view, one pool page at two GPU-view pages, a write in the GPU view uploads every view of the page, and a later change of the pool page leaves the GPU view on the page it was given.Tested
XCL_DXC_DIR), debug tests, release runs.cargo test --workspace -- --test-threads=4on64ad64c: 1118 passed, 4 failed, 26 ignored. The 4 failures aregpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3(CreateComputePipelineState→E_OUTOFMEMORYon this card, #1905);main568e7dbfails the same 4 here (1094 passed, 4 failed, 26 ignored). SKIPPED (23, the same onmain): 20 need 64-lane waves ("no wave64"), 3 per-lane f16 refusals inlower_dxil::tests::{f16,f32}_programs_on_the_gpu.XCL_PAGE_ALIAS=1, 300 s into its world: 256 calls by 170 s, 31 196 GPU-view pages mapped to a physical page, 3 137 unmapped, none pointing at an empty pool page; no crash or device removal (before, every one of these mappings was dropped).Regression run (the switch off, as the PR checks run it)
scripts/smoke.ps1 -Game <retail title> -Seconds 60, no input,mainfirst, same machine (each run'sxcl.exebuilt from a clean checkout of its commit):Not tested
AI use
31fe59cand64ad64c, the test and this description, and made the runs above on this hardware.4f34c8dis @Xeltax's #1055. I read every line of the diff and checked it.@SlopTart on GitHub · 2026-11-25 14:37 UTC · original
Wine/vkd3d-proton lane: this PR's own new test fails deterministically here, in both switch states, and with the switch on one pre-existing main test breaks on the branch too.
Tested: heads
31fe59c+64ad64c(branch64ad64ce) merged onto currentorigin/main(auto-merge, clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo targetx86_64-pc-windows-gnurun under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29). The branch carries its open ancestors (#1055 via4f34c8d, #2307, #2294, #2293) on top of main.Switch off (default):
gpu_suite 144 passed / 4 failed / 1 ignored. Three failures are this rig's known baseline (fuzz seed 1003 of #2115,gpu_nonfused_mad_and_mac_prevent_fma_contraction,gpu_depth_buffer_created_for_unordered_access_is_placed). The fourth is this PR's own test:hle::kernelx::alias::tests::the_queue_page_mapping_method_shows_the_pool_pages_physical_page_in_the_gpu_viewFAILED, 3/3 solo reruns (--exact --test-threads=1), panic atalias.rs:553:assertion left == right failed: a write in the GPU view: every view of the page is uploaded, left:[].Switch on (
XCL_PAGE_ALIAS=1): the same test still fails (both suite runs), and more does:a_page_mapped_into_two_spaces...,a_page_moved_outside_the_spaces...,pages_read_and_written_by_number...) plus this PR's queue-mapping test.gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes(a test that exists on plainorigin/mainand passes there with the switch off) FAILED on this branch with the switch on. Control: plainorigin/mainwith the switch on does not fail it. So the mapping-change semantics change somewhere in this stack, and that test's assumptions no longer hold underXCL_PAGE_ALIAS=1.The alias tests are in-process unit tests (finish in 0.03 s), and the failures are identical across reruns, so this does not look like timing flakiness; it looks like a real behavior gap for the physical-page-upload invariants on the Wine/vkd3d-proton lane. Whether the root is in the top two commits or in an unmerged ancestor layer I cannot separate from outside the stack; the queue-mapping test failure at least is in code this PR adds.
Not tested: native Windows CI (upstream CI presumably sees these green, so the delta is lane-specific); NVIDIA lane (parked); retail titles (no title data on this lane, counts only).
AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
@nnonno91 on GitHub · 2026-11-25 14:47 UTC · original
Native Windows check of exact head
64ad64ce6bcae6a0b5847b54c24ff12d12d5324bfor comparison with the Wine report.Tested
cargo test --locked -p xcl --lib hle::kernelx::alias::tests:: -- --nocapture --test-threads=1withXCL_PAGE_ALIASunset and1in separate processes gave 6 passed, 0 failed each. The new queue page-mapping test passed both times.gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changesand each adapter selected viaXCL_ADAPTER. On each adapter, unset gave 1 passed, 0 failed. With1, each gave 0 passed, 1 failed attitle_textures.rs:1287:fallback must be write-watched, before the readback. No ignores or skips. The runtime log confirmed both adapter selections.f30ca3f037e474fe1ca1720835313db161b36004when the switch is on. This isolates the test setup failure to the stack before the queue method change.Not tested
A mirror readback using an alias-aware fixture, Wine, retail smoke, and the full workspace suite.
AI use
OpenAI Codex (GPT-6.2 Sol) ran the checks, compared the two heads and wrote this report.
@thiagocalile on GitHub · 2026-11-25 16:25 UTC · original
Independent test and 60 s smoke report for head
64ad64ce6bcae6a0b5847b54c24ff12d12d5324bon an AMD Radeon RX 6600 (8 GB VRAM, RDNA2, native wave64).Tested
32.0.21045.29003,XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust1.100.0(stable-x86_64-pc-windows-msvc), DXC1.8.2502.11.XCL_ADAPTER=radeon cargo test --no-fail-fast -p xcl --lib -- hle::kernelx --test-threads=1: 62 passed, 0 failed, 1 ignored (0skipped), coveringalias,guards,sections,lazy, andmirrors.Regression run (
scripts/smoke.ps1 -Seconds 60, release builds,XCL_ADAPTER=radeon)main(06c9f55):PR
#2308(64ad64c):Default (
XCL_PAGE_ALIASunset):With
XCL_PAGE_ALIAS=1:Not tested: full workspace test suite on this head, NVIDIA/Intel GPUs, Linux/Wine, or world load past the 60 s smoke window.
AI use: Antigravity (Gemini 4 Neon) ran the builds, tests, and smoke runs and drafted this report; the account owner reviewed and approved posting.
@safesearch77 on GitHub · 2026-11-25 16:30 UTC · original
Reviewed
64ad64c(#2308, stacked on#2307) against#1031andmain(0829441).mirrors::decode_batchesmatches#1031's 24-byteBatch+ 12-byteRange(kind 0..=3, 64 KiB pages) layout cleanly, and the ~7 GB commit drop underXCL_PAGE_ALIAS=1is huge. Three edge cases worth flagging for texture streaming underXCL_PAGE_ALIAS=1:title_textures/sparsedirty tracking:Pin frameF,ExecuteCommandLists->guards::take_dirtyclearsPfroms.dirtyat the end of frameF. When the title callsCopyPageMappingsBatchXin frameF + 1to map that already-committed, already-filled pagePinto GPU-view addressat,alias::map_onecallsguards::watch(P, at)without markingatorPdirty.title_textures::recheck_source(e)(title_textures.rs:444-458) only checksmirror_source(e.va) != e.srcat byte0(e.va), so (a) replacingP1 -> P2ate.va(e.srcstayse.va) and (b) streaming high-res mip0ate.va + k * 64 KiB(k >= 1, since GFX10 places mip tails ate.vaand level0last) will not trigger a re-upload. Recording newly mapped committed views in adirty_viewsset emitted bytake_dirtywould catch both.note_gpu_view_mappingonly checkschanges.first()(real.rs:6188):0in a multi-batchCopyPageMappingsBatchXcall targets a non-mirror address (elsewhere) while a subsequent batch targets a GPU view,changes.first()misses theGPU_VIEW_MAP_GENbump. Checkingchanges.iter().any(|&(va, _)| mirrors::source(va).is_some())avoids that.in_spaceguard inalias::apply_page_mappings(alias.rs:320):mirrors::record(which skips!in_view(va)),apply_page_mappingscallsmap_oneunconditionally, so an out-of-space destination falls intomove_toand evictspageout of its section home intos.away. Skipping!s.in_space(dest & !(PAGE - 1))keeps parity withmirrors::record.AI use: Antigravity (Gemini 4 Carbon) assisted with tracing
CopyPageMappingsBatchX->alias->title_texturesdirty propagation; verified against the source by me.@DavidM1911 on GitHub · 2026-11-25 17:41 UTC · original
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!
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.