Skip to content

Recheck GPU feedback after an unsignaled fence event - #1409

Open
givethesourceplox wants to merge 1 commit into
seedds:mainfrom
givethesourceplox:fix/nvn-feedback-wait-recheck
Open

givethesourceplox wants to merge 1 commit into
seedds:mainfrom
givethesourceplox:fix/nvn-feedback-wait-recheck

Conversation

@givethesourceplox

Copy link
Copy Markdown
Contributor

What and why

A rejected GPU command buffer can report completion through Metal feedback without signaling its shared event. The fast game-fence wait could remain blocked on that event for up to an hour, even after g_done had advanced.

Limit the initial event wait to 100 ms, recheck published completion, then use the existing feedback condition variable. A finite timeout shares its original budget across both waits. This recovers the completed-fence wait; it does not prevent the GPU error that caused the missing signal or claim a normal-frame performance gain.

Reference finding. Found during Ocarina's memory-fault investigation (#1299). This is separate from #1073's future-fence scheduling. Includes the same SDK-26 declaration prerequisite as #1404 for the existing OS-27-guarded MetalFX setters.

Checked

Apple M1 Pro, macOS 26.5.2, Xcode 26.5:

  • perf-order-cpu: all four fast-wake/wait-ledger combinations pass, including unsignaled-event completion, finite timeout budgets, sub-ms and infinite waits, completion ownership and callback ordering.
  • check_t_perf_order: default, encode-thread, and fast-wake/slice-merge/compute-hoist-disabled Metal-validation runs pass.
  • Documentation tests: 11 pass; chain tests: 17 pass; git diff --check passes.
  • LLVM static analysis: no new findings.
  • Shader chain and profile inputs unchanged; no game shader rebuild.

The regression harness discovers only DK, MKW and Ocarina locally, with no stored baselines; DK and Ocarina have no smoke route on this upstream base. No five-game report or standalone gameplay claim is available. The fixture deterministically reproduces missing event signaling without deliberately faulting the GPU. iPhone behavior is unmeasured.

Docs

  • Reference finding added and symptom index regenerated.
  • Shader chain unchanged.
  • No game files, keys or extracted data included.

@github-actions github-actions Bot added nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) docs Documentation labels Nov 5, 2026
@PucaVaz

PucaVaz commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

For the reviewer, this overlaps #1332 in purpose but not in lines. Once macOS revokes the process's GPU access (SubmissionsIgnored), #1332 raises the shared event to the last fence from the CPU at each feedback, stops presents and has the front end quit. This PR's bounded wait and recheck also covers a rejected command buffer that comes without a revocation. They should compose: with both, a revoked process's waits return at once and the app stops, and any other completed-but-unsignaled fence returns within 100 ms. Neither touches the other's hunks in nvn_mtl.m.

Drafted with Claude; reviewed by me.

fpedrolucas95 pushed a commit to fpedrolucas95/nxnative that referenced this pull request Nov 6, 2026
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.
FeReuss pushed a commit to FeReuss/nxnative-oot that referenced this pull request Nov 10, 2026
…ack after an unsignaled fence event

kept both sides of docs/agents/symptoms.md; kept both sides of docs/reference/frame-rate.md

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants