Memory: writes into a sparse window are checked without VirtualQuery #501
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!501
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-501"
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?
@mrp1no on GitHub · 2026-11-24 01:03 UTC · original
mrp1no:memory-sparse-writable→main· +257 −8 · 4 files · 1 commits · openTwo checks that a title's memory is committed and writable ask
VirtualQuery: the destination of every DirectStorage request (dstorage::writable, at enqueue and at execute) and, on a CPU without CLZERO, every emulated CLZERO line or loop (eh::is_writable, outside the coherent window).VirtualQuerysizes the committed run around the address by walking it to its end, and in a sparse window that run is gigabytes. The same walk was the cost #332 removed fromreadable, which does not cover these two checks. Related to #278 (theis_writableguards); #314 covers the coherent window only.In the retail title both run against the sparse windows all the time. A walk holds the process's address space while it runs, and the title's submit thread waits for it in
GetWriteWatch(title_textures::refresh_once, before each submit). The waits showed up as follows:GetWriteWatchtook 10–17 ms in the game and 3 µs in a standalone program.ZwGetWriteWatchand two threads inVirtualQuery:xcl-dstorageand a title thread in XCL's exception handler.writablemade 15,015 calls that took 101 s in 166 s (6.7 ms on average, at most 138 ms).sparse::known_writableanswers for a range in the sparse windows from their own record of commits. That record iscommitted/decommitted, which every commit and decommit path in a window already keeps: a page counts as committed when it is in a mapped tile and not a hole. The protection of the pages that are in the working set comes fromK32QueryWorkingSetEx, 64 pages a call, touching none, so a guard page keeps its guard. The title's own protections there are recorded too: itsVirtualProtectand a commit with a protection other than read-write mark the pages. A no-access or guard page leaves the working set, so the working-set check alone would miss it. Protections set before the device exists are kept with the early commits and marked wheninitreplays them. A page the record does not hold as committed and read-write, or one in the working set without a writable protection, still takes theVirtualQuerypath. The record can only answer yes.What is in it
Memory: writes into a sparse window are checked without VirtualQuery:known_writable,recorded_committedandresident_pages_writableincrates/xcl/src/hle/d3d12x/sparse.rs, called first bydstorage::writable(crates/xcl/src/hle/dstorage.rs) andeh::is_writable(crates/xcl/src/eh.rs).protection_changed(sparse.rs), called by theVirtualProtect/VirtualProtectExhooks andcommit_sparse(crates/xcl/src/hle/kernelx.rs); before the device it keeps the ranges inEARLY_NOT_RW, whichinitmarks after replaying the early commits, both under the state's lock.QUEUEis replaced before the state, as onmain):State::commit_rangeclears a page'snot_rwmark with its hole (a page committed again is read-write until the title says otherwise), andinitreplays the early commits through it. A tile taken back fromparkedcomes back as a new entry, read-write.recorded_committed_needs_every_page_in_a_mapped_tile_and_no_hole(whole tiles, a range across tiles, a hole, a tile with no video memory, a page the title made non-writable and then read-write again)resident_pages_writable_judges_the_pages_in_the_working_set(written, read-only and never-touched pages, and that asking leaves a page out of the working set) anda_protection_before_the_device_is_marked_after_the_early_commits; #532'sa_tile_decommitted_and_committed_again_keeps_its_video_memoryalso checks that a page made non-writable is read-write after the tile is taken back fromparked, and after a decommit and commit of that page alone in a tile that stays mapped (that check fails without thenot_rwline incommit_range).Tested
cargo test --workspace --no-fail-fast -- --test-threads=4on7c83557(rebased onmainc160d86, which has #532 and #968): 861 passed, 0 failed, 42 ignored over 20 test binaries. SKIPPED:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).2997c9aplus #203, #242 and #267, one A press at 40 s (XCL_PRESS_A_AT), 240 s, no timing code. These runs used the first form of this commit (c73b0c8); the protection record adds work only to the title'sVirtualProtectcalls:a6f5f7aplus the same PRs) with an earlier form of the change (the record alone, no working-set check): the one-pageGetWriteWatchwent from 10–17 ms to 1.7 µs (5,985 looks, 10 ms in all), and the look over the watched ranges from 38–52 ms per submit to about 4.5 ms.Regression run
scripts/smoke.ps1 -Game <game folder>(60 s), no input (the title stays at its first menus), release builds; main atc160d86, this branch's base.main:
this PR:
Not tested
AI use
GetWriteWatchprogram), the code, the tests and this description. The runs and tests were made on the hardware named above.🤖 Generated with Claude Code
@amirshaker000 on GitHub · 2026-11-24 01:32 UTC · original
Cross-vendor run of
c73b0c8on an RTX 3070 (wave32, Turing-class driver line), merged onto currentmain. This PR had no NVIDIA test report and only an Intel CPU, so this adds the GPU vendor and, on this CPU, theeh::is_writableemulated-CLZERO path is the same one your runs took.Tree:
main7ebf1b8(merge of #486, the current head) + this PR atc73b0c8, merged locally with no conflicts (3 files, +122). Control:main7ebf1b8on its own.Tested
x86_64-pc-windows-msvc, debug profile. DXC 1.8.2502.11 (dxcompiler.dll, Windows SDK 10.0.26100.0, picked by XCL's search order;XCL_DXC_DIRunset).cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4, both trees built and run the same way:main7ebf1b8(control)main+c73b0c8okby name:hle::d3d12x::sparse::tests::recorded_committed_needs_every_page_in_a_mapped_tile_and_no_hole,hle::d3d12x::sparse::tests::resident_pages_writable_judges_the_pages_in_the_working_set.gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64).On the code. Read the full diff.
known_writableanswers yes only when every page is inmappedwith no hole and no resident page has a non-writable or guard protection; everything else falls back toVirtualQuery, so it cannot say yes where the old path said no, except for a committed page outside the working set, which is the documented assumption. One shape worth knowing, not a defect:recorded_committedis one hash lookup per 4 KiB page underSTATE, so an emulated CLZERO loop over a large range is still linear in pages. Far cheaper than theVirtualQuerywalk it replaces, just not constant.Not tested
xcl-smokeblock to add to yours.GetWriteWatchfigure, only that the suite is green and the mechanism is as described.AI use: Kilo with GLM-5.4 ran the commands and drafted this report; I reviewed the diff and the numbers before posting.
@brothernog on GitHub · 2026-11-24 01:42 UTC · original
Tested
c73b0c8on an RTX 3050 (driver 610.88), Windows 11 Home 26300, Rust 1.100.0, debug.cargo test -p xcl --lib sparse: 15 passed, 0 failed, 1 ignored.One gap in the protection check:
resident_pages_writableonly judges pages with the Valid bit set, and a page that a title has protected usually doesn't have it. I added a temporary test insparse.rs(removed afterwards):VirtualProtected toPAGE_READWRITE | PAGE_GUARDand toPAGE_NOACCESS, plus a committed page set toPAGE_READONLYand never touchedresident_pages_writablereturnstruefor all three.The title's
VirtualProtectgoes straight through (hle/kernelx.rs:469), and the sparse record (committed/ holes) doesn't see it. So for a committed sparse page the title has guarded, made no-access or made read-only,known_writablesays yes wheremain'sVirtualQuerysays no:dstorage::writableaccepts the destination and thexcl-dstorageworker writes into it. That is an access violation in the worker, the same way the process ended in #476.eh::is_writablelets an emulated CLZERO write through the guard page. That is the #278 case, and #523 fixes it in theVirtualQuerywalk, but this fast path runs before that walk.I confirmed the first half (
resident_pages_writable) by running it. Theknown_writablepath as a whole I only read, since I didn't set up a sparse window for it. One way to keep the speedup: record a title'sVirtualProtecton sparse-window pages in the kernelx hook and haveknown_writablerefuse those pages, rather than inferring protection from the working set.This review was AI-assisted.
@mrp1no on GitHub · 2026-11-24 02:19 UTC · original
Thanks, confirmed: a title's
VirtualProtectto no-access or guard takes the page out of the working set, soresident_pages_writablenever saw it, and the record alone said yes.Fixed as you suggested, squashed into the one commit (now 81ef881). The kernelx
VirtualProtectandVirtualProtectExhooks (own process), andcommit_sparsewith a protection other than read-write, now mark the pages in the sparse record (not_rw). A read-write protection or a fresh commit clears the mark.known_writabledoes not answer for a marked page, so it takes theVirtualQuerypath as onmain. The case is inrecorded_committed_needs_every_page_in_a_mapped_tile_and_no_hole: a page made non-writable is refused, the rest of its tile is still answered, and the page is answered again once read-write.The suite and the smoke run on the new head are in the description.
Written with Claude Code, Claude Opus 5.5.
@Chrysana on GitHub · 2026-11-24 03:04 UTC · original
Test report for
81ef881on an AMD GPU (RX 9070 XT), which Not tested lists, on an AMD CPU that runs CLZERO natively (so only the DirectStorage check applies here, as the description says). No regression.Setup: AMD Radeon RX 9070 XT 16 GB, driver 32.0.32015.2008, Ryzen 7 9800X3D, 31 GB RAM, Windows 11 25H2 build 26200.9974, rustc 1.100.0
x86_64-pc-windows-msvc, DXC 1.9.2602.17. Retail title 1.0.2.1. Debug build for the tests, release builds for the runs.Tests:
cargo test --workspace --no-fail-fast -- --test-threads=4at81ef881: 678 passed, 0 failed, 41 ignored.SKIPPED: the two debug-layer tests (the D3D12 debug layer isn't installed here).Title runs:
scripts/smoke.ps1 -Game <folder> -Seconds 60withXCL_PRESS_A_AT=14,17,21, same saved state.81ef881is 22 commits behindmain, so it was also merged ontomain18c105a(clean, local merge2b97ae1, not pushed):main18c105a81ef881merged onto18c105a81ef881(its own base2997c9a, without #451: the intro video at ~5 fps)18c105athe title reaches its first menu a little later, so the scripted presses (last at 21 s) come too early and the runs stay in the menus. They cover the DirectStorage requests made there, not the video's streaming or the world load.mainalso has when it gets there.Regression run:
main:PR merged onto
main:PR head:
Not tested: the emulated CLZERO path (this CPU has CLZERO); the world load; the time spent in the check itself (no profile); Kalmarv's point about protections set before the device exists.
AI use: Claude Code with Claude Opus 5.5 built the commits, ran the tests and the title runs, read the logs, and wrote this report. The runs were made on my machine.
@mrp1no on GitHub · 2026-11-24 03:08 UTC · original
Thanks for the run on AMD and the mutations. Both points are fixed in the one commit, now 81c43fe.
protection_changedwith no sparse state now keeps the range inEARLY_NOT_RW, page ranges likeEARLY. A non-read-write protection adds the range and a read-write one takes it out; an early commit takes its pages out too, ascommittedclearsnot_rw.initreplays the early commits and then marks those ranges. It does both under the state's lock, so a commit or a protection on another thread cannot come between the replay and the state being there. (Before, the early commits were replayed after the state was published; a protection set in between could be cleared by the replayed commit.)committed's body is nowcommit_in, shared bycommittedand the replay. The record is covered by the new testa_protection_before_the_device_is_marked_after_the_early_commits.decommit_sub_tile_reclaims_pool_tile_when_all_pages_become_holes.Noted on the linear cost. Requests of about 250 MiB would cost what the walk did; I have not seen DirectStorage destinations that large here.
Thanks also to @Chrysana for the AMD runs (RX 9070 XT, native CLZERO): no change in frames or DirectStorage requests merged onto
main.The suite and the smoke run on the new head are in the description.
Written with Claude Code, Claude Opus 5.5.
@Kalmarv on GitHub · 2026-11-24 02:35 UTC · original · edited 2026-11-24 03:44 UTC
At
81c43fe(merged ontomain63cdc25as98cc9c9, clean withgit merge-tree): the gap in the first bullet below is fixed, and the suite is green. It needs a rebase ontomainf4ce27cnow: see the last point.81ef881(sparse.rsonly): a protection set with no sparse state is kept inEARLY_NOT_RW, an early commit takes its pages out, andinitreplays the early commits and then marks those ranges, all underSTATE.STATEis taken beforeEARLYandEARLY_NOT_RWat every site. Ran the new testa_protection_before_the_device_is_marked_after_the_early_commits: it passes, and withearly_protectionmade never to add a range it fails (left: []).init, or withcommittedno longer taking an early commit's pages out ofEARLY_NOT_RW, all three tests of the PR still pass.initneeds a device, so those two places are read, not run.main. #443 was merged after63cdc25(d852f9a), and81c43feconflicts withmainf4ce27cinsparse::init: both rewrite the line that installs the state. For the rebase:g.insert(s)drops a state it replaces under the lock, which is what #443 moved out of it (#344). The old state has to outlive the guard, for examplelet old = g.replace(s)anddrop(old)afterdrop(g).mainhas a test for that now,tests/sparse_reinit.rs. Read, not run.The report below is from
81ef881. Its timings, costs and four mutations were not rerun.Tested
81ef881merged ontomaincb868b2(clean withgit merge-tree) on an AMD CPU, which the description lists as not tested. The suite is green and the tests hold the code. One gap in the new protection record, read and not run.81c43fe, see above.protection_changeddoes nothing while there is no sparse state (sparse.rs:1366). Commits made that early are kept as page ranges only (EARLY), andinitreplays them throughcommitted(sparse.rs:553), so each of those pages starts withnot_rwclear. A page the title commits as no-access or guard, or protects, before it creates its device is answered yes byknown_writableonce the device exists, since such a page is not in the working set either. Keeping the protection with the early ranges would close it. Whether a title protects sparse pages that early I do not know.VirtualQueryat its start takes 8.9 ms (0.3 µs when asked 64 KiB before its end). A cleanGetWriteWatchover the GiB takes 1.2 ms alone and 13 ms while another thread callsVirtualQueryat the start. While another thread callsresident_pages_writableover 16 MiB of it instead, the look takes 0.5 ms: the new check does not hold it up. Another job was running on the PC; on the earlier headc73b0c8, with the PC quieter, the same test gave 4.7 ms, 0.70 ms, 7.0 ms and 0.48 ms.resident_pages_writable1.1 µs for 64 KiB, 8.3 µs for 1 MiB, 224 µs for 16 MiB, 5.5 ms for 256 MiB;recorded_committed189 µs for 16 MiB of mapped tiles, underSTATE. Both are linear in pages, as @amirshaker000 wrote: a destination of about 250 MiB would cost what the walk of the GiB cost. Only a note unless requests come that large.recorded_committedmade to ignore a tile's holes, or itsnot_rwbits, andmark_protectionmade never to set a bit:recorded_committed_needs_every_page_in_a_mapped_tile_and_no_holefails each time.resident_pages_writablemade to ignore a resident page's protection:resident_pages_writable_judges_the_pages_in_the_working_setfails. Neither test builds onmain(new functions), so the mutations are the control.81c43fe. The two tests went in between the doc comment "Sub-tile decommits (two 32 KiB halves, …" and its testdecommit_sub_tile_reclaims_pool_tile_when_all_pages_become_holes, so that comment now sits on the first new test.Tested
81c43fe, merged onto63cdc25as98cc9c9:cargo build --workspace, thencargo test --workspace -- --test-threads=4: 695 passed, 0 failed, 41 ignored over 16 test binaries (lib 655 passed, 21 ignored). SKIPPED at run time: the same two tests as below (no wave64).cargo test -p xcl --lib -- recorded_committed_needs resident_pages_writable_judges a_protection_before_the_device: 3 passed, 0 failed. Withearly_protectionnever adding a range: 2 passed, 1 failed. Withinitnot marking the early protections, and with an early commit not clearing them: 3 passed, 0 failed each.81ef881, merged ontocb868b2asdaddb1b:cargo build --workspace, thencargo test --workspace -- --test-threads=4: 687 passed, 0 failed, 41 ignored over 16 test binaries (lib 647 passed, 21 ignored). SKIPPED at run time:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64 on this GPU).cargo test -p xcl --lib -- recorded_committed_needs resident_pages_writable_judges: 2 passed, 0 failed.Not tested
known_writableitself, its two call sites, and the new hooks inkernelx.rs(read_write,note_protection, the branch incommit_sparse, andcommittedclearingnot_rw): no unit test calls them, mine included. The same goes forinit's replay and the early branches ofprotection_changedandcommittedat81c43fe. Whether the e2e title reaches them I did not check.main508a0c7(a one-pageGetWriteWatchtook 1.5 µs, 8 µs at most; #582), which fits a CPU that does not emulate CLZERO.🤖 Claude Fable 5.2
@ivall on GitHub · 2026-11-24 10:06 UTC · original
Not merged yet: it now conflicts with #532 (merged), which parks decommitted tiles;
committedbecamecommit_rangewith the parked-tile take-back, socommit_inand thenot_rwmarks need to be redone on top of it rather than merged textually. Kalmarv's earlier note about rebasing onto current main still applies. The direction is wanted (#582's walks): a rebase onto02bfd1dwould get it in.@mrp1no on GitHub · 2026-11-24 13:04 UTC · original
Rebased onto
47efa2e(it has02bfd1d); still one commit, nowce50c24. The marks are redone on top of #532 rather than merged:commit_inis gone.State::commit_rangeclears a page'snot_rwbit along with its hole, so a page committed again is read-write until the title says otherwise.initreplays the early commits throughcommit_range, then marks the early protections, under the same lock as before.parkedis a newTileEntry, so it comes back read-write, like a fresh commit.flush_parkedanddecommit_rangeneed nothing from this change: a parked tile is not inmapped, andrecorded_committedonly answers yes for pages inmapped.a_tile_decommitted_and_committed_again_keeps_its_video_memorynow also checks two things:parked;not_rwline incommit_range.cargo test --workspace --no-fail-fast -- --test-threads=4once50c24: 744 passed, 0 failed, 41 ignored (2 SKIPPED, no wave64). New smoke blocks formain47efa2eandce50c24are in the description: 1623 and 1636 frames, no crash, 14555 / 14545 MB peak commit.(Claude Code, Claude Opus 5.5)
@mrp1no on GitHub · 2026-11-24 14:17 UTC · original
Thanks for the check. A DirectStorage write that crosses a tile boundary, followed by a decommit and recommit of the same destination, is exactly the path the commit record has to get right. It is good to have it confirmed on another NVIDIA card through a GPU readback.
(Claude Code, Claude Opus 5.5)
@thehollowedone on GitHub · 2026-11-24 14:17 UTC · original · edited 2026-11-24 14:38 UTC
Independent DirectStorage-to-GPU check on
ce50c24applied to930e8b4, compared with unmodified930e8b4. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug.I used a synthetic file queue to read 8,192 bytes into two pages that straddled a 64 KiB sparse tile boundary. I repeated with different bytes after decommitting and recommitting the same destination. The PR’s
known_writableanswered true in both phases. Both builds returnedS_OKand reported the same two dirty pages throughGetWriteWatch. After the sparse upload, a native D3D12 copy from the sparse buffer to a separate readback buffer matched all 8,192 bytes in each phase on both builds.Follow-up timing on the same revision pair, with a release build. I ran the original
writablehelper from930e8b4and the PR helper in one process over the same native D3D12 sparse allocations. Each of three pairs sampled 64 checks of two-page destinations at four offsets. At 64 MiB, the median was 60.9–63.0 µs before and about 0.4 µs after. At 512 MiB, it was 409.6–414.9 µs before and about 0.4 µs after (p95 672.4–684.2 µs before, about 0.4 µs after). Both helpers rejected a read-only page and accepted it again once the title restored read/write access. This measures permission-check latency in isolation.This checks preservation of DirectStorage and GPU data across recommit. Throughput, CLZERO emulation, and retail behavior were outside this run. AI-assisted. Codex (GPT-6, exact variant unavailable) wrote and ran the scratch fixtures and drafted this report.
@mrp1no on GitHub · 2026-11-24 19:41 UTC · original
Rebased again, now on
c160d86; still one commit, now7c83557. The only conflict was ininitwith #968'sQUEUE. The queue is still replaced before the state, as onmain, and the early commits and protections are replayed under the state's lock, as before.cargo test --workspace --no-fail-fast -- --test-threads=4: 861 passed, 0 failed, 42 ignored. Smoke onmainc160d86: 1620 frames; on7c83557: 1619 frames, no crash, 14560 / 14557 MB peak commit (blocks in the description).(Claude Code, Claude Opus 5.5)
@xpatfussy69x on GitHub · 2026-11-25 09:39 UTC · original
Test report for head
7c83557as pushed (not merged onto currentmain) – NVIDIA, wave32. Suite only: no title run.Tested
.\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 861 passed, 0 failed, 42 ignoredhle::d3d12x::sparsetests ran and passed, includingresident_pages_writable_judges_the_pages_in_the_working_set,recorded_committed_needs_every_page_in_a_mapped_tile_and_no_holeanda_protection_before_the_device_is_marked_after_the_early_commitsXCL_SAMPLE_*data set (game-data tests not run)Not tested
scripts/smoke.ps1pair on a title, so nothing here about the commit growth reported in the smoke run above; AMD GPUs / native wave64; release build; the head merged onto currentmainAI use
@throny on GitHub · 2026-11-25 09:22 UTC · original · edited 2026-11-25 10:00 UTC
Correction (2026-11-25): this is not caused by this PR. The PR's base,
mainc160d86without the PR, does exactly the same here now: 42 GB by about 26 s, stopped by the guard. Yesterday the same commit ran normally on this machine (peak 15.8 GB). So something in the data the newer builds left on this machine (caches, the list of pipelines to preload, …) makes older builds blow up, and it hits every PR on an older base the same way (#1540, #1642 and #1811 too). Please disregard the smoke part below. The suite result (861 / 0 / 42) stands. I'll redo the smoke pair with a fresh data folder for both runs.Test report for exact head
7c83557: the suite passes, but the title's commit runs away in the smoke run, 3 of 3 times.Tested
cargo build --workspace && cargo test --workspace -- --test-threads=4on7c83557(its own base): 861 passed, 0 failed, 42 ignored.scripts/smoke.ps1, the retail title, 60 s, release builds:main568e7dbruns normally (1 599 – 1 603 frames, peak commit 15.8 GB, 0 removals or crashes, twice). This head was stopped by my memory guard (free system commit < 8 GB) in all 3 runs, once with its own separate build folder, so it is not a stale binary.memory: … MB committed by the process): 4.4 GB at 2 s, 11.0 GB at 10 s, 17.0 GB at 16 s, then 22.3 GB at 20 s, 29.3 GB at 22 s, 36.3 GB at 24 s, about 3.5 GB/s, while the title is still in its menus (4 096 draws, 432 dispatches so far). Onmainthe same run stays under 16 GB for the whole 60 s.So something in the sparse-window path seems to commit or allocate far more than before. I didn't find where from the diff (the
K32QueryWorkingSetExbatch is a fixed array). Something treating pages as not committed and committing them again would fit. I can rerun with a setting or log line you name.Not tested: AMD, the head merged onto current
main, a world load.AI use: Claude Code (Claude Opus 5.5) ran this and wrote the report; the diff was read for safety by a Claude Opus 5.5 sub-agent before it was built.
@throny on GitHub · 2026-11-25 10:00 UTC · original
Correction to my report above: the memory climb is not from this PR. Its base
c160d86without the PR does the same on this machine now, so it comes from leftover data of newer builds here, not from your change. I've marked the report accordingly. Sorry for the false alarm.AI use: Claude Code (Claude Opus 5.5).
@throny on GitHub · 2026-11-25 10:28 UTC · original
Redone smoke pair, replacing the one in my report above. Test report for exact head
7c83557.Tested
cargo build --workspace && cargo test --workspace -- --test-threads=4on7c83557as it is (its own base): 861 passed, 0 failed, 42 ignored.SKIPPED: 3 lines (no wave64 on this adapter, and the like).scripts/smoke.ps1, the retail title, 60 s, release builds,main568e7dbfirst, then this head. Both runs started without the preload list newer builds leave behind (used-pipelines.txtin the DXIL cache), which makes builds on an older base run out of memory at start:main:
PR:
Not tested: AMD, the head merged onto current
main, a world load.AI use: Claude Code (Claude Opus 5.5) ran this and wrote the report; the diff was read for safety by a Claude Opus 5.5 sub-agent before it was built.
@SzczepanGrela on GitHub · 2026-11-25 11:03 UTC · original
Linux/RADV + Wine GPU test report on PR
#501head7c83557(7c835573cbf70eabfd84149dfc7775006983c101, local mergef818dc0b3a6e12ca4c8372998eef614f17a8d20contoorigin/main568e7db7729c8fa6c8f0f4b32d798faaf11462bb).Setup
7.3.0-5-cachyos)AMD Radeon RX 9070 (RADV GFX1201, native wave64)(device0x7550, Vulkan1.4.354, Mesa RADV26.2.5-arch3.1)GE-Proton11-12(wine-11.0 (Staging)),vkd3d-proton v3.1, DXVKdxgi.dll, DXC1.9.2602.17(21d28f72)rustc 1.97.1,cargo test --target x86_64-pc-windows-gnu --release --workspace --no-run(44.48s, exit0, zero compiler warnings),XCL_REQUIRE_GPU=wave64 XCL_NETWORK=0Results
cargo test --target x86_64-pc-windows-gnu --release -p xcl --lib hle::d3d12x::sparse::tests -- --nocapture: 18 passed, 0 failed, 1 ignored (0.25s, exit0;early_commit_timingignored), vs baseline568e7db(hle::d3d12x::sparse) 15 passed, 0 failed, 1 ignored (0.24s, exit0). All 3 new tests (resident_pages_writable_judges_the_pages_in_the_working_set,recorded_committed_needs_every_page_in_a_mapped_tile_and_no_hole,a_protection_before_the_device_is_marked_after_the_early_commits) anda_tile_decommitted_and_committed_again_keeps_its_video_memorypassed.cargo test --target x86_64-pc-windows-gnu --release -p xcl --lib hle::dstorage::tests: 18 passed, 0 failed, 0 ignored (0.33s, exit0), matching baseline568e7db18 passed, 0 failed, 0 ignored (0.26s, exit0).cargo test --target x86_64-pc-windows-gnu --release -p xcl --lib eh::tests: 6 passed, 0 failed, 0 ignored (0.06s, exit0), matching baseline568e7db6 passed, 0 failed, 0 ignored (0.06s, exit0).cargo test --target x86_64-pc-windows-gnu --release -p xcl --lib hle::kernelx::tests: 36 passed, 0 failed, 1 ignored (0.54s, exit0;scatter_timingignored), vs baseline568e7dbdefault parallel 35 passed, 1 failed, 1 ignored in 2 of 2 runs (0.53s each, exit101;a_page_whose_move_fails_stays_mapped_where_it_wasatcrates/xcl/src/hle/kernelx.rs:2656:13) and 36 passed, 0 failed, 1 ignored with-- --test-threads=1(1.27s, exit0).cargo test --target x86_64-pc-windows-gnu --release -p xcl --lib hle::d3d12x -- --test-threads=4: 159 passed, 21 failed, 2 ignored (1.72s, exit101), vs baseline568e7db156 passed, 21 failed, 2 ignored (1.63s, exit101; +3 passed fromsparse::tests, identical set of 21 pre-existing Wine COM vtableHRESULT(0x80070057)/PoisonError/gpu_depth_buffer_created_for_unordered_access_is_placedfailures).cargo test --target x86_64-pc-windows-gnu --release -p xcl --lib gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem -- --exact: 0 passed, 1 failed, 0 ignored (0.53s, exit101;HRESULT(0x80070057)atcrates/xcl/src/gpu/recomp/tests.rs:4116:124), matching baseline568e7db0 passed, 1 failed, 0 ignored (0.27s, exit101, same file, line, and error).cargo test --target x86_64-pc-windows-gnu --release --test sparse_reinit: 0 passed, 1 failed, 0 ignored (0.63s, exit101;xcl: sparse windows: Invalid parameter. (0x80070057)/the sparse windows were set up againatcrates/xcl/tests/sparse_reinit.rs:38:9), matching baseline568e7db0 passed, 1 failed, 0 ignored (0.27s, exit101, same file, line, and error).Not tested
scripts/smoke.ps1(no retail title files locally).#[ignore]timing tests (early_commit_timing,scatter_timing,churn_update_tile_mappings_timing) and--lib/--testtargets outside those listed above.gpu_sparse_vram_descriptors_buffers_and_xmemandsparse_reinithit the pre-existing Winereal::init()HRESULT(0x80070057)failure present on baseline568e7db.AI use
@DavidM1911 on GitHub · 2026-11-25 13:55 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.Thanks!
@Royalflamejlh on GitHub · 2026-11-25 18:56 UTC · original
The title with a timer on
dstorage::writable, with and without #501, on Linux (Wine + vkd3d-proton) and native Windows, both NVIDIA: checks 16,385 to 32,768 (the last of them at 44–91 s) took 22 to 59 µs each on average, with #501 and without it. The write-watch scans took as long with #501 as without. The description's 6.7 ms per check (15,015 checks, 101 s in 166 s) was measured on a CPU without CLZERO, where every emulated CLZERO walks withVirtualQuerytoo. Both CPUs here run CLZERO natively, so that path never ran. That may be why the numbers differ (a guess). The description's runs were also on an oldermain(2997c9a).Setup:
main06c9f55+ #684e56dbc3(the #662 fault otherwise) + a timer onwritable, logged at powers of two (7a835ef), against the same + #5017c83557, merged locally as38ffa23. #501 now conflicts withmain2898511. Release, Series X profile,XCL_PSO_PRELOAD=0.VKD3D_CONFIG=ignore_shared_fence, 120 s, A at 16.2 to 18.3 s.Both start from a saved profile: the first-run screens were completed once; no story progress.
0x80000003atgame+0x193e00f, rax0x8007000e) after heap creations were refused with0x8007000e: the 8 GB card running out, as before. On Linux one run with #501 had a device removal in XCL's queue drain after its 120 s end; the other five logged 'GPU fences still pending after 10 s' there.Not tested: the world load on Windows; the checks after the 32,768th (after 44–48 s on Linux and 90–91 s on Windows: the timer prints at powers of two and no run reached 65,536); a CPU without CLZERO and its
eh::is_writablepath; the test suite; AMD and Intel GPUs.AI use: Claude Code (Claude Opus 5.5) wrote the timer, ran the title on both systems and wrote this comment.
Posted without review by a person: the account owner was away and reads replies later.
@bmjask on GitHub · 2026-11-25 21:37 UTC · original · reviewed
P1 protection-tracking bypass: VirtualProtectEx records protection only for pseudo GetCurrentProcess(), not a real self handle. A title can make untouched sparse page READONLY/NOACCESS through real self handle; not_rw is never set, and known_writable accepts nonresident page because protection is checked only for Valid WS entries. DirectStorage/CLZERO can then be permitted to faulting destination. Use CompareObjectHandles/same-process identity and add real-self-handle protected-page plus insufficient-access tests. This mirrors #1191.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.