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

Open
github-bot wants to merge 2 commits from github-bot/gh-305 into main AGit
Owner

@⁠zocram4cc on GitHub · 2026-11-26 15:19 UTC · original
zocram4cc:fix/note-writes → main · +143 −5 · 7 files · 2 commits · open

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).

**@⁠zocram4cc** on GitHub · 2026-11-26 15:19 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/305) `zocram4cc:fix/note-writes` → `main` · +143 −5 · 7 files · 2 commits · open ## 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).
Landings through the title's own address (land.rs, put_changed in
shadow.rs), read-backs, bottom-of-pipe writes and texture backs did not
tell the write-watch journal, and wrote() told it only while a
submission's asking stood. 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.

Those writes are told now, exactly by 4 KiB, after their bytes are in,
and wrote() tells the journal whether or not an asking stands.
VICTORY_NOTE_WRITES=0 turns the new notes off, as before. Each note takes
the journal's lock; that is the cost the switch measures.

Renderer port #7 (VICTORY_PORT_JOURNAL=1): wrote() returned early with no
asking standing, counting it as skipped, before the notes were read. That
early return now also waits for VICTORY_NOTE_WRITES=0, so port 7 keeps
the new notes. told() notes through the sharded Notes (port 7) instead of
Journal::note.

Tests (Windows-only; run under Proton, not here):
a_landing_under_a_standing_asking_is_seen_by_the_refresh_after_it,
our_write_between_two_askings_is_copied (the ASK_QUIET test, adapted to ask_once).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 15:20:42 +00:00
The adapted ASK_QUIET test passed with VICTORY_NOTE_WRITES=0: its second asking asks the
kernel, whose write-watch reports our write by itself, so the test passed on the kernel's
answer, not on the journal's notes. It is replaced by the test that needs the notes: told
and wrote, port 7 off and on; with one asking standing, the note is read back from the
journal's answer.

Proven under Proton (one test exe, --test-threads 1, same binary):
- VICTORY_NOTE_WRITES=0, port 7 off and on: both new tests 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)".
- 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: the known Wine-only failures holes_are_known_until_the_runtime_tells,
  no_mapping_is_lost_between_askers, what_is_left_alone_is_no_known_hole.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/305/head:github-bot/gh-305'
git switch 'github-bot/gh-305'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-305'
git switch 'github-bot/gh-305'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-305'
git switch 'github-bot/gh-305'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-305'
git switch 'main'
git merge --squash 'github-bot/gh-305'
git switch 'main'
git merge --ff-only 'github-bot/gh-305'
git switch 'main'
git merge 'github-bot/gh-305'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.