Repository navigation
Conversation
…rest Keep an open job at the head of its queue until its producer closes it. Publish sync snapshots at each boundary and retain program serials and texture descriptors until replay is done. Exercise the gap between prefix and suffix with a blocked producer and a second submission.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2987. Extracts the submission streaming change from #2912 onto
0b5fd6020093.An NVN queue now accepts the submission before the game thread finishes copying it. At each wait or fence, the producer publishes the completed prefix under the queue mutex. A worker that drains that prefix keeps the open job at the head of its queue. It can service other ready queues until the producer publishes the suffix. Program snapshots pin the initialization serial and resolve on replay. Texture snapshots use the existing owner pins. Frame capture and
DM_NVN_SUB_STREAM=0retain whole-submission copying.Mario Kart World race on M3 Max
Mario Bros. Circuit, Mushroom Cup, v1.0. Both graphics modes ran on the same 36 GB Mac on AC power (macOS 27.0.1, Xcode 27.2). The host, game modules, and shader library were built against the stated revision (chain
03a3ac831bfb). All runs used the same starting save, direct race boot, no player input, and a shared private pipeline archive. A separate warm-up race filled the archive before timing.Uncapped, the same PR binary alternated streaming every 300 frames. Each mode ran twice with opposite starting states. For frames 1800–5399, the first 75 frames of each phase were discarded to let timing settle. Each row pools 2,700 frames over 12 phases. FPS is 1,000 divided by mean frame time. Lower frame and GPU times are better.
The streamed half had a lower median frame time in 9/12 matched docked phases and 11/12 handheld phases. Each match compares the same frame range across the two runs with the switch reversed.
Frame medians for matched 300-frame phases (ms)
Separate fixed-setting docked runs
In the first fixed docked pair, the PR improved median and p95 frame time, but its mean FPS fell from 76.79 to 75.50. Frame 2212 took 2,917.42 ms wall time. Its recorded GPU time was 15.09 ms and it created no new pipeline or shader library. The unmodified run’s longest frame was 166.39 ms. The cause of the long frame is unresolved. All frames are included in the fixed-run table.
The fixed comparison was repeated in reverse order after a separate archive warm-up. The longest frame was 20.25 ms on unmodified main and 34.67 ms with streaming. At the 60 fps target, the game selected a two-vsync step for 62/1,800 frames with streaming off and 0/1,800 with it on.
The fixed-setting runs use the full race window (3,600 uncapped frames or 1,800 capped frames). FPS in this table comes from elapsed wall time. Other desktop GPU activity was 10–22% before these runs. Desktop indexing also used CPU. Opposite phase orders reduce scene bias, but opponents and items can still vary between races.
Reproduction
DM_NVN_TSV. UseDM_OPMODE=1for docked orDM_OPMODE=0for handheld. For an uncapped run setDM_FPS_TARGET=0 DM_PRESENT_HZ=0 DM_PRESENT_LINK=0 DM_PRESENT_SCREEN=0 DM_VSYNC_HZ=240.DM_AB=300 DM_NVN_SUB_STREAM=ab, thenDM_AB=300 DM_NVN_SUB_STREAM=ab:0/2. The host logs each active phase asSUB_STREAMorbase. For capped runs, useDM_FPS_TARGET=60and fixedDM_NVN_SUB_STREAM=0/1with the normal presentation settings.Order, lifetime and regression checks
t_wait_eventcase pauses the producer while copying the command after a fence. The GPU completes the preceding copy while the producer is parked. A second submission on the same queue stays pending and reads the first job’s final value after the producer resumes.t_queue_lifetimeparks replay, finalizes and reuses the guest program and texture objects, then checks the rendered pixels. Together witht_wait_event,t_queue_origin,t_render_enable_queue,t_sub_overlap,t_serial_owner, andt_nvn_accel, it passed with streaming both enabled and disabled. The docs and switch checks passed.git nx qtest --all, repeated in keep-going mode to run the rest) had one failure at the OpenGLtest_lod_biaspixel assertion int_gl_imports.m:427on this M3 Max. Unmodified0b5fd602failed the same assertion with the same Metal validation settings. Every other test target completed successfully.scripts/regress.py check --games 0400C3F00006E000 --quickpassed on Mario Kart World, the available local Mac game build and the title from nvn: retest submission streaming in Mario Kart World #2987. Both revisions booted. All 11,559 shaders built on both sides, with no changed MSL, new interface failures, or new RED diagnostics. The harness marked the candidate boot as busy. The existing swizzled-texture CPU fallback also appeared in both race logs.