Repository navigation
Conversation
…can see them (Ocarina of Time -0.2 ms of GPU time a frame on an M1) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Not doubting your results (I'd take -.2ms on my M2) but how are you testing to remove variance for a change so small? I've needed to really add a lot to the test regiment to control for variance to confirm results of -.5 @ p50. On a fan-less M1/M2 temperature alone can create a lot of variance in results. |
NXNative has features to A/B test different configuration ever X frames |
The rows seedds#2577, seedds#2441 and seedds#2574 added went in out of order; test_env_switches compares the table with the sorted output.
|
Results on a base M2 (MacBook Air, 10-core GPU, 16 GB, macOS 27.0) Ocarina of Time, handheld 1440x810, 1. On main b06f4e0 (11-13), 20 clean pairs: frame p50 −11.7 ms [−24.2, −4.4], GPU p50 −3.8 ms. That main often fell into a launch-wide slow state on this Mac: the residency state #2715 removes, see #2751. Most of that gain came from inside it. 2. On main 0def324 + #2715 (
Without the slow state, the effect on this Mac is within run-to-run noise. The traffic and pass counts lean the right way, but none clears its interval. That's consistent with the −0.2 ms you measured on an M1: smaller than this kind of A/B resolves on a fanless Air. No hangs and no new red lines in either test. We're keeping it in our build. |
…can see them (PR #2574) A samples-passed reset drops the counts gathered since the last report unread, so draws between a samples-passed report or reset and a following reset in the same submission never reach a value the game reads. After each samples-passed report or reset the host now looks ahead through the submission (stepping over multi-draw records, since the scan moves no work) and, when the next samples-passed op is a reset, encodes those draws with visibility counting off. Reported values are unchanged. DM_NVN_VIS_NEED=0 counts every draw as before; ab alternates with DM_AB. t_vis_need covers reset/report sequences, a report read across submissions, multi-draw records and called command buffers, with the switch on and off (29 checks each). GPU time: about -0.2 ms a frame in Ocarina of Time on an M1 (the PR's A/B); within noise on the M4 Pro (-0.05 +/- 0.08 and +0.05 +/- 0.17 ms). Ocarina gameplay reaches the path and draws whole; BotW regress passes (19592/19592 shaders, 59.7 fps, no new red lines). Co-authored-by: Adya <114347520+AdyaGMD@users.noreply.github.com>
|
Thanks, landed as 0de2ac2 on main, redone on current main with you credited as co-author. What changed from the PR:
Measurements on an M4 Pro: Ocarina GPU time is unchanged within noise (−0.05 ± 0.08 and +0.05 ± 0.17 ms in the two polarities), so the −0.2 ms gain rests on your M1 numbers. Ocarina gameplay reaches the path and draws whole. BotW's regression check passes (19592/19592 shaders, 59.7 fps, no new red lines). If you can, an A/B on your M1 with main ( |
What
Once occlusion-query counting has started, every draw counts samples into the current visibility slot. NVN's samples-passed counter is a running total that a reset zeroes. So after a samples-passed reset or report, if the next samples-passed op in replay order is a reset, the draws up to it add to a total no report ever sees.
With
DM_NVN_VIS_NEED(on by default;=0counts every draw again,abfor theDM_ABphases), each samples-passed reset or report scans ahead (vis_need_scan) for the next one:The reported values are the same.
zskip_vis_deadalready reasons this way for skipped draws. The scan uses its own cursor (vis_next), which steps over indirect multi-draws;fz_nextstops at them because it moves work, and this scan moves none.The per-draw counting setup moves into
vis_draw_state, which task / mesh draws now call too. Before, they kept whatever mode the last ordinary draw had left.Why
Ocarina of Time wraps nearly every scene draw in its own query (reset, draw, report: about 1,800 a frame), and the draws between a report and the next reset counted for nothing.
Performance
Ocarina of Time (0400486024DEC000), Kokiri Forest, MacBook M1 (8-core GPU), fullscreen, in a tree with other local changes. The frame is paced at 30 fps, so this measures GPU time (
DM_NVN_GPUPROF"first start to last end", frames 1200–3600) in one run per row:DM_NVN_VIS_NEED=ab, 300-frame phases=ab:0/2(polarity swapped), 450-frame phasesAbout −0.2 ms of GPU time a frame. Draw counts are the same with it on and off (the same objects pass their queries), and screenshots look right.
Switch (in
docs/env_switches.tsv)DM_NVN_VIS_NEED=0|1|ab: on by default.Checked
Not run
🤖 Generated with Claude Code