Repository navigation
puller: decide met semaphore acquires without draining the split's back (stacked on #243) - #956
Draft
robertveloso wants to merge 5 commits into
Draft
robertveloso wants to merge 5 commits into
robertveloso wants to merge 5 commits into
Conversation
Reads of report memory (pages 3D reports and semaphore releases write) are answered on the front from guest memory, with the queued writes the front knows the words of on top (fence releases, inline uploads), once the back ran the queued writes it doesn't know that overlap the read. Pages GPU shaders or copies wrote, counter reports whose host query hasn't completed, and fence releases the back ran before their host fence signalled take the drained path, which flushes pending query results (zortos293#215). Queued compute and copy work is waited for before the page checks. EDEN_NX2_DMA_READ_CHECK=1 drains, flushes and compares every early read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 7035379)
…known writes A block-linear upload doesn't write the byte range from its address, and a linear one only does when every page maps contiguously on the device. Both now note an unknown write; the inline data reuses the range launch_dma found. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 7735da2)
Every Switch 2 semaphore acquire drained the back before reading the word (Ocarina of Time: ~5,800 a second, ~170 ms of the front's time), and most are met already. The macro DMA read path already reads report memory as the back will see it without a drain: guest memory with the queued writes the front knows on top, after the queued compute and copy writers ran. That path is now ReadReportWordsQueued, and acquires use it first: one it shows met continues at once; any other (unknown or not met) takes the drained path as before. EDEN_NX2_PERF_VERIFY drains anyway and reports a met acquire the drained read disagrees with. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 50f56af)
Review of the previous commit: GPU-written command lists on pages queued draws wrote are read once the back passed the last sync point (WaitForSync), and acquires provided one by draining. A met acquire that skips the drain now notes the sync point instead, so a list fetched after it still waits for the work queued before it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit fb970f0)
The front's profile line gains the outcomes of acquire reads without a drain (met, not met, not report memory, GPU-written page, pending writes), and the writer wait those reads make gets its own wait site (acquire writers) instead of counting as an acquire drain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 1b91ae2)
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Omfgnowai
pushed a commit
to Omfgnowai/Lichii
that referenced
this pull request
Nov 9, 2026
…quires off by default with bail-out counters Build-18 runs 12b/12c (Castle Town): EDEN_NX2_EQUAL_ACQUIRE cut drained acquires from ~1.26 M to ~15k per 10 s and frame times from 17-21 to ~17 ms at a 60 cap; its verify run found 0 acquires passed that a drain doesn't meet. The report-memory read (zortos293#956) never passed one and waited for the queued writers each time: now EDEN_NX2_REPORT_ACQUIRE=1 turns it on, and the acquire line logs why its reads bail out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PqTTnurEBDTbs9dv5uKn6x
ThatGuyMcd
added a commit
to ThatGuyMcd/Lichii-TGM
that referenced
this pull request
Nov 9, 2026
Ports the channel clearing behavior of PR zortos293#615 and the met-acquire sync point guard of PR zortos293#956.
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.
Changes
With the GPU thread split, every Switch 2 semaphore acquire drains the back before reading the semaphore word:
ProcessSemaphoreTriggerMethodon theg_nx2_amperepath, andCanResumeAcquirefor a parked channel. Most acquires are already met.In Ocarina of Time on my machine, the front's profile showed about 3,000–5,800 acquire drains a second, taking 170–450 ms of the front's time each second. At that rate the front and back mostly take turns instead of overlapping. The worst case was Hyrule Field, at about 54 ms per frame.
#243's drain-free read of report memory moves into a function,
ReadReportWordsQueued, and acquires use it first:NoteSync), because a drain would have run the work queued before the acquire. A GPU-written command list fetched after it still waits for that work (WaitForSync).EDEN_NX2_PERF_VERIFY=1drains anyway and logs a met acquire that the drained read disagrees with.The last commit only adds measurement:
acquire writers.Known gap: a queued draw that writes the semaphore word through a storage buffer isn't seen. That page is only marked GPU-written once the back runs the draw. #243's macro DMA reads have the same limit.
Testing
Machine: Ubuntu 26.04, i5-10400, RTX 3060 (NVIDIA 580.178). Game: Ocarina of Time.
nx2plus video_core: macro DMA reads on the split front without draining the back #243, Ocarina of Time: fix stutter from pipeline rebuilds and slow compute builds #408, buffer_cache: opt-in EDEN_NX2_PREFLUSH=1 for Switch 2 titles (OoT Kokiri ~26 -> ~40 fps, some flicker) #259, shader_warm: follow-ups to #579 (warm-up on the loading screen, link mode in the marker, save the driver cache after a warm-up) #741, buffer_cache: upload each byte of native uniform banks once a frame #802 and my other perf PRs from today.puller.cpp,maxwell_3d.cppandgpu_split.cppwith-fsyntax-only. I did not build or play this exact branch.EDEN_NX2_PERF_VERIFY=1run, and the new counters, which aren't in a played session yet. Draft until both are done.🤖 Generated with Claude Code