watch: writes of ours into title memory go to the journal, landings too (VICTORY_NOTE_WRITES, port-7 adapted) #305

Open
zocram4cc wants to merge 2 commits from upstream-pr/305 into main
zocram4cc commented 2026-11-26 15:19:28 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by zocram4cc on 2026-11-26T15:19:28Z.


What

Writes of ours into title memory now tell the write-watch journal, not only writes made while a submission's asking stands:

  • landings through the title's own address (land.rs, put_changed in shadow.rs);
  • read-backs, bottom-of-pipe writes and texture backs;
  • wrote() notes the journal whether or not an asking stands. Notes are exact by 4 KiB and happen after the bytes are in.

VICTORY_NOTE_WRITES=0 turns the new notes off, restoring the previous behaviour.

Port-7 adaptation (VICTORY_PORT_JOURNAL=1): wrote() returned early when no asking stood, counting the write as skipped, before the notes were read. That early return now also waits for VICTORY_NOTE_WRITES=0, and told() notes through the sharded Notes used by port 7.

Why

A landing between a submission's asking and the refresh of an overlapping copy was missed: the journal answered for the range without the page, and the copy kept the bytes from before. This is a correctness fix; the switch measures the cost of the extra journal notes (each note takes the journal's lock).

Originally authored as 9a1ec09 / ba77ca6 on our branches; re-applied here on v7900/main with the port-7 changes above. The original author is kept.

Tests

Run under Proton on commit 57c2622 (one test exe, --test-threads 1, same binary for every row):

  • watch::tests::our_writes_are_told_with_port_7_whether_or_not_an_asking_stands replaces our_write_between_two_askings_is_copied. That test passed with VICTORY_NOTE_WRITES=0: its second asking asks the kernel, whose write-watch reports the write by itself, so the test passed on the kernel's answer, not on the notes.
  • land::tests::a_landing_under_a_standing_asking_is_seen_by_the_refresh_after_it

Red, VICTORY_NOTE_WRITES=0 (port 7 off and on): both fail.

  • watch.rs:4058: told with none standing, port 7: false
  • land/tests.rs:497: the landed page is not in the journal: [] (asked 1)

Green, default and VICTORY_PORT_JOURNAL=1: both pass.

watch:: and land:: (58 tests), port 7 off and on: 54 pass, 1 ignored (what_landing_costs), 3 fail, all Wine-only failures that also occur on upstream: holes_are_known_until_the_runtime_tells, no_mapping_is_lost_between_askers, what_is_left_alone_is_no_known_hole.

Measured

No frametime numbers for this PR: it is a correctness fix, and its cost is what VICTORY_NOTE_WRITES measures. Linux/Proton only measured, Windows untested.

Build

cargo xwin build --profile release -p victory --target x86_64-pc-windows-msvc: passes on this branch.

AI-assisted (Claude Code).

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6629754624 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/305). Originally posted by [zocram4cc](https://github.com/zocram4cc) on 2026-11-26T15:19:28Z. --- ## What Writes of ours into title memory now tell the write-watch journal, not only writes made while a submission's asking stands: - landings through the title's own address (land.rs, `put_changed` in shadow.rs); - read-backs, bottom-of-pipe writes and texture backs; - `wrote()` notes the journal whether or not an asking stands. Notes are exact by 4 KiB and happen after the bytes are in. `VICTORY_NOTE_WRITES=0` turns the new notes off, restoring the previous behaviour. Port-7 adaptation (`VICTORY_PORT_JOURNAL=1`): `wrote()` returned early when no asking stood, counting the write as skipped, before the notes were read. That early return now also waits for `VICTORY_NOTE_WRITES=0`, and `told()` notes through the sharded `Notes` used by port 7. ## Why A landing between a submission's asking and the refresh of an overlapping copy was missed: the journal answered for the range without the page, and the copy kept the bytes from before. This is a correctness fix; the switch measures the cost of the extra journal notes (each note takes the journal's lock). Originally authored as 9a1ec09 / ba77ca6 on our branches; re-applied here on `v7900/main` with the port-7 changes above. The original author is kept. ## Tests Run under Proton on commit 57c2622 (one test exe, `--test-threads 1`, same binary for every row): - `watch::tests::our_writes_are_told_with_port_7_whether_or_not_an_asking_stands` replaces `our_write_between_two_askings_is_copied`. That test passed with `VICTORY_NOTE_WRITES=0`: its second asking asks the kernel, whose write-watch reports the write by itself, so the test passed on the kernel's answer, not on the notes. - `land::tests::a_landing_under_a_standing_asking_is_seen_by_the_refresh_after_it` Red, `VICTORY_NOTE_WRITES=0` (port 7 off and on): both fail. - `watch.rs:4058`: `told with none standing, port 7: false` - `land/tests.rs:497`: `the landed page is not in the journal: [] (asked 1)` Green, default and `VICTORY_PORT_JOURNAL=1`: both pass. `watch::` and `land::` (58 tests), port 7 off and on: 54 pass, 1 ignored (`what_landing_costs`), 3 fail, all Wine-only failures that also occur on upstream: `holes_are_known_until_the_runtime_tells`, `no_mapping_is_lost_between_askers`, `what_is_left_alone_is_no_known_hole`. ## Measured No frametime numbers for this PR: it is a correctness fix, and its cost is what `VICTORY_NOTE_WRITES` measures. Linux/Proton only measured, Windows untested. ## Build `cargo xwin build --profile release -p victory --target x86_64-pc-windows-msvc`: passes on this branch. AI-assisted (Claude Code).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/305:upstream-pr/305'
git switch 'upstream-pr/305'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/305'
git switch 'upstream-pr/305'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/305'
git switch 'upstream-pr/305'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/305'
git switch 'main'
git merge --squash 'upstream-pr/305'
git switch 'main'
git merge --ff-only 'upstream-pr/305'
git switch 'main'
git merge 'upstream-pr/305'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
avatarmanz/VIctory-7900XTX!305
No description provided.