fix(gpu): treat unreadable memory in ValueWait::holds as not holding #3359

Open
github-bot wants to merge 1 commit from github-bot/gh-3359 into main AGit
Owner

@⁠reeledMarek on GitHub · 2026-11-26 20:25 UTC · original
reeledMarek:fix/gpu-hold-unreadable-wait → main · +44 −3 · 1 files · 1 commits · open

Summary

  • ValueWait::holds documented unreadable memory as not holding, but returned None via read(self.address, self.bytes)?—the same sentinel used for unknown D3D12 comparison functions.
  • Held::pump treats None as an unknown comparison (incrementing done.unknown and leaving ok = true), so queues waiting on unreadable memory ran prematurely instead of staying held, and Held::blocked omitted those waits because it filters for Some(false).
  • Returns Some(false) when read(self.address, self.bytes) returns None, reserving None strictly for unknown comparison functions.
  • Updates comparisons_test_the_masked_value and adds regression test unreadable_memory_holds_the_queue_without_counting_as_unknown.

Verification

  • cargo clippy -p victory-gpu --all-targets --target x86_64-pc-windows-msvc --locked -- -D warnings
  • Ran all 11 hold::tests unit tests directly (rustc --edition 2024 --test)
  • cargo test -p xtask --locked
**@⁠reeledMarek** on GitHub · 2026-11-26 20:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/3359) `reeledMarek:fix/gpu-hold-unreadable-wait` → `main` · +44 −3 · 1 files · 1 commits · open ### Summary - `ValueWait::holds` documented unreadable memory as *not holding*, but returned `None` via `read(self.address, self.bytes)?`—the same sentinel used for unknown D3D12 comparison functions. - `Held::pump` treats `None` as an unknown comparison (incrementing `done.unknown` and leaving `ok = true`), so queues waiting on unreadable memory ran prematurely instead of staying held, and `Held::blocked` omitted those waits because it filters for `Some(false)`. - Returns `Some(false)` when `read(self.address, self.bytes)` returns `None`, reserving `None` strictly for unknown comparison functions. - Updates `comparisons_test_the_masked_value` and adds regression test `unreadable_memory_holds_the_queue_without_counting_as_unknown`. ### Verification - `cargo clippy -p victory-gpu --all-targets --target x86_64-pc-windows-msvc --locked -- -D warnings` - Ran all 11 `hold::tests` unit tests directly (`rustc --edition 2024 --test`) - `cargo test -p xtask --locked`
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:26:23 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 20:28 UTC · original · approved these changes

LGTM — verified on Windows against origin/main (63bcca4).

  • Returning Some(false) instead of None when read(self.address, self.bytes) returns None prevents unreadable wait memory from being treated as an unknown comparison (which previously released the waiting queue segment early).
  • cargo test -p victory-gpu --lib hold:: -- --test-threads=1: 11 passed, 0 failed (including unreadable_memory_holds_the_queue_without_counting_as_unknown).
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-26 20:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/3359#pullrequestreview-6080162121) · **approved these changes** LGTM — verified on Windows against `origin/main` (`63bcca4`). - Returning `Some(false)` instead of `None` when `read(self.address, self.bytes)` returns `None` prevents unreadable wait memory from being treated as an unknown comparison (which previously released the waiting queue segment early). - `cargo test -p victory-gpu --lib hold:: -- --test-threads=1`: 11 passed, 0 failed (including `unreadable_memory_holds_the_queue_without_counting_as_unknown`). - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
This pull request can be merged automatically.
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/3359/head:github-bot/gh-3359'
git switch 'github-bot/gh-3359'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3359'
git switch 'github-bot/gh-3359'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3359'
git switch 'github-bot/gh-3359'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3359'
git switch 'main'
git merge --squash 'github-bot/gh-3359'
git switch 'main'
git merge --ff-only 'github-bot/gh-3359'
git switch 'main'
git merge 'github-bot/gh-3359'
git push origin 'main'
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/Marvisak--VIctory!3359
No description provided.