feat(aot): discuss native ARM64 compiler architecture and integration #1835
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1835"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-08T20:57:46Z.
What
Retain this PR as the architectural discussion and review record for the experimental offline x86-64 to native ARM64 compiler. The complete implementation is consolidated in #5021, including the runtime and runnable consumers. This draft preserves the original review context; it is not a second implementation to merge or a dependency that must land before #5021.
The architectural constraints remain native ARM64 AOT output, reuse of AnyPS5 platform services, explicit input/ABI/effect qualification and rejection of unsupported cases. The shipped executable contains no x86 interpreter, JIT or Rosetta dependency. The original proposal's typed native-call compiler and the broader guest-state compatibility backend have distinct qualified scopes; recovering native values and effects across caller chains remains the direction for further simplification and performance work.
The existing request for a runnable end-to-end consumer is retained in review history. The source-built
hello_notifyexample, native provider startup and explicit Linux ARM64 target provide that reproduction path. They do not settle the maintainers' decision about architecture, dependency policy or in-tree acceptance. Further implementation review belongs in #5021; architecture and contributor coordination can remain here.Tested
Discussion branch integrated with upstream
51acb79ac49eeabf2d0e1d377867f953eb1bcefa. All 466 local compiler/runtime tests and the conventions check passed on Apple M5 Max / macOS 27.2. Full combined consumer/runtime evidence is described on #5021 and must not be attributed to this narrower branch.The source-built example and reproduction commands are in
docs/dev/BUILD.md. EnableANYPS5_RELINKER_ONLY,ANYPS5_NATIVE_AOT,ANYPS5_NATIVE_AOT_EXAMPLEandBUILD_TESTING. The bounded CI variant shortens the example delay; the runtime sleep behavior is unchanged. Full Linux/Windows builds still require maintainer dispatch; new-head hosted results are separate from local results and historical checks.Checklist
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-09T08:22:16Z.
@boykopovar Could you review the architecture and integration of this initial compiler-only ARM64 AOT implementation, related to #1553? It is now ready for review at
7725ddba, rebased onto6cc0503d. All 204 tests pass locally and the fresh native Apple ARM64 CI has passed: https://github.com/boykopovar/AnyPS5/actions/runs/37903536478. Full Linux/Windows and relinker validation is running separately. The pointer/ABI restrictions remain explicit in the description; the full runtime and complete game port are follow-up work.Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-09T10:16:38Z.
@boykopovar Current head
a2f4f368is rebased onto main745b775e, including merged #2099 and #2151. Both previous upstream CI blockers (SPIRV headers and Windows Clang without AMDGPU support) are addressed in this base. All 207 local CTest cases pass; the initial compiler-only scope and pointer/ABI limitations remain explicit. Under the new policy, could you dispatch Build on main with inputpr=1835for full Linux/Windows validation, and review the current head? Skipped full-build jobs are not counted as passes.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T06:03:04Z.
Thanks for the work and for keeping the scope explicit (compiler-only, limits recorded in BUILD/TechnicalDebt).
This adds a new area rather than a fix, so it needs a direction call before a code review:
core/aot/, two new third-party submodules (Capstone 5.0.6, pyelftools 0.32) and an opt-inANYPS5_NATIVE_AOTCMake option..github/workflows/native-aot.yml) that only runs on Apple Silicon runners; CONTRIBUTING has no rule for that.@boykopovar @oneandonlydean: do you want this in-tree at this stage (new submodules, the Apple-only workflow, the long-term ARM64 direction from #1553), or should it live out of tree until a runtime exists? We can't build or run it on Linux, so the claims that depend on macOS/ARM64 (the 212 tests, the emitted code) remain unverified on our side.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T08:06:50Z.
I'd keep it out of tree until there's a runtime that runs something with it: we can't build or check it here, and it brings two submodules and an Apple-only workflow with no runnable output yet. The ARM64 direction (#1553) is the owner's call.
Imported from boykopovar/AnyPS5. Originally posted by Bruggi-ch on 2026-10-10T22:46:04Z.
Checked head
142a7ab2on an Apple M5 (MacBook Air, macOS 27.0.1, AppleClang 21.0.0, CMake 4.4.4, native arm64 Python 3.14.7, Rosetta 2 installed for the SSE reference runs). Built as in BUILD.md (git submodule update --init 3rdparty/capstone 3rdparty/pyelftools,-DANYPS5_RELINKER_ONLY=ON -DANYPS5_NATIVE_AOT=ON -DBUILD_TESTING=ON).ctest --parallel 2: 212 of 212 pass, 52 s. This matches the 212 reported in the description, on a different machine (M5 Air instead of M5 Max) and OS version (27.0.1 instead of 27.2).This is a second run of the existing tests only. I did not try other inputs, and it does not say anything about whether a game could run.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T09:20:09Z.
Review: CHANGES_REQUESTED
Thanks for the work and for the clear scope and limits.
Our position, as already said by @oneandonlydean: keep this out of tree until there is something that runs the output.
What would make it mergeable: a runtime consumer in the same effort (entry-point caller plus the imports needed to run at least one small program) so the compiler's output is exercised by a test that also runs on Linux CI, or at minimum the first runnable program built with it. Until then, a separate repository or branch is the right place; we're happy to reopen the discussion in-tree once that exists.
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-11T14:07:01Z.
@adriadam10 @oneandonlydean Understood. I'll continue the ARM64 work on the separate
feature/aot-native-runtimebranch in my fork and keep #1835 as the coordination point while I make the runtime consumer reproducible. I won't add more compiler-only features to this PR in the meantime.The concrete next deliverable is
hello_notifybuilt from source, compiled ahead of time from x86-64 ELF to native Apple ARM64, linked with an entry-point caller and the native import implementations it needs, and run from a clean checkout with one documented command. No Rosetta, x86 interpreter or JIT in the generated program. The acceptance test will check its output, exit status and native execution, with portable compiler/contract checks on Linux and end-to-end execution on Apple Silicon.I already have a local runtime checkpoint, but it still depends on research scripts and separate local checkouts. I'm removing those dependencies and revalidating it before presenting it as a reproducible result. This is the area I'm actively taking forward; the macOS x86-64/MoltenVK port in #1 remains a separate effort. Once the runnable program and tests are ready, I'll bring the branch and evidence back here for review of the integration scope.
@Bruggi-ch thank you for independently reproducing the 212 tests. A clean-checkout run of the runtime example on your M5 would be useful once I post the verified instructions.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-11T14:30:14Z.
The first runnable consumer is now on the separate native runtime branch, head
0c839fb00, based on maina11c8f7f7. #1835 itself is unchanged.The branch builds the public SDK's
hello_notifysource into x86-64 ELF, matches its companion objects and DWARF stack metadata, compiles it AOT to ARM64 Mach-O, and links it with an entry-point caller and the required native providers. The resulting executable prints the notification, exits successfully and runs its registered teardown. It is ARM64-only, reportssysctl.proc_translated=0, and links only libSystem and libc++; no runtime x86 translator is included.I reproduced the documented command from a fresh clone, without the research scripts or other checkouts. The original source also passed with its real 30-second sleep. The CI source variant changes that one delay to 1,000 microseconds to stay below the 30-second test limit; it uses the same runtime sleep implementation.
Reproduce on Apple Silicon:
The additional SDK submodule is pinned source and only needed for this optional example; its license is retained. The existing heap, notification and timer implementations are reused. The example contracts make no provider memory-effect assertions.
CI at this head is green: 121 tests on Linux and 393 on Apple Silicon. It covers Linux compiler/contract checks, reconstruction and cross-compilation of the whole example, and native C++ image/heap/notification/timer tests. Apple Silicon additionally executes the generated program and the native compiler suite. Linux does not execute the Mach-O output. The local suite passed all 393 cases; this is a first statically linked program, not game compatibility or a complete runtime.
@adriadam10 @oneandonlydean @boykopovar this provides the runnable-program evidence requested in the review. Please take another look at the integration direction; I have kept it out of tree while that decision is open. @Bruggi-ch the command above is ready for an independent run.
@mugurc the branch includes small macOS changes to main-image allocation registration and POSIX arena operations needed to build these providers. They are visible in the branch diff; I will align them with the shared macOS foundation as it lands to keep the platform support shared.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-11T15:03:14Z.
@adriadam10 @oneandonlydean @boykopovar The branch now also covers the end-to-end Linux CI part of the review: the generated program executes on a native Linux ARM64 runner.
Head:
2337ca1b4. All three CI jobs passed:Apple ARM64 remains the default output. Linux ARM64 is an explicit validation target using the same lowering and native providers, with ELF RELRO and actual page-protection checks. Neither generated program includes an x86 interpreter, JIT or runtime decoder. Linux ARM64 does not run the relinker's x86-only execution tests; its test scope is explicit in the workflow.
The runtime, entry-point caller, implemented imports, source-built example, tests and reproduction instructions are all on the separate branch. Use the earlier checkout instructions with this new commit.
cmake --build build-aot --target native_aot_hello_notify --parallel 3runs the example on either native ARM64 host. The separatenative_aot_hello_notify_originaltarget retains the original 30-second delay; that also passed locally on Apple Silicon at this head.This supplies the runnable-consumer and Linux-CI evidence requested in the review. The in-tree direction decision remains with the project owner; the branch stays separate while that is reviewed. No game-compatibility or complete-port claim is made.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-11T15:15:20Z.
@adriadam10 @oneandonlydean @boykopovar The runnable-consumer prerequisite is now included in this PR's actual diff at
f6c566854, together with the Linux ARM64 execution test. The runtime is no longer available only through a separate branch link.This revision includes the entry-point caller, implemented native imports, source-built
hello_notify, reproduction command, and native execution on Apple Silicon and Linux ARM64. It incorporates maina11c8f7f7and retains the previously reviewed pointer-invalidation and dylib-loader regressions. All 398 local CTest cases pass; fresh upstream ARM64 CI also passes on this revision: 398 macOS tests, 124 Linux x86-64 tests and 10 focused Linux ARM64 tests, including native execution of the generated program on both ARM64 hosts.Automatic upstream relinker, register-context and write-watch checks have also passed. Full Linux/Windows jobs remain skipped pending the manual dispatch below.
The PR title and description now describe the combined compiler/runtime proposal and its remaining limits. This is ready for the direction and code review requested; it is not a complete game port or a claim of architectural approval.
Could a maintainer also dispatch Build on main with
pr=1835for full Linux/Windows validation? Those jobs are skipped in the automatic PR workflow, and this account has no write access to start the authorized run.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-11T18:58:52Z.
The graphics follow-up is now available as draft #3891, on
feature/aot-native-graphicsat37c9fc550. This PR remains unchanged atf6c566854.The new branch builds the public SDK's
gpu_cubefrom source, compiles all 14 declared CPU functions AOT, and runs it as a native ARM64 process through Vulkan/MoltenVK. In a fresh independent checkout, both the AOT program and the independent source reference completed 600 flips and teardown; all eight 1920x1080 captures matched exactly. The 17 native integration tests also pass. The new PR's upstream AOT CI is green on macOS ARM64, Linux x86-64 and Linux ARM64.The macOS platform implementation is shared with mugurc's
macos-port, with its provenance and the #1835/#3703 dependencies stated in the draft. The reproduction command and the explicit fixture/reference arithmetic contracts are included. This adds runnable graphics evidence to the discussion; it does not establish game compatibility, a complete ARM64 port or a speedup. The draft leaves the integration/direction decision with the maintainers.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:23:37Z.
Thanks for adding the runnable consumer; that was the missing piece from the previous review.
What we could check: the PR merged onto current
mainbuilds and the whole Linux ctest passes (844/844), butANYPS5_NATIVE_AOTis opt-in, so none of thenative_aot_*tests run there. The AOT jobs on macOS ARM64 and Linux ARM64 are green in the PR's checks, and @Bruggi-ch confirmed an earlier head on an Apple M5.What is left is not a code question, it is a direction/policy call:
ps5link-sdk).native-aot.yml) running on Apple Silicon and Linux ARM64 runners, which CONTRIBUTING doesn't cover.GuestAllocations.cpp: new__APPLE__branch,#ifndef _WIN32narrowed to#ifdef __linux__).@boykopovar @oneandonlydean: do you want this in tree, and under what CI/dependency policy? If yes, we'd review the code in detail next; the Apple-only parts can't be run on our side.
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-11T23:46:00Z.
Thanks for confirming the runnable consumer addresses the earlier prerequisite. I understand the in-tree direction, dependencies and CI policy still need an owner decision.
The next batch I am taking forward is contract qualification and reproducibility. I am first aligning the graphics draft #3891 with current main, including the merged #3703 implementation. For the follow-up, I will make the repetitive guard-site generation reproducible from the exact input and declared ABI, keep the remaining source/layout assumptions explicit, and test invalidation when those inputs change. The current large JSON includes records generated by private scripts; reducing that file alone would not demonstrate automatic ABI recovery.
I will keep new compiler work in a separate follow-up, with negative cases and independent inputs, rather than expand #1835 while the direction decision is pending. Performance experiments will compare equivalent CPU work and record preparation, execution and validation separately. There is still no claim of game compatibility or a speedup over Rosetta.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by adambenhassen on 2026-10-12T00:11:22Z.
@yabanana thank you for this. In a couple of days this went from a compiler-only PR to a source-built program running natively on Apple Silicon and Linux ARM64. It comes with CI and steps anyone can reproduce, and you've been clear about the scope and the limits the whole way.
On the direction question: that decision belongs to @boykopovar, who is busy right now and unlikely to post for a while. Waiting would stall the ARM64 work with no end date, so please keep going. Carry on with the runtime, the graphics path in #3891 and the reproducibility work you described, and keep building toward a working solution. When @boykopovar has time, there will be a much stronger case to review.
If @boykopovar decides against this direction in tree and doesn't offer another way forward, we would unfortunately have to carry it on as a fork. I'd very much like to avoid that, because splitting the effort helps nobody. So let's keep the work here, in pieces small enough to review, and kept in sync with main.
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-12T09:15:09Z.
@adambenhassen Thanks. I'm continuing here, keeping the shared platform aligned with main and the follow-ups separate for review. The next checkpoint is now available in two drafts:
pad_inputprogram compiled AOT to Apple ARM64, plus a reproducible transfer probe using a source from a different SDK.pad_inputnow completes startup, reads, notifications, close and teardown through the shared runtime. AOT and an independently source-compiled ARM64 reference agree across six deterministic scenarios covering button edges, intercepted input, OPTIONS, timeout and errors. The production-provider run also preserves the original 625 sleeps of 16 ms. This tests simulated input and the state API; physical-controller acquisition/event pumping is still unqualified.The knowledge-reuse result is deliberately bounded: four C signatures and 26 fixed frame objects come from the matching debug companion. Ten imports resolve through the catalog, but seven entries were first qualified for this consumer. Three existing contracts also transfer to
ps5-payload-dev/sdk'shello_world. That source runs natively and matches its independent C reference; it uses our verified CRT and declaration-only cross headers, rather than that project's original payload loader. Its unprototypedmain()correctly remains an explicit qualification obligation. The script and remaining assumptions are included in #4397.After rebasing the stack onto main
c36fd0a0e, local checks passed: 475 compiler/relinker/runtime cases plus the new controller compile check, and 20 native integration tests. The rebuilt graphics pair still completes 600 flips each with all eight 1920x1080 RGB comparisons exact. The rebase also exposed the new physical-span index's Linux-only guard; #3891 now enables that shared index on macOS and adds a direct-memory alias/split/remap regression.After configuring the native graphics build, the new reproduction target is:
BUILD.md includes the independent-source transfer command. New hosted CI is pending; these are local results, and full Linux/Windows builds still need maintainer dispatch. This adds evidence for running another program and reusing qualified knowledge. Game compatibility, performance advantages and the in-tree policy decision remain open.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-12T10:47:41Z.
The next batch is now split into #4422 (incremental debug facts), #4423 (finite native dispatch and the required integer lowering), and #4424 (optimized consumers/reproduction), based on main
e7c70a2df.The unchanged pad_input source now executes at O2 through the same six controller scenarios and production sleep/teardown smoke. An unchanged external SHA-256 component passes O0/O2 against known vectors, hashlib and an independent native build. A musl memcmp holdout then reused the pipeline without another compiler change, including aliases and protected-page boundaries. The rebuilt graphics path still completes 600 flips per implementation with eight exact RGB comparisons.
The important boundary remains explicit: PC-scoped debug values are retained as candidates, not widened into lifetime proofs. The symbol-free ELF, analyzed without its companion, still has unresolved function/ABI recovery. Table dispatch is restricted to immutable relocation tables with bounds and target checks. This is stronger reproducible coverage, not a game-compatibility or Rosetta speedup claim. Commands and optional CTest integration are in BUILD.md; the PRs link their incremental diffs. Hosted CI is pending.
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-12T14:20:30Z.
The modular runtime checkpoint is now split into four drafts: #4520 (closed bundle and checked function/data binding), #4521 (initialization, finalization and rollback), #4522 (general-dynamic guest TLS and default joinable thread boundaries), and #4523 (reproducible modular consumer). They depend on the existing compiler/graphics/consumer stack, which is now aligned with main
fe66af13e.The new consumer converts three separately linked x86 ELF images into native ARM64 objects. Two guest-created workers call across module boundaries, use initialized/zero-filled TLS and a cross-module TLS symbol, and run the unchanged external SHA-256 component. Four worker pairs match independently source-compiled ARM64 C and Python hashlib. The check also verifies distinct live TLS blocks, main-thread isolation, shared-data binding, join results, buffer guards, ordered finalization, no outstanding threads and rollback when an initializer fails. Create/join use the production AnyPS5 providers; controlled-provider failure/race tests are separate.
Reproduction is documented in #4523:
cmake --build build --target native_module_bundle_check, with the pinned SHA source checkout and an offline ELF linker. Receipts bind sources, contracts, IR, objects, executables and runtime archives. On Apple Silicon, the final combined stack passed 526 compiler/relinker/runtime checks and 26 native integration checks. The rebuilt graphics pair still completed 600 flips each with eight exact RGB comparisons and teardown; optimized controller and independent component checks also pass. New hosted CI is pending, and full Linux/Windows builds still require maintainer dispatch.This is a qualified closed C bundle with explicit ABI/lifetime preconditions, not arbitrary PRX/stripped recovery, dynamic loading, guest C++ exceptions or a general memory-ordering proof. No game compatibility or speedup is claimed. It moves the shared runtime beyond a single-image consumer while keeping each addition separately reviewable. The in-tree architecture decision remains with the owner.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-12T19:47:12Z.
The recovered C++ checkpoint is now in draft #4718, on top of #4599/#4566. It converts the exception/unwind machinery linked into the input itself, adds static TLS and bounded atomic/x87 support, and keeps the guest-state runtime explicit. This does not reconstruct native C signatures or establish general shared-memory ordering.
After restoring the x86 oracle, the initial 580 tests passed. Review then found unchecked alignment in implicitly locked XCHG and an inappropriate aligned LLVM CAS for CMPXCHG without LOCK. These are corrected; a separate subtraction oracle now checks all six arithmetic flags and partial-register/memory outcomes across 1,296 cases, independently of Rosetta's differing non-ZF behavior.
The final combined stack passed 588 compiler/relinker/runtime checks and 26 native integrations. Rebuilt yaml-cpp matches 147 cases, zstd still matches 61, and the dedicated C++ cleanup/rethrow/RTTI/noexcept program matches its source-compiled ARM64 reference. Graphics still matches eight exact RGB frames after 600 flips per executable, with teardown; controller and typed bundle checks pass.
All dependent PRs were aligned with main
2f4cc8983, retaining the macOS target guards and convergent shader handling while adopting upstream changes and the new debt-document layout. Their current heads merge cleanly at readback; new hosted CI is pending. Full Linux/Windows builds still require maintainer dispatch. Ordinary shared-memory semantics, guest thread lifecycle in this new backend, original PS5 startup and controlled performance evaluation remain follow-ups. No game compatibility or speedup claim.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-12T23:01:02Z.
Progress update in separate drafts: #4740 adds qualified concurrent guest workers, #4749 separates SCE entry from glibc startup, #4760 adds the numeric forms exposed by the first jq trial, and #4813 reduces the cost of ordered scalar accesses and includes a reproducible benchmark harness.
The repaired stack is based on main
43e3a70f8. I reviewed the new ContentSearch declarations and VR pad export before requalifying the unchanged pad interfaces; the macOS CI failures were those source-identity checks, not relaxed assertions. The final local stack passes 610 compiler/relinker/runtime tests, 27 native integrations, cube flips/teardown/exact RGB, pad and the typed module consumer. Fresh hosted CI is separate and still needs to finish.There is a measured improvement, with a clear remaining gap. On the qualified 128 MiB zstd workload with two workers, ordered AOT falls from about 80.3 ms to 35.1 ms; the source-equivalent Rosetta reference (O3+ThinLTO) takes 33.7 ms. With both compression workers and asynchronous I/O disabled, AOT takes 39.7 ms against Rosetta's 48.9 ms. Outputs are checked before timing. These are warm CLI/source-equivalent comparisons, not the same ELF run under Rosetta or game/FPS claims.
The profile points to the data-processing loops. I would next qualify buffer ownership/immutability and loop-level guards so LLVM can optimize proven-private regions, retaining the general native AOT path where those facts are missing. Weaker-order, LSE2 and ThinLTO variants did not show a clear benefit here and were left out of the published optimization.
C5 is not complete: the original independent homebrew still needs instruction/provider/module work. Jq's frozen first trial remains a rejection; after numeric adaptation it reaches the missing-provider boundary. No runtime x86 decoder, interpreter or JIT was added.
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-12T23:28:11Z.
Maintenance update: the dependency stack from #1835 through #4718 is now synchronized with main
90c683946, using fast-forward branch updates and preserving each PR's scope. This brings the already-tested Darwin shared-memory backing and platform guards into the graphics foundation, preserves the upstream tracing dependencies, and carries forward the reviewed Pad provider identities without changing their contracts.Validation on Apple ARM64: 427 tests at the compiler base, 473 at the recipe layer, 591 compiler/relinker/runtime tests at #4718, and 27 native integration tests. The cube completed 600 flips per implementation with teardown and eight exact RGB comparisons; Pad and the three-image modular consumer passed their independent references. Pad input is simulated, not physical-controller validation. Per-layer catalog, recovery, dispatch and module checks also passed. Hosted checks for the new heads are being followed; full Linux/Windows builds still require maintainer dispatch.
The existing #4740/#4749/#4760/#4813 heads have completed their automatic checks successfully. Their implementation and performance scope are unchanged by this maintenance update.
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-13T09:03:26Z.
The next concrete consumer is now in #5021: the independently built jq input runs natively on Apple ARM64. Its core upstream suite passes 550/550, and 32 additional CLI comparisons match stdout, stderr and exit status against a separately source-built ARM64 reference. The final stack also passes 613 compiler/runtime/relinker tests and 27 native integrations, with cube/Pad/bundle rechecked after the main integration.
This is explicitly an adapted consumer, without Oniguruma, rather than a fresh holdout or a game-compatibility claim. Provider tests caught two useful cross-platform counterexamples before delivery: empty-needle
memmemand math errno behaviour. The limits of Darwin libm equivalence are documented.I am continuing with checked memory specialization and the original homebrew's module/lifecycle closure in separate branches. The JSON workload currently remains slower than Rosetta, so performance is still an acceptance gate, not an assumed consequence of native execution. The next untouched consumer, bzip2, was frozen before adaptation; its first trial stopped at five 16-bit double-shift sites, and that result is retained.
We are now at the 20-open-PR limit. I will keep the follow-ups separate and tested while slots become available, rather than expanding existing PRs into unrelated topics. The architectural decision remains with the owners.
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-13T15:06:15Z.
The original public PPSA99999 package now runs on Apple ARM64 in #5021, including its original application and supplied
libc.prx. The module is converted and initialized, not replaced by a host libc. Both the normal asset path and the missing-asset path match every RGB pixel at 1920×1080 against a separately compiled source-tag renderer. Module finalization and GPU teardown pass. The harness requests shutdown after a completed API boundary; the original application otherwise loops indefinitely.The combined checkpoint is
88e0629b4, based on main69b4ca5d9. It verifies 652 compiler/relinker/runtime cases, 27 native integrations, 550/550 official jq tests plus 32 CLI comparisons, and 46 bzip2 cases with an independent decoder. The first frozen bzip2 attempt failed on five narrow double-shift sites; the successful adapted run is not being relabeled as an unseen first-pass result. Reproduction commands and input identities are in the updated build documentation.The four optimization routes now have bounded implementations: checked private/ordered AOT epochs, immutable-image lifetime checks, guarded REP copy/fill lowering, and verified scalar provider calls with sparse register writeback. They do not recover private ownership inside arbitrary worker threads. On the final warm CLI experiment, jq falls from 748 to 201 ms against the conservative AOT path, but Rosetta still takes 103 ms. Single-thread zstd takes 42.25 ms versus Rosetta's 53.56 ms; two-worker zstd takes 36.89 versus 34.35 ms. These are source-equivalent comparisons, not identical-ELF, cold-start or game/FPS claims.
One review-scope change from my previous update: I have consolidated these components into the existing draft #5021, keeping distinct commits and explicit dependencies. Its description requests an exception to the separate-follow-up rule; it does not claim that this scope or the architecture is already approved. Fresh hosted CI is running, and the full Linux/Windows dispatch policy is unchanged.
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-14T08:26:06Z.
The 20-PR ARM64 stack is now updated through main
31bfc4e86, published with atomic fast-forward pushes. The current #5021 head is8598a0bde; all 20 PRs report mergeable at readback. No architecture decision or merge is implied.The integration keeps upstream's macOS x86-64/Rosetta configuration for the full build and ARM64 for native graphics. It also preserves the main-thread SDL path, generates the new presentation shader headers, and carries the checked Darwin deadline conversion into the shared base. Provider implementations were reviewed before requalification.
Local validation on the final stack: 672 compiler/runtime/relinker tests and 27 native tests passed. The graphics base separately passed its 21 native tests. Cube execution completed 600 flips per implementation with eight exact RGB comparisons; Pad and the module bundle passed. The original SCE app plus PRX also passed with the asset present and absent, exact RGB and teardown. Shutdown remains host-requested at an API boundary.
A new socket-stat test exposed a Darwin/Linux SHUT_RD difference. The Darwin case now verifies its actual queue-flush transition, while retaining the Linux case; provider semantics are unchanged and the limitation is documented. Three timeouts in the first validation round passed unchanged reruns; the final full run passed all 672 without timeouts.
Hosted CI for the new heads is pending, with no current failures at readback. Full Linux/Windows builds still need maintainer dispatch. This is integration validation, with no new performance or game-compatibility claim. AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-15T10:41:18Z.
A new bring-up checkpoint uses lowbit/ps5-doom v1.1.1, PPSA99666, with the original PS5 eboot and its supplied libc module preserved.
On the adapted macOS x86/Rosetta runtime, all three recorded demos now finish: 5,026 / 3,836 / 2,134 gametics. Six captured game framebuffers, at frames 120 and 900 of each replay, match the independently source-built ARM64 reference exactly in RGB after decoding the title's tiling and CPU scaling. This run explicitly selects the title's CPU presentation path. It is not an ARM64 AOT game run or a performance comparison.
The ARM64 compiler still rejects 387 instruction sites, down from 2,629 in the frozen input. The new generic integer/VEX families have independent models, alias/upper-lane checks, guard-page cases and explicit EVEX rejection. The full local compiler/runtime/relinker suite passed 694 tests; the final EVEX guard also passed focused regression tests.
Code is available as separate commits on the dedicated checkpoint branch, including the Darwin statvfs build blocker and POSIX declarations. No additional PR has been opened.
Scope of the Rosetta evidence: an older adapted runtime based on
be5cc3c58, with recorded macOS overlays and #5735, rather than a complete current-main title build. One smoke run reproduced the AudioOut shutdown abort described in #3533 (queueAudio → mutex::lock, after GPU teardown). Three subsequent warm A/B pairs passed both variants, so the game failure is intermittent. The controlled upstream shutdown fixture failed with baseline AudioOut and passed 10/10 with the candidate; the complete replays above use that candidate. No claim is made that this satisfies a current-main merge gate.Host: Apple M5 Max, macOS 27.2, Rosetta, Khronos Vulkan Loader 1.4.313 built for x86_64 and MoltenVK. The native-AOT game startup, remaining ISA/provider coverage and comparable performance runs remain open. AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by yabanana on 2026-10-15T12:20:06Z.
Follow-up: the original PS5 DOOM executable now completes all three demos as ARM64 AOT, without Rosetta, with its original libc module converted and initialized alongside it.
The reproducible run uses lowbit/ps5-doom v1.1.1, PPSA99666, the frozen shareware WAD and the title's CPU scaler. Results: 5,026 / 3,836 / 2,134 gametics, six exact 1920×1080 RGB comparisons against the pinned source-built reference, normal title-requested exit, module finalization and Vulkan teardown. The executable is ARM64 Mach-O and reports
translated=0. Audio, guest worker callbacks, file/stdio operations, Pad initialization and the capture connection run through native providers.Four new commits separate the reused #3533 AudioOut shutdown fix, remaining VEX lowering, and the SCE services/consumer. The build and verification procedure and qualified binding manifest are included. No additional PR was opened; the branch builds on the existing ARM64 stack and still needs upstream review/integration.
Local validation: 711 compiler/runtime/relinker tests, 29 native tests, callback/varargs checks with ASan/UBSan (linked platform libraries uninstrumented), the controlled AudioOut shutdown regression, cube execution with 600 flips per implementation and eight exact RGB comparisons, Pad and the modular consumer. The Strings.cpp identity change was requalified after checking that the complete consumed memcpy/memset definitions and effects remained unchanged. The final static ABI guard also rejects host
long double; both affected DOOM objects are byte-identical to the replayed objects. Hosted CI has not run on this branch.Scope remains explicit: these are recorded demos with the CPU scaler, not AGC presentation, arbitrary WADs, controller hardware or a performance comparison. Scalar FMA currently rejects nonfinite operands; floating status and alternate rounding remain unqualified. VTEST exposed a Rosetta flag discrepancy, so all flags are checked against an independent integer model following the Intel specification. The compatibility compiler used here is separate from the ongoing native-quality compiler work.
Host: Apple M5 Max, macOS 27.2, Apple Clang 21, Vulkan/MoltenVK. AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T04:42:05Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected portions show no verified blocking defect, but the review is incomplete and does not support approval.
What I ran
Reviewed head
c7d0a3c4c8769ea769ec2d913791af2a4e8a8a65using the prepared review bundle and the pinned repository reader. No build or tests were run.Results
Findings
Blocking
None verified in the inspected portions.
Non-blocking
Not verified
Read:
review/description.md,review/commits.md,review/manifest.json,review/diff.patch,review/README.md,core/aot/compiler.pylines 1–300,core/aot/native_image.py, andcore/libs/native/NativeAotImage.cpp. The diff and manifest were only partially read. The other changed files were not read; the three submodule entries (3rdparty/capstone,3rdparty/ps5link-sdk, and3rdparty/pyelftools) were excluded because they are not plain text. No tests, builds, or negative control were run.To get this to a good state
Nothing is required for this comment. Optional: complete review of the remaining changed lines and run the applicable checks before making a formal decision.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.