Skip to content

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

Open
reeledMarek wants to merge 1 commit into
Marvisak:mainfrom
reeledMarek:fix/gpu-hold-unreadable-wait
Open

reeledMarek wants to merge 1 commit into
Marvisak:mainfrom
reeledMarek:fix/gpu-hold-unreadable-wait

Conversation

@reeledMarek

Copy link
Copy Markdown
Contributor

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

@Dukestar69 Dukestar69 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants