Skip to content

docs: route C implementation plan (M1–M5, tests, FH trigger) - #140

Closed
LNPANDY wants to merge 3 commits into
mainfrom
route-c-plan
Closed

LNPANDY wants to merge 3 commits into
mainfrom
route-c-plan

Conversation

@LNPANDY

@LNPANDY LNPANDY commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

The probe passed (#139), so route C gets a concrete plan: M1 proves the real payload as a framework (single game, no shell) and is the gate for everything else; M2 shell, M3 aggregate IPA, M4 per-game data, M5 hardening. Files, tests, risks and the FH fallback condition are spelled out. This is a plan, not code.

docs/launcher-c-plan.md is the fork's own document, so it has to ride the patch queue #124 put in place (.upstream-ref + patches/), not the retired scripts/sync_upstream.py. Two patches, both made with scripts/patches.py export:

Verified locally: scripts/patches.py check → ok, 21 patches on upstream 062cd06e (2143 files); python3 -m unittest discover -s scripts/tests → 24 tests OK.

Produced from the design doc, the probe result and the current code, to be
executed as M1 (real payload as a framework, single game) → M2 (shell + one
framework) → M3 (aggregate IPA) → M4 (per-game data/settings) → M5
(signing/incremental hardening). Each milestone names files, the off-device
tests and the on-device check; the FH fallback trigger is written as a
decidable condition, and the doc lists the stale claims to fix as it lands
(ROADMAP's 'C unbounded', WIP's C7 row, the design's argv note).
@v0lumehi

Copy link
Copy Markdown
Collaborator

Nice result on the probe (#139). One app with many games is the right answer to the sideloading limits, and having M1 prove the real payload before any shell work is the right order.

Some notes on the plan:

  1. docs: the dlopen probe passed on a device — route C's gate is open #139 and docs: route C implementation plan (M1–M5, tests, FH trigger) #140 after the patch queue (Patch queue on a pinned upstream replaces the anchor-based sync (part of #123) #124). Files under docs/ (and the rest of the vendored paths) now come from the pinned upstream plus patches/. So docs/probe-dlopen.md, docs/WORK-IN-PROGRESS.md and docs/launcher-c-plan.md go into the fork-docs patch (scripts/patches.py export <commit>). The one-line change to scripts/sync_upstream.py isn't needed anymore, since that script is gone. I'm happy to move both PRs over if you like; it's my change that broke them.
  2. Upstream first for the engine hooks. M1–M4 change dm/host/loader.c, dm/ios/Sources/main.m, dm/ios/tools/build_ipa.sh and the NSP script. As fork patches, that would be our biggest and most fragile patch by far, since those are among the files upstream changes most. The M1 hooks are small and general: a settable image header in loader.c (dm_set_game_image_header, defaulting to _mh_execute_header), a DM_FRAMEWORK mode in build_ipa.sh, and --framework in the NSP script. Several games in one IPA helps every iOS player, so I'd propose them to seedds as an issue (or a small PR) before M1. Then the shell app (M2/M3) is fork code under our own paths, with no patches.
  3. M4 and the data folders. M4's per-game data builds on our ios-game-data-folder patch (Documents/games/<id>/…, the picked-data bookmark), which is pending upstream as the iOS counterpart of Mac app: a dataFolder key keeps a game's save, caches and log in one folder a front end chooses seedds/nxnative#460. Worth naming in the plan, so M4 lands on whatever upstream takes.
  4. Manifest and One JSON file per language, read by the Mac launcher, the Windows launcher and the iOS shell #388. game.manifest.json overlaps with what front ends read from launcher.json (schema 1, Front ends: one interface between the engine and graphical apps (settings, build progress, runtime events) seedds/nxnative#388). If the manifest points at it (the launcher key already does), the shell can reuse the Launch options model instead of a second settings format.

@LNPANDY

LNPANDY commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #147: with the patch queue (#124) the plan doc is carried by patches/0015-fork-docs.patch, not by an OURS entry in a script that no longer exists. #147 includes this doc plus the probe/WIP updates from #139, verified by patches.py check.

@LNPANDY LNPANDY closed this Oct 28, 2026
v0lumehi pushed a commit to v0lumehi/NX2Apple that referenced this pull request Oct 28, 2026
…, plan doc and C7 note

Three things the migration could not know, fixed in the series itself:

- 0019 (prune intermediate extractions) was revoked on main in 0506db0
  (the owner wants every extracted version kept as a build resource); the
  migration re-derived it from the tree at the time and would have brought
  it back. Patch dropped, build_ipa_from_nsp.py carries no prune again.
- 0015 (fork documents) now carries docs/launcher-c-plan.md (the route C
  implementation plan, PR LNPANDY#140) and the updated WORK-IN-PROGRESS.md and
  probe-dlopen.md (the device result and the C7 note, PR LNPANDY#139) — those
  edits landed on main after the queue was derived and made 'patches.py
  check' fail.

Verified: patches.py check ok (18 patches on 062cd06 give the tree, 2143
files); scripts/tests 21 tests ok; grep prune_intermediate_extracts ->
none.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants