Memory: defer private physical-home GPU tiles on NVIDIA #3123
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3123"
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 Prime1997 on 2026-11-28T11:51:39Z.
NVIDIA adaptation of CallMeBrado’s #1916, reviewed at
e2aa856010a637d33adc2cf8b49766da91574747. Physical-page storage writes can allocate sparse GPU tiles before a title exposes that home to the GPU.XCL_DEFER_PRIVATE_HOME_TILES=1defers this duplicate backing and queues the existing bytes when the home is explicitly mapped.This targets
nvidia-devdirectly; it does not replace the original main-targeted PR or import the separate physical-page release/alias-identity integration. Default remains off. This is not a global VRAM cap or a claim that the previous device removal is solved.What is in it
Tested
6330fba1f3d2cfcfebef82d3032b38639f0b175e.d54d80e1bc9d070cbec4a619abb5f4b89880b2f5compiled withcargo build --locked --release -p xcl --target-dir <isolated-target>: exit 0, 229.200 seconds. This is compilation of the combined candidate, not a build or runtime validation of this standalone PR. Zero tests executed; no GPU checks or smoke run.git diff --checkonly, at6330fba1f3d2cfcfebef82d3032b38639f0b175e.54225f5884a94cd23b7aab3f703a7c975070aa77; one commit, four files, 162 insertions / 28 deletions.Regression run
Not run. No smoke blocks or runtime test results are claimed.
Not tested
Build, fixtures, full suite, real-title behavior, NVIDIA/AMD hardware and actual memory savings have not been validated at this standalone head. Keep as draft pending validation.
AI use
Codex (GPT-6) adapted the existing contribution, inspected local SDK contracts, wrote fixtures and performed independent source review. Original behavior/design credit belongs to CallMeBrado’s #1916.
Optional contributor/test coordination: https://discord.gg/6B4TykyC4W
Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-28T12:06:44Z.
Failed interactive integration result for
d54d80e1bc9d070cbec4a619abb5f4b89880b2f5, containing this PR's change together with the other memory/removal repairs. This was not a standalone test of6330fba1f3d2cfcfebef82d3032b38639f0b175eand does not establish which change caused or prevented a symptom.0x887a0005(DEVICE_REMOVED); no external stop or automated inputs.0x887a0004(unsupported), so there is no reliable GPU fault location. System commit still had 34,764 MiB headroom at removal; no out-of-memory result was established.The private-home path was active, with capped CPU-backing samples reporting up to 2,007 MiB still private. Final sparse pools were 1,472 MiB capacity / 1,471 MiB mapped. These partial CPU snapshots are not measured VRAM savings or directly comparable totals. The mixed build and changed cache make this unsuitable as a controlled A/B measurement.
This run does not justify merge approval or a claim that RAM growth/device removal is fixed. Full standalone validation and matching main/head smoke reports remain outstanding. No builds or synthetic GPU tests ran during gameplay. Logs, hashes, counter samples and source/installed-data preservation checks are retained locally.
AI use: OpenAI Codex (GPT-6) launched the prepared candidate at the user's request, monitored existing logs and read-only counters, and prepared this report; a separate Codex agent reviewed the log evidence.
Optional contributor/test coordination: https://discord.gg/gK3y7WRRY
Imported from ivall/xcl. Originally posted by Gevroska on 2026-11-28T12:21:47Z.
I tested standalone head
6330fba1on Windows. The CPU testexposed_physical_home_is_never_made_private_againpassed. The native D3D12 testprivate_physical_pages_reach_the_gpu_on_mappingran without a skip and failed at the firstcopy_backbyte comparison. All 65,536 bytes in the first tile were0xDD, the fixture’s CPU overwrite pattern. The expected value was0xA7. The assertion stopped the test before it checked the other two tiles. Failing assertionThe fixture enabled
XCL_DEFER_PRIVATE_HOME_TILES=1andXCL_SPARSE_LAZY=1, withXCL_DS_KNOWN_WRITES=0. AfterMapTitlePhysicalPages,mapped_ranges()covered the three-tile interval and the pending count was zero. The tracker includes lazy entries that can still be waiting for GPU backing, and a zero pending count is also possible if no copy was submitted. The byte mismatch is reproducible evidence from this run; which stage produced it remains open. Tracker semanticsThis was a standalone fixture run on the Windows default D3D12 device. The log didn’t identify the adapter model. I didn’t run a retail title or establish a connection to the combined integration failure.
I used OpenAI Codex with GPT-6.2 Sol to run the tests and review the fixture. A separate GPT-6.2 Sol agent verified the saved results. GPT-6.2 Astra drafted this comment.
I reviewed and approved this comment before posting.
Imported from ivall/xcl. Originally posted by kole07139 on 2026-11-28T13:12:02Z.
Test report for head
6330fba1. It confirms @Gevroska's result on another NVIDIA card and suggests a cause.exposed_physical_home_is_never_made_private_againpasses.private_physical_pages_reach_the_gpu_on_mappingfails 3 of 3 when run alone, atsparse.rs:5305: the first tile reads0xdd(the fixture's CPU overwrite) where0xa7is expected. That is the same failure Gevroska saw.nvidia-dev,land_page(sparse.rs:1065) does not overwrite a 64-byte chunk that the CPU changed since it was last sent: "a chunk the CPU wrote since it was last sent keeps its (newer) bytes and goes up with the next look". The fixture writes0xddover the home with the CPU right beforereadback_after_execute, then expects the GPU's bytes in the same chunks. On this base the copy-back keeps the0xddchunks, whether or not the deferred bytes reached the GPU. So the test may need to check the GPU copy without a CPU write in between (or check that it is the newer CPU write that wins), rather than the deferral being wrong.Tested: NVIDIA GeForce RTX 3070 8 GB (driver 617.42, wave32), Intel i9-9900K, 32 GB RAM, Windows 11 Pro N 26200, rustc 1.99.0, DXC 1.8.2502.11, debug. Each head was tested alone, with its own target directory, on its base
nvidia-dev54225f58. The library tests were run ascargo test -p xcl --lib --no-fail-fast -- --test-threads=4 --skip a_refused_gpu_upload_segment_becomes_custom. That one test is left out because the library test binary stops at its fail-stop (0x7C10003), as throny reported on #3041, with or without this PR; alone it passes. On the base the same command gives 1771 passed, 6 failed, 28 ignored. The 6 failures (placed_title_textures_share_vram_and_preserve_pixels, threestream_recheck_*,d32s8_targets_take_their_own_size_of_video_memory,gpu_retire_queue_holds_heap_until_blocked_queue_passes_mark) are the base's own and are not repeated below.I also merged the four heads #3122–#3125 together on
54225f58(only README.md conflicts, plus the two new tests of #3123 and #3125 at the same place insparse.rs; both kept). On that treecargo test --workspace --no-fail-fast -- --test-threads=4gives: library binary stopped at the same fail-stop; the other test binaries 132 passed, 0 failed, 20 ignored. The library command above: 1779 passed, 9 failed, 28 ignored, that is the base's 6 plus the 3 named below.Not tested: a title run or smoke run of this head, a release build, AMD and Intel GPUs.
AI use: Claude Code (Claude Opus 5.5) ran the merges, builds and tests, and wrote this report.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-28T15:05:46Z.
@Prime1997 a whole-suite run of your head on an RTX 3090 against its base on the same machine: your new GPU test fails here; nothing else changes.
Tested:
6330fba1and its basenvidia-dev54225f58.XCL_*set.cargo test --workspace --no-fail-fast -- --test-threads=4 --skip uma_driver::tests::a_refused_gpu_upload_segment_becomes_custom --skip uma_driver::tests::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment --skip uma_driver::tests::failed_restore_stops_before_importing_an_unbacked_window(the three end the lib test binary on 621.24, at the base too): base 1,900 passed, 7 failed, 48 ignored; head 1,901 passed, 8 failed, 48 ignored.sparse::tests::private_physical_pages_reach_the_gpu_on_mapping.sparse.rs:5305,assertion left == right. The GPU read[221, 221, …](0xDD) where the test expects[167, 167, …](0xA7): it saw other bytes than the private page's.sparse.rs:5263,output.status.success().--exact … --nocapture --test-threads=1): 0 passed, 1 failed.exposed_physical_home_is_never_made_private_againpasses. The other 7 failures are the base's own on this VM (see #3122's report).Not tested: a title run with
XCL_DEFER_PRIVATE_HOME_TILES=1; a release build; other GPUs.AI use: an agent swarm: Claude Fable 5.2, Claude Opus 5.5, GPT-6.2-Sol and Gemini 4 Neon.
Imported from ivall/xcl. Originally posted by vasanex on 2026-11-29T02:04:38Z.
Test report for head
6330fba1on a 10 GB card (RTX 3080), with deferral off vs on in one binary, plus a test-only fix forprivate_physical_pages_reach_the_gpu_on_mappingthat makes it pass here. This is not amerge-check: no full suite, no merge onto currentmain.1. Deferral at the front end (#3211 E). One release binary of
6330fba1,XCL_DEFER_PRIVATE_HOME_TILESunset vs1, interleaved after one 420 s warm-up run;XCL_PREPARE=0, an empty data root, otherwise defaults; retail title in its front end, 150 s per run; values from XCL's ownmemory:lines (every 2 s).¹ pair 1 got a stray manual input (one button press each, at 82.7 s / 28.5 s); pair 2 had none. Both pairs agree on the pool and local video memory.
1b. Loading the save (A presses). Same binary, interleaved after a warm-up, a data root with a save, A pressed every 4 s, 600 s per run,
XCL_PREPARE=0, no other switches (so no system-memory pools). Every run stops presenting while loading, at 70–88 s, with local video memory far over the 9.3 GB budget. At the last presenting point:0x887a0006(hung) at 71.3 sSo while loading, deferral takes ~2.75 GB off local video memory (pool 3,072 → 320 MB) – far more than in the front end – but on 10 GB the title still does not reach a rendering world with either setting; both stay about 2.8 GB or more over budget. Peak commit is the same in both arms (38–40 GB in the runs that did not end early). One device removal, in an off run, under that overload; not enough to say more about it.
2. Why the GPU test fails, and a test-only fix (#3211 A). The test fails here as on the 3070 / 3090:
sparse.rs:5305, first tile0xDDinstead of0xA7. As @kole07139 suggested, it fails whatever the deferral does: the test reads the CPU home afterreadback_after_execute, andland_page(sparse.rs:1065-1080) only lands GPU bytes into a 64-byte chunk whose hash still equals the one last sent; the fixture's own0xDDoverwrite (5295) changes every chunk, so nothing lands and the home reads0xDD(also with no upload at all, or with the tiles still lazy). The fixture comes from #1916, whose base copied back unconditionally, so the 0xDD check made sense there.The change below reads the window natively after the test queue's fence (as #3211 A step 5 asks), and adds checks so that a pass means something: only the written pages are queued for their first upload, their tiles have video memory and were mapped by the refresh (not by the test's own flush), the unwritten middle tile stays lazy, and the CPU home keeps its bytes.
window_bytesnow uses the window that holds the address (its other callers use window 0, unchanged).Test-only diff (crates/xcl/src/hle/d3d12x/sparse.rs, +31/−7)
cargo test -p xcl --lib --release private_physical_pages_reach_the_gpu_on_mapping -- --exact …), noSKIPPED: the private pages' bytes (A7/ zeros /38) are in video memory at the first mapping on this card.title_textures::take_knownmade to drop the queued ranges (local, reverted), it fails (the first tile has no video memory). That shows a missing replay is caught; it fails at the video-memory check, one step before the byte comparison, so a wrong-bytes upload is not shown to be caught separately.cargo test -p xcl --lib --release sparse:: -- --test-threads=4, twice: head 73 passed / 1 failed (this test) / 1 ignored; with the change 74 / 0 / 1. (One parallel run showeda_tile_decommitted_and_committed_again_keeps_its_video_memoryfailing once; it passes alone on both trees and did not repeat.)This covers first exposure only. It does not touch the later-write discrepancy from the RTX 4060 report in #3211 (
0x5bCPU /0x00GPU), whichland_pagecannot explain.Tested: RTX 3080 10 GB, NVIDIA 621.40, Ryzen 9 7950X, 64 GB RAM, Windows 11 (26200), Rust 1.100.0, release.
Not tested: the full suite; a merge onto current
main(the head is onnvidia-dev54225f58); a rendering world (not reached on this base on 10 GB, see 1b); AMD; the later-write case; repeats beyond two pairs.AI use: Claude Code (Claude Opus 5.5) ran the runs and the tests, wrote the test change and wrote this comment; two further Claude agents reviewed the test change.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-29T02:20:55Z.
I checked recommit after moving an already-exposed physical page away at
6330fba1on RTX 5070, driver 616.92. Three fresh-process runs returned the new data from native GPU memory. This extends the RTX 3080 first-exposure check.The local test used one 64 KiB physical page with
XCL_DEFER_PRIVATE_HOME_TILES=1,XCL_SPARSE_LAZY=1, andXCL_DS_KNOWN_WRITES=0. It used the production physical-page APIs and texture refresh:(17*i + 0xA7) mod 256. Refresh and verify the sparse mapped ranges remain unchanged. Map the page at its home, refresh, fence, and read the mapped window with a nativeCopyBufferRegion.VirtualQuerythat the original home is now reserved and that its address is absent from the sparse mapped ranges.write_physical_pageswhile away, this time with(17*i + 0x5B) mod 256. Verify those bytes at the away address, map back to the original home, verify the CPU bytes, refresh, fence, and read the GPU window again.All 65,536/65,536 native bytes matched the first pattern on initial exposure and the second pattern after recommit in each run. Every byte differs between the patterns. Before either GPU copy the fixture required a concrete pool tile, no pending mapping for that home, and a completed queue fence. It issued no copy while the page was away.
This covers a full-page storage write while mapped away, followed by a normal refresh on remapping home. It leaves open the separate later-write case on an already-mapped home, the behavior of submissions that skip a write-watch scan, and retail memory usage.
AI-assisted fixture and verification.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-29T04:12:44Z.
Independent Windows check of head
6330fba1with current mainfa204595. I merged the two in a disposable worktree without committing, then ran the focused native tests on an RTX 3080 Ti (driver 621.35), Ryzen 7 9800X3D, Windows 11 build 26300.cargo check -p xcl --all-targetspassed on that combination.The existing
private_physical_pages_reach_the_gpu_on_mappingfixture failed on standalone PR head at its first-tile comparison (0 passed, 1 failed, 0 ignored, no skip). That result has already been independently reported above. On the current-main combination, its first tile passed but the middle-tile assertion failed: the middle remainsLAZYand has no GPU backing, soreadback_after_executeleaves the fixture's0xddCPU bytes there. With the middle expectation corrected toLAZY/0xdd, this test passed (1 passed, 0 failed, 0 ignored, no skip), including its populated last tile. This is a test-only correction in an uncommitted integration, not a standalone-head pass or a retail run.I also reproduced a separate protection-state problem on that combination.
commit_homescallssparse::committed(home, len)for the entire ready range when any page isCpuOnly. That marks an already exposed neighboring home writable again, clearing a recorded read-only 4 KiB page. A child-isolated regression usingAllocateTitlePhysicalPages,MapTitlePhysicalPages, XCLVirtualProtect, and a second map failed atexposing neighbor must retain prior protection(not_rwchanged from set to zero; 0 passed, 1 failed, 0 ignored, no skip). The path matters becauseknown_writablecan then give an affirmative answer for a protected page. Registering only the newly exposed private runs would avoid this particular overwrite; the fix also needs to preserve protection on a private home that was already read-only or no-access before exposure, and avoid reading such a page during replay. I have not validated a complete fix for those cases.Test-only candidate diff for the two reproduced boundaries
Commands:
cargo test -p xcl --lib hle::d3d12x::sparse::tests::private_physical_pages_reach_the_gpu_on_mapping -- --exact --test-threads=1 --nocaptureand the same command withexposing_a_private_neighbor_keeps_an_exposed_home_read_onlyas filter. The whole workspace suite, clean-commit paired smoke, other adapters, and a retail title were not run for this scratch combination. AI use: Codex (GPT-6.2 Sol) ran the checks and wrote this report; Codex (GPT-6.2 Astra) independently traced the protection and lazy-tile paths.Imported from ivall/xcl. Originally posted by vasanex on 2026-11-29T04:23:25Z.
How this was run: the suite ran once on the 11 of your PRs that build on this base, merged together (#3047 #3048 #3049 #3091 #3092 #3103 #3104 #3105 #3107 #3123 #3125; a local tree, only #3125 needed a resolution in README and the
sparse.rstest module); the base alone gave 2608 passed, 0 failed, 49 ignored with the same 27SKIPPEDlines (21 no wave64, 3 refused per-lane f16/f32 forms, 2 heap windows opt-in, 1 driver cache needs Developer Mode). This PR alone was merged onto the base, built (cargo build --workspace, then release), its modules' lib tests run (debug), and smoke-run once for 60 s (scripts/smoke.ps1, retail title, front end,XCL_PREPARE=0). The smoke numbers are for my local merged tree, not a clean-head block for the description.AI use: Claude Code (Claude Opus 5.5 and Claude Fable 5.2) ran the builds, tests and title runs, reviewed the diff and wrote this; the code points cited were checked against the merged tree.
Imported from ivall/xcl. Originally posted by lnqigr on 2026-11-29T13:36:42Z.
Independent RTX 4060 Laptop GPU check for #3211, on Windows 11 build 26300.9974, NVIDIA driver 610.88 and Rust 1.100.0.
Late CPU writes. On the exact parent
54225f5884a94cd23b7aab3f703a7c975070aa77and PR head6330fba1f3d2cfcfebef82d3032b38639f0b175ewith deferral off and on, I ran three fresh processes per configuration and write route (CPU pointer and storage helper). All 18 passed, 0 failed, 0 ignored, 0 skipped. A separate native GPU readback after the production queue submission and fence matched all 65,536 bytes of the middle page in every run. The earlier CPU/GPU mismatch did not reproduce.Read-only protection. I independently confirmed the reported protection regression on a local merge of
7a649b0e7341c1daf1bcf2f3101e9518a8a8c16fwith6330fba1f3d2cfcfebef82d3032b38639f0b175e. Clean main and the merge with deferral off each had 3 passed, 0 failed. With deferral on the merge had 0 passed, 3 failed. No skips or ignored tests in these runs. Windows retainedPAGE_READONLY, while XCL's tracker reported the page writable after the neighbor was mapped.Commands. Both fixtures were built in debug with
cargo test --offline --locked -p xcl --lib --no-run -j 4. The late-write fixture ran in the resulting test binary with--exact hle::d3d12x::sparse::tests::qualifying_late_physical_write_reaches_native_gpu_memory --nocapture --test-threads=1. The protection check ran withcargo test --offline --locked -p xcl --lib -j 4 hle::d3d12x::sparse::tests::exposing_a_private_neighbor_keeps_an_exposed_home_read_only -- --exact --test-threads=1 --nocapture. Both usedXCL_SPARSE_LAZY=1,XCL_DS_KNOWN_WRITES=0, andXCL_DEFER_PRIVATE_HOME_TILES=0/1as applicable.Not tested. No-access protection, the full workspace suite, retail smoke and AMD.
AI use. Codex (GPT-6) prepared the local fixtures, ran the tests and drafted this report.
@Prime1997 Are you already working on the protection fix? I can independently retest an updated head, or help prepare a patch if useful.
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-29T22:38:34Z.
merge-check
base:
beeb81be4b(mergeable cleanly on current main)head:
6330fba1f3merge: clean
build: cargo check -p xcl --all-targets -> ok
tests: non-GPU lib tests of touched modules (sparse 19 passed, title_textures 7 passed / 1 ignored, kernelx 52 passed / 1 ignored). Full workspace suite and hardware-sparse GPU test not run.
review: none blocking. Opt-in via XCL_DEFER_PRIVATE_HOME_TILES=1; per-page state is cleaned up on FreeTitlePhysicalPages and exposure is one-way.
performance: off by default. In a combined 600 s run with XCL_DEFER_PRIVATE_HOME_TILES=1 + XCL_TEXTURE_DROP_LEVELS=1 (#2968), local video memory dropped 2.3-2.6 GB (11.87-12.16 vs 14.19-14.76 GB), sparse tiles -1.5 GB, peak commit -3.0 GB (32,052 vs 35,016 MB), 0 removals, 0 crashes. Tested in a combined 600 s retail run on main
beeb81be+ 13 PRs (warm cache, defaults) vs baseline: presents/2 s 3.27 vs 3.29, peak commit 35,016 vs 35,767 MB, local video memory 14.19-14.76 vs 14.32-14.95 GB, 0 pipeline waits >= 1 s vs 5, 0 device removals, 0 crashes. Combined result across all 13 PRs, not isolated to this PR.verdict: not yet: full workspace suite and hardware-sparse GPU test not run.
hardware / tool and model: NVIDIA GeForce RTX 5070 Ti, driver 32.0.16.1074, AMD Ryzen 9 9950X, Windows 11 Pro 26200 / Claude Code (claude-opus-5-5)
Imported from ivall/xcl. Originally posted by bmjask on 2026-11-29T22:44:17Z.
Review: COMMENTED
Critical review of current head
6330fba1. Blocking correctness evidence: the new native GPU round-trip testprivate_physical_pages_reach_the_gpu_on_mappingfailed independently on multiple NVIDIA cards: the first tile returned the CPU overwrite pattern0xDDinstead of the expected earlier storage bytes0xA7(see test reports). The pure state test does not cover the write-watch/replay order that failed. Please resolve this at the exact standalone head and require that GPU fixture to pass with deferral on and off before promotion; the feature can otherwise expose stale/incorrect physical-home contents. No local GPU run.Imported from ivall/xcl. Originally posted by vasanex on 2026-11-29T23:00:22Z.
@bmjask one correction to the evidence, not to the conclusion that this is not ready.
The failing GPU test does not show stale physical-home contents.
private_physical_pages_reach_the_gpu_on_mappingfails with deferral off as well as on, because of what the fixture reads, not because of what the GPU holds:0xDDand then reads that home after the copy back.land_pageonly lands GPU bytes into a 64-byte chunk whose hash still equals the one last sent; the fixture's own overwrite changes every chunk, so nothing lands and the home reads0xDD. The fixture comes from #1916, whose base copied back unconditionally. (Cause suggested by @kole07139; details in my report.)mainthe first tile already reads right (main'sland_pagetakes a list's own GPU writes, #3149) and the test fails at the middle tile instead, which is lazy and gets no copy back – @thehollowedone has the same result (report).main+ this PR (diff in my report). So on this card the bytes on the GPU are the expected ones with deferral on.What does block it, in my reading: with the switch on, exposing a private page records already exposed neighbours as writable again (
commit_homes→sparse::committedfor the whole range), the regression @thehollowedone reproduced; plus the test needs to be replaced by one that passes for the right reason, and the description refreshed. That is what my merge-check says ("not yet").So "require the GPU fixture to pass with deferral on and off" is right, but with the corrected fixture; the current one cannot pass on
maineither way.Not tested for this reply: nothing new. The runs above are on an RTX 3080 10 GB (621.40), Ryzen 9 7950X, Windows 11 26200, heads as named in the linked comments. AI use: Claude Code (Claude Fable 5.2) wrote this from our earlier reports; read and posted by me.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:32:58Z.
Review (head
6330fba1, diff read, not a merge-check; draft, so not built or run):XCL_DEFER_PRIVATE_HOME_TILESswitch and design). Since #3203 put nvidia-dev into main, both target main, so a maintainer needs to pick one.54225f58, before #3203 and four later kernelx commits; it merges cleanly ontod0832e61but was never built there.private_physical_pages_reach_the_gpu_on_mappingwas never run, and there are no smoke runs.home_pages[&at](kernelx.rs~2125) would panic if an address in the run were missing from the map; impossible today (homes are 64 KiB aligned), but.get()would be safer since the line also runs with the setting off.Fine: with the setting off the calls are the same as main's. A home only becomes visible to the GPU through MapTitlePhysicalPages at its home, where the tiles are committed before the stored bytes are queued for upload after the copies home; exposure is sticky, freeing a page clears its entry, and the test covers writes an earlier write-watch look already consumed.
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 thehollowedone on 2026-12-01T05:59:59Z.
Updated consolidated check for #3123 head
6330fba1, test-merged onto maind0832e6. The original report's read-only failure still reproduces. An expanded test found a second failure: when the neighboring home is reserved,commit_homescallsVirtualAlloc(MEM_COMMIT, PAGE_READWRITE)over the entire range, which changes the already exposed neighbor fromPAGE_READONLYtoPAGE_READWRITEin Windows. When both homes are already committed, Windows keeps the protection, but the followingsparse::committed(home, len)clears its non-writable tracker bit. Both paths need correction.The local candidate commits only the reserved subranges, queries the resulting protection runs, and publishes their actual writability. It also serializes sparse-overlapping
VirtualProtect/ own-processVirtualProtectExwith physical-page mapping through the existingAWAYlock, so a protection change cannot be overwritten by a stale query result. Non-sparse protection calls avoid that lock. It validates all query spans before updating the sparse tracker and decommits newly committed spans if validation fails.Local verification — Windows 11 build 26300, RTX 3080 Ti / NVIDIA 621.40, Ryzen 7 9800X3D, rustc 1.99.1 MSVC, debug:
PAGE_READWRITEafter that call. With the complete local candidate, the expanded child-isolated test passes six cases (read-only, no-access, guard × adjacent home reserved/already committed) with deferral on and off: each parent invocation 1 passed, 0 failed, 0 ignored, 0 skips. Windows protection and the sparse non-writable bit agree in every case.cargo test --offline --locked -p xcl --lib hle::kernelx:: -- --test-threads=4: 67 passed, 0 failed, 1 ignored, 0SKIPPED.cargo test --offline --locked -p xcl --lib hle::d3d12x::sparse::tests:: -- --test-threads=4: 142 passed, 0 failed, 1 ignored, 0SKIPPED. This includes the previously proposed native GPU-readback correction to the PR'sprivate_physical_pages_reach_the_gpu_on_mappingfixture; without that test-only correction, the original CPU-home oracle still fails at the middle tile.cargo build --offline --locked --workspacepassed.git diff --checkis clean.Local candidate diff against the current-main PR merge
This is a tested candidate for the PR author, not a merge check. The full workspace suite, paired smoke, and a title-level performance comparison were not run. The sparse-overlap lock order was source reviewed; the query/protection race has not had a deterministic interleaving test. Alternate protection APIs that bypass XCL's
VirtualProtectwrappers are outside this candidate's coverage. #1916 still overlaps the feature and needs a maintainer choice.AI use: OpenAI Codex (GPT-6.2 Sol) prepared the candidate, ran the tests, and drafted this update; a Codex specialist independently reviewed the lock and tracker lifecycle.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T16:58:59Z.
Test report (not a merge-check: draft,
PR descriptionred)base:
b2b1f109d2head:
6330fba1f3merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2903 passed, 2 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: hle::d3d12x::sparse::tests::private_physical_pages_reach_the_gpu_on_mapping
review: not repeated here; my review of this same head is at https://github.com/xcl-dev/xcl/pull/3123#issuecomment-7301886911, and its findings stand. This run adds what reading couldn't: whether the change merges, builds and passes the whole suite on current main.
performance: no smoke run.
assessment: its own new test fails on this NVIDIA card:
hle::d3d12x::sparse::tests::private_physical_pages_reach_the_gpu_on_mapping(it runs itself in a child process, so it counts as 2 failures: the child, and the parent that checks it). The child's output in the log doesn't include the assertion message, so I can't say which check fails, only that the private physical pages don't reach the GPU on mapping here (RTX 5070 Ti, driver 621.14, Windows), which is the case this PR is for. Runningcargo test -p xcl --lib private_physical_pages_reach_the_gpu_on_mapping -- --nocaptureon an NVIDIA card would show it. The rest of the suite passes, and the findings in my review standhardware / 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 throny on 2026-12-01T18:18:30Z.
Closing as a duplicate of #1916: #1607 group D156, checked by oni-swr and Foniass, who both read the diffs and suggest keeping #1916. If something here is not in #1916, say so and reopen it, or ask and I will.
AI use: Claude Code (Claude Opus 5.5) ran the closing script.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T20:19:41Z.
Note on this closure: #1916 does not yet carry everything here. On current
main, unmap-only runs go throughkernelx.rscommit_homes_ahead(kernelx.rs:2118, called at :2620), which commits homes ahead and skipshome_again, so #1916's deferral never runs on that path. This PR'skernelx.rshunk (private_homeper page beforesparse::committed) handles it. My D156 check missed this and is corrected. #1916's rebase should take over that hunk; otherwise this PR should be reopened to carry it.AI use: Claude Code (Claude Opus 5.5).
Pull request closed