Repository navigation
Conversation
… instead of taking the registry lock fb_prepare took and released g_rmu for every texture binding of every draw's fragment shader to read the ID's serial. It now reads the lock-free copy the store lookahead already uses (h_ser, g_tser), which mtl_reg_tex writes with the registration. Same answer: 0 for an ID with no texture. t_feedback (242 checks) passes unchanged.
|
Ran on an M2 MacBook Air with Ocarina of Time as part of a set with #2542 / #2543 (in-run A/B to frame 12000 at handheld 1440x810): no regressions, no red lines, unit tests pass. This change was on in both arms, so we didn't measure it on its own; by our count of its call sites on this route it's in the ~0.01-0.03 ms a frame range. |
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 ( |
|
OoT-fps combined phone build, against the baseline (session A, A-2) iPhone 17, Ocarina of Time, Kakariko Village by day, unattended drive script, 7 minutes each, back to back (2026-11-13, 22:20 and 22:36). Medians over the gameplay windows (more than 1,000 draws a frame).
Against A-1's targets:
An earlier pair that cannot be compared: the first pair (21:04-21:19) gave 11.4 fps for the baseline and 29.2 fps for the combined build. That gap is the time of day, not the change: the baseline's save loaded Kakariko at night (GPU p50 60 ms) and the combined build's by day, as B found (#2582). Every run's The combined build is the one installed on the phone. |
#2544) The same-pass feedback checks took and released g_rmu for each texture binding of every draw's fragment shader only to read the ID's serial: fb_prepare and fb_depth_rule (every draw with a depth target) over the same textures, fb_texu_reads for handles in uniform buffers, and fb_tile_plan. They now read the lock-free copy mtl_reg_tex writes in the same locked block as the registration (g_tser), through tid_ser, which h_ser now calls; it holds exactly what the locked read returned (mtl_reg_tex is the only writer of a registration's ok and texture, the registry only grows, IDs are 20 bits). fb_tile_plan takes g_rmu only for a texture that is an attachment this pass wrote, and checks under it that the ID still holds that serial before it fetches the texture. Measured on an M4 Pro (20-core GPU), Ocarina of Time, kokiri-deck, three runs a side on 1dbbf22 (the last commit of the chain its library was built on; the feedback code is main's): standing on the deck, submit instructions a frame fitted at 2,180 draws 73.86 -> 72.72 M (-1.5 %), submit CPU p50 9.61 -> 9.57 ms, within run-to-run noise; frame time unchanged, no red lines. One run left the route at 92.8 s and was not fitted. Checked: t_feedback (324), t_nvn, t_sbw, t_view_reuse, t_vc_lifetime, t_rt_lifetime, t_stencil_view, t_view_swizzle, t_image_usage; lint_c tidy. Co-authored-by: stan69b <3304418+stan69b@users.noreply.github.com>
|
Landed on main as edc5701, credited to you with The same locked read of an ID's serial was in three more places in the feedback code, so all four now go through one helper,
Measured on an M4 Pro (20-core GPU), Ocarina of Time,
Both differences are within run-to-run noise. Frame time is unchanged and there are no red lines. It landed as a simplification: the four sites now share one lock-free read, and the gain is too small for this Mac to measure. The same runs also gave a measured number for the #2542 view cache, now in its reference entry: 73.93 → 73.06 M instructions a frame (−1.2 %), and submit CPU p50 9.40 → 9.18 ms. |
OoT-fps batch, session C (submit-thread CPU per draw), item C-4. The ranked list of where the submit thread's time goes (C-1) is in #2542.
fb_prepare(same-pass feedback, run for every draw) took and releasedg_rmufor every texture binding of the draw's fragment shader just to read the ID's serial. It now reads the lock-free copy the store lookahead already uses (h_ser,g_tser), whichmtl_reg_texwrites with the registration; an ID with no texture still reads 0. For every game. Small on its own: in the ranked listfb_prepareis about 6 % of the submit thread's busy time, the lock pairs a part of that; with C-5 it moved the standing scene from 38.7–39.3k to 38.6–38.8k instructions per draw (M4 Pro), within noise.Checks
t_feedback(242 checks),t_nvnpass unchanged;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.