watch: a hole noted absent in a race with its unmapping is known as a placeholder at the next asking #3603

Closed
github-bot wants to merge 1 commit from github-bot/gh-3603 into main AGit
Owner

@⁠ACSchafer on GitHub · 2026-11-30 01:36 UTC · original
ACSchafer:pr/watch-hole-placeholder → main · +101 −1 · 1 files · 1 commits · closed without merging

What it changes

A block whose view went between protect's two questions (committed? a placeholder?) was noted absent and not held. Nothing told of it again, so every asking of its range asked Windows about it and the bits never answered for it. No write was lost, but it cost a question to Windows per asking, and no_mapping_is_lost_between_askers failed its last check (published(at, end)) on some runs.

guard() now takes such a hole for a placeholder when Windows says it is one and holds it (held, and PUBLISHED when light()). Blocks the runtime told of memory in (title_memory_allocated) are the exception: they stay asked about, as before. A new set, Guards::told, remembers them until a mapping, a free, or a kernel write there tells of the block.

The placeholder question is asked with the guards' lock not held, like the others in guard(), so VICTORY_KEEP_GUARD_LOCK behaves as before.

How it was tested

  • GPU and profile: not applicable (write-watch bookkeeping; no rendering change)
  • Before: no_mapping_is_lost_between_askers run 2,400 times, 4 at a time, on upstream/main @ 41adb551: 36 failed (1.5 %), each assertion failed: super::published(at, end)
  • After: the same 2,400 runs, side by side with the above: 0 failed
  • New test a_hole_noted_absent_in_a_race_is_known_at_the_next_asking makes the state the race leaves and checks the next asking; it fails without the change
  • For shader changes, the wave sizes tested: not applicable
  • cargo test passed for the crates it touches: yes. cargo test -p victory-gpu --lib watch:: (66 passed). cargo clippy -p victory-gpu --all-targets, with and without --all-features, adds no warnings.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: none for the placeholder bookkeeping. (#2655, #3367 and #3105 touch the same file, in the lock and the hole cache.)
**@⁠ACSchafer** on GitHub · 2026-11-30 01:36 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3603) `ACSchafer:pr/watch-hole-placeholder` → `main` · +101 −1 · 1 files · 1 commits · closed without merging ## What it changes A block whose view went between `protect`'s two questions (committed? a placeholder?) was noted absent and not held. Nothing told of it again, so every asking of its range asked Windows about it and the bits never answered for it. No write was lost, but it cost a question to Windows per asking, and `no_mapping_is_lost_between_askers` failed its last check (`published(at, end)`) on some runs. `guard()` now takes such a hole for a placeholder when Windows says it is one and holds it (`held`, and `PUBLISHED` when `light()`). Blocks the runtime told of memory in (`title_memory_allocated`) are the exception: they stay asked about, as before. A new set, `Guards::told`, remembers them until a mapping, a free, or a kernel write there tells of the block. The placeholder question is asked with the guards' lock not held, like the others in `guard()`, so `VICTORY_KEEP_GUARD_LOCK` behaves as before. ## How it was tested - GPU and profile: not applicable (write-watch bookkeeping; no rendering change) - Before: `no_mapping_is_lost_between_askers` run 2,400 times, 4 at a time, on `upstream/main` @ 41adb551: **36 failed** (1.5 %), each `assertion failed: super::published(at, end)` - After: the same 2,400 runs, side by side with the above: **0 failed** - New test `a_hole_noted_absent_in_a_race_is_known_at_the_next_asking` makes the state the race leaves and checks the next asking; it fails without the change - For shader changes, the wave sizes tested: not applicable - `cargo test` passed for the crates it touches: yes. `cargo test -p victory-gpu --lib watch::` (66 passed). `cargo clippy -p victory-gpu --all-targets`, with and without `--all-features`, adds no warnings. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: none for the placeholder bookkeeping. (#2655, #3367 and #3105 touch the same file, in the lock and the hole cache.)
A block whose view went between protect's two questions (committed? a
placeholder?) was noted absent and not held. Nothing told of it again, so
it was asked about at every asking and never answered by its bits: one
extra question to Windows per asking of its range, and about 1 in 400 runs
of no_mapping_is_lost_between_askers under load failed its last check.
No write was lost.

