Watch: avoid VirtualQuery in write-fault waits using OPEN_DONE (VICTORY_FAULT_ASK) #1908
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!1908
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1908"
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?
@Nosheboo on GitHub · 2026-11-29 02:14 UTC · original
Nosheboo:port/foxhound-fault-ask→main· +141 −11 · 1 files · 1 commits · merged 2026-11-29 08:16 UTCFixes #
What it changes
Ports
VICTORY_FAULT_ASK(OPEN_DONE,AGAIN,again,again_at, andopen_unlocked/settle/installfast retry path) fromreadmet3xt-lab/foxhoundcommit4349ab56(GPL-3.0-or-later) intocrates/victory-gpu/src/watch.rs.OPEN_DONE(cleared in both normal and!tookpaths ofsettle()).install()), lets a faulted thread spin briefly without blocking on the guard lock or asking Windows viaVirtualQueryuntilOPEN_DONEshows the block is settled, with per-thread rapid-retry capping (again()/again_at(), max 1 rapid retry per address within 1 ms before falling back towritable(at)).VICTORY_FAULT_ASK=1(viacrate::asked_for!("VICTORY_FAULT_ASK")) to ask Windows directly inside the 100 µs spin loop as before.crates/victory-gpu/src/watch.rs.How it was tested
clippy, andrustfmtverified locally; live in-game telemetry A/B pending after merge/release testing.VirtualQuery(writable(at)) inside the 100 µs fault-wait loop.OPEN_DONElets settling finish lock-free on the hot path andagain()/again_at()bounds rapid same-address retries to avoid spinning forever if memory stays read-only; verified by new unit testwatch::ask_holds::fault_again_caps_rapid_retries_and_resets_across_addresses_or_delay(includingstd::thread::spawnper-threadAGAINisolation).cargo testpassed for the crates it touches: yescargo test -p victory-gpu --lib --locked -- --test-threads=1on7fcac7f:590 passed; 0 failed; 44 ignored(--test-threads=1used due to pre-existing parallel watch flake #724;VICTORY_HOME/LOCALAPPDATAisolated,VICTORY_STREAMLINE_DIRunset).cargo clippy -p victory-gpu --no-deps --all-targets --locked: 0 warnings incrates/victory-gpu/src/watch.rs(only pre-existing baseline warnings elsewhere invictory-gpu).rustfmt --edition 2024 --config-path rustfmt.toml: 0 formatting diffs on touched lines incrates/victory-gpu/src/watch.rs.cargo xtask policyfails on pre-existing untouchedcrates/victory-shader/src/emit/lower.rs(> 655,360 bytes) already present onmain(#1460/#1493/#1527).Checked for overlap
VICTORY_FAULT_ASK/OPEN_DONEincrates/victory-gpu/src/watch.rs.Council review
gpt-6-luna(xhigh)gpt-6-luna(xhigh)nosh-perf)gpt-6-luna(xhigh)H1baseline,H2–H3,H5)H1acknowledged baseline,H2–H5resolved)Created with Gemini Pro Orchestrator (Neon) and reviewed by GPT-6 Luna (xhigh) in T3 Code.
[pr-performance] Watch: avoid VirtualQuery in write-fault waits using OPEN_DONE (VICTORY_FAULT_ASK)to Watch: avoid VirtualQuery in write-fault waits using OPEN_DONE (VICTORY_FAULT_ASK)@Dukestar69 on GitHub · 2026-11-29 03:36 UTC · original · approved these changes
Tested locally merged onto
main(568c5e5).crates/victory-gpu/src/watch.rs.cargo test -p victory-gpu --lib watch -- --test-threads=1passed (53 passed; 0 failed, includingask_holds::an_asking_waits_only_for_the_pages_it_asks_about,fault_again_caps_rapid_retries_and_resets_across_addresses_or_delay, andranges_are_merged_in_order_and_told_apart) with 0 warnings inwatch.rs.Clean
OPEN_DONEfault-wait path avoiding unnecessaryVirtualQuerysyscalls. LGTM.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@eleboucher on GitHub · 2026-11-29 07:36 UTC · original
PC result: RTX 4070 Ti SUPER 16 GB, Ryzen 7 9800X3D, 16 GB RAM, Windows 11, native 1440p,
VICTORY_BVH_BUILDER=1 VICTORY_ACTIVATE_RAYS=1, diagnostics build of main568c5e5dplus this PR and several others (one exe, one switch per run), 10-minute runs, medians after 200 s. Same exe without the switch: 24.3 fps (p10 23.5), preparing 30.6 ms.With the new path (no
VirtualQueryin fault waits): 25.4 fps (p10 24.6), preparing 29.2 ms, about +1.1 fps, the best of the five switches tried in this batch. No crash.@Bazovsky on GitHub · 2026-11-29 11:00 UTC · original
A measurement from after the merge, in case it helps: on a Ryzen 9 9950X3D + RTX 5090 the new default costs the submitting thread about half a millisecond a frame against
VICTORY_FAULT_ASK=1, in one of the frame line's parts.2560x1440, DLSS Quality, frame generation off, started with
victory play;e1f2eb6with this PR merged in, 190 s runs in turn. A loaded save standing in the first playable scene (about 4,800 draws a frame), seconds 60 to 140 of 3D counted. The frame line's "putting the title's bytes under flights' writes":VICTORY_FAULT_ASK=1829188ethe same direction showed in two runs (1.2 against 0.8 ms), but those ran while the PC was short of memory, so I would not lean on them.Measured unattended by an AI assistant (Claude Code) on my PC.
github-bot referenced this pull request2026-11-29 17:39:14 +00:00