Avoid yielding on zero-timeout frame polls #538
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!538
Loading…
Reference in a new issue
No description provided.
Delete branch "holoslicer/Darner:fix/nonblocking-frame-polls"
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?
Contributor role (optional)
Please credit Fluxer ID
1577921940104949761for the Contributor role on merge.What it changes
On Windows,
WaitFrameEventXcan give up the calling thread's time slice when the title requests a zero-timeout poll. If the next frame tick is in the future,maincallsstd::thread::sleep(Duration::ZERO)before returningS_FALSE. This change skips the sleeper when the requested duration is zero. Positive waits still sleep for the shorter of the time to the tick and the timeout.How it was tested
I compared
c8258f9(A) and6186d7b(B) on Windows 11 x64 with an Intel Core i7-12700K. The measurements use an emulated device and synthetic calls. Gameplay and in-game frame times remain untested.WaitFrameEventXwith event kind0, timeout0, no handles and flags2. Check forS_FALSEand a token increment of one on every measured call.With the worker stopped, both builds recorded a 0.1 µs p50 over 30,720 polls per revision. At that scale the timer rounds readings to 0.1 µs. Blocking controls used event kind
2, a 1,000 ms timeout and 72 measured waits per revision at each interval. Their means were 33.34 → 33.32 ms at 30 Hz and 16.73 → 16.67 ms at 60 Hz. Contention and the Windows scheduler affect these timings. Settings and cap defaults stay the same.I ran these checks on
6186d7b.cargo test --workspace --offline --locked -- --test-threads=1 --skip oracle64::legacy_mul_forms_are_exactpassed, including the new deterministic test for polls, elapsed ticks and positive sleeps.oracle64::legacy_mul_forms_are_exactpassed in 229.36 seconds.cargo clippy --workspace --all-targets --offline --locked -- -D warningspassed. The same command with--all-featurespassed.cargo xtask policypassed for all 576 files.Checklist
main.docs/asset-policy.md.Checked for overlap
frame.rs.0249058, a zero-timeout call on a manual-reset event returnedS_FALSE, thenS_OKafter signaling, thenS_FALSEafter resetting. The token advanced only on the two timeouts.frame.rsfor menu and reset handling.WIP: [pr-fix][rendering] Avoid yielding on zero-timeout frame pollsto [pr-fix][rendering] Avoid yielding on zero-timeout frame polls[pr-fix][rendering] Avoid yielding on zero-timeout frame pollsto Avoid yielding on zero-timeout frame pollsTest needed — commit
6186d7ba; what to check: On Windows,WaitFrameEventXcan give up the calling thread's time slice when the title requests a zero-timeout poll. If the next frame tick is in the future,maincallsstd::thread::sleep(Duration::ZERO)before returningS_FALSE. This change skips the sleeper when the requested duration is zero. Positive waits still sleep for the shorter of the time to the tick and the timeout.Evidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture.
Reply
testingto take this run; it's free again after 24 h with no results.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.