Repository navigation
Conversation
… skip, merged Shadow ranged/copied lock, and chunk-batched refresh counters
1 task done
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.
What it changes
Removes redundant submitting-thread write-watch work and lock/atomic contention across
watch,shadow, andhostrefresh flushes:crates/victory-gpu/src/watch.rs:ASK_ONCE_ACTIVE(AtomicBoolmirror ofJournal::kept) and exposesask_once_active()soask_ahead()/ask_ahead_done()andBatch::refresh_front/Batch::flush_allskip building, filtering (published), sorting, and discarding thousands of ranges on every flush whileask_onceis already active.ask_onceinto a single pass overranges(onepublished()filter, one sort, oneAskings::hold_or_all, onejournal_mut()lock) instead of runningask_aheadfollowed by a second full scan andahead.clone()inask_rest.Journal::aheadsorted and merged into disjoint intervals and replaces linearj.ahead.iter().any(...)scans innothing_new,writes,asked,ask_more, andask_restwith O(log N)ahead_contains(partition_point).copiedpage bounds / zero-marks innothing_newbefore takingJOURNAL.read().ahead_containsparity andask_onceactive-flag / sorted-aheadinvariants.crates/victory-gpu/src/shadow.rs:Shadow::rangedintoCopiedPagesunderShadow::copied(all callers already heldcopied's lock), removing a second mutex per buffer check/update.Shadow::update'sself.pending.lock()andVecallocation behind the existing lock-freeself.has_pending.load(Acquire)check.watch::parts_written(&again_at)(and itsJOURNAL.read()) inShadow::copy_stalewhenagain_atis empty.wide_each_chunksso parallel flush workers receive(from, to)ranges directly.crates/victory-gpu/src/host.rs:ranges: Vec<(usize, usize)>beforewatch::ask_aheadinBatch::refresh_frontandBatch::flush_allwhenwatch::ask_once_active()is true.wide_each_chunksinBatch::refresh_frontandBatch::flush_allto flushFLUSHES[2](nothing_newcount) once per worker chunk instead of per buffer.How it was tested
game_scarlett_master.exe), 1440p DLSS Balanced,-NoFrameGenReady,VICTORY_PORT_CONSTANTS=1,VICTORY_WAIT_RESIDENT=textures, clean 90s gameplay runs (0 WARNs / 0 ERRORs).stack8v2without this PR):22.00/ mean23.15(p10 18.0, max31.2),frame_timesmed43.7 ms/ mean43.5 ms,>50 ms: 24.9%sub_all: median36.25 ms/ mean37.35 ms(watch 5.00 ms,refreshes 10.75 ms,ASYNC_SUBMIT worked 39.4 ms)stack9with this PR):22.80/ mean23.64(p10 19.2, max32.2),frame_timesmed42.7 ms/ mean42.7 ms,>50 ms: 24.0%sub_all: median35.30 ms/ mean36.12 ms(-1.23 ms mean;watch 4.65 ms-7%,refreshes 10.55 ms,ASYNC_SUBMIT worked 37.05 ms-2.35 ms)cargo clippy -p victory-gpu --lib --tests --locked(default &--all-features): 0 new warnings.cargo testpassed for the crates it touches: yes (551 passed; 0 failedincargo test -p victory-gpu --lib --locked -- --test-threads=1).Checked for overlap
Journal::ahead; this PR additionally adds theask_once_active()skip inwatch/host, single-passask_once,Shadow::updatehas_pendingguard,Shadow::rangedmerged intoShadow::copied, and chunk-batchedFLUSHES[2]updates).