Skip to content

Sync: bring the upstream files the first sync missed, restore the memory-limit guide (test_docs.py) - #41

Merged
LNPANDY merged 2 commits into
LNPANDY:mainfrom
v0lumehi:sync-missing-files
Oct 27, 2026
Merged

LNPANDY merged 2 commits into
LNPANDY:mainfrom
v0lumehi:sync-missing-files

Conversation

@v0lumehi

@v0lumehi v0lumehi commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

dm/tools/tests/test_docs.py fails on main because of dead links. This PR fixes their cause. Together with #40 (the README anchors) the test passes.

1. Upstream files the sync never brought

upstream_changes only takes files that changed between the last synced ref and the new one, so a vendored file the first wholesale sync missed never arrives. Comparing the fork's tree with seedds' finds 35:

  • docs/geometry-metal-research.md (the Somnium Files and Luigi's Mansion 3 notes link to it)
  • 34 of docs/images

upstream_changes now also adds every vendored file upstream has that the fork's tree lacks, OURS excepted. They arrive with the next scheduled sync.

2. dm/ios/ENTITLEMENTS.md

This is the fork's own guide that both READMEs link to. The 296-commit sync (1609b30) deleted it, which is the case #29 is about. It is back:

  • Updated: the entitlement no longer comes from a Sources/DmIOS.entitlements file. build_ipa.sh writes it (DM_ENTITLEMENTS overrides it), and a prepared Xcode project gets Gen/DmIOS.entitlements.
  • In OURS, so no future sync can delete it.

scripts/sync_upstream.py itself also joins OURS. It is fork-only, so a PR that changes it is not a vendored edit; without that, pr-scope would fail this PR.

3. Executables that lost their x bit

take_from_upstream wrote a file's bytes and nothing else, so every executable it took came out 0644. Eight files are 100755 upstream and 100644 here:

  • the committed spirv-cross binary and its build.sh
  • compile_check.py, pack_app.py, gpuprof.py, romfs_image.py
  • bench.py, push_romfs.sh

test_spirv_cross_pin fails with Permission denied when it runs spirv-cross. The sync now sets each file's mode from upstream's tree, and upstream_changes takes an upstream executable again when the fork's copy is not executable.

Checked

Also found (not changed)

These fork-only files sit in vendored paths and are not in OURS:

  • dm/host/hle_profile.c / .h
  • dm/host/touchpad_geometry.h, dm/host/tests/t_touchpad_geometry.c, dm/host/tests/t_layout_runtime.c
  • dm/ios/probe/
  • dm/tools/tests/test_nro_header.py
  • the docs under docs/, such as ROADMAP.md and RELEASE_NOTES.md

An incremental sync leaves them alone unless upstream creates or deletes the same path, but a wholesale sync like 1609b30 would drop them. Whether they belong in OURS is your call. Same for dm/ios/probe/…/xcuserdata/hejie.xcuserdatad/UserInterfaceState.xcuserstate, which looks like it was committed by accident.

…ory-limit guide

test_docs.py failed on main with dead links to docs/geometry-metal-research.md
(from three game notes) and dm/ios/ENTITLEMENTS.md (from both READMEs).

The sync only takes files that changed between the two upstream refs, so
a vendored file the first wholesale sync missed never arrives: 35 files,
docs/geometry-metal-research.md and 34 of docs/images. upstream_changes
now also adds every vendored file upstream has and the fork's tree lacks
(OURS excepted), so the next sync brings them. A run with --old = --new
at 75065df takes exactly those 35 and ends SYNC OK.

dm/ios/ENTITLEMENTS.md is the fork's own guide; the 296-commit sync
(1609b30) deleted it. It is back, updated for where the entitlement now
comes from (build_ipa.sh writes it; Gen/DmIOS.entitlements for a prepared
Xcode project), and in OURS. So is this script, which is fork-only, so
pr-scope does not take a change to it for a vendored edit.
… lost

take_from_upstream wrote a file's bytes and nothing else, so every
executable it took came out 0644: the committed spirv-cross binary and its
build.sh, compile_check.py, pack_app.py, gpuprof.py, romfs_image.py,
bench.py and push_romfs.sh are 100755 upstream and 100644 here
(test_spirv_cross_pin: Permission denied running spirv-cross). It sets
the mode from upstream's tree now, and upstream_changes takes an upstream
executable again when the fork's copy is not executable. A run with
--old = --new at 75065df takes the 35 missing files and the 8 modes, ends
SYNC OK, and test_spirv_cross_pin passes on the result.
@LNPANDY
LNPANDY merged commit 96a7141 into LNPANDY:main Oct 27, 2026
1 check passed
LNPANDY added a commit that referenced this pull request Oct 27, 2026
…eight files had lost

dm/tools/tests/test_docs.py has been failing on main since the wholesale sync: three
game notes link to docs/geometry-metal-research.md, which the fork's tree never had,
and README.zh-CN's contents pointed at anchors the emoji broke (PR #40 fixed those).

The cause was upstream_changes(): it only diffs the two refs, so a vendored file that
existed on both sides and was never touched by the fork's history simply never
arrived. Running the sync with --old and --new at the same ref, now that PR #41 adds
every file upstream has and the tree lacks, brings exactly the 35 that were missing
(geometry-metal-research.md and 34 of docs/images) plus the x bit that eight
executables had lost (spirv-cross, build.sh, pack_app.py, gpuprof.py, romfs_image.py,
compile_check.py, bench.py, push_romfs.sh) — take_from_upstream now copies the mode.

test_docs.py: 4 tests, OK. Patcher consistency: every patcher agrees with the tree.
LNPANDY added a commit that referenced this pull request Oct 27, 2026
…rts are repaired

The launcher's Controls page (PR #39) writes DM_KEYMAP / DM_PAD_MAP at Play, but nothing on
this side read them: the page moved the fields and every game kept its default keys. This
brings seedds/nxnative#386's engine side here — dm/host/input_map.h (the key and button maps,
pure so a test runs without a keyboard) and front_mac.m using it in place of the fixed
key_bit() switch — so the page does what it says. #386 is still open upstream, so
front_mac.m and input_map.h are carriers here (OURS for the two new files, patch_front_mac()
for the changed one), and the day #386 merges, a sync finds every anchor applied already.

