Repository navigation
OoT-fps C-3: a submission's commit reads only the storage-write pages it noted, not all 16,384 slots - #2543
OoT-fps C-3: a submission's commit reads only the storage-write pages it noted, not all 16,384 slots#2543stan69b wants to merge 1 commit into
Conversation
… it noted, not all 16,384 slots gw_commit walked every slot of the storage-write page set (g_sbwp, 16,384 slots, 256 KB) to find the current submission's pages whenever it had one. Ocarina of Time makes about 30 submissions a frame, so the walk ran about 30 times a frame. The set now lists the slots a submission takes (g_sbw_list) and the commit reads only those; which pages enter the running-write tables is unchanged, and their order does not change the tables. Standing on the Kokiri Forest deck (M4 Pro, 640 draws a frame), with C-2: 43.3-43.7k -> 38.7-39.3k instructions per draw on the submit thread. t_sbw gains checks of the list and the commit (they need the list, so they do not build without it). docs/reference/frame-rate.md entry, symptom index, game note line.
|
Tested on an M2 MacBook Air (16 GB, macOS 27.0, AC), Ocarina of Time, together with #2543 / #2542. We applied C-2 and C-3 on our test line (7f50222 base plus our own PR set) behind one runtime switch and ran an in-run A/B: alternating 240-frame phases on and off in the same run, along our scripted Kokiri Forest route to frame 12000 at handheld 1440x810, 60 fps cap. Two valid runs; a third ended early in an off phase (a stall we haven't attributed) and gave no data.
We couldn't separate C-2 from C-3 in this test; the desk estimate is about 0.25-0.33 ms for C-2 and 0.2-0.4 ms for C-3 of submit-thread time on this route. |
iPhone 17, Kakariko Village: C-2 to C-5 together, before / afterUnattended runs with the batch's drive script (
What is left of the submit thread's cost per draw (C-1's ranking in #2542): argument blocks ( |
|
Landed on main as f63ecbd, with you credited as co-author. The code and the new t_sbw checks are as you wrote them. The docs give this change's own share (42.8–43.9k → 38.7–39.3k instructions per draw, with #2542 on both sides) instead of naming the unmerged C-2. PR #2458 (PucaVaz) made the same list change a day earlier, so it is credited too. t_sbw, t_ubp_running, t_nvn and test_docs pass. Thank you! |
OoT-fps batch, session C (submit-thread CPU per draw), item C-3. The ranked list of where the submit thread's time goes (C-1) is in #2542.
What changes
The pages a submission's storage buffers, texture→buffer copies and reports write are kept in an open-addressed set of 16,384 slots tagged with the submission (
g_sbwp,sbw_note). At commit,gw_commitwalked all 16,384 slots (256 KB) to find this submission's pages whenever there was one, and Ocarina of Time commits about 30 submissions a frame. The set now lists the slots a submission takes (g_sbw_list) and the commit reads only those. Which pages enter the running-write tables (g_gw,g_gwx) is unchanged, and the order they enter in does not change the tables. For every game.Measured (M4 Pro, Kokiri Forest deck, standing, 640 draws a frame, encode thread on as on iOS)
Checks
t_sbwgains checks of the list and the commit (39 checks; they need the list, so they do not build without it).t_ubp_running(25),t_nvnpass;test_docsOK.scripts/regress.py check --baseline upstream/main --games 0400486024DEC000on the stack of C-2 to C-5 (Apple M4, macOS 27.2; Ocarina of Time's title route from the unmerged ed769e9smoke.tsv, as main has no route for it): shaders PASS (42848/42848, no MSL change), boot ok, fps p50 59.5 → 59.5, frame p99 17.82 → 17.81 ms, peak 2879 → 2872 MB, no new RED line. The check's status is REGRESSION because of its two screenshots (350 s, 385 s). They show different title backdrops (a forest at night vs Gerudo Desert; Lon Lon Ranch vs Lake Hylia), i.e. the backdrop rotation's timing, not a rendering difference. The same two screenshots were flagged between unrelated revisions on 2026-11-12 (0c07813 vs b8cb0bd), and with one run per revision the harness has no noise to compare against. A bit-exact replay check is not available for this game:DM_NVN_CAPTUREcannot capture its multiple NVN queues. Gameplay on the Kokiri Forest deck renders correctly in the bench runs. Other local NVN games (Echoes of Wisdom, Super Mario 3D All-Stars) were not run: pending.