Repository navigation
xmem tests: unmap only the mapped pages after the tile hold test - #665
Open
snoozedDev wants to merge 1 commit into
Open
snoozedDev wants to merge 1 commit into
snoozedDev wants to merge 1 commit into
Conversation
gpu_tile_hold_keeps_the_whole_private_span_mapped (brcly#660) unmaps page 1 of its four-page aperture, and its clean-up then unmapped all four in one call. An unmap refuses a range with an unmapped page in it (unmap_single_private_span_range returns ERROR_INVALID_ADDRESS), so map(aperture, 4, null) returned NULL and the test failed on every run. It panicked while holding POOL, and six more tests failed on the poisoned lock. The clean-up now unmaps page 0 and pages 2 and 3. The test's assertions about the hold are unchanged and pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Since #660, the
tuxbox-xmemunit tests fail on every run on main under GE-Proton11-14's Wine.gpu_tile_hold_keeps_the_whole_private_span_mappedunmaps page 1 of its four-page aperture, and its clean-up then unmaps all four in one call. An unmap refuses a range with an unmapped page in it (unmap_single_private_span_rangereturnsERROR_INVALID_ADDRESS), somap(aperture, 4, null)returns NULL atphysical_backing.rs:248. The test panics while holdingPOOL, and six more tests fail on the poisoned lock.The change: the clean-up unmaps page 0 and pages 2 and 3 separately. Only that test's clean-up changes. Its assertions about the hold are unchanged and pass: the sibling page stays committed while the hold lives and is reserved again after release.
I left the provider alone. Whether an unmap should skip pages that are already unmapped is your call; the current check is explicit, so I treated it as intended.
I didn't run the game. Nothing here changes what the game runs.
This contribution was written by an AI agent (Claude Opus 5.5) operating under my supervision. I am accountable for it and will respond to review.
Tested
Run the checks relevant to this change.
xmem,lanes-selftestor D3D12 buffer controls on either card.The first box is unticked because the GPU suites the table names for
runtime/xmem/were not run. This PR only changes a unit test, so no Lanes scenario applies. The xmem unit tests ran under Wine, andtuxbox.py check --no-gpupassed (below).GPU, driver and backend: none (CPU-only unit tests under GE-Proton11-14's Wine).
The
Evidence:linetuxbox.py checkprints last, one per card (it names the commit it tested; run it on this pull request's head):(The one not run is the synthetic shaders through the runtime's DXC flags; no Linux DXC was on
PATH.)Commands run and their results:
--test-threads=1The two failed runs with this PR are older rare failures, not in the changed test:
mapping_state_seqlock_tracks_active_and_completed_mutations(physical_backing.rs:815), once in 300 runs from a short path.gpu_pool_then_plain_cpu_view_upgrades_backing_and_keeps_mem_private(physical_backing.rs:420), once in 100 runs from cargo's output path. Line 420 is the acquire that xmem: end protection runs at private-span boundaries #662 described as failing when the CPU view lands across a 4 MiB boundary; I didn't print the addresses in this run. It poisonedPOOLin that run, so the same six tests failed after it.Also run:
cargo fmt --all --checkandcargo +1.95.0 clippy --locked --target x86_64-pc-windows-msvc -p tuxbox-xmem --all-targets -- -D warnings: pass.-p tuxbox-xmemon a local nightly (not CI's pinned one): 1 passed, 56 ignored. The test keeps its Miri ignore.Checks
CI runs the code checks: the Python and Rust unit tests, the translator tests through DXC, a Windows typecheck, clippy, formatting, rustdoc, and Miri on the providers. It has no GPU.
If this pull request changes evidence JSON, regenerate the results table and the progress map and include both files:
python tuxbox.py status > docs/RESULTS.md python tuxbox.py status --svg docs/progress.svgThis pull request changes no evidence JSON.