fix(gpu/uav_pool): read QUEUED before STARTED in retire_uavs and strengthen QUEUED ordering (#316) #335
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/335"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Androtim/MiniVI. Originally posted by RUIZ-Enrique-25002136 on 2026-12-02T13:15:09Z.
Summary
Fixes the reversed
STARTED/QUEUEDload order inuav_pool::retire_uavsand strengthensQUEUEDsynchronization inqueue::behindso still-in-flight scratch UAV buffers cannot be under-counted and prematurely recycled intoUAV_SPARE.Fixes #316
Changes
crates/victory-gpu/src/host/uav_pool.rscurrent_started_with(queued, started)that evaluatesqueued()strictly beforestarted(), matchinghost::retireandhost::retire_resource.retire_uavs(and test helperwait_submissions_idle) to usecurrent_started_with(crate::queue::queued, || STARTED.load(Ordering::Acquire)).current_started_reads_queued_before_startedverifying load ordering and non-under-counting across a concurrentSTARTEDincrement +QUEUEDdecrement transition.crates/victory-gpu/src/queue/behind.rsQUEUED.fetch_sub(...)fromRelaxedtoRelease(unfold,Job::Run,Job::Joined,Job::Present) andQUEUED.load(...)inqueued()fromRelaxedtoAcquire, establishing happens-before withSTARTED.fetch_add(1, AcqRel)inhost.rs.Rig Specs Tested On
x86_64)victory-gpucrate; full clippy & tests verified on GitHub Actionswindows-latestCI)x86_64) — Windowsx86_64-pc-windows-msvcCI verifies compilation, clippy, and unit testsRun Settings & Profile
origin/main(b0842d9)VICTORY_*Overrides: N/AMeasurements & Verification
cargo clippy --workspace --all-targets --locked -- -D warnings(verified on GitHub Actionswindows-latestCI)cargo clippy --workspace --all-targets --all-features --locked -- -D warnings(verified on GitHub Actionswindows-latestCI)cargo test --locked -p xtask-> 8 passed, 0 failedcargo xtask policy->asset policy: 324 files okcargo test -p victory-gpu --locked -- --test-threads=1(verified on GitHub Actionswindows-latestCI)