Repository navigation
Make deferred GPU reference cleanup linear - #1408
Closed
givethesourceplox wants to merge 1 commit into
Closed
givethesourceplox wants to merge 1 commit into
givethesourceplox wants to merge 1 commit into
Conversation
fpedrolucas95
pushed a commit
to fpedrolucas95/nxnative
that referenced
this pull request
Nov 6, 2026
This was referenced Nov 6, 2026
Owner
|
Thank you. The deferred release queue is linear on main now (6121fd7), so I'm closing this. Final checks on the rebased tree (full shader build, walks, regression) are still running, so please report anything you see. |
Aeonitis
pushed a commit
to Aeonitis/nxnative
that referenced
this pull request
Nov 6, 2026
…er and shader chain, the branch's host services, movie clock, packing and Ocarina of Time additions Upstream reached about 60 fps in Kokiri Forest with its own versions of most of the branch's merged PRs, so where both changed the same code upstream's is kept: - The shader chain is upstream's (translator, lock, dmsh tools, Ryujinx sources), plus the branch's bracket-depth flattening (dmsh_depth.py, test_dmsh_depth.py); chain c732699d4fdb. Not carried: the LDSM subgroup fence (seedds#1376, needs a translator rebuild; upstream's HMMA/LDSM rework reports clean movies) and the shared raw-memory lookups (seedds#1405, superseded by upstream's last-entry lookups). - The renderer (dm/gfx/nvn, dm/gfx/msl) and its tests are upstream's. Not carried: seedds#1390-seedds#1394, seedds#1404, seedds#1408, seedds#1409, seedds#1417, seedds#1418, seedds#1420, seedds#1427, seedds#1320, seedds#1331, seedds#1332, seedds#1368, seedds#1285 renderer parts, pool_skip_retired, and the branch's warning fixes and prewarm progress there. They stay on oot-integration. - Ocarina of Time's profile is upstream's, with the branch's 12 movie compute rows in pso_manifest.tsv, PLAN.md and PR-AUDIT.md. - shader_split.py is upstream's plus the BAHS record check (test_split_bahs_records.py). - Host: upstream's EventFd, PlayReport send, audio lock and vibration answers; the branch's service sessions (hle_sf, hle_prepo), sync waits, AV1 movie clock and parallel decode, diag_abort frame fix and focus control are kept. - Scripts: shader.noindex, tmp.noindex, notes outside the shader key, bench and regress changes. Checked: the Mac host builds (GAME=0400486024DEC000); host unit tests pass; the Python tool tests pass on Python 3.13 except test_dmsh_pool_arrays, test_nro_pack, test_nsp_dump and test_nsp_incremental, which fail on upstream main as well. Not run: the full shader build on this chain, gameplay.
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.
What and why
Scene transitions can queue many GPU references whose fences complete out of order.
defer_drainremoved every completed reference from the middle of an NSMutableArray, repeatedly shifting pending entries. Interleaved fences make cleanup quadratic.Partition ready and pending references once under the existing mutex. Release ready objects outside the lock in the same reverse order as before, retaining fence eligibility, pending order and keep-resident behavior. This is a CPU cleanup change, with no shader, pipeline or image changes. The small declaration shim for existing OS-27-guarded MetalFX setters is the same SDK-26 build prerequisite as #1404; runtime availability checks are unchanged.
Reference finding. Found while investigating Ocarina's scene-load stalls alongside #1299.
Checked
Apple M1 Pro, macOS 26.5.2, Xcode 26.5:
t_deferred_releasepasses: 100,000 references with interleaved completed/pending fences; exact pending order, reverse destruction order, retained lifetimes, second-fence completion and empty drain. The first half drains in about 7.8 ms on this machine. This is a synthetic result, not a gameplay FPS comparison.git diff --checkpasses.No standalone gameplay or five-game regression report is available for this upstream-base branch. The Ocarina bring-up depends on other open changes; its integrated runs cannot isolate this patch. Cross-game runtime behavior and iPhone performance are unmeasured. This PR claims the cleanup complexity improvement only.
Docs