Two more things surfaced while checking the suites:

* patch_nso.py had lost the NRO header skip (issue #14). It was fixed in 4b86323 and then
  silently reverted by a sync, because the file was not a carrier: an NRO's text starts at
  0x80, and scanning from 0 read the header's build ID as instructions and skipped the last
  128 bytes of text. Restored, and patch_nso.py is a carrier now (patch_patch_nso).
* patch_tests_makefile() opened with `if 'romfs_arc.c' in t: return skip(...)`, which made the
  touch-pad test block that follows dead code ever after. Its first addition skips on its own
  now, so the new t_input_map rule is not skipped as well.

docs/env_switches.tsv gains the rows the tool asks for (DM_KEYMAP, DM_PAD_MAP), the two it
listed with no meaning (DM_FULL_ROMFS, DM_PROFILE), and the mode change PR #41 needed.

Checked: t_input_map 22/22; the full host suite (make -C dm/host/tests run) exits 0; dmhost
builds; the Python suite is 350 passed, 17 skipped, 0 failed (test_env_switches and
test_nro_header were both failing before this); the sync reports every patcher agreeing with
the tree.
v0lumehi added a commit to v0lumehi/NX2Apple that referenced this pull request Oct 27, 2026
The repository checkout the launcher builds with stays where it was
until someone presses Pull, so a checkout days behind builds with tools
main had already fixed: it was 208 commits behind and its spirv-cross
had no x bit (fixed by LNPANDY#41), so an iPhone build stopped at once.

When the app opens, the check it already ran (fetch, count the commits
behind origin/main) now fast-forwards the checkout when it is behind:
only on main, with no changes to tracked files and no build running, so
a checkout someone works in is never touched (a pull that would
overwrite an untracked file fails as a fast-forward and says so).
Settings has a switch for it (on by default) and says what happened or
why not; the library's activity line names the new commits for the
session ("Build tools updated: 208 new commits").

RepoAutoUpdateTests uses a local bare repository as origin: a clean
checkout on main is fast-forwarded, one with a local change is left as
it is, and only main without tracked changes may be moved.
@v0lumehi
v0lumehi deleted the sync-missing-files branch November 1, 2026 05:10
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