Skip to content

games/13-sentinels-asia: wait for the render thread at frame end - #2936

Open
Haseenesss wants to merge 1 commit into
seedds:mainfrom
Haseenesss:13-sentinels-asia-frame-skip
Open

Haseenesss wants to merge 1 commit into
seedds:mainfrom
Haseenesss:13-sentinels-asia-frame-skip

Conversation

@Haseenesss

Copy link
Copy Markdown
Contributor

What and why

13 Sentinels: Aegis Rim, Asian release (01008D7016438000, base 1.00) crashes about 9 s after the start, before the logo, when the start is slow: SIGSEGV at main+0x309128.

  • Cause. At the end of a frame the main thread waits for the render thread only as long as the frame's time lasts (main+0x30c194), then goes on without it (a skipped frame). The render thread's first submission waits on the host for the pipeline archive and the prepare step. From a library folder on a USB 2.0 disk (a 131 MB archive) that took 7 s and more. The main thread ran on meanwhile, and the render thread's first draws bound a texture entry of index -1.
  • Change. dm/games/01008D7016438000/patches.py cuts the three branches that end the wait in the 1.00 build of main, so the main thread waits until the render thread is done. A frame the render thread cannot finish in time now makes the game slower instead of being skipped.

Reported in LNPANDY/NX2Apple#1411, which carries this as a patch until it lands here. The finding is in the game's note under "Found on this game".

Details
  • 21 starts in a window without the cut: all 13 with a wait (archive plus prepare) of 7 s or more crashed, none of the 8 below 6.5 s did. Language, fullscreen, DM_NVN_ENC_THREAD, DM_NVN_PREFETCH, DM_PSO_PREBUILD, DM_PSO_PREPARE=0 and DM_PREEMPT=1 did not change it.
  • The crash: x0 = entries + 0xffffffff × 0xe8 at ldr w27, [x0], after the texture object's entry getter was called with index -1. Backtrace main+0x30c81c main+0x2bfadc main+0x2b1a8c main+0x2b1e94 main+0x2fc3c0 main+0x308a40 main+0x30bd24.
  • Without the cut the main thread reads the next screens' files from the same disk while the archive opens, which makes the wait longer (7 s against 2 s with the cut).

Checked

  • Tests: dm/tools/tests/test_docs.py; docs_patches.py and docs_symptoms.py were run. patch_nso.py on the game's main applies the three cuts (cuts 3), and its output is the binary that was run.
  • Games run, with title ID and version: 01008D7016438000 1.00 (v0) on the Mac, 9 starts with the cut, each run for 30 to 40 s (1200 to 1800 frames) through the logos, none crashed.
  • Not checked: no start with the cut had a wait of 7 s or more (the waits were 2 to 3.5 s, since the main thread no longer reads from the disk meanwhile). What the main thread did to the texture meanwhile was not traced. The western release (01003FC01670C000) was not at hand: its main is another build and gets no cut here. Not run on an iPhone. Only the first 40 s of the game were run.
  • Devices and OS: Apple M2, 8 GB, macOS 27.2.

Docs

  • The finding is in its game note or its docs/reference/<subsystem>.md entry, and python3 dm/tools/docs_symptoms.py was run (the symptom index)
  • No game files, keys or data extracted from a game in the change or the attachments

🤖 Generated with Claude Code

At the end of a frame the main thread waits for the render thread only as
long as the frame's time lasts (main+0x30c194), then goes on without it. The
render thread's first submission waits on the host for the pipeline archive
and the prepare step. From a library folder on a USB 2.0 disk that wait was
7 s and more, the main thread ran on meanwhile, and the render thread's first
draws bound a texture entry of index -1: SIGSEGV at main+0x309128, in 13 of
13 starts with a wait of 7 s or more and in none of 8 below 6.5 s (Mac, M2,
8 GB).

patches.py cuts the three branches that end the wait in the 1.00 build of
main, so the main thread waits until the render thread is done. 9 of 9 starts
ran with the cut; none of them had a wait of 7 s, since the main thread no
longer reads from the disk meanwhile. The western release was not checked.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions github-actions Bot added rewriter The NSO rewriter and per-build patches docs Documentation game: 01008D7016438000 13 Sentinels: Aegis Rim, Asian release labels Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation game: 01008D7016438000 13 Sentinels: Aegis Rim, Asian release rewriter The NSO rewriter and per-build patches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant