Skip to content

fix(gpu/uav_pool): read QUEUED before STARTED in retire_uavs and strengthen QUEUED ordering (#316) - #335

Merged
Androtim merged 1 commit into
Androtim:mainfrom
RUIZ-Enrique-25002136:fix/uav-pool-retire-order
Dec 2, 2026
Merged

Androtim merged 1 commit into
Androtim:mainfrom
RUIZ-Enrique-25002136:fix/uav-pool-retire-order

Conversation

@RUIZ-Enrique-25002136

Copy link
Copy Markdown
Contributor

Summary

Fixes the reversed STARTED / QUEUED load order in uav_pool::retire_uavs and strengthens QUEUED synchronization in queue::behind so still-in-flight scratch UAV buffers cannot be under-counted and prematurely recycled into UAV_SPARE.

Fixes #316

Changes

  1. crates/victory-gpu/src/host/uav_pool.rs
    • Added current_started_with(queued, started) that evaluates queued() strictly before started(), matching host::retire and host::retire_resource.
    • Updated retire_uavs (and test helper wait_submissions_idle) to use current_started_with(crate::queue::queued, || STARTED.load(Ordering::Acquire)).
    • Added unit test current_started_reads_queued_before_started verifying load ordering and non-under-counting across a concurrent STARTED increment + QUEUED decrement transition.
  2. crates/victory-gpu/src/queue/behind.rs
    • Upgraded QUEUED.fetch_sub(...) from Relaxed to Release (unfold, Job::Run, Job::Joined, Job::Present) and QUEUED.load(...) in queued() from Relaxed to Acquire, establishing happens-before with STARTED.fetch_add(1, AcqRel) in host.rs.

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 (atomic synchronization fix)
  • 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 1c717e6 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/uav_pool): reversed STARTED/QUEUED load order in retire_uavs can recycle in-flight UAV buffers

2 participants