gpu: lock-free refresh checks, single-lock scoped pool, and zero-clone card_dirty (rebased #1094) #1442
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!1442
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1442"
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?
@Bazovsky on GitHub · 2026-11-28 20:05 UTC · original
Bazovsky:pr/lockfree-refresh-pool-v2→main· +723 −159 · 6 files · 1 commits · merged 2026-11-29 08:16 UTCClean rebase of #1094 onto current
main(923e38c), per @trustno1-coder's request in #1094.Summary of changes
Shadow::nothing_new/watch::nothing_new_with(watch.rs,shadow.rs,host.rs):WRITTENmutex reads on the no-op refresh fast path with lock-free per-page atomic epochs (PageEpochs) + anaheadsnapshot (ahead_snapshot_into) reused across the submission's refresh batch.Shadow::copied: Mutex<Vec<u64>>withBox<[AtomicU64]>(copy_lockserializes writers) and adds a SeqLock (ranged_seq) forShadow::ranged.Shadow::copy_stalepost-take_allepoch publish fix (be4e568from #1094, audited by @POMXARK and @hasekenmustafa-ctrl):copied[i].store(now, Ordering::Release)runs only aftertake_all(runs)joins all workers, ensuring Acquire readers never observe a refreshed epoch before worker writes are visible.main's existinghas_pendingatomic and#1400'sUnderSlots/batchedcard.dirtyinmerge_under_writes.land.rs,shadow.rs,host.rs):wide_each_scopedruns parallel refresh batches without per-jobArc/Boxallocations and claims work in chunks (MANY_CHUNKfor large no-op sweeps,wide_chunk()otherwise soVICTORY_WIDE_CHUNKremains honored).card_dirty_ranges(shadow.rs,host.rs,host/send.rs,host/upcheck.rs):&[(Arc<Shadow>, Vec<(usize, usize)>)]without redundant per-submissionVecclones.Independent benchmark (from #1094)
Measured by @Rafa7046 on Ryzen 9 9950X3D + RTX 5080 (Series X, 1440p DLSS Performance, FG off):
main(4 sessions):35.6–37.8median fps,36.0–38.7boat fps,19.2–21.2 mssubmit-thread preparing#1094(2 sessions):38.3 / 38.4median fps,39.6 / 39.6boat fps (+2.4 fps / +6%),18.0 / 18.9 mspreparingVerification
victory-gpuunit tests: 552 passed, 0 failed (43 ignored).cargo xwin clippy --no-deps -p victory-gpu --all-targets: 0 warnings in all modified files (watch.rs,land.rs,shadow.rs,host/upcheck.rs, touchedhost.rsregions).1935174664to27d312d38d