Skip to content

fix(gpu): wake WaitOnAddress in fence::written and fail fast on non-sharing errors in samplers::open_alone (#318) - #337

Merged
Androtim merged 1 commit into
Androtim:mainfrom
RUIZ-Enrique-25002136:fix/fence-wake-and-samplers-retry
Dec 2, 2026
Merged

Androtim merged 1 commit into
Androtim:mainfrom
RUIZ-Enrique-25002136:fix/fence-wake-and-samplers-retry

Conversation

@RUIZ-Enrique-25002136

Copy link
Copy Markdown
Contributor

Summary

Fixes both synchronization and I/O stall bugs in crates/victory-gpu tracked in #318.

Fixes #318

Changes

  1. crates/victory-gpu/src/fence.rs (fence::written):
    • Captured (&raw const fence.value).cast() before releasing waiters and live locks, then called WakeByAddressAll(addr) under #[cfg(windows)] (matching fence::set).
    • Added #[cfg(windows)] unit test a_write_at_the_fence_address_wakes_wait_on_address verifying WaitOnAddress wakes promptly on bottom-of-pipe Written::Value writes.
  2. crates/victory-gpu/src/pipeline/samplers.rs (open_alone / open_alone_in):
    • Extracted open_alone_in(dir) and gated the 10-second retry loop specifically on e.raw_os_error() == Some(ERROR_SHARING_VIOLATION) (32), so permanent errors (ERROR_ACCESS_DENIED, ERROR_PATH_NOT_FOUND, etc.) fail immediately instead of stalling threads on the global MADE mutex.
    • Added unit test open_alone_fails_fast_on_non_sharing_error using a blocking directory at FILE to verify non-sharing errors return None without stalling.

Rig Specs Tested On

  • CPU: Linux workstation (x86_64)
  • GPU & VRAM: N/A (Windows-only victory-gpu crate; full clippy & tests verified on GitHub Actions windows-latest CI)
  • System RAM: N/A
  • OS & GPU Driver: Linux (x86_64) — Windows x86_64-pc-windows-msvc CI verifies compilation, clippy, and unit tests

Run Settings & Profile

  • Build & Commit SHA: rebased on origin/main (b0842d9)
  • Console Profile & Internal Resolution / Scale: N/A
  • Ray Tracing: N/A
  • Upscaling: N/A
  • Frame Generation: N/A
  • Launcher Command / Preset & Extra VICTORY_* Overrides: N/A
  • Scene / Area & Session Length: N/A

Measurements & Verification

  • Base FPS (without Frame Gen): N/A
  • Frame-Gen FPS (if enabled): N/A
  • VRAM / RAM Usage: N/A
  • Crashes / DRED Resets: N/A
  • Automated Checks:
    • cargo clippy --workspace --all-targets --locked -- -D warnings (verified on GitHub Actions windows-latest CI)
    • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings (verified on GitHub Actions windows-latest CI)
    • cargo test --locked -p xtask -> 8 passed, 0 failed
    • cargo xtask policy -> asset policy: 324 files ok
    • cargo test -p victory-gpu --locked -- --test-threads=1 (verified on GitHub Actions windows-latest CI)

@Androtim
Androtim merged commit baf967f into Androtim:main Dec 2, 2026
1 check passed
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.

fix(gpu): missing WakeByAddressAll in fence::written and 10s MADE stall on non-sharing I/O errors in pipeline::samplers::open_alone

2 participants