You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trails in the Sky 1st Chapter, 01002C9022770000, 1.0.7 (update v393216)
Engine and graphics API, if known
NVN, SDK 21_4_4. The survey does not name the engine. The RomFS has .mdl, .xtx, .nvn, .mi, .vfx and .nxopus files, and main has 21 GLSLC compiler output magics. The survey also lists NintendoSDK_movie in subsdk0 and 6 .mp4 files, and the game imports nn::ro (0 .nro/.nrr files in the RomFS).
Survey and what happened
I ran scripts/build_ipa_from_nsp.py --platform mac-app on the NSP folder (base + update). The survey, the extraction (about 90,000 files, 13.6 GB) and the provisional profile worked.
The build then stops at the rewrite step of main:
AssertionError: retry block overlaps a window 2cdeb4
(dm/tools/patch_nso.py, line 1206)
Only main fails. The sdk log has two "function patch skipped: 0 matching functions" messages and the subsdk0 log is empty. I tried again on the latest main (0e8503e) and got the same error, so the game was never packed and there is no app log.
Update: with two local changes the game now builds, boots and plays its cutscenes on the Mac. Inside the house the furniture (table, chairs) is missing. Details below, in case they help.
Setup: MacBook Air M3, macOS 27.2, Xcode 27.2, Metal 32023.922, main cd859c3 plus my local changes, shader chain b7cd656abd7c. Full reports attached (bug_report.py zips, no game files).
Rewrite of main (patch_nso.py)
The assertion "retry block overlaps a window 2cdeb4" comes from a compare-and-swap window on x18:
The window at 0x2cdeb4 (to 0x2cdec8) is a byte compare-and-swap on x18 (ldaxrb ... stlxrb). Its first cbz jumps over an inline failure path (clrex; b out) onto the stlxrb, and the second cbz at 0x2cdec8 exits on success.
The cbz at 2cdeb8 is inside the window and jumps to its own stlxrb, but the check for branches into the middle of a window treats it as coming from outside. site_window also asserts on a plain b inside a window. My local change:
# check loop, after `wseg = next(...)`
if x.address in {y.address for y in wseg}: continue
# site_window, before `elif m == 'adrp'`
elif m == 'b':
tgt = x.operands[-1].imm
if lo <= tgt < hi: newt = copy0 + (tgt - lo)
else: ex_targets.append(tgt); newt = exits + 16 * (len(ex_targets) - 1)
pc = copy0 + 4 * k; off = (newt - pc) >> 2
w = 0x14000000 | (off & 0x3FFFFFF)
dd = dis(w, pc); assert dd.operands[-1].imm == newt and dd.mnemonic == 'b'
With it the rewrite of main, subsdk0 and sdk passes. I do not know if this is the right way to handle it.
Address regions
The heap check and the profile guess give an iPhone-sized block (mem_reserve 0x140000000, mem_alias 0x98000000, 2.38 GB). The address region check reports a red line: the game reaches alias +12.27 GB (an 11.27 GB region at alias +1.00 GB, returning to main+0x56d37c). With that profile the app crashed at launch:
CRASH sig=11 addr=0x1 pc=sdk+0x15576c lr=sdk+0x60301c, bt main+0x56e1e8 main+0x56d5dc ... (right after the game's VirtualMemoryAllocator Initialize)
I set mem_alias 0x1000000000 and mem_reserve 0x10A8000000 (the layout the region check itself ran with, Mac only) and the crash is gone.
Shaders and app
6,601 of 6,602 shaders translated. The failed one is an ArgumentOutOfRangeException with "Invalid instruction at 0x..." lines in dmsh_build.log. The pipeline archive and the Mac app (14.6 GB) were built.
What happens in the game
It boots, plays the cutscenes and gets to the inside of the house, where the table and chairs are not drawn. No crash. In the app log:
3,797 times: [RED] failed to create compute pipeline: Threadgroup memory size (45056) exceeds the maximum threadgroup memory allowed (32768). It is always the same size, 44 KB against the 32 KB limit of this Mac. nvn_mtl.m returns from the dispatch when the pipeline fails and tries again on the next dispatch, so that compute pass never runs.
The shader is 43c2b838b11bc19c (local size 1024x1x1, shared memory 45056 bytes, 44 bytes per thread). It is the only compute shader in shader_facts.tsv above Metal's 32 KB threadgroup limit. A group of 1024 threads fits Metal, the 44 KB of shared memory does not.
I do not know if it is the reason for the missing furniture. Since it is one shader, it might be easy to test by making it fit in 32 KB or by skipping that dispatch and seeing if the furniture appears.
2 shaders not in the shader map: f9def5d93748a39f and a370ad7eceb0897a, and once "the dispatched program has no compute shader".
2 unimplemented NVN functions, once each: nvnCommandBufferSetZCullZF32CompressionEnable and nvnTextureBuilderGetDepthStencilMode.
The two shaders not in the shader map and "the dispatched program has no compute shader" look like the symptoms listed in docs/agents/symptoms.md for shaders the split did not find (at least one of them seems to be a compute shader), so they may be as likely a cause of the missing furniture as the 44 KB one. I have not dumped them yet.
e9d71e2 gives the Mac a Switch-sized 64 GB alias region by default, for every game, so the launch crash after the 11.27 GB region at alias +1.00 GB (sig=11 addr=0x1 at sdk+0x15576c) should no longer need DM_ALIAS_SIZE. I don't have this game, so I haven't run it.
If you retest on e9d71e2 or later without that switch, please say whether it gets past launch. If it crashes in a way that looks like a cut-off pointer, check the log for a [mem] line saying the heap and stacks reach past 2^39. This issue stays open for the rest of the port, including the missing furniture.
@seedds Thanks. Quick clarification on the rewrite step: on main b4318c7 (which includes e9d71e2) the main rewrite still stops before building the app, so I can't reach the launch yet:
AssertionError: retry block overlaps a window 2cdeb4 (dm/tools/patch_nso.py:1311)
That is the compare-and-swap window from my first report (cbz at 0x2cdeb8 jumps to its own stlxrb, and the check treats it as a branch from outside). e9d71e2 doesn't touch patch_nso.py. As far as I can tell from the diff, PR #1002 already has the fix (it skips a branch that lands inside its own window, and site_window / site_retry_window handle a plain b), so it looks like main just needs that part of #1002.
I've applied the same two changes locally on top of main and the game launched without crashing on the startup. I did a testing on #1002 PR too and the game worked really well with all the furniture and details working.
The rewrite step should no longer stop here. 10fd970 (from PR #1171) fixes the retry block overlaps a window assertion. On update 1.0.6 (v327680) here, main failed the same way (at 2d7c64) on the old main and now rewrites. Your 1.0.7 (v393216) wasn't checked, but it is the same shape.
Could you pull main and run the NSP script again on base + 1.0.7? If it packs, the next question is whether the game boots and plays; a log from the first start would help either way. Leaving this open until then.
@seedds Pulled main (4861fb0, which includes 10fd970) and ran the NSP script on base + 1.0.7: the rewrite of main now passes, and the app packs and boots. Report attached (bug_report.py zip; the current log is main at 4861fb0, chain 3ee493b2c3a4, and its .prev log is from the PR #1002 build, 65c7213, chain a4511bb2bb79, for comparison).
Launch: it gets past launch with the default 64 GB alias (no DM_ALIAS_SIZE, no mem_alias edit): the log shows "alias region 64.00 GB" and there is no crash. The old Threadgroup memory (44 KB > 32 KB) red line no longer shows in the log on main, but the furniture is still missing there.
What is still wrong on main is the whole lighting pass. Screenshots attached (Top: how the scene should look, "Exit the Sewers"; Bottom: main build on my M3). Geometry and textures are fine, but there is no dim ambient, no light pools around the torches, no fog/haze, no bloom and no shadows, and the furniture is missing indoors.
The main log has these lines:
shader f9def5d93748a39f is not in the shader map
shader a370ad7eceb0897a is not in the shader map
(prewarm: "shader keys not in the shader map (another game version) 2")
"the dispatched program has no compute shader (or it is not mapped)", once
shader 567fcd0c97a29418_b writes colour target 1, an integer format, as a float
On the PR #1002 build the same scene renders correctly on my M3: the lighting, fog, shadows and the furniture are all there. So what is missing on main looks like the profile/shader tables and the compute and image fixes that #1002 carries (compute scratch lowering, mixed material outputs, cube image stores), not the rewriter.
Update: I rebuilt on main c8bfa16 and "Mac shaders" still reports 6,601 of 6,602 (one shader fails to translate: IndexOutOfRangeException, with "Invalid instruction at 0x000008 (0x0000000000000000)", "0x000028 (0x000000003F800000)" ...; it looks like constants being read as code). The log doesn't print which key it is, so I can't tell whether it is one of the two shaders missing from the map. PR #1002's description mentions an explicit compute-code offset fix for constants after the control section, which might be related.
@seedds Tested the game for 30 minutes and still haven't found any type of glitch or texture bug. All the forniture and lighting is showing normally from what ive seen. I will continue playing to see if i encounter any glitch. Thanks!
Activity
ricardosousa191 commentedon Nov 2, 2026
Update: with two local changes the game now builds, boots and plays its cutscenes on the Mac. Inside the house the furniture (table, chairs) is missing. Details below, in case they help.
Setup: MacBook Air M3, macOS 27.2, Xcode 27.2, Metal 32023.922, main cd859c3 plus my local changes, shader chain b7cd656abd7c. Full reports attached (bug_report.py zips, no game files).
The assertion "retry block overlaps a window 2cdeb4" comes from a compare-and-swap window on x18:
The window at 0x2cdeb4 (to 0x2cdec8) is a byte compare-and-swap on x18 (ldaxrb ... stlxrb). Its first cbz jumps over an inline failure path (clrex; b out) onto the stlxrb, and the second cbz at 0x2cdec8 exits on success.
The cbz at 2cdeb8 is inside the window and jumps to its own stlxrb, but the check for branches into the middle of a window treats it as coming from outside. site_window also asserts on a plain b inside a window. My local change:
With it the rewrite of main, subsdk0 and sdk passes. I do not know if this is the right way to handle it.
The heap check and the profile guess give an iPhone-sized block (mem_reserve 0x140000000, mem_alias 0x98000000, 2.38 GB). The address region check reports a red line: the game reaches alias +12.27 GB (an 11.27 GB region at alias +1.00 GB, returning to main+0x56d37c). With that profile the app crashed at launch:
CRASH sig=11 addr=0x1 pc=sdk+0x15576c lr=sdk+0x60301c, bt main+0x56e1e8 main+0x56d5dc ... (right after the game's VirtualMemoryAllocator Initialize)
I set mem_alias 0x1000000000 and mem_reserve 0x10A8000000 (the layout the region check itself ran with, Mac only) and the crash is gone.
Shaders and app
6,601 of 6,602 shaders translated. The failed one is an ArgumentOutOfRangeException with "Invalid instruction at 0x..." lines in dmsh_build.log. The pipeline archive and the Mac app (14.6 GB) were built.
What happens in the game
It boots, plays the cutscenes and gets to the inside of the house, where the table and chairs are not drawn. No crash. In the app log:
The two shaders not in the shader map and "the dispatched program has no compute shader" look like the symptoms listed in docs/agents/symptoms.md for shaders the split did not find (at least one of them seems to be a compute shader), so they may be as likely a cause of the missing furniture as the 44 KB one. I have not dumped them yet.
Happy to test patches or collect more logs.
nxnative-report-01002C9022770000-2026-11-01.zip
seedds commentedon Nov 6, 2026
e9d71e2 gives the Mac a Switch-sized 64 GB alias region by default, for every game, so the launch crash after the 11.27 GB region at alias +1.00 GB (
sig=11 addr=0x1atsdk+0x15576c) should no longer needDM_ALIAS_SIZE. I don't have this game, so I haven't run it.If you retest on e9d71e2 or later without that switch, please say whether it gets past launch. If it crashes in a way that looks like a cut-off pointer, check the log for a
[mem]line saying the heap and stacks reach past 2^39. This issue stays open for the rest of the port, including the missing furniture.ricardosousa191 commentedon Nov 6, 2026
@seedds Thanks, i will give it a test!
ricardosousa191 commentedon Nov 6, 2026
@seedds Thanks. Quick clarification on the rewrite step: on main b4318c7 (which includes e9d71e2) the main rewrite still stops before building the app, so I can't reach the launch yet:
AssertionError: retry block overlaps a window 2cdeb4 (dm/tools/patch_nso.py:1311)
That is the compare-and-swap window from my first report (cbz at 0x2cdeb8 jumps to its own stlxrb, and the check treats it as a branch from outside). e9d71e2 doesn't touch patch_nso.py. As far as I can tell from the diff, PR #1002 already has the fix (it skips a branch that lands inside its own window, and site_window / site_retry_window handle a plain
b), so it looks like main just needs that part of #1002.I've applied the same two changes locally on top of main and the game launched without crashing on the startup. I did a testing on #1002 PR too and the game worked really well with all the furniture and details working.
Branches within an exclusive window stay in its copy, and its uncondi…
seedds commentedon Nov 7, 2026
The rewrite step should no longer stop here. 10fd970 (from PR #1171) fixes the
retry block overlaps a windowassertion. On update 1.0.6 (v327680) here,mainfailed the same way (at 2d7c64) on the old main and now rewrites. Your 1.0.7 (v393216) wasn't checked, but it is the same shape.Could you pull main and run the NSP script again on base + 1.0.7? If it packs, the next question is whether the game boots and plays; a log from the first start would help either way. Leaving this open until then.
ricardosousa191 commentedon Nov 7, 2026
@seedds Pulled main (4861fb0, which includes 10fd970) and ran the NSP script on base + 1.0.7: the rewrite of main now passes, and the app packs and boots. Report attached (bug_report.py zip; the current log is main at 4861fb0, chain 3ee493b2c3a4, and its .prev log is from the PR #1002 build, 65c7213, chain a4511bb2bb79, for comparison).
Launch: it gets past launch with the default 64 GB alias (no DM_ALIAS_SIZE, no mem_alias edit): the log shows "alias region 64.00 GB" and there is no crash. The old Threadgroup memory (44 KB > 32 KB) red line no longer shows in the log on main, but the furniture is still missing there.
What is still wrong on main is the whole lighting pass. Screenshots attached (Top: how the scene should look, "Exit the Sewers"; Bottom: main build on my M3). Geometry and textures are fine, but there is no dim ambient, no light pools around the torches, no fog/haze, no bloom and no shadows, and the furniture is missing indoors.
The main log has these lines:
(prewarm: "shader keys not in the shader map (another game version) 2")
On the PR #1002 build the same scene renders correctly on my M3: the lighting, fog, shadows and the furniture are all there. So what is missing on main looks like the profile/shader tables and the compute and image fixes that #1002 carries (compute scratch lowering, mixed material outputs, cube image stores), not the rewriter.
nxnative-report-01002C9022770000-2026-11-07.zip
Update: I rebuilt on main c8bfa16 and "Mac shaders" still reports 6,601 of 6,602 (one shader fails to translate: IndexOutOfRangeException, with "Invalid instruction at 0x000008 (0x0000000000000000)", "0x000028 (0x000000003F800000)" ...; it looks like constants being read as code). The log doesn't print which key it is, so I can't tell whether it is one of the two shaders missing from the map. PR #1002's description mentions an explicit compute-code offset fix for constants after the control section, which might be related.
Branches within an exclusive window stay in its copy, and its uncondi…
game: Trails in the Sky 2nd Chapter 1.0.4 plays on the Mac
seedds commentedon Nov 13, 2026
An update related to this request: Trails in the Sky 2nd Chapter (1.0.4, the same Falcom engine) now plays on the Mac on main (6cb67b8e, game note).
Three general changes it needed are on main too, and should reach the 1st Chapter as well:
nvnTextureBuilderGetDepthStencilModeandnvnCommandBufferSetControlMemoryCallbackEnabled(c7edcd4).The 1st Chapter itself is still PR #1002, so this issue stays open.
ricardosousa191 commentedon Nov 13, 2026
Thanks a lot, i will test it and report back about 1st chapter.
ricardosousa191 commentedon Nov 13, 2026
@seedds Tested the game for 30 minutes and still haven't found any type of glitch or texture bug. All the forniture and lighting is showing normally from what ive seen. I will continue playing to see if i encounter any glitch. Thanks!