Skip to content

Tests: the view-guard tests' views are forgotten by the journal too, and holes in title memory are tested - #1008

Closed
cmt8 wants to merge 2 commits into
fxceless:mainfrom
cmt8:up/wine-tests
Closed

cmt8 wants to merge 2 commits into
fxceless:mainfrom
cmt8:up/wine-tests

Conversation

@cmt8

@cmt8 cmt8 commented Nov 25, 2026

Copy link
Copy Markdown

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_asker fails now and then with assertion 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 of title_memory_remapped and the unmap). This one remains with #963 applied.

The change

  1. drop_views also drops the journal's pages of the views it unmaps, through a test-only forget. Ported from our 57b91aeb and afe67caa.
  2. Three new tests, 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 that host::read_into fails, that texture::committed does not count the memory as mapped, and that copy_mapped reads 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:

Build Runs Failed
0b0074e0 200 3 (written_pages_are_reported_to_every_asker ×2, writes_in_partly_committed_view_blocks_are_reported ×1)
0b0074e0 + #963 200 2 (written_pages_are_reported_to_every_asker ×2, before.is_empty())
this branch 200 0
this branch + #963 200 0

An earlier 100 runs each of 0b0074e0 and this branch gave 2 failures each, one of them written_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-test run (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 on 0b0074e0, and the three new tests pass.

Not verified

  • Not run on Windows (we have none). The journal change is test code and makes no assumption about the platform. The hole tests use plain Win32 placeholder APIs and should pass on Windows too, but nobody has run them there.

Related

AI-assisted (Claude Code); no game data.

cmt8 and others added 2 commits November 25, 2026 07:48
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant