GPU watch marks unaligned zero-byte writes and can drop live aliases on empty remaps #2011

Open
opened 2026-11-26 04:51:36 +00:00 by github-bot · 2 comments
Owner

@⁠tyr0nsur on GitHub · 2026-11-25 02:53 UTC · original

On 940d32f, writing(base + 1, 0) reports a write to a clean 64 KiB page and its alias. Rounding the unaligned start down and the identical end up produces a one-page range. The same rounding in title_memory_remapped can remove an alias link on an empty remap.

The regression links two tracked pages and consumes the initial dirty range. It checks the empty write both while the guard lives and after dropping it, checks the empty remap, and then verifies that a real one-byte write through the first address still dirties the second. It uses the existing test helpers.

I reproduced the first empty-write assertion failure on Windows x64 at the revision above. With the small guard and range changes, the regression and the GPU library suite pass. Apply the linked patch, then run cargo test --locked -p victory-gpu --lib watch::tests::empty_writes_and_remaps_leave_a_clean_page_and_its_alias_untouched -- --exact.

Standalone patch and regression test

**@⁠tyr0nsur** on GitHub · 2026-11-25 02:53 UTC · [original](https://github.com/Marvisak/VIctory/issues/2011) On `940d32f`, `writing(base + 1, 0)` reports a write to a clean 64 KiB page and its alias. Rounding the unaligned start down and the identical end up produces a one-page range. The same rounding in `title_memory_remapped` can remove an alias link on an empty remap. The regression links two tracked pages and consumes the initial dirty range. It checks the empty write both while the guard lives and after dropping it, checks the empty remap, and then verifies that a real one-byte write through the first address still dirties the second. It uses the existing test helpers. I reproduced the first empty-write assertion failure on Windows x64 at the revision above. With the small guard and range changes, the regression and the GPU library suite pass. Apply the linked patch, then run `cargo test --locked -p victory-gpu --lib watch::tests::empty_writes_and_remaps_leave_a_clean_page_and_its_alias_untouched -- --exact`. [Standalone patch and regression test](https://github.com/tyr0nsur/PortVI/blob/1443a990c4fc84bf9de250cf456ea84c0edd2f02/patches/0007-empty-memory-ranges.patch)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:51:36 +00:00
Author
Owner

@⁠BaggyALPHA on GitHub · 2026-11-25 03:07 UTC · original

Independent Windows validation on 940d32f. I split the two behaviors into separate synthetic probes so each executes on the upstream baseline.

  • Unaligned empty write: upstream dirtied the alias both while the guard was alive and when it was dropped. With the linked patch, the alias stayed clean at both points.
  • Unaligned empty remap: upstream dirtied the alias immediately and then failed to propagate the next real one-byte write. With the linked patch, the empty remap left it clean and the real write reached the alias.

All 9 watch tests passed with the linked patch, including its original regression and both local probes. The full GPU library suite with that patch had 144 passed, 2 failed, 2 ignored on RTX 3080. Both failures were the known NVIDIA descriptor-heap tests. Adding #1751 separately brought it to 146 passed, 0 failed, 2 ignored.

All inputs were synthetic. No game files were used. AI-assisted (OpenAI Codex).

**@⁠BaggyALPHA** on GitHub · 2026-11-25 03:07 UTC · [original](https://github.com/Marvisak/VIctory/issues/2011#issuecomment-7151614096) Independent Windows validation on `940d32f`. I split the two behaviors into separate synthetic probes so each executes on the upstream baseline. - Unaligned empty write: upstream dirtied the alias both while the guard was alive and when it was dropped. With the linked patch, the alias stayed clean at both points. - Unaligned empty remap: upstream dirtied the alias immediately and then failed to propagate the next real one-byte write. With the linked patch, the empty remap left it clean and the real write reached the alias. All 9 watch tests passed with the linked patch, including its original regression and both local probes. The full GPU library suite with that patch had 144 passed, 2 failed, 2 ignored on RTX 3080. Both failures were the known NVIDIA descriptor-heap tests. Adding #1751 separately brought it to 146 passed, 0 failed, 2 ignored. All inputs were synthetic. No game files were used. AI-assisted (OpenAI Codex).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 12:49 UTC · original

Automated triage for the maintainers.

Confirmed in main (940d32f). In crates/victory-gpu/src/watch.rs, both writing and title_memory_remapped compute (at / PAGE, (at + len).div_ceil(PAGE)) with no check for len == 0, so an unaligned empty range covers one page: writing marks it (and its aliases) changed, and title_memory_remapped removes that page's alias links.

Open PR: #2021, which carries this change against main, so review can continue there rather than on the patch file in the fork.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 12:49 UTC · [original](https://github.com/Marvisak/VIctory/issues/2011#issuecomment-7162915030) <!-- victory-issue-triage v1 verdict=confirmed seen=2026-11-25T03:07:34Z at=2026-11-25T12:55:00Z --> Automated triage for the maintainers. Confirmed in `main` (`940d32f`). In `crates/victory-gpu/src/watch.rs`, both `writing` and `title_memory_remapped` compute `(at / PAGE, (at + len).div_ceil(PAGE))` with no check for `len == 0`, so an unaligned empty range covers one page: `writing` marks it (and its aliases) changed, and `title_memory_remapped` removes that page's alias links. Open PR: #2021, which carries this change against `main`, so review can continue there rather than on the patch file in the fork. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#2011
No description provided.