Repository navigation
nvn/fstep: judge frames around display-link events by their GPU time - #3156
Eriksrevenge1 wants to merge 1 commit into
Conversation
|
Rebased on current main (a README conflict only); the host builds. The earlier Tool tests failure came from a stale merge base: test_patches and test_nvn_rt_api pass on current main with this change. |
4c92e13 to
fb18a88
Compare
fb18a88 to
98cf9ee
Compare
While the display link is silent the acquire waits for a present the link never takes, and that wait counted as the frame's CPU cost; after a rescue or a pacing mode change the first frames wait for the screen the same way. Three such frames raised the hold 1 -> 2 -> 3 (20 fps) for up to a second each time a window was covered or shown again. nvn_mtl.m counts the link's events (stall start and end, rescue start and end, pacing mode change; mtl_link_events). While the link is silent and for 30 frames after an event, fstep_tick takes a frame whose GPU time fits its hold as on time; a GPU-bound frame is judged as before. Ocarina of Time, field-run with DM_TEST_LINK_STALL=95,3, two runs a side on an M6 Mac mini: 56.4 -> 59.4 fps, frame p99 51.2 -> 17.8 ms, frames over budget 91 -> 15. t_fstep: 119 checks pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Rebased on current main (conflicts in nvn_mtl.m with the probation change: kept main's code, link_event() added at the same events plus the probation's rescue); the host builds, test_docs and test_patches pass. Not run: GPU and game checks (no Metal 4 here). |
98cf9ee to
21472c8
Compare
|
Thanks @Eriksrevenge1 for isolating the pacing drop, measuring it, and rebasing the patch. I'm closing this PR because #3174 landed as The Ocarina of Time forced-stall run on the M6 Mac mini is a good baseline to keep. With |
…nts by their GPU time
…nk events by their GPU time): closed, superseded by seedds#3174, on main as 6ef18a1 (the host signals window uncover, focus return and fullscreen changes; the frame step ignores the pause)
… and seedds#3156 reverted first (on main in its own form / superseded by seedds#3174); chain 6cc6fc49af97 -> 3fe2e3787fdf Conflicts, both sides kept: - hle_nvn.c: main's deferred acquire wait (c17a549, acq_wait bound to the sync) takes the batch's acquire fence (seedds#1847's 81c6189: the image's own last present, pfence, snapshotted with the ticket under acq_mu; DM_NVN_ACQ_FENCE=last the old one) as aw->gpu_fence, and DM_NVN_FRAME_LAG's wait at the acquire's start; the present notes the lag ring before publishing its ticket, and @lag_ms stays beside main's atomic @wait_ms / @pq_wait_ms. nvn_obj.h win_t has pfence and pending_acq. - nvn_mtl.m: the pool cache keeps seedds#1847's last-hit entry in front of main's 64 KB region table (a359f9e); ubd_conflict_scan's partial look walks main's buffer binding list (e49e481). - shader_lib.py: seedds#2140's shared payloads with main's on_progress (seedds#2684). - hle_fs.c: the profile's RomFS files beside main's releasable mounts (seedds#3217). - game.py (main's mem_map_limit default), pack_app.py (--tweaks and --mesh-pairs), env_switches.tsv, frame-rate.md, services.md, Ocarina's note: both entries. - dm/host/tests/Makefile: t_crash_diag (new on main) links memstat.m, which seedds#2261's GPU share line makes use IOKit: -framework IOKit. Chain header is main's (dmsh_chain.py --header agrees); symptom index, game-patches.md and env_switches.tsv order regenerated.
What and why
While the display link is silent the acquire waits for a present the link never takes, and that wait counted as the frame's CPU cost; after a rescue or a pacing mode change the first frames wait for the screen the same way. Three such frames raised the hold 1 -> 2 -> 3 (20 fps) for up to a second each time a window was covered or shown again.
nvn_mtl.m counts the link's events (stall start and end, rescue start and end, pacing mode change; mtl_link_events). While the link is silent and for 30 frames after an event, fstep_tick takes a frame whose GPU time fits its hold as on time; a GPU-bound frame is judged as before.
Ocarina of Time, field-run with DM_TEST_LINK_STALL=95,3, two runs a side on an M6 Mac mini: 56.4 -> 59.4 fps, frame p99 51.2 -> 17.8 ms, frames over budget 91 -> 15. t_fstep: 119 checks pass.
Checked
0400486024DEC000, 1.1.1), a Mac app built from this branch, fullscreen on a DELL S2725QC (120 Hz, variable refresh), about 2 minutes from a Hyrule Field save with a scripted walk: no crash, no[RED]line, 60 fps (p50 16.67 ms, every 300-frame window under 17.5 ms). The before/after measurement in the commit (56.4 -> 59.4 fps underDM_TEST_LINK_STALL=95,3) was on a build with the same code.lint_clocally (no LLVM release installed here; CI runs it);regress.py check(no local game has a smoke route).Docs
docs/referenceentry or game note, andpython3 dm/tools/docs_symptoms.pywas run