Repository navigation
Conversation
…in-place vtables Integrates 16 upstream PRs (ivall#1380, ivall#1383, ivall#1384, ivall#1395, ivall#1398, ivall#1400, ivall#1404, ivall#1405, ivall#1419, ivall#1420, ivall#1421, ivall#1423, ivall#1424, ivall#1427, ivall#1428, ivall#1429) on top of the Linux/Proton fork, plus three Proton/vkd3d-proton fixes caught during verification: - Recompiler (ivall#1428): flatten IO_GROUP_LIMIT early-return in compute shaders so vkd3d-proton v3.1 dxil-spirv accepts the emitted CFG. - D3D12.X (ivall#1395 + ivall#867): skip UnadoptGuard on in-place-patched vtables and restore native vtables in runner::submit_list when a prior test adopted the singleton ID3D12Device. - Tests: match Wine centered default in window_position_modes. Verified under GE-Proton11-14 (RX 9060 XT / RADV): - gpu_sparse_vram_descriptors_buffers_and_xmem + gpu_valu_float_and_int + window_position_modes: 3 passed, 0 failed - Broad sweep (present, real, sparse, clamp, dstorage, gpu_valu, gpu_typed_buffer): 82 passed, 0 failed, 1 ignored, 0 skipped - 2.5 min retail title run (XCL_MEM_LIMIT=12G): 3,000+ frames at 30.0 fps, 6.0-6.1 GB flat committed RAM, 6.4 GB local VRAM, 0 DS failures.
|
Two notes that connect directly to this PR:
Not tested: live retail run on this branch (static analysis of AI use: Antigravity ( |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Test report on GTA VI 1.0.2.1 (Windows, NVIDIA). With this PR, the title's Tested at Hardware: NVIDIA GeForce RTX 5060 Ti 16 GB, driver 621.24, Agility SDK 1.620.2. CPU i7-14700KF, 64 GB RAM, Windows 10 22H2 (19045). Rust 1.88.0, release. Env for all three runs:
Not this PR's issue, but it ended both runs: the process commit grows by 5–9 GB per 2 s while the NVIDIA compiler builds big compute pipelines (270–810 KB DXIL in the heap form). It goes from ~32 GB to over 55–70 GB within a minute, and I stopped the runs there. That's tracked in #156 / #1307. Not tested:
AI use: runs, log analysis and this report by Claude Code (Claude Opus 5.5); posted at the request of the person running the tests. |
gut0to
left a comment
There was a problem hiding this comment.
AI-assisted review; I traced the enqueue snapshot and execution-time reread paths.
| let mut current = vec![0usize; pages.len()]; | ||
| let pages = if read_own(r.destination as usize, current.as_mut_ptr() as *mut u8, std::mem::size_of_val(pages)) | ||
| && current[..] != pages[..] | ||
| && crate::hle::kernelx::physical_pages_live(¤t) |
There was a problem hiding this comment.
This proves only that the replacement page IDs are currently allocated; it does not prove the list is a persistent title table. If a stack-backed list is overwritten after enqueue with the ID of another still-live allocation, read_own succeeds and this check redirects the request from the snapshotted page p1 to unrelated page p2, potentially corrupting its owner. This conflicts with the stated fallback for overwritten stack arrays. Could the late reread require a positively identified persistent page-table range, and otherwise keep the snapshot? AI-assisted review; I verified this with the existing page-list flow.
There was a problem hiding this comment.
You're right: being allocated now does not make the list a persistent table. Fixed in bb27ed6 (squashed, rebased onto main with #509): queue_enqueue_request records whether the destination page list lies on the calling thread's stack (GetCurrentThreadStackLimits), and such a list keeps its snapshot at execution. a_destination_page_rewritten_after_enqueue now has your case – a list on the test thread's stack, rewritten after enqueue with the ID of another live page, keeps its snapshot page and leaves the other alone; it fails without the check.
I could not find a way to positively identify a title's persistent table, so this rules out the stack, the case the snapshot fallback was for. A heap array the title frees and reuses before its request runs would still be read late; that limit is now under Not tested.
(AI-assisted: Claude Code with Claude Opus 5.5 wrote the change and this reply; I checked the test fails without it.)
|
I independently tested mgrein’s change at The focused test On a matched cold-cache story load, 4,934 of 34,610 traced physical-page requests used a destination entry that was already nonzero at enqueue and had changed by execution. This count excludes entries that were zero at enqueue. Both runs opened the same seven story paths, reached loading artwork, then stopped after device removal on a dark screen. The page-selection fix is independently reproducible here. I saw no visible gameplay improvement in this comparison. I ran the Windows lib-test binary under Proton with the filter |
|
Where the failures that remain with this PR come from, on an RTX 4070 Ti. I added a local log line to every Tested: RTX 4070 Ti (driver 616.56), Ryzen 7 7800X3D, 32 GB RAM, Windows 11 Pro 26200, release, retail 1.0.2.1 from an NVMe SSD,
So the reread fixes nearly all of them here. The few left fail at the same physical-page write, all within 0.2 s on Not tested: this PR without #1464; more than one run with each tree; AMD. AI use: Claude Code (Claude Opus 5.5) wrote the diagnostic, ran the title on my machine, and wrote this comment. Note on comparing counts (re @3L1A5-1's report above): my tree had #1464 as well, and the two fixes cover different entries. #1464 waits for entries that were |
|
Test report for Tested
Not tested: this PR alone on AI use: Claude Code (Claude Opus 5.5) ran the runs, compared the logs and wrote this. |
|
I reproduced the #1164 crash ( Update after testing #1405 alone. Both builds hit Tested Windows 11 25H2 (26200.9974), i7-9700F, RTX 3080 10 GB, driver 621.01, Rust 1.100.0 MSVC, release. Control
Counts are sums of the recorded two-second activity samples. The two runs processed different numbers of requests. Neither logged a D3D12 device removal. Both processes remained alive after the exception and the launcher stopped them at its 765 s deadline. A preliminary control needed a late manual profile selection and is excluded from the comparison.
Not tested The effect on #1164 remains open on this machine. One matched pair, no full test suite or OpenAI Codex (GPT-6.2 Sol High) ran the tests and helped draft this comment. |
|
Test report: with this PR (and #1464), the CPU access violations that ended Series S story loads around 90–110 s are gone in 3 of 3 runs, against 6 of 10 runs without them. The same setup and the same warm caches on both sides. Setup: RTX 5070 Ti 16 GB (driver 610.88), Ryzen 7 9700X, 32 GB, Windows 11 Pro 26300, rustc 1.97.0, release. Retail title, Series S profile ( Tree: a local integration branch on
Not tested: #1405 and #1464 separately, so the effect is not split between them; plain AI use: Claude Code (Claude Opus 5.5) ran the runs on the machine above, analysed the logs and wrote this report. |
A retail title keeps its destination page lists in slots of its own table and writes a slot's pages after EnqueueRequest. At enqueue such a slot can still name the pages of the slot's previous request, and the snapshot taken then is what execute() wrote to (xcl-dev#289 rereads only the entries that are 0). Over 16 000 requests a run were written into pages the title had since reused: its objects got garbage pointers and it crashed about 20 s into world loading; when the old pages were freed, the request failed with E_ACCESS_VIOLATION. The console reads the list when it runs the request. execute() now reads it again (through read_own, as the snapshot) and takes it when it differs and every page in it is allocated (kernelx::physical_pages_live). A list that was on the enqueuing thread's stack keeps the snapshot: that memory is reused once the call returns, and a page ID written there since can belong to another live allocation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Test report on an RTX 3090 with the world running above 1 frame per second: garbage-pointer faults in 8 of 8 runs without this change, 0 of 9 with it. Two things for the PR: it now conflicts with the merged #509, which does not cover this case; and a second fault showed up behind it, in Setup
Results
More than 16 384 destination lists per run differ from their enqueue-time snapshot, from 21.6 s on. Evidence for the mechanism (local page-history log of every map / unmap / DirectStorage write per 64 KiB page, dumped at the fault): in a snapshot run the faulting object's page shows About #509 (merged): it makes the late re-read of entries that were A second fault behind it, not covered by this PR: once the title survives, one run in six died inside XCL in Not tested: the PR's unit test, #1464, AMD, runs without AI use: Claude Code (Claude Fable 5.2 coordinating, Claude Opus 5.5 for the page-history log and the runs) did this and drafted the report. |
7f15632 to
bb27ed6
Compare
|
Test report: retail 1.0.2.1 on an RTX 5090 (Windows), #1405 at Tested
Not tested
AI use: Claude Code (Claude Opus 5.5) applied the patches, ran the builds, tests and runs, read the logs and wrote this report. The numbers come from those runs. |
A retail title keeps its DirectStorage destination page lists in slots of its own table and writes a slot's pages after
EnqueueRequest. At enqueue, a slot can still name the pages of its previous request.execute()wrote to the snapshot taken then, so the data went into pages the title had since reused. #289 rereads only the entries that are0at enqueue (since #509 throughread_own), so it does not catch a stale nonzero entry. The console reads the list when it runs the request; this PR does the same, except for a list on the enqueuing thread's stack.On a new retail game this was more than 16 000 requests per run. The title's own objects got garbage pointers and it crashed about 20 s into world loading, at a different site each run, mostly reads through non-canonical addresses. When the old pages had been freed, the request failed with
E_ACCESS_VIOLATION(0x89240009).What is in it
crates/xcl/src/hle/dstorage.rs,execute: the destination page list is read again when the request runs, withread_ownas at enqueue. It replaces the snapshot when it differs and every page in it is allocated. DirectStorage: a destination page array entry that is 0 at enqueue is read at the request's turn #289/DirectStorage: a deferred page-array entry is reread without faulting (#476) #509's reread of0entries is unchanged and runs after it.queue_enqueue_requestrecords whether the list lies on the calling thread's stack (GetCurrentThreadStackLimits), and such a list keeps its snapshot. That memory is reused once the call returns, so a page ID written there since can belong to another live allocation.crates/xcl/src/hle/kernelx.rs:physical_pages_live, true when every page of a list is allocated now.a_destination_page_rewritten_after_enqueue: a slot in a heap table names one page at enqueue and another beforeSubmit; the data must land in the second page and leave the first alone. The same list on the test thread's stack, rewritten with the other (live) page, must keep its snapshot. Each case fails without its part of the change.Tested
cargo test --workspace -- --test-threads=4atbb27ed6(rebased ontomain3da2abb): 1112 passed, 0 failed, 46 ignored (20 test binaries). SKIPPED (25): 20 GPU subtests that need wave64 (gpu::recomp::lower/lower_dxilprogram families,gpu_wave32_program_in_wave64_hardware,gpu_geometry_wave32_prefix_count_over_a_mask), 3 wave32 per-lane f16 subtests oflower_dxil::tests(refused: unsupported f16 instructions),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),pso_measurement_compiles_an_exact_synthetic_record(Windows Developer Mode is off).main47efa2eplus other open PRs, before the stack check), 400 s scripted world-load runs of a new retail game with the same settings:Regression run
The same title for 100 s on each build,
XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1, warm shader caches.main:
This PR:
Not tested
mainthe title stops before the world load where they happened, with a GPU hang at about 113 s on both builds (DXGI_ERROR_DEVICE_HUNGlater), which is unrelated to this change. So the stack check has not been run against the retail title: if it kept these lists on the enqueuing thread's stack, it would lose the fix. The diagnostic above found them in the title's own table.Submit): it changes neighbouring lines and would need a rebase whichever lands second.AI use
🤖 Generated with Claude Code