host: rewire lock-free nothing_new_with and wide_chunk in refresh_front and flush_all #2175
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!2175
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2175"
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?
@qlfu on GitHub · 2026-11-29 10:14 UTC · original
qlfu:pr/rewire-lockfree-refresh-checks→main· +150 −56 · 1 files · 2 commits · openWhat it changes
Re-wires the lock-free
Shadow::nothing_new_with(&ahead_snap, ...)refresh checks andwide_chunk()/MANY_REFRESH_CHUNKchunking incrates/victory-gpu/src/host.rsthat were accidentally disconnected during the wave 1–6 merge ontomain(829188e9), also clearing five dead-code / unused-variable warnings (ahead_snap,MANY_CHUNK,shadow::wide_chunk,Shadow::nothing_new_with,watch::nothing_new_with):Batch::refresh_front: Snapshotsahead_snapshot_into(&mut self.ahead_snap)once instead of takingJOURNALlocks per span inshadow.nothing_new(...). Whenkeptis active withoutVICTORY_FRONT_SIFTandspans.len() > FEW, checksnothing_new_withinline in a single chunkedwide_each_scopedpass (MANY_REFRESH_CHUNK = 8); whenask_aheadwill run orVICTORY_FRONT_SIFT=1, sifts spans in parallel via lock-freesift_spansbeforeask_aheadand dispatches remaining spans usingcrate::shadow::wide_chunk().Batch::flush_all&Batch::refresh_ahead: Uses&self.ahead_snapwithshadow.nothing_new_with(...)in both the<= FEWretain loop and the parallelcheck_noopwide_each_scopedloop (MANY_REFRESH_CHUNK), and replacessift_front/sift_refreshes(which clonedArc<Vec<_>>and used lockednothing_new) with the shared zero-clone lock-freesift_spanshelper.How it was tested
VICTORY_PORT_CONSTANTS=1,VICTORY_WAIT_RESIDENT=textures), clean 90s A/B gameplay runs on829188e9(0 WARNs / 0 ERRORsin both runs):origin/main829188e9,victory-nvidia-20261129-120600.log):refreshesmed14.05 ms,stepsmed25.05 ms,sub_allmed44.00 ms(mean46.55 ms)16.80(mean17.76, p109.3), 1,830 frames in 104s,>50ms55.5%, p9591.3 ms, max249.8 ms829188e9,victory-nvidia-20261129-124952.log):refreshesmed11.05 ms(-3.00 ms/-21.4%),stepsmed22.60 ms(-2.45 ms),sub_allmed41.15 ms(-2.85 ms, mean41.19 ms-5.36 ms/-11.5%)17.40(mean18.25, p1010.3+1.0 FPS), 1,927 frames in 104s (+5.3%),>50ms48.3%(-7.2%), p9584.7 ms(-6.6 ms), max196.6 ms(-53.2 ms)cargo testpassed for the crates it touches: yes (cargo test -p victory-gpu --lib --locked -- --test-threads=1— 915 passed, 0 failed;cargo clippy -p victory-gpu --lib --tests --locked— exit 0, 5 pre-existing dead-code warnings cleared, 0 new warnings).Checked for overlap
Batchhot caches inhost.rs, does not touchrefresh_front/flush_allnothing_new_withrewiring), supersedes #1676 (closing #1676 in favor of this focused PR sinceahead_contains,Shadow::copied/ranged_lockfree, andwatch::is_keptalready merged onmain).@Dukestar69 on GitHub · 2026-11-29 10:22 UTC · original · approved these changes
Tested locally merged onto
main(829188e9).crates/victory-gpu/src/host.rs.cargo test -p victory-gpu --lib host::refresh_tests::passed.cargo test -p victory-gpu --lib shadow::passed (71 passed; 0 failed; 5 ignored).Clean rewiring of lock-free
nothing_new_withandwide_chunkinrefresh_frontandflush_all. LGTM.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@Nazzgy on GitHub · 2026-11-29 11:36 UTC · original
Independent Series S run on an RTX 3080 with the exact
c4ff2452release build. Both builds used the same checkpoint, the same logged gameplay settings, 1080p DLSS Performance with FSR 3 2x, and a copy of the same prepared host library. FRONT_SIFT and WIDE_CHUNK stayed at their defaults. The candidate visibly reached the expected scene.In 30-second gameplay samples with similar draw counts, the median copy refresh cost was 24.30 ms on
829188eand 21.80 ms on this PR. Median draw counts were 5,436 and 5,483. Rendered FPS medians were 14.0 and 11.7, with 6 and 5 periodic reports. GPU time was also different in those samples. These observations support a lower cost for the refresh step on this rig. Overall frame pacing needs a repeated comparison.The candidate took longer to reach the same view, so these windows began at different times after the first upscale. Check the rendered scene and loading phase before interpreting periodic FPS during startup.
@iBooM72 on GitHub · 2026-11-29 13:49 UTC · original
I tested this PR at
c4ff2452against its base,829188e9. Refreshes were about 4-5% faster, but I saw no FPS gain. This is a small test (1 base run and 2 PR runs), so both results could be normal variation.System: RTX 4070 Ti 12 GB (driver 621.01), i7-14700K, 32 GB RAM, Windows 11 build 26300.
Settings: Series X,
1080to1440, DLSS Quality, frame generation and ray tracing off, 120 FPS cap,VICTORY_PATCH_SSE4A=0,VICTORY_KEEP_SHOWN=checked.VICTORY_FRONT_SIFT,VICTORY_FLUSH_SIFTandVICTORY_WIDE_CHUNKweren't set. The logs list identical Victory settings for all three runs, apart from folder paths.Method: I built both versions with
cargo build --release --locked -p victory. Each had its own folder and one preload and warm-up run that isn't counted. The save and settings were reset before every run, and the planned route was the same. Runs were in the order base, PR, PR, with about 3 minutes in the world each. The table shows medians from 60 s after the first reading with over 1,000 draws until the last one (about 2 minutes, 24-25 FPS readings per run).cargo test -p victory-gpu --lib --locked -- --test-threads=1gave 915 passed, 0 failed and 57 ignored on both commits.victory-gpuhad 16 with the PR and 21 on base. The PR removes thenothing_new_with,wide_chunk,MANY_CHUNKandahead_snapones.unwind_copyinvictory-loader/src/crash.rs, which this PR doesn't change.Limits: with only one base run, I can't tell how much base varies. #1151 reports about 2.5 FPS of noise between runs, and the two PR runs differed by 0.9. I didn't record background activity or compare graphics, so this doesn't rule out visual differences. Other CPUs may show a different result.
Logs (redacted): the full play logs of the three runs in the table. The warm-up logs aren't included.
Analysed and written with an AI assistant (Claude Code); the game runs were on my PC.
pr2175-three-runs.zip
@DoubleD17 on GitHub · 2026-11-30 07:58 UTC · original · edited 2026-11-30 09:57 UTC
We ran a test of this PR on current main (
41adb551with this PR merged), on a CPU-bound machine.We compare only the seconds where the idle camera shows the same lighter views (about 7,500 draws a frame). Its heavier view (about 15,000 draws, half the frame rate) takes 10 to 60 s of each 150 s run, and it moved whole-run means by several ms.
No difference we can measure. The five main runs of the session agreed within 1.3 ms on these seconds. But we also ran main again, built in another folder, eight times: it ranged from 57.5 to 65.5 ms. Its first four runs were 2.4 ms slower than main on average, and the last four 4.2 ms faster. All nine PRs we tested in this session came out 0.4 to 3.9 ms slower than main, and fps moved with it. So we read the difference as a newly built executable, not as this PR.
The submitting thread's refreshes, which this PR aims at: 20.4 and 18.9 ms a frame, against 18.9 to 21.2 on main.
Picture: 0 defects in 160 frames.
Setup:
41adb551(only its own commits on top), against41adb551itself;Picture check: a burst of 10 captures a second at the end of each run (80 frames), looked at frame by frame.
AI Assisted
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.