Repository navigation
gpu: keep the page guard lock when no mapping query is needed (opt-in) - #653
Open
Blitzball996 wants to merge 1 commit into
Open
Blitzball996 wants to merge 1 commit into
Blitzball996 wants to merge 1 commit into
Conversation
Blitzball996
force-pushed
the
perf/keep-guard-lock
branch
from
November 28, 2026 03:31
1fff28b to
50bef02
Compare
This was referenced Nov 28, 2026
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.
Change
guard()checks the bitmap of absent blocks while holdingGUARDS. When there are no uncertain blocks, it releases and immediately reacquires the mutex before examining dirty blocks.VICTORY_KEEP_GUARD_LOCK=1keeps the existing guard across that empty interval. Ranges that need a Windows mapping query still release the mutex for the query and revalidate the result after reacquiring it. The switch is opt-in and supportsVICTORY_ABin diagnostics builds.In a 24-second diagnostics capture, 286 of 2,312 samples of the submitting thread were waiting for
watch::guardsfromwritesduring a buffer refresh. This is a count of sampled stacks across the guard path. It does not isolate time spent on the second acquisition.Measurements
RTX 4070 SUPER, i7-14700KF, Series S profile, DLSS Performance (960x540 to 1920x1080), frame generation disabled. The two release runs used the same save and launcher settings on a local branch containing upstream
a4d05e7. The table uses median base FPS from five-second reporting windows with zero pipelines being compiled, 55 to 155 seconds after entering the world.In a separate diagnostics run,
VICTORY_AB=6,VICTORY_KEEP_GUARD_LOCKalternated the switch every six seconds. Of seven adjacent off/on pairs within 5% in draw count, six had lower mean frame time with the switch. The median paired difference was -1.5 ms. Independent runs can differ in streaming and scene timing. The full release run showed no overall FPS gain.Verification
cargo test --offline --locked -p victory-gpu watch::tests:: -- --test-threads=1passed all 35 tests on the PR branch with the switch set to0and again with it set to1.Related work in #516 changes fault handling and the collection of soft-view ranges in the same guard path.
The branch targets
mainat8fc2254. PR #687 addresses the upstream CI failures independently.