Repository navigation
Conversation
…he journal too
Ported by hand from 57b91aeb (and the test-only `forget` of afe67caa) of
cmt8/VIctory linux/fx-next6.
The journal of written pages is kept by page address for the process.
The view-guard tests guard two views of a section, note their pages
written, and unmap them through `drop_views`, which tells the guards
(`title_memory_remapped`) but not the journal. A test that gets one of
those addresses next for fresh memory then finds pages already written:
a full run of the victory-gpu tests under Wine failed once at
watch::tests::written_pages_are_reported_to_every_asker
("before.is_empty()"). `drop_views` now drops the journal's pages of the
views too (`forget`, test-only). No assertion changes.
Tested: the victory-gpu test binary (without the groups that fail under
Wine for other reasons) run 200 times under Wine 11.22: on this commit's
parent 3 runs failed (written_pages_are_reported_to_every_asker twice,
"before.is_empty()"; writes_in_partly_committed_view_blocks_are_reported
once), with this commit 0; with fork PR #963 applied as well, 2 and 0
(the two: written_pages_are_reported_to_every_asker, "before.is_empty()").
An earlier 100 runs each: 2 and 2. A rare flake, so the numbers are small.
Not run on Windows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and the mapped check Under Wine, title memory is read through the kernel's copy (host::read_into, host::copy_mapped) and asked whether it is mapped by reading a byte of each page (texture::committed), as everywhere; each takes a read that succeeds as "there". If a placeholder page (never mapped, or mapped and unmapped again, as xmem leaves title memory) or a reserved or no-access page read as zeros instead of failing, a texture streaming in would be read as whole with zero blocks where its pages are missing. Three tests map a section's pages into a placeholder with a hole and check that the kernel copy fails, the memory does not count as mapped, and the copy that stands holes reads zeros only in the hole. Only tests are added; nothing they cover changes. Tested: the three tests pass under Wine 11.22 (Windows test binary, Proton Experimental's vkd3d-proton, RX 7900 XTX). Not run on Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit f6e8bcd68741b791d8d12e143fd54cb7d26fe12b of cmt8/VIctory linux/fx-next6; the module notes name this tree's functions)
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.
Test code only. No production code changes, and no test is weakened, removed or ignored.
What breaks today
watch::tests::written_pages_are_reported_to_every_askerfails now and then withassertion failed: before.is_empty(): fresh write-watched memory reports pages already written. The journal of written pages is kept by page address for the whole process. The view-guard tests (two_views/drop_views) note their pages written and unmap the views, telling the guards (title_memory_remapped) but not the journal. A test that gets one of those addresses next finds them written. #963 and #769 fix a different race in the same tests (the order oftitle_memory_remappedand the unmap). This one remains with #963 applied.The change
drop_viewsalso drops the journal's pages of the views it unmaps, through a test-onlyforget. Ported from our 57b91aeb and afe67caa.mapped_tests.rs, from our f6e8bcd6. Each maps a section's pages into a placeholder with a hole (a placeholder page, a page unmapped again, reserved or no-access pages). They check thathost::read_intofails, thattexture::committeddoes not count the memory as mapped, and thatcopy_mappedreads zeros only in the hole. Wine handles placeholders and kernel copies its own way, and a hole read as zeros would let a streaming texture be taken as whole. No production code changes. They pass under Wine.Evidence
The victory-gpu test binary, cross-built on Linux, run under Wine 11.22. Four groups that fail under Wine for other reasons were skipped (
drvwatch,indirect::,pipeline::library, the depth-plane twin). Runs that failed:0b0074e0written_pages_are_reported_to_every_asker×2,writes_in_partly_committed_view_blocks_are_reported×1)0b0074e0+ #963written_pages_are_reported_to_every_asker×2,before.is_empty())An earlier 100 runs each of
0b0074e0and this branch gave 2 failures each, one of themwritten_pages_...on this branch. The flake is rare and these counts are small, so this change makes the journal failure less likely but does not clearly remove it. #963's reorder and this change together gave the only clean 200 runs of the base.Full
wine-testrun (the xtask from Marvisak/VIctory #1218, not part of this PR) with Proton Experimental's vkd3d-proton on an RX 7900 XTX: victory-gpu 165 passed, 8 failed. The same 8 fail on0b0074e0, and the three new tests pass.Not verified
Related
title_memory_remappedin three watch tests. We carry the same reorder (our afe67caa) and left it out here so as not to duplicate them. This PR combines with either.AI-assisted (Claude Code); no game data.