Repository navigation
kernelx: XMemMapPhysicalPagesScatter with no page array unmaps - #495
Conversation
|
Regression run, plus two review notes. Native Windows 11, RTX 5070 Ti (Blackwell, 32-lane, driver 32.0.16.1742), 32 GB. Same title, 180 s each, no uncommitted changes.
This PR @ Frames 1377 vs 1479 (93 %), peak commit 15040 vs 15064 MB (100 %), no device removal, no crash, exit 0x0. Inside the 80 % / 125 % bounds — but see the note at the end about the frame counts on this machine. Not tested: neither build stopped on the NULL-scatter path, so this run does not confirm the fix fires. 1. 2. Three points on the change itself (static read, not from a test):
All of this is one title on one GPU, and that machine had other heavy load on it during the runs — treat the frame counts as indicative and the review points as questions, not as a block. |
A retail game unmaps addresses while it streams its world with
XMemMapPhysicalPagesScatter(addresses, n, NULL); it checks the result
and runs into its own int3 when the call fails (+0xb18de7, then its
crash reporter). XCL refused a NULL page array with
ERROR_INVALID_PARAMETER. Page 0 already means "unmap this address" in a
scatter, so no array is taken as page 0 for every address.
Test scatter_without_pages_unmaps: two pages mapped and written, unmapped
with no array (the call succeeds, the addresses are no longer committed),
mapped again they read what was written. It fails without the change
("refused").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1822092 to
3ae0841
Compare
|
@yyc160 thanks for the regression run and the review. Pushed
Tested on |
|
Regression run for this PR's head on Windows, as asked in #175. Tested
Regression run main: PR: Not tested
🤖 Claude Opus 5.5 |
|
Tested on native Windows 11, RTX 4060 Laptop 8 GB (7956 MiB), driver 621.24, 15 GB RAM, release MSVC build. The newer retail title (TitleID 7952987A) with the Series S profile ( Without #495/#496: With both: the run went past that point (XStore query at 186 s) and played on until 354.5 s. No device removal and no failed scatter calls logged. The run then ended on #333 (
So on 8 GB the Series S profile trades target pages for sparse pools and starts 1.2 GB higher. It lasted about 12 s longer after the load point than Series X did. It is not a way around #333. Caveats: one run, no AI use: the crash was traced and this comment drafted with Claude Opus 5.5; I ran the game and checked the results. |
|
Native Windows 11 / RX 7900 XT, retail 1.0.2.1, Series S profile. The local control accepted A, then took 0x80000003 at title+0xb18de7 at 41.473 s (RCX 0x57, R8 zero). Adding 3ae0841 plus #615's presentation overlay to the same integration build, with the same saved profile, input and initial application caches, got past that breakpoint and into world streaming. The isolated scatter_without_pages_unmaps regression passed in the combined workspace suite. I did not instrument the scatter return value in the retail run. The follow-up run ended at 168.731 s at the separate title+0x23cf683 watchdog, with zero device removals. The full combined suite passed 730 tests, 0 failed, 41 ignored; one nominal pass reported SKIPPED for missing xgameruntime.dll. Commands: cargo build --workspace --offline --locked and cargo test --workspace --offline --locked -- --test-threads=4 --nocapture, followed by a release hardware run. Codex (GPT-6) ran the checks and summarized the local logs. |
|
Test report on Windows + NVIDIA for On the Series S profile ( Tested
Regression run This block is from the local merge, not from this PR's head alone: on this card the title does not reach the scatter without #242, so a run of this PR alone would only show the earlier assert. Not tested
AI use
|
|
Test report: retail title, a run confirming the problem this PR fixes Not a run of this PR's head ( Hardware / build
Without the fix
With the fix
Not tested
AI use
|
|
Windows validation on a GTX 1650 (4 GB) Retail 1.0.2.1 in the Series S profile. I compared
The final sampled 1920×1080 frame had 0 of 129,600 non-dark samples. The report also recorded 45 calls to queue slot #31 (the case tracked in #1031). This is Windows runtime evidence that the scatter change clears the assertion at AI use Codex (GPT-6) prepared the local cherry-pick, ran the comparison, and wrote the report from the generated logs. |
# Conflicts: # crates/xcl/src/hle/kernelx.rs
|
RTX 5080, Series S profile: the title stops at this
Setup: RTX 5080 16 GB (driver 610.47), i7-7700K, 16 GB RAM, Windows 10 22H2, release, Not tested: this head rebased on AI use: Claude Code with Claude Fable 5.2 ran the title and wrote this. |
|
Test report for The conflict. Tested
Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11): merge conflict with current |
When a pool heap for title textures is refused, the log said "no video memory for more pages of title textures", and the activity line gave the process's commit and the video memory in use. Neither says what ran out: the card, the memory the system shares with it, or the system's commit, which a PC charges video memory to as well. The warning now ends with the system's free commit and its limit, and the local and the non-local video memory in use with their budgets. The activity line (XCL_ACTIVITY) gets the commit and the two budgets at its end; what scripts/smoke.ps1 reads from it is unchanged. What they showed in runs of a retail title on a 10 GB card with 16 GB of RAM (a local tree with xcl-dev#495 and xcl-dev#615, Series S profile), up to the title's own check at +0x193e00f (xcl-dev#333): the first refusal came with 779 MB of commit free in one run and with 31764 MB and 32252 MB free in two runs with a larger page file, each time at 12541 - 12552 MB of local video memory in use against a budget of 9260 - 9285 MB. In the last run non-local video memory stood at 4708 MB of a 7465 MB budget. So the commit is not what stops that machine, which the first run alone suggested. Logging only: no test. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Additional Linux/Wine + RTX 4060 Laptop validation of the change and regression from Scope: the function change and Environment: Linux 6.17.0-40-generic, Wine 11.0, stock/assert-enabled vkd3d-proton 3.2.0 ( Observed before the change: retail 1.0.2.1, Series S profile, stopped at Regression: ran Bounded title follow-up: Not tested: native Windows, AMD, clean PR head, full suite, or 15-minute gameplay/30fps. No proprietary assets or frame dumps attached. AI assistance: omp / openai-codex/gpt-6-astra performed the local integration, commands, inspection and report. Existing PR authors retain credit for the fix and test. |
|
Merged into
AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this on the maintainer's behalf. |
Bring in 36 upstream PRs from origin/main (#2310..#587) onto amd-dev (c7a18d8) while preserving all local AMD RDNA4 work (#615 pipelined presenter SRVs, #495/#1405 XCL_PAGE_ALIAS=1 hooks, #2306 level tiling timers, #1989 vtable fix, mesh user SGPRs). Resolved 4 conflicts: - console_list.rs: kept both mesh_arguments_go_in_user_sgprs_from_s16 and #2323 dispatch-heap tests - real.rs: kept both effective_st depth-UAV tracking and #2280 pc_clear_for_desc - vram.rs: kept Step::Tiling timer around level_tiling - kernelx.rs: kept XCL_PAGE_ALIAS=1 hooks in physical_pages_live and XMemMapPhysicalPagesScatter Assisted-by: Antigravity (Gemini 4 Neon High)
A retail game unmaps addresses while it streams its world with
XMemMapPhysicalPagesScatter(addresses, n, NULL). It checks the result and runs into its ownint3when the call fails (+0xb18de7; the function at+0xb18dc0calls the scatter through its IAT slot and breaks on 0), then its crash reporter. XCL refused a NULL page array withERROR_INVALID_PARAMETER. Page 0 already means "unmap this address" in a scatter, so no array is now taken as page 0 for every address. Part of #175 (#175 (comment)).What is in it
hle/kernelx.rs:XMemMapPhysicalPagesScatterwith a NULL page array unmaps each address (through the existing page-0 path).scatter_without_pages_unmaps: two pages mapped and written, unmapped with no array (the call succeeds, the addresses are no longer committed), mapped again they read what was written. Without the change it fails ("no page array: unmapped, not refused").Tested
from_ifacechecks relaxed and-Db_ndebug=true, as in Linux: docs/linux.md, scripts/linux and Wine start-up checks for vkd3d-proton and DXVK (#154, #241) #257; DXVK 3.1.1 dxgi), Rust stablex86_64-pc-windows-gnu(cross-built), releasemain2997c9a+ this commit): CPU tests--skip gpu:: --test-threads=4: 364 passed, 0 failed, 3 ignored; GPU testsgpu:: --test-threads=1: 271 passed, 0 failed, 18 ignored (run serially: with 4 threads this card sometimes loses the device, NVRM Xid 109, in tests this change does not touch).mesh_dispatch::tests::gpu_*/paired_*were excluded: they hang this GPU onmaintoo.SKIPPEDon this adapter:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64)int3at+0xb18de7at ~113 s; after, the run went on past it.Regression run
scripts/smoke.ps1needs Windows (see Not tested).Not tested
scripts/smoke.ps1blocks and no MSVC build; this PR needs someone to run the regression on Windows before it can be merged.AI use
🤖 Generated with Claude Code