Repository navigation
gpu: lock-free refresh checks, single-lock scoped pool, and zero-clone card_dirty (rebased #1094) - #1442
Open
Bazovsky wants to merge 1 commit into
Open
gpu: lock-free refresh checks, single-lock scoped pool, and zero-clone card_dirty (rebased #1094)#1442Bazovsky wants to merge 1 commit into
Bazovsky wants to merge 1 commit into
Conversation
rrxlb
added a commit
to OBERON-gg/miranda
that referenced
this pull request
Nov 28, 2026
Upstream PR trustno1-coder#1442 (Bazovsky; a rebase of trustno1-coder#1094), open upstream. The no-op refresh fast path reads per-page atomic epochs and one snapshot per submission instead of the write mutex; a copy's copied epochs are atomics published only after every worker has joined; refresh batches run on a scoped pool without per-job allocations; card-dirty ranges are borrowed, not cloned. Measured upstream: +2.4 fps, submit-thread preparing 19-21 -> 18-19 ms (9950X3D, RTX 5080). Tests: victory-gpu 552 ok.
rrxlb
added a commit
to OBERON-gg/miranda
that referenced
this pull request
Nov 29, 2026
About 60 upstream PRs, among them shader translation fixes (POPS wave ids, SCC of signed scalar adds, SDWA sign extension, byte and halfword constant loads, DPP and swizzles on inactive lanes), depth twins' shader views, the compute pipeline wait capped at 3 s a frame, the ray-tracing arenas' own room and windows kept under the texture line. Kept ours where they meet: - shadow.rs: upstream's one lock for a copy's state (trustno1-coder#1463) against our lock-free refresh looks (trustno1-coder#1442); ours kept, and upstream's Copied type left out. Windows turned down past the texture line are logged as the budget's are. - watch.rs: our snapshot of the ranges ahead, with upstream's owned memory taken as known; upstream's tests call the look through a small adapter. - README: ours. - The trees' wave-wide form (trustno1-coder#1571, 24556e2) is taken out again: it cost about 12 ms of card time a frame here (09c1bc0).
…e card_dirty (rebased trustno1-coder#1094)
Bazovsky
force-pushed
the
pr/lockfree-refresh-pool-v2
branch
from
November 29, 2026 01:43
1935174 to
27d312d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clean 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 gpu: lock-free refresh checks, single-lock scoped pool, and zero-clone card_dirty #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).