An asking now takes such a hole for a placeholder when Windows says it is
one, except blocks the runtime told of memory in (title_memory_allocated),
which stay asked about as before (`Guards::told`). The new test makes the
state of the race directly and fails without the change.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 01:37:26 +00:00
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-30 01:36 UTC · original · reviewed

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-11-30 01:36 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3603#pullrequestreview-6105953184) · **reviewed** Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Author
Owner

@⁠Tan7rex on GitHub · 2026-12-01 14:37 UTC · original

Tested on Windows 11 Pro (build 26100), RTX 4090, with this PR's change applied onto current main (5fabb46e). The branch is 550 commits behind and conflicts in guard(): main dropped VICTORY_KEEP_GUARD_LOCK in 8bd49cdc, so I resolved it as if !unsure.is_empty() { with the PR's comment and let mut placeholders kept. Release test binary for victory-gpu --lib.

no_mapping_is_lost_between_askers, failures:

How it was run main 5fabb46e main + this PR
the test alone, 4 processes at a time, 600 runs 1 failed 0 failed
watch:: filter, 300 runs 0 failed 0 failed
whole lib, 60 runs 0 failed 0 failed

On this machine the failure is too rare (1 in 960 runs on main) to show the fix working. The new test a_hole_noted_absent_in_a_race_is_known_at_the_next_asking passes.

Possible regression, small numbers: watch::tests::a_late_fault_leaves_the_guard_taken_since failed 5 of 600 watch:: runs with the PR (4 then 1, in two batches of 300) and 0 of 600 on main. In 60 whole-lib runs it also failed once with the PR, against 0 on main. watch::many_askers_tests::no_write_is_lost_when_faults_take_no_lock failed once in 300 with the PR, against 0 on main. Worth a look, since guard() now holds placeholders it used to leave absent.

Not tested: the game.

**@⁠Tan7rex** on GitHub · 2026-12-01 14:37 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3603#issuecomment-7314552227) Tested on Windows 11 Pro (build 26100), RTX 4090, with this PR's change applied onto current `main` (5fabb46e). The branch is 550 commits behind and conflicts in `guard()`: `main` dropped `VICTORY_KEEP_GUARD_LOCK` in 8bd49cdc, so I resolved it as `if !unsure.is_empty() {` with the PR's comment and `let mut placeholders` kept. Release test binary for `victory-gpu --lib`. `no_mapping_is_lost_between_askers`, failures: | How it was run | `main` 5fabb46e | `main` + this PR | |---|---|---| | the test alone, 4 processes at a time, 600 runs | 1 failed | 0 failed | | `watch::` filter, 300 runs | 0 failed | 0 failed | | whole lib, 60 runs | 0 failed | 0 failed | On this machine the failure is too rare (1 in 960 runs on `main`) to show the fix working. The new test `a_hole_noted_absent_in_a_race_is_known_at_the_next_asking` passes. Possible regression, small numbers: `watch::tests::a_late_fault_leaves_the_guard_taken_since` failed **5 of 600** `watch::` runs with the PR (4 then 1, in two batches of 300) and **0 of 600** on `main`. In 60 whole-lib runs it also failed once with the PR, against 0 on `main`. `watch::many_askers_tests::no_write_is_lost_when_faults_take_no_lock` failed once in 300 with the PR, against 0 on `main`. Worth a look, since `guard()` now holds placeholders it used to leave absent. Not tested: the game.
Author
Owner

@⁠Tan7rex on GitHub · 2026-12-01 15:14 UTC · original

A correction to my earlier comment: a_late_fault_leaves_the_guard_taken_since also fails on main. In 60 more whole-library runs it failed once on main 5fabb46e (and 2 times with #3902, which doesn't touch watch.rs), and #4705 is open for exactly this test. So the 5 of 600 I saw with this PR (against 0 of 600 on main) is weaker evidence of a regression than I made it sound. It may only be the existing flake.

**@⁠Tan7rex** on GitHub · 2026-12-01 15:14 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3603#issuecomment-7315574294) A correction to my earlier comment: `a_late_fault_leaves_the_guard_taken_since` also fails on `main`. In 60 more whole-library runs it failed once on `main` 5fabb46e (and 2 times with #3902, which doesn't touch `watch.rs`), and #4705 is open for exactly this test. So the 5 of 600 I saw with this PR (against 0 of 600 on `main`) is weaker evidence of a regression than I made it sound. It may only be the existing flake.
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:50 UTC · original

Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:50 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3603#issuecomment-7321652664) Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
github-bot closed this pull request 2026-12-01 18:58:11 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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/trustno1-coder--VIctory-NVIDIA!3603
No description provided.