Park emulated MONITORX/MWAITX waits on GPU fence signals #1020
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!1020
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1020"
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?
@Lkxex on GitHub · 2026-11-25 16:24 UTC · original
Lkxex:perf/park-console-fence-waits→main· +267 −3 · 8 files · 1 commits · openThe frame pacing notes in
465b94freport about 280,000 emulated MONITORX/MWAITX exceptions per second on Intel while the title polls a layer-owned graphics fence. The current handler spins at each MWAITX, so a thread that cannot advance keeps reentering the exception handler.With VICTORY_MONITOR_FENCE_WAIT=1, the GPU layer registers the exact address it exposes for a fence. MONITORX captures a generation ticket for a registered address, and MWAITX consumes it and can use WaitOnAddress with a requested 1 ms timeout. Publishing a fence value advances the generation and wakes the waiters. Capturing the generation before the wait handles a signal between MONITORX and MWAITX. The ticket owns the wake word independently of the fence so release and address reuse are safe. The handler never reads the guest-supplied address, falls back to the existing hint for unknown addresses or a busy registry, preserves Windows last error across the wait, and leaves the title's condition check in place. The switch is off by default.
On Windows with a Ryzen 5 5600, a synthetic producer issued 64 signals per run. The benchmark invoked the actual emulation functions directly:
Both modes observed all 64 signals. The test counts emulation calls, not OS exceptions, and there is no in-game FPS claim. Core tests cover multiple armed waiters, release/reuse, and last error. The GPU fence test with the switch enabled verifies that the actual fence API registers and wakes a ticket and removes it on release.
For an in-game Intel A/B, compare MONITORX/MWAITX exceptions per second in the existing log, the new emulated fence wait counters, and frame times with otherwise identical settings.
AI-assisted.
The diagnostics application also passed cargo check --locked -p victory --features diagnostics.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.