gpu(fence,queue): block on null-event fence waits and wake events on bottom-of-pipe writes #88
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: launcher
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
run report
security: hold
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs gpu test
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Androtim--MiniVI!88
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/88/head"
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?
@Androtim on GitHub · 2026-11-29 08:18 UTC · original
Androtim:feat/iter89-fence-blocking-and-bop-events→main· +182 −42 · 2 files · 1 commits · merged 2026-11-29 14:32 UTCSummary
Adapted from upstream
VIctory-NVIDIAPRs #905 (81b3653) and #906 (1841d59) (GPL-3.0), extracted cleanly offorigin/main(7fe6886) with zero overlap against open PRs:crates/victory-gpu/src/fence.rs,crates/victory-gpu/src/queue.rs):ID3D12Fence::SetEventOnCompletionwith a null event now waits in 10 msWaitOnAddressslices until the target fence value is reached instead of returningE_NOTIMPLafter 250 ms, settling late flights and releasing held queue work (queue::release_forced()after 2 s).crates/victory-gpu/src/fence.rs,crates/victory-gpu/src/queue.rs): Registers liveFenceinstances byvalueaddress and callsfence::writtenfromqueue::Written::writeso 4-byte and 8-byte bottom-of-pipe GPU writes into a fence's address wake registeredSetEventOnCompletionevents just likeSignal.Verification
cargo xtask policy:asset policy: 303 files okcargo test -p victory-gpu --lib --locked -- fence:: queue::: 14 passed; 0 failed (includinga_null_event_blocks_until_the_value_is_reachedanda_write_at_the_fence_address_sets_waiting_events)cargo clippy --workspace --all-targets -- -D warnings: 0 warningscargo clippy --workspace --all-targets --features diagnostics -- -D warnings: 0 warnings--release+objdump -p: standard Windows system DLLs onlypr89-fence-blocking-bop): 11/11 gates PASS12.3 fps(81.2 ms, vs8.9 fpsbaseline,+3.40 fps)5869 MB/6961 MBbudget (over=0 MB)2281(vs7121baseline) |mapped()stall rate:6.1 ms/suntranslated=1| Crashes / host texture errors:0/0frame-8478.png,frame-8518.png, median luma103.93, edge energy7.11,0.0%near-black/magenta): clean daylight rendering with no hangs or artifacts.@Androtim on GitHub · 2026-11-29 09:03 UTC · original
Automated triage for the maintainers (not an approval).
Verdict:
needs-gpu-test· CI (check):passingReview Summary
Changes in
crates/victory-gpu/src/fence.rsandcrates/victory-gpu/src/queue.rsare clean, well-scoped, and CI is passing.What was verified:
fence::set_event_on_completion/fence::block_until,queue::release_forced): Replacing the 250 msE_NOTIMPLtimeout with a 10 msWaitOnAddressloop matchesID3D12Fence::SetEventOnCompletion(value, NULL)semantics. Settling late flights (queue::before_sync+host::settle_for_fence) and callingqueue::release_held(false)per slice avoids missing work submitted while blocked, andqueue::release_forced()(gated on!behind::on()andforces()) mirrors present-time fallback afterBLOCKED_LONG(2 s).fence::LIVE,Fence::drop,fence::written,queue::Written::write):Fenceis heap-pinned in aBox<Fence>, registered by&raw const fence.valueincreate, and unregistered inDrop::dropunderLIVE.fence::writtenholdsLIVEwhile dereferencing theFencepointer and lockingfence.waiters, preventing use-after-free during concurrentDropwith a consistentLIVE->waiterslock order (no lock-order inversion withcreate,Drop,set, orset_event_on_completion).a_null_event_blocks_until_the_value_is_reachedanda_write_at_the_fence_address_sets_waiting_eventscover both signal and 4/8-byte bottom-of-pipe write wakeups past the previous 250 ms cutoff.Minor notes (non-blocking):
start + 4),fence::writtencorrectly detects the overlap and signals registered events, whileWakeByAddressAll(at.cast())inWritten::writewakesstart + 4rather than&fence.value;block_untilstill wakes within its 10 msWaitOnAddressslice, so it will not deadlock.Next step: Ready for a local real-GPU smoke test to confirm no deadlocks or frame-pacing regressions under live host submissions.
Generated with Antigravity CLI (
agy).@Androtim on GitHub · 2026-11-29 10:41 UTC · original
Completed live 75s Series S GPU verification on
bdb094cf(D:\victory-data\verify-runs\pr89-fence-blocking-bop):crashes=0,no_host_texture_errors=0,untranslated=1,world_windows=15,max_draws=11549)12.3 fps(+3.40 vs baseline8.9 fps), max VRAM5869 MB/ budget min6961 MB(over=0 MB), final waiting textures2281(-4840 vs baseline7121),mapped()rate6.1 ms/world_sec, pipeline drops271vs261.0(PASS)24captures,lit=20/24, median luma103.93,near_black=0.0%,magenta=0.0%,edge_energy=7.11@Androtim on GitHub · 2026-11-29 14:32 UTC · original
Automated RTX 4060 Ti 8 GB Wave 3 A/B hardware verification passed (
playtest/wave3vsorigin/mainc7ed150— 5/5 A/B gates PASS):cargo test(RTX 4060 Ti):victory-gpu542 passed, 0 failed (36 ignored);victory-shader323 passed, 0 Wave 3 regressions (the 3 PSV0 validation failures inemit::rect::testsandemit::barycentric_testsalso fail identically onorigin/mainc7ed150).scripts/verify-world.ps1, DLSS Quality + golden autosave):10.25 fpsvs10.7 fpsbaseline (min FPS improved6.9vs4.2, preparing45.35 msvs50.3 ms)5948 MBvs6073 MB(-125 MB,0 MBover budget)final_waiting=5487vs7350(-1863);no room for new ones38vs43mapped_rate=20.95 ms/svs37.22 ms/s(-44%)frame-10645.png,frame-10669.png), luma82.77vs23.2, edge energy2.27vs1.81, magenta0.0%.