Skip to content

Build BlueWake's iPhone module without Xcode through PadMint (Linux) - #42

Closed
chrissotraidis wants to merge 5 commits into
mainfrom
codex/padmint-off-mac
Closed

chrissotraidis wants to merge 5 commits into
mainfrom
codex/padmint-off-mac

Conversation

@chrissotraidis

@chrissotraidis chrissotraidis commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Draft: BlueWake's iPhone game module, built without Xcode, through PadMint's shared iPhone module pipeline. This lets Linux players build BlueWake for iPhone. Nothing here is released, and BlueWake's published recipe is unchanged until a release under the private audit.

What it does

  • padmint.json: the ios target declares ios_module (Frameworks/gGZLE01_recomp.dylib). PadMint prepares its open-source iPhone SDK and toolchain. The steps run build.sh --source-only (extract, translate, generate the verified composite source), then configure and build cmake/composite with {ios_toolchain}. PadMint then checks the module's imports against the published app and inserts it. Hosts are Apple Silicon Mac and Linux x86-64/ARM64. Xcode is required only on a Mac and a C compiler only on Linux, using PadMint's host-scoped requirements (padmint#91). The output check is PadMint's general ipa check, since this path writes no BuilderProvenance.json.
  • build.sh: with --source-only off a Mac it checks only the tools that path uses (CMake, Ninja, Python, Git, shasum and a C compiler). It counts CPUs portably, and skips the Dawn download, which only the app needs.
  • disc_import.c: a built-in SHA-1 for hosts with neither CommonCrypto nor bcrypt. Apple and Windows builds compile exactly as before.

Evidence

  • Apple Silicon Mac (M3 Max), same disc and app, padmint build at 51a8e4b with PadMint's LLVM 22.1.8:
    • All 757 units compiled in 57 minutes.
    • The import check found "0 from the app, 12 from the device's C and C++ libraries". The module went into v0.1.0, and the IPA passed PadMint's IPA check.
    • The module is an iOS (minimum 16) ARM64 dylib, @rpath/gGZLE01_recomp.dylib, linking only libSystem, with BlueWake's full export set (staticrecomp_get_module, _get_rel_data, _get_rel_lifecycle, and the mod and alias entry points).
  • Compile-time fix (51a8e4b): the configure step now passes -fno-slp-vectorize -mllvm -large-interval-freq-threshold=10, as scripts/windows/build.py does. Without them, clang 22's SLP vectorizer and register coalescer are superlinear on the composite chunks. The first Mac run spent more than 3 h 49 min on one chunk (d_a_mgameboard chunk 0) and reached 233/757 in 4.7 hours. With them, that chunk took 155 s and the whole module 57 minutes. The Linux evidence below predates this commit.
  • Linux x86-64, Ubuntu 24.04 in Docker under Rosetta, with the player-owned GZLE01 disc, padmint build and the published v0.1.0 app:
    • The source steps produced the verified composite digest 54f54434…, matching the Mac.
    • All 757 units compiled.
    • The first link exposed two PadMint SDK gaps, both fixed and released in PadMint 0.3.3: missing fortify headers (padmint#90) and missing libm/load-time names (padmint#97).
    • Relinked with the fix, PadMint's import check found "0 from the app, 12 from the device's C and C++ libraries". The module was inserted into v0.1.0, and the 98.6 MB IPA passed PadMint's IPA check.
    • The module is an iOS (platform 2) ARM64 dylib linking only libSystem, and it exports staticrecomp_get_module, _get_rel_data and _get_rel_lifecycle.
  • The portable SHA-1 matches shasum for inputs from 0 bytes to 5 MB.

Before this can leave draft

  • No device check yet: the module hasn't been installed or played on an iPhone or iPad.
  • No local optimization training: this path doesn't run BlueWake's training, so it loses the trained performance on a Mac too. It needs a device performance comparison, or a per-host route that keeps training on Macs.
  • Windows needs a non-bash source step.
  • The release decision is open: BlueWake's public release is paused pending the private audit.

Two LLVM passes are superlinear on the composite chunks (one function each): the SLP vectorizer and the register coalescer. scripts/windows/build.py already passes -fno-slp-vectorize and -mllvm -large-interval-freq-threshold=10 for this reason. With PadMint clang 22.1.8 on an M3 Max, d_a_mgameboard chunk 0 took 155 s with them, against more than 3 h 49 min (still running) without.
@chrissotraidis

Copy link
Copy Markdown
Owner Author

Folded into #100, which contains every commit here plus the Windows host. Closing this one so the work is tracked in one place.

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.

1 participant