feat(aot): add opt-in LLVM integer leaf compiler #9776

Closed
Xx-LiDAF-xX wants to merge 3 commits from upstream-pr/9776 into main
Xx-LiDAF-xX commented 2026-10-22 14:34:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Xx-LiDAF-xX on 2026-10-22T14:34:05Z.


What

An opt-in experimental compiler for one named, sized x86-64 ELF integer leaf function. It uses LLVM 20.1.5 from the pinned source submodule to verify IR and emit native x86-64 ELF, COFF or Mach-O objects and assembly. The input contract is zero to six uint64_t System V arguments and a uint64_t result. Unsupported instructions, memory, control flow, relocations and undeclared inputs fail explicitly. The old placeholder backend and unrelated runtime/I/O/graphics additions are removed.

This PR is held as a draft pending a genuine in-tree consumer, as noted in the October 27 review and November 14 review:

  • ANYPS5_BUILD_AOT defaults to OFF in every root build configuration. ON explicitly enables it; existing CMake caches retain their prior value. BUILD documents this and the LLVM fetch cost.
  • LLVM has update = none in .gitmodules. The normal recursive initialization skips it. Opt-in requires git submodule update --init --checkout 3rdparty/llvm-project; the explicit --checkout overrides the configured skip. Naming the path alone does not. Existing local Git update settings take precedence.
  • All requested outputs (--output, --emit-asm, --emit-llvm) are now staged to temporary files on disk and checked for case-insensitive path collisions before any destination path is replaced, with RAII cleanup of all staged .tmp files if any write or validation step fails.
  • Rebased onto current main (96dddbe61d).
  • #5021 coordination update: #5021 was closed on November 12, and its closing note explicitly advised #9776 not to wait on #5021 and to drop Depends on: #5021. Depends on is now none. #1835 remains open as an architecture discussion thread, not an implementation to merge.
  • Acceptance blocker remains: no production consumer, qualified title or committed integration follow-up exists yet. The CLI and regression tests do not satisfy that requirement, so this PR stays in draft until a consumer or follow-up integration is established.

LLVM fetch cost: the measured pinned working tree contains 154,024 files, 1,785,225,413 bytes (1.66 GiB), excluding Git metadata. The local shallow checkout also has 396.50 MiB of Git pack data. These are logical local sizes, not measured network-transfer or filesystem-allocation sizes. The full-build git submodule update --init --recursive command skips LLVM by default, so these costs are opt-in. Existing local Git configuration may override the default.

Measured fresh-directory source-build cost on the Windows machine below: configuration took 39.27 seconds. The eight-worker build ran 697.41 seconds (11m 37s) before compiler processes ran out of memory while root build/test validation was also running. A two-worker retry was interrupted before its completion timer was recorded. Resuming the remaining 195 steps with two workers then completed successfully in 607.08 seconds (10m 7s). These are separate observed phases, not a clean end-to-end benchmark; total uninterrupted clean-build time is unavailable. LLVM compilation adds no build work when AOT is OFF. The documented opt-in example uses two workers.

Tested

November 22 rebase validation (5cd81c31cb9025423954d24bea54934b50c13baf on upstream 96dddbe61db803ce7e3a0b538b203c3286f7a72d), same Windows 11 machine, WinLibs GCC 15.2.0:

  • Rebased onto current main. The only conflict was docs/dev/BUILD.md: kept upstream's new tools/relinker_seed_manifest.py paragraph and placed the leaf-compiler section after it. Compiler sources are unchanged by the rebase.
  • Following @MarcZX10's latest review, aot_leaf_reject now prints Skipped aliased-output rejection: the filesystem is case-sensitive when the case-alias check cannot run (5cd81c31cb).
  • Fresh root Release build (build-leaf, ANYPS5_RELINKER_ONLY=ON, ANYPS5_BUILD_AOT=ON, fresh LLVM checkout at 7b09d7b446). Configure took 36.58 s. The six-worker build of aot_compiler_cli and aot_ir_check took 853.75 s (14m 14s) for 1558/1558 steps, with no out-of-memory retry.
  • ctest -R "^aot_leaf_": 6/6 passed, 0 skipped, in 12.81 s.
  • ctest -R "conventions_|test_script_registration": 67/67 passed, 0 skipped, in 195.91 s.
  • python tools/check_conventions.py --base upstream/main, git diff --check upstream/main and python tools/check_test_registration.py --scripts pass.
  • tools/pr_overlap.py --branch result, refreshed table below. It fails closed only on PRs that already conflict with main. The only same-new-file overlap is #1835, an architecture discussion thread.
  • Linux and macOS execution are still not tested.

November 14 rebase and multi-output staging validation (6ab76219be0c05756517c71921a51c114d35ab5b on upstream c04f8bec02607da57e2b99219a7e49fd20c89340):

  • Read the latest reviews and comments on #9776, #5021 and #1835. Addressed the multi-output staging item from review 5903724583 and dropped Depends on: #5021 per the closing comment on #5021.
  • Standalone AOT build (build-aot): 6/6 AOT CTest groups passed, zero skipped in 11.46 seconds.
  • Root Release build (build-root, ANYPS5_RELINKER_ONLY=ON and ANYPS5_BUILD_AOT=ON): 6/6 AOT CTest groups passed, zero skipped, and focused relinker/conventions/registration tests (13/13 passed, zero skipped in 27.73 seconds: conventions_doc_links, conventions_debt_length, conventions_debt_labels, test_script_registration, aot_leaf_abi, aot_leaf_arithmetic, aot_leaf_moves, aot_leaf_shifts, aot_leaf_reject, aot_leaf_formats, relinker_conversion, relr_relocations and windows_trace_imports).
  • aot_leaf_reject now verifies that secondary output failures (--emit-llvm or --emit-asm targeting a missing directory) preserve existing primary output and clean up all .tmp files, and that case-insensitive output aliases (alias.o and ALIAS.O) fail during staging before creating any destination file.
  • python tools/check_conventions.py --base upstream/main, python tools/check_conventions.py --base origin/main, git diff --check upstream/main..HEAD and python tools/check_test_registration.py --scripts pass with zero findings.

Earlier validation (October 27–28; original heads recorded below):

Windows 11 x86-64, Ryzen 7 5800X, WinLibs MinGW-w64 GCC 15.2.0, Ninja and Python 3.14.8.

  • Git 2.56.0.windows.1 with real isolated local repositories: recursive update skips the optional submodule and initializes an ordinary dependency; explicit path-only update still skips; explicit --checkout initializes it at the pinned commit. The fixture reads the actual LLVM update setting from this branch. No LLVM checkout download was needed for this policy check.
  • Rebased root Release build with AOT explicitly ON succeeds. The 370-test run recorded 369 passes, one process-launch failure, zero skips in 659.93 seconds with two test workers. windows_trace_imports failed with Windows error 1455 (paging file too small) during the eight-worker LLVM build; its focused rerun passed (1.07 seconds test time) after that build stopped. All six AOT groups passed in the root run. This is not presented as an uninterrupted 370/370 pass.
  • Fresh-directory standalone build: 6/6 AOT CTest groups passed, zero skipped (17.97 seconds) using the newly built LLVM/compiler executables.
  • Fresh relinker-only default configure succeeds with AOT OFF and no LLVM targets configured. Fresh full-build configuration also records AOT OFF and never enters LLVM, then stops at missing SDL2/FFmpeg submodules; this is not a full product configure/build pass.
  • Execution coverage remains 68 instruction sequences on 210 boundary/random vectors, comparing original native bytes, independent integer results, emitted objects and emitted assembly. The six-argument ABI group covers the Windows register/stack bridge. Rejection tests cover malformed/unsupported input and preserve existing output on errors.
  • Linux/macOS native execution, MSVC linking, full system-library/product builds, GPU tests and console titles were not tested locally. Mach-O/ELF emission is not native-platform validation. Apple Silicon execution requires Rosetta; Python itself can remain ARM64.

Compiler/build validation head: 5cd81c31cb9025423954d24bea54934b50c13baf (prior heads 6ab76219be0c05756517c71921a51c114d35ab5b, 758b3527733935394d67f0b84db49281ad8669e1, 82345086e561dbb548c3bb304d9fc3c3bfccb240); upstream base: 96dddbe61db803ce7e3a0b538b203c3286f7a72d.

Reproduce the focused build/tests:

git submodule update --init --checkout 3rdparty/llvm-project
cmake -S . -B build-leaf -G Ninja -DCMAKE_BUILD_TYPE=Release -DANYPS5_RELINKER_ONLY=ON -DANYPS5_BUILD_AOT=ON -DBUILD_TESTING=ON
cmake --build build-leaf --target aot_compiler_cli aot_ir_check --parallel 2
ctest --test-dir build-leaf -R '^aot_leaf_' -V

The November 22 open-PR overlap scan is below (omitting the self-comparison against #9776's pre-push remote head). Shared files in PRs already conflicting with main remain unverified; no overlap-free merge is claimed.

Open-PR overlap scan

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 1835 core/aot/CMakeLists.txt
docs/dev/debt/aot.md

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1835 .gitmodules
CMakeLists.txt
core/aot/CMakeLists.txt
docs/dev/BUILD.md
docs/dev/debt/aot.md
PR 7642 CMakeLists.txt
PR 9508 CMakeLists.txt
PR 10193 CMakeLists.txt
PR 10897 CMakeLists.txt
PR 11435 docs/dev/BUILD.md
PR 11436 docs/dev/BUILD.md
PR 13928 CMakeLists.txt
PR 13929 CMakeLists.txt
PR 15136 docs/dev/BUILD.md
PR 16391 CMakeLists.txt
PR 16793 docs/dev/BUILD.md
PR 17558 CMakeLists.txt
PR 18208 docs/dev/BUILD.md
PR 18210 docs/dev/BUILD.md
PR 19610 docs/dev/BUILD.md
PR 20315 docs/dev/BUILD.md
PR 21208 docs/dev/BUILD.md
PR 21229 docs/dev/BUILD.md
PR 21444 CMakeLists.txt
PR 22178 CMakeLists.txt
PR 22179 CMakeLists.txt
PR 22267 CMakeLists.txt
PR 22282 CMakeLists.txt
PR 22357 CMakeLists.txt
PR 22466 CMakeLists.txt
PR 22594 CMakeLists.txt
docs/dev/BUILD.md
PR 23196 docs/dev/BUILD.md
PR 23970 CMakeLists.txt

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4969126144 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9776). Originally posted by [Xx-LiDAF-xX](https://github.com/Xx-LiDAF-xX) on 2026-10-22T14:34:05Z. --- ### What An opt-in experimental compiler for one named, sized x86-64 ELF integer leaf function. It uses LLVM 20.1.5 from the pinned source submodule to verify IR and emit native x86-64 ELF, COFF or Mach-O objects and assembly. The input contract is zero to six `uint64_t` System V arguments and a `uint64_t` result. Unsupported instructions, memory, control flow, relocations and undeclared inputs fail explicitly. The old placeholder backend and unrelated runtime/I/O/graphics additions are removed. This PR is held as a **draft pending a genuine in-tree consumer**, as noted in the [October 27 review](https://github.com/boykopovar/AnyPS5/pull/9776#pullrequestreview-5666345427) and [November 14 review](https://github.com/boykopovar/AnyPS5/pull/9776#pullrequestreview-5903724583): - `ANYPS5_BUILD_AOT` defaults to **OFF in every root build configuration**. `ON` explicitly enables it; existing CMake caches retain their prior value. BUILD documents this and the LLVM fetch cost. - LLVM has `update = none` in `.gitmodules`. The normal recursive initialization skips it. Opt-in requires `git submodule update --init --checkout 3rdparty/llvm-project`; the explicit `--checkout` overrides the configured skip. Naming the path alone does not. Existing local Git update settings take precedence. - All requested outputs (`--output`, `--emit-asm`, `--emit-llvm`) are now staged to temporary files on disk and checked for case-insensitive path collisions before any destination path is replaced, with RAII cleanup of all staged `.tmp` files if any write or validation step fails. - Rebased onto current `main` (`96dddbe61d`). - **#5021 coordination update:** #5021 was closed on November 12, and its [closing note](https://github.com/boykopovar/AnyPS5/pull/5021#issuecomment-6914794976) explicitly advised #9776 not to wait on #5021 and to drop `Depends on: #5021`. `Depends on` is now `none`. #1835 remains open as an architecture discussion thread, not an implementation to merge. - **Acceptance blocker remains:** no production consumer, qualified title or committed integration follow-up exists yet. The CLI and regression tests do not satisfy that requirement, so this PR stays in draft until a consumer or follow-up integration is established. LLVM fetch cost: the measured pinned working tree contains **154,024 files, 1,785,225,413 bytes (1.66 GiB)**, excluding Git metadata. The local shallow checkout also has **396.50 MiB** of Git pack data. These are logical local sizes, not measured network-transfer or filesystem-allocation sizes. The full-build `git submodule update --init --recursive` command skips LLVM by default, so these costs are opt-in. Existing local Git configuration may override the default. Measured fresh-directory source-build cost on the Windows machine below: configuration took **39.27 seconds**. The eight-worker build ran **697.41 seconds (11m 37s)** before compiler processes ran out of memory while root build/test validation was also running. A two-worker retry was interrupted before its completion timer was recorded. Resuming the remaining 195 steps with two workers then completed successfully in **607.08 seconds (10m 7s)**. These are separate observed phases, not a clean end-to-end benchmark; total uninterrupted clean-build time is unavailable. LLVM compilation adds no build work when AOT is OFF. The documented opt-in example uses two workers. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> November 22 rebase validation (`5cd81c31cb9025423954d24bea54934b50c13baf` on upstream `96dddbe61db803ce7e3a0b538b203c3286f7a72d`), same Windows 11 machine, WinLibs GCC 15.2.0: - Rebased onto current main. The only conflict was `docs/dev/BUILD.md`: kept upstream's new `tools/relinker_seed_manifest.py` paragraph and placed the leaf-compiler section after it. Compiler sources are unchanged by the rebase. - Following @MarcZX10's latest review, `aot_leaf_reject` now prints `Skipped aliased-output rejection: the filesystem is case-sensitive` when the case-alias check cannot run (`5cd81c31cb`). - Fresh root Release build (`build-leaf`, `ANYPS5_RELINKER_ONLY=ON`, `ANYPS5_BUILD_AOT=ON`, fresh LLVM checkout at `7b09d7b446`). Configure took 36.58 s. The six-worker build of `aot_compiler_cli` and `aot_ir_check` took 853.75 s (14m 14s) for 1558/1558 steps, with no out-of-memory retry. - `ctest -R "^aot_leaf_"`: 6/6 passed, 0 skipped, in 12.81 s. - `ctest -R "conventions_|test_script_registration"`: 67/67 passed, 0 skipped, in 195.91 s. - `python tools/check_conventions.py --base upstream/main`, `git diff --check upstream/main` and `python tools/check_test_registration.py --scripts` pass. - `tools/pr_overlap.py --branch` result, refreshed table below. It fails closed only on PRs that already conflict with main. The only same-new-file overlap is #1835, an architecture discussion thread. - Linux and macOS execution are still not tested. November 14 rebase and multi-output staging validation (`6ab76219be0c05756517c71921a51c114d35ab5b` on upstream `c04f8bec02607da57e2b99219a7e49fd20c89340`): - Read the latest reviews and comments on #9776, #5021 and #1835. Addressed the multi-output staging item from [review 5903724583](https://github.com/boykopovar/AnyPS5/pull/9776#pullrequestreview-5903724583) and dropped `Depends on: #5021` per the [closing comment on #5021](https://github.com/boykopovar/AnyPS5/pull/5021#issuecomment-6914794976). - Standalone AOT build (`build-aot`): **6/6 AOT CTest groups passed, zero skipped** in 11.46 seconds. - Root Release build (`build-root`, `ANYPS5_RELINKER_ONLY=ON` and `ANYPS5_BUILD_AOT=ON`): **6/6 AOT CTest groups passed, zero skipped**, and focused relinker/conventions/registration tests (**13/13 passed, zero skipped** in 27.73 seconds: `conventions_doc_links`, `conventions_debt_length`, `conventions_debt_labels`, `test_script_registration`, `aot_leaf_abi`, `aot_leaf_arithmetic`, `aot_leaf_moves`, `aot_leaf_shifts`, `aot_leaf_reject`, `aot_leaf_formats`, `relinker_conversion`, `relr_relocations` and `windows_trace_imports`). - `aot_leaf_reject` now verifies that secondary output failures (`--emit-llvm` or `--emit-asm` targeting a missing directory) preserve existing primary output and clean up all `.tmp` files, and that case-insensitive output aliases (`alias.o` and `ALIAS.O`) fail during staging before creating any destination file. - `python tools/check_conventions.py --base upstream/main`, `python tools/check_conventions.py --base origin/main`, `git diff --check upstream/main..HEAD` and `python tools/check_test_registration.py --scripts` pass with zero findings. Earlier validation (October 27–28; original heads recorded below): Windows 11 x86-64, Ryzen 7 5800X, WinLibs MinGW-w64 GCC 15.2.0, Ninja and Python 3.14.8. - Git 2.56.0.windows.1 with real isolated local repositories: recursive update skips the optional submodule and initializes an ordinary dependency; explicit path-only update still skips; explicit `--checkout` initializes it at the pinned commit. The fixture reads the actual LLVM `update` setting from this branch. No LLVM checkout download was needed for this policy check. - Rebased root Release build with AOT explicitly ON succeeds. The 370-test run recorded **369 passes, one process-launch failure, zero skips** in 659.93 seconds with two test workers. `windows_trace_imports` failed with Windows error 1455 (paging file too small) during the eight-worker LLVM build; its focused rerun passed (1.07 seconds test time) after that build stopped. All six AOT groups passed in the root run. This is not presented as an uninterrupted 370/370 pass. - Fresh-directory standalone build: **6/6 AOT CTest groups passed, zero skipped** (17.97 seconds) using the newly built LLVM/compiler executables. - Fresh relinker-only default configure succeeds with AOT OFF and no LLVM targets configured. Fresh full-build configuration also records AOT OFF and never enters LLVM, then stops at missing SDL2/FFmpeg submodules; this is **not** a full product configure/build pass. - Execution coverage remains 68 instruction sequences on 210 boundary/random vectors, comparing original native bytes, independent integer results, emitted objects and emitted assembly. The six-argument ABI group covers the Windows register/stack bridge. Rejection tests cover malformed/unsupported input and preserve existing output on errors. - Linux/macOS native execution, MSVC linking, full system-library/product builds, GPU tests and console titles were not tested locally. Mach-O/ELF emission is not native-platform validation. Apple Silicon execution requires Rosetta; Python itself can remain ARM64. Compiler/build validation head: `5cd81c31cb9025423954d24bea54934b50c13baf` (prior heads `6ab76219be0c05756517c71921a51c114d35ab5b`, `758b3527733935394d67f0b84db49281ad8669e1`, `82345086e561dbb548c3bb304d9fc3c3bfccb240`); upstream base: `96dddbe61db803ce7e3a0b538b203c3286f7a72d`. Reproduce the focused build/tests: ```sh git submodule update --init --checkout 3rdparty/llvm-project cmake -S . -B build-leaf -G Ninja -DCMAKE_BUILD_TYPE=Release -DANYPS5_RELINKER_ONLY=ON -DANYPS5_BUILD_AOT=ON -DBUILD_TESTING=ON cmake --build build-leaf --target aot_compiler_cli aot_ir_check --parallel 2 ctest --test-dir build-leaf -R '^aot_leaf_' -V ``` The November 22 open-PR overlap scan is below (omitting the self-comparison against #9776's pre-push remote head). Shared files in PRs already conflicting with main remain unverified; no overlap-free merge is claimed. <details> <summary>Open-PR overlap scan</summary> <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 1835](https://www.github.com/boykopovar/AnyPS5/pull/1835) | | | `core/aot/CMakeLists.txt`<br>`docs/dev/debt/aot.md` | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 1835](https://www.github.com/boykopovar/AnyPS5/pull/1835) | `.gitmodules`<br>`CMakeLists.txt`<br>`core/aot/CMakeLists.txt`<br>`docs/dev/BUILD.md`<br>`docs/dev/debt/aot.md` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `CMakeLists.txt` | | [PR 9508](https://www.github.com/boykopovar/AnyPS5/pull/9508) | `CMakeLists.txt` | | [PR 10193](https://www.github.com/boykopovar/AnyPS5/pull/10193) | `CMakeLists.txt` | | [PR 10897](https://www.github.com/boykopovar/AnyPS5/pull/10897) | `CMakeLists.txt` | | [PR 11435](https://www.github.com/boykopovar/AnyPS5/pull/11435) | `docs/dev/BUILD.md` | | [PR 11436](https://www.github.com/boykopovar/AnyPS5/pull/11436) | `docs/dev/BUILD.md` | | [PR 13928](https://www.github.com/boykopovar/AnyPS5/pull/13928) | `CMakeLists.txt` | | [PR 13929](https://www.github.com/boykopovar/AnyPS5/pull/13929) | `CMakeLists.txt` | | [PR 15136](https://www.github.com/boykopovar/AnyPS5/pull/15136) | `docs/dev/BUILD.md` | | [PR 16391](https://www.github.com/boykopovar/AnyPS5/pull/16391) | `CMakeLists.txt` | | [PR 16793](https://www.github.com/boykopovar/AnyPS5/pull/16793) | `docs/dev/BUILD.md` | | [PR 17558](https://www.github.com/boykopovar/AnyPS5/pull/17558) | `CMakeLists.txt` | | [PR 18208](https://www.github.com/boykopovar/AnyPS5/pull/18208) | `docs/dev/BUILD.md` | | [PR 18210](https://www.github.com/boykopovar/AnyPS5/pull/18210) | `docs/dev/BUILD.md` | | [PR 19610](https://www.github.com/boykopovar/AnyPS5/pull/19610) | `docs/dev/BUILD.md` | | [PR 20315](https://www.github.com/boykopovar/AnyPS5/pull/20315) | `docs/dev/BUILD.md` | | [PR 21208](https://www.github.com/boykopovar/AnyPS5/pull/21208) | `docs/dev/BUILD.md` | | [PR 21229](https://www.github.com/boykopovar/AnyPS5/pull/21229) | `docs/dev/BUILD.md` | | [PR 21444](https://www.github.com/boykopovar/AnyPS5/pull/21444) | `CMakeLists.txt` | | [PR 22178](https://www.github.com/boykopovar/AnyPS5/pull/22178) | `CMakeLists.txt` | | [PR 22179](https://www.github.com/boykopovar/AnyPS5/pull/22179) | `CMakeLists.txt` | | [PR 22267](https://www.github.com/boykopovar/AnyPS5/pull/22267) | `CMakeLists.txt` | | [PR 22282](https://www.github.com/boykopovar/AnyPS5/pull/22282) | `CMakeLists.txt` | | [PR 22357](https://www.github.com/boykopovar/AnyPS5/pull/22357) | `CMakeLists.txt` | | [PR 22466](https://www.github.com/boykopovar/AnyPS5/pull/22466) | `CMakeLists.txt` | | [PR 22594](https://www.github.com/boykopovar/AnyPS5/pull/22594) | `CMakeLists.txt`<br>`docs/dev/BUILD.md` | | [PR 23196](https://www.github.com/boykopovar/AnyPS5/pull/23196) | `docs/dev/BUILD.md` | | [PR 23970](https://www.github.com/boykopovar/AnyPS5/pull/23970) | `CMakeLists.txt` | </details> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes
MarcZX10 commented 2026-10-22 16:35:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T16:35:51Z.

Review: CHANGES_REQUESTED


I built the exact PR’s standalone AOT project and ran its tests: all 4/4 pass. However, an end-to-end compiler check exposes a blocking issue. I compiled a minimal ELF with one _start function (mov $0, %eax; ret) and ran the new aot_compiler_cli with --output and --emit-llvm. The CLI reported “AOT Compilation succeeded” and one function lifted, but the object file is 0 bytes and the emitted IR contains only ModuleID and target triple, no function.

The added LLVM compatibility layer is currently a no-op for code generation: Module::print emits only those two lines; TargetRegistry::lookupTarget accepts any nonempty triple; TargetMachine::addPassesToEmitFile returns success without registering an emitter; and PassManager::run performs no work. The four tests exercise the parser, lifter, runtime, graphics and I/O components, but do not call AotCompilerDriver::Compile and assert a valid output object/executable. Please use real LLVM code generation or implement and test a working backend for the lifted instructions, and add an end-to-end test that parses the generated object and verifies emitted function code. Until then the new compiler’s success report is a false positive.

There is also no add_subdirectory(core/aot) in the repository’s root CMakeLists.txt; the new tests run only when configuring core/aot as a separate project, so normal builds and upstream PR CI do not build or test this code. Please integrate the AOT targets/tests with the repository build (or document and wire up an intentional standalone build in the project’s normal CI path).

The exact-head standalone build and 4/4 CTest pass, but they do not cover the broken output path. Current-main conventions and git diff --check pass. The branch is 13 commits behind and 39 commits ahead of live main (499b1cf9fc44da935fe6d63813675ad5810e8402); CONTRIBUTING.md requires keeping branches up to date. Please refresh the branch after addressing the output and integration gaps, then rerun the end-to-end and normal build tests.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5617625898 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9776#pullrequestreview-5617625898). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T16:35:51Z. **Review:** CHANGES_REQUESTED --- I built the exact PR’s standalone AOT project and ran its tests: all 4/4 pass. However, an end-to-end compiler check exposes a blocking issue. I compiled a minimal ELF with one `_start` function (`mov $0, %eax; ret`) and ran the new `aot_compiler_cli` with `--output` and `--emit-llvm`. The CLI reported “AOT Compilation succeeded” and one function lifted, but the object file is **0 bytes** and the emitted IR contains only `ModuleID` and `target triple`, no function. The added LLVM compatibility layer is currently a no-op for code generation: `Module::print` emits only those two lines; `TargetRegistry::lookupTarget` accepts any nonempty triple; `TargetMachine::addPassesToEmitFile` returns success without registering an emitter; and `PassManager::run` performs no work. The four tests exercise the parser, lifter, runtime, graphics and I/O components, but do not call `AotCompilerDriver::Compile` and assert a valid output object/executable. Please use real LLVM code generation or implement and test a working backend for the lifted instructions, and add an end-to-end test that parses the generated object and verifies emitted function code. Until then the new compiler’s success report is a false positive. There is also no `add_subdirectory(core/aot)` in the repository’s root `CMakeLists.txt`; the new tests run only when configuring `core/aot` as a separate project, so normal builds and upstream PR CI do not build or test this code. Please integrate the AOT targets/tests with the repository build (or document and wire up an intentional standalone build in the project’s normal CI path). The exact-head standalone build and 4/4 CTest pass, but they do not cover the broken output path. Current-main conventions and `git diff --check` pass. The branch is 13 commits behind and 39 commits ahead of live `main` (`499b1cf9fc44da935fe6d63813675ad5810e8402`); CONTRIBUTING.md requires keeping branches up to date. Please refresh the branch after addressing the output and integration gaps, then rerun the end-to-end and normal build tests.
MarcZX10 commented 2026-10-22 22:34:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T22:34:58Z.

Review: COMMENTED


I built the exact current head (241c38a7c4508702520758cf1cdeb9c7f924a448) with cmake -S core/aot -B build-aot -G Ninja, built all targets, and ran CTest: 3/4 pass; test_aot_runtime aborts at TestAotRuntime.cpp:43 because the queried block remains MemoryProtection::Read after the aps5_sys_mprotect(..., 3) call. The failure is in the test setup: lines 11–15 create/allocate a local MemoryBridge, and lines 33–37 protect/query that instance, but aps5_sys_mprotect in RuntimeRegistry.cpp:123–131 always calls the distinct static gMemoryBridge. That syscall initializes/updates its own address space; the next memory.QueryMemoryBlock still reads the untouched local bridge. Please test Protect directly on the local instance, and separately test the syscall using an allocation/query that goes through the registry-backed bridge (or expose a consistent instance for the integration test). This also means the reported 4/4 result is not reproducible on the current head. I did not run the hosted product build.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5621697008 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9776#pullrequestreview-5621697008). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T22:34:58Z. **Review:** COMMENTED --- I built the exact current head (`241c38a7c4508702520758cf1cdeb9c7f924a448`) with `cmake -S core/aot -B build-aot -G Ninja`, built all targets, and ran CTest: 3/4 pass; `test_aot_runtime` aborts at `TestAotRuntime.cpp:43` because the queried block remains `MemoryProtection::Read` after the `aps5_sys_mprotect(..., 3)` call. The failure is in the test setup: lines 11–15 create/allocate a local `MemoryBridge`, and lines 33–37 protect/query that instance, but `aps5_sys_mprotect` in `RuntimeRegistry.cpp:123–131` always calls the distinct static `gMemoryBridge`. That syscall initializes/updates its own address space; the next `memory.QueryMemoryBlock` still reads the untouched local bridge. Please test `Protect` directly on the local instance, and separately test the syscall using an allocation/query that goes through the registry-backed bridge (or expose a consistent instance for the integration test). This also means the reported 4/4 result is not reproducible on the current head. I did not run the hosted product build.
jotitadev commented 2026-10-23 04:42:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-23T04:42:26Z.

Review: COMMENTED


The Tested section says native execution on macOS wasn't tried. On Apple silicon, the arithmetic, moves and shifts groups can't pass as written. I didn't build LLVM here. I reproduced the test's reference step by hand on an M2 Max (macOS 27.2, Apple clang 21, head 2cb4c77224).

  • In a macOS x86-64 build (-DCMAKE_OSX_ARCHITECTURES=x86_64), CMake sets CMAKE_SYSTEM_PROCESSOR to x86_64, so the native x86-64 host gate in core/aot/tests/CMakeLists.txt passes. ctest then runs test_aot_compiler.py with Python3_EXECUTABLE (Xcode's /usr/bin/python3). That Python runs as arm64.
  • execute_cases links with --host-compiler without an -arch, so clang builds arm64. I wrote reference.cpp and reference.s the way the script does, with one case: .byte 72,137,248,195 (mov rax, rdi; ret) and the original_0 wrapper. clang++ -shared -fPIC -o reference.so reference.cpp reference.s gives Mach-O 64-bit dynamically linked shared library arm64. Calling original_0 through ctypes kills Python with SIGILL (exit 132), because the x86 bytes run as arm64 code.
  • The object and assembly libraries would fail the same way. They are x86-64 Mach-O objects linked by an arm64 link.

With -arch x86_64 on the host-compiler calls and the script run under arch -x86_64 /usr/bin/python3, the same reference library loads and returns 5 for original_0(5, ...). So on macOS, either pass -arch x86_64 and launch Python under Rosetta, or skip the three execution groups when platform.machine() isn't x86_64. As it stands, a full macOS build with BUILD_TESTING=ON gets three crashing groups, because AOT is on by default outside relinker-only builds.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5623974342 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9776#pullrequestreview-5623974342). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-23T04:42:26Z. **Review:** COMMENTED --- The Tested section says native execution on macOS wasn't tried. On Apple silicon, the `arithmetic`, `moves` and `shifts` groups can't pass as written. I didn't build LLVM here. I reproduced the test's reference step by hand on an M2 Max (macOS 27.2, Apple clang 21, head `2cb4c77224`). - In a macOS x86-64 build (`-DCMAKE_OSX_ARCHITECTURES=x86_64`), CMake sets `CMAKE_SYSTEM_PROCESSOR` to `x86_64`, so the `native x86-64 host` gate in `core/aot/tests/CMakeLists.txt` passes. ctest then runs `test_aot_compiler.py` with `Python3_EXECUTABLE` (Xcode's `/usr/bin/python3`). That Python runs as arm64. - `execute_cases` links with `--host-compiler` without an `-arch`, so clang builds arm64. I wrote `reference.cpp` and `reference.s` the way the script does, with one case: `.byte 72,137,248,195` (`mov rax, rdi; ret`) and the `original_0` wrapper. `clang++ -shared -fPIC -o reference.so reference.cpp reference.s` gives `Mach-O 64-bit dynamically linked shared library arm64`. Calling `original_0` through `ctypes` kills Python with SIGILL (exit 132), because the x86 bytes run as arm64 code. - The `object` and `assembly` libraries would fail the same way. They are x86-64 Mach-O objects linked by an arm64 link. With `-arch x86_64` on the host-compiler calls and the script run under `arch -x86_64 /usr/bin/python3`, the same reference library loads and returns 5 for `original_0(5, ...)`. So on macOS, either pass `-arch x86_64` and launch Python under Rosetta, or skip the three execution groups when `platform.machine()` isn't `x86_64`. As it stands, a full macOS build with `BUILD_TESTING=ON` gets three crashing groups, because AOT is on by default outside relinker-only builds. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
MarcZX10 commented 2026-10-23 14:25:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T14:25:19Z.

Review: CHANGES_REQUESTED


I reviewed exact head f8b85103b0ca449c286f80fbbb4221d810a15481. The earlier empty-object/IR issue is addressed in this revision, and the new macOS subprocess architecture checks are a concrete fix. Conventions and whitespace pass; the author reports 240/240 Windows tests and 5/5 standalone groups.

One test-harness ABI mismatch still blocks relying on the Windows execution results:

  • test_aot_compiler.py declares both guest_i and original_i with sysv_abi in the generated reference source (around line 161).
  • execute_program declares the called symbols and its Function pointer with the host default ABI (around lines 194-197), and CMake passes ${CMAKE_CXX_COMPILER} as that host compiler. On Windows x64, that is the Microsoft ABI, while original_i expects SysV registers. For example, the runner places its first argument in RCX, but the SysV wrapper reads RDI; so the reference result is not a reliable oracle for the emitted function.

I reproduced the call-site mismatch with GCC's -mabi=ms: the caller emitted mov $1, %ecx; call original, while the sysv_abi wrapper read %rdi. Please make the outer original_i wrapper use the host ABI while keeping only the raw guest_i byte function SysV (so the compiler bridges the arguments), or otherwise make the runner's declaration and function-pointer type explicitly SysV. Then rerun the Windows execution groups; the current reported 26,040 evaluations should not be treated as validated until the reference call convention is corrected. Linux/macOS default to SysV, so the mismatch is specific to the Windows host run.

This head is also 18 commits behind current main (e94545a5, merge base 938812df), though Git reports a clean merge. Refresh and rerun the AOT tests and conventions on the refreshed head before merge. The current PR CI only ran contribution checks; product jobs are skipped. I started an independent Linux build from the pinned LLVM submodule in an isolated worktree; configuration succeeded, and the 1,556-step build is still running, so I have no local CTest result yet.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5629643709 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9776#pullrequestreview-5629643709). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T14:25:19Z. **Review:** CHANGES_REQUESTED --- I reviewed exact head `f8b85103b0ca449c286f80fbbb4221d810a15481`. The earlier empty-object/IR issue is addressed in this revision, and the new macOS subprocess architecture checks are a concrete fix. Conventions and whitespace pass; the author reports 240/240 Windows tests and 5/5 standalone groups. One test-harness ABI mismatch still blocks relying on the Windows execution results: - `test_aot_compiler.py` declares both `guest_i` and `original_i` with `sysv_abi` in the generated reference source (around line 161). - `execute_program` declares the called symbols and its `Function` pointer with the host default ABI (around lines 194-197), and CMake passes `${CMAKE_CXX_COMPILER}` as that host compiler. On Windows x64, that is the Microsoft ABI, while `original_i` expects SysV registers. For example, the runner places its first argument in `RCX`, but the SysV wrapper reads `RDI`; so the reference result is not a reliable oracle for the emitted function. I reproduced the call-site mismatch with GCC's `-mabi=ms`: the caller emitted `mov $1, %ecx; call original`, while the `sysv_abi` wrapper read `%rdi`. Please make the outer `original_i` wrapper use the host ABI while keeping only the raw `guest_i` byte function SysV (so the compiler bridges the arguments), or otherwise make the runner's declaration and function-pointer type explicitly SysV. Then rerun the Windows execution groups; the current reported 26,040 evaluations should not be treated as validated until the reference call convention is corrected. Linux/macOS default to SysV, so the mismatch is specific to the Windows host run. This head is also 18 commits behind current `main` (`e94545a5`, merge base `938812df`), though Git reports a clean merge. Refresh and rerun the AOT tests and conventions on the refreshed head before merge. The current PR CI only ran contribution checks; product jobs are skipped. I started an independent Linux build from the pinned LLVM submodule in an isolated worktree; configuration succeeded, and the 1,556-step build is still running, so I have no local CTest result yet.
adriadam10 commented 2026-10-26 10:36:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-26T10:36:35Z.

Review: CHANGES_REQUESTED


The lifter, ELF reader and output handling read correctly: unsupported encodings, memory, relocations and undeclared register reads throw, and the tests pin values against the original bytes. Blocking points are about scope and cost:

  • CMakeLists.txt:309: ANYPS5_BUILD_AOT defaults to ON in full builds, so every Build run (one per PR in the merge queue, Windows and Linux) compiles LLVM's X86 backend from source for a tool nothing in the tree consumes. Default it to OFF in every configuration and keep it opt-in (-DANYPS5_BUILD_AOT=ON); update the sentence in docs/dev/BUILD.md ("Full build") accordingly. Also state the added build time and the size of the 3rdparty/llvm-project checkout, since git submodule update --init --recursive in that same section would now fetch it for everyone.
  • Overlap: #5021 (and #1835) add core/aot/CMakeLists.txt and docs/dev/debt/aot.md too, with a different design (x86-64 to native ARM64, with a runtime and a title running). Both cannot land as written. Please agree with that PR's author on the directory layout and list the one that goes first under Depends on.
  • Purpose: Unblocks: none. AnyPS5 already relinks x86-64 executables to native x86-64, so an x86-64 to x86-64 leaf compiler does not plug into that flow. Describe what consumes it (a caller, a follow-up PR, a qualified title) or leave it out until there is one.
  • Checks I could not run here: Linux/macOS execution of the emitted objects (the PR only ran Windows GNU).
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5650709714 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9776#pullrequestreview-5650709714). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-26T10:36:35Z. **Review:** CHANGES_REQUESTED --- The lifter, ELF reader and output handling read correctly: unsupported encodings, memory, relocations and undeclared register reads throw, and the tests pin values against the original bytes. Blocking points are about scope and cost: - `CMakeLists.txt:309`: `ANYPS5_BUILD_AOT` defaults to ON in full builds, so every Build run (one per PR in the merge queue, Windows and Linux) compiles LLVM's X86 backend from source for a tool nothing in the tree consumes. Default it to OFF in every configuration and keep it opt-in (`-DANYPS5_BUILD_AOT=ON`); update the sentence in `docs/dev/BUILD.md` ("Full build") accordingly. Also state the added build time and the size of the `3rdparty/llvm-project` checkout, since `git submodule update --init --recursive` in that same section would now fetch it for everyone. - Overlap: #5021 (and #1835) add `core/aot/CMakeLists.txt` and `docs/dev/debt/aot.md` too, with a different design (x86-64 to native ARM64, with a runtime and a title running). Both cannot land as written. Please agree with that PR's author on the directory layout and list the one that goes first under `Depends on`. - Purpose: `Unblocks: none`. AnyPS5 already relinks x86-64 executables to native x86-64, so an x86-64 to x86-64 leaf compiler does not plug into that flow. Describe what consumes it (a caller, a follow-up PR, a qualified title) or leave it out until there is one. - Checks I could not run here: Linux/macOS execution of the emitted objects (the PR only ran Windows GNU).
adriadam10 commented 2026-10-27 11:28:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-27T11:28:50Z.

Review: CHANGES_REQUESTED


Thanks for the update: ANYPS5_BUILD_AOT is now OFF in every configuration and docs/dev/BUILD.md states the LLVM checkout and build cost. That point is settled. What still blocks:

  • Overlap with #5021: it is open and adds core/aot/CMakeLists.txt and docs/dev/debt/aot.md with a different design. The PR body says there is no agreement yet. Please settle the layout and merge order with that PR's author and list the one that goes first under Depends on; both cannot land as written.
  • Purpose: Unblocks: none and the body says no consumer exists. An x86-64 to x86-64 leaf compiler does not plug into the relinker flow. Either add the caller/follow-up PR that uses it, or hold this until #5021's direction shows where it fits.
  • .gitmodules / docs/dev/BUILD.md: the "Full build" step git submodule update --init --recursive now fetches the 1.66 GiB LLVM tree for everyone even with AOT OFF. Please set update = none on the 3rdparty/llvm-project entry (so only an explicit git submodule update --init 3rdparty/llvm-project fetches it) and say so in BUILD.md.
  • Not checked here: Linux/macOS execution of the emitted objects (only Windows GNU was run).
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5666345427 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9776#pullrequestreview-5666345427). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-27T11:28:50Z. **Review:** CHANGES_REQUESTED --- Thanks for the update: `ANYPS5_BUILD_AOT` is now OFF in every configuration and `docs/dev/BUILD.md` states the LLVM checkout and build cost. That point is settled. What still blocks: - Overlap with #5021: it is open and adds `core/aot/CMakeLists.txt` and `docs/dev/debt/aot.md` with a different design. The PR body says there is no agreement yet. Please settle the layout and merge order with that PR's author and list the one that goes first under `Depends on`; both cannot land as written. - Purpose: `Unblocks: none` and the body says no consumer exists. An x86-64 to x86-64 leaf compiler does not plug into the relinker flow. Either add the caller/follow-up PR that uses it, or hold this until #5021's direction shows where it fits. - `.gitmodules` / `docs/dev/BUILD.md`: the "Full build" step `git submodule update --init --recursive` now fetches the 1.66 GiB LLVM tree for everyone even with AOT OFF. Please set `update = none` on the `3rdparty/llvm-project` entry (so only an explicit `git submodule update --init 3rdparty/llvm-project` fetches it) and say so in BUILD.md. - Not checked here: Linux/macOS execution of the emitted objects (only Windows GNU was run).
MarcZX10 commented 2026-11-14 10:18:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T10:18:53Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this change based on the inspected implementation; the draft status and unresolved integration direction keep a formal approval from being justified.

What I ran

Read the prepared diff at head 758b3527733935394d67f0b84db49281ad8669e1, its description, commits, manifest, and selected changed files through repo_read.py. No build or tests were run during this review. The description reports prior Windows and focused test results; those results were not independently reproduced here.

Results

Check Result Note
Diff and implementation review passed Core parser, lifter, driver, CLI, tests, and build docs inspected
Build and tests not run No checks run in this review
Integration readiness not verified PR description says consumer and architecture direction remain unresolved

Findings

Blocking

None.

Non-blocking

  • The PR description says purpose and layout coordination with #5021 remains unresolved and identifies no production consumer or committed integration follow-up. Settle that direction before treating this experimental tool as ready to merge.
  • Output publication is atomic per file but not across all requested outputs: a later write failure can leave earlier outputs replaced (core/aot/compiler/src/AotCompilerDriver.cpp:153-155). The debt documentation records this limitation.

Not verified

  • No build, tests, negative control, or standalone command was run. The author-reported checks were not reproduced.
  • The LLVM submodule gitlink at 3rdparty/llvm-project was excluded from full-text review because it is not plain text; its pinned commit is shown in the diff.
  • No production integration, Linux/macOS native execution, MSVC linking, full product build, GPU behavior, or console behavior was verified.
  • Files read: description.md, commits.md, manifest.json, diff.patch, .gitmodules, CMakeLists.txt, core/aot/compiler/src/AotCompilerDriver.cpp, core/aot/compiler/src/ElfBinaryParser.cpp, core/aot/compiler/src/LlvmLifter.cpp, core/aot/tests/test_aot_compiler.py, and docs/dev/BUILD.md. The manifest marks these changed files as included; 3rdparty/llvm-project was excluded by rule. Other included changed files were not read in full.

To get this to a good state

Nothing is required for correctness based on the reviewed code. Optional: resolve the stated integration purpose and layout with the proposed prerequisite; consider staging all requested outputs before publishing them as a group.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5903724583 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9776#pullrequestreview-5903724583). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-14T10:18:53Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this change based on the inspected implementation; the draft status and unresolved integration direction keep a formal approval from being justified. ## What I ran Read the prepared diff at head `758b3527733935394d67f0b84db49281ad8669e1`, its description, commits, manifest, and selected changed files through `repo_read.py`. No build or tests were run during this review. The description reports prior Windows and focused test results; those results were not independently reproduced here. ## Results | Check | Result | Note | |---|---|---| | Diff and implementation review | passed | Core parser, lifter, driver, CLI, tests, and build docs inspected | | Build and tests | not run | No checks run in this review | | Integration readiness | not verified | PR description says consumer and architecture direction remain unresolved | ## Findings ### Blocking None. ### Non-blocking - The PR description says purpose and layout coordination with #5021 remains unresolved and identifies no production consumer or committed integration follow-up. Settle that direction before treating this experimental tool as ready to merge. - Output publication is atomic per file but not across all requested outputs: a later write failure can leave earlier outputs replaced (`core/aot/compiler/src/AotCompilerDriver.cpp:153-155`). The debt documentation records this limitation. ## Not verified - No build, tests, negative control, or standalone command was run. The author-reported checks were not reproduced. - The LLVM submodule gitlink at `3rdparty/llvm-project` was excluded from full-text review because it is not plain text; its pinned commit is shown in the diff. - No production integration, Linux/macOS native execution, MSVC linking, full product build, GPU behavior, or console behavior was verified. - Files read: `description.md`, `commits.md`, `manifest.json`, `diff.patch`, `.gitmodules`, `CMakeLists.txt`, `core/aot/compiler/src/AotCompilerDriver.cpp`, `core/aot/compiler/src/ElfBinaryParser.cpp`, `core/aot/compiler/src/LlvmLifter.cpp`, `core/aot/tests/test_aot_compiler.py`, and `docs/dev/BUILD.md`. The manifest marks these changed files as included; `3rdparty/llvm-project` was excluded by rule. Other included changed files were not read in full. ## To get this to a good state Nothing is required for correctness based on the reviewed code. Optional: resolve the stated integration purpose and layout with the proposed prerequisite; consider staging all requested outputs before publishing them as a group.
MarcZX10 commented 2026-11-17 02:16:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T02:16:14Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

  • Head 1cd795ed5a580076f93d5e1b1309c14861626bf1, base main. No merge preview.
  • Static review of the pinned diff. All 17 files in the reviewed list were read through the diff. Existing files were read only at their changed hunks, plus the read-only lookups below.
  • House rules applied: Readable reviews, Standard PR response format, Accuracy and evidence, Approval rules.
  • No file was excluded by rule.
  • Not run: CMake configure, build, CTest, and the convention and registration scripts. The LLVM submodule is a gitlink and is not in the review tree.
Read-only lookups at the head
python3 repo_read.py cat CMakeLists.txt 830 860
python3 repo_read.py search add_test_executable
python3 repo_read.py search ANYPS5_RELINKER_ONLY CMakeLists.txt

Results

Check Result Note
Static read of changed code passed No blocking defect found
Comments in added code passed None in the diff
CMake configure and build not run No build here
AOT CTest groups not run Author-reported only
Convention and registration scripts not run Author-reported only
Hosted checks on this head not run Not queried in this run

Findings

Blocking

None.

Non-blocking

  • core/aot/tests/test_aot_compiler.py:273 — The case-alias rejection runs only when the upper-case name of the input exists, which is true only on a case-insensitive filesystem. On a case-sensitive host the branch is skipped silently, and the reject group still prints its "Rejected N invalid or unsupported inputs" line as if every check had run. Suggest printing a line when the alias branch is skipped, so the log shows that the alias case was not exercised.

Not verified

  • Build, link and execution of the LLVM 20.1.5 compiler and its tests on any host. The test results in the PR body are author-reported; I did not reproduce them.
  • Hosted required checks for this head were not queried. The approval rules need them, so this is a COMMENT, not an APPROVE.
  • Windows, macOS, MSVC and Mach-O behaviour, and the case-alias branch on a case-insensitive host, were not run here.
  • Instruction semantics against Intel SDM Volume 2, as cited in docs/dev/debt/aot.md: the lifter was read, but each encoding was not checked against the SDM text.
  • Claims in the PR body that depend on outside state: the 1.66 GiB and 154,024-file measurement, the build durations, the #5021 closing note, the status of #1835, the overlap table, and the rebase onto c04f8bec02.
  • .gitmodules, CMakeLists.txt and docs/dev/BUILD.md were read at the changed hunks and at the lines listed above, not in full. 3rdparty/llvm-project is a gitlink, so it holds a commit pointer, not text.
  • Draft status: the PR body says it stays a draft until a production consumer or a committed follow-up integration exists. That is the author's own gate, and this review does not assess it.

To get this to a good state

Nothing is required. The optional point above can be taken or left.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5931612713 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9776#pullrequestreview-5931612713). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T02:16:14Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran - Head `1cd795ed5a580076f93d5e1b1309c14861626bf1`, base `main`. No merge preview. - Static review of the pinned diff. All 17 files in the reviewed list were read through the diff. Existing files were read only at their changed hunks, plus the read-only lookups below. - House rules applied: Readable reviews, Standard PR response format, Accuracy and evidence, Approval rules. - No file was excluded by rule. - Not run: CMake configure, build, CTest, and the convention and registration scripts. The LLVM submodule is a gitlink and is not in the review tree. <details> <summary>Read-only lookups at the head</summary> ```sh python3 repo_read.py cat CMakeLists.txt 830 860 python3 repo_read.py search add_test_executable python3 repo_read.py search ANYPS5_RELINKER_ONLY CMakeLists.txt ``` </details> ## Results | Check | Result | Note | |---|---|---| | Static read of changed code | passed | No blocking defect found | | Comments in added code | passed | None in the diff | | CMake configure and build | not run | No build here | | AOT CTest groups | not run | Author-reported only | | Convention and registration scripts | not run | Author-reported only | | Hosted checks on this head | not run | Not queried in this run | ## Findings ### Blocking None. ### Non-blocking - `core/aot/tests/test_aot_compiler.py:273` — The case-alias rejection runs only when the upper-case name of the input exists, which is true only on a case-insensitive filesystem. On a case-sensitive host the branch is skipped silently, and the `reject` group still prints its "Rejected N invalid or unsupported inputs" line as if every check had run. Suggest printing a line when the alias branch is skipped, so the log shows that the alias case was not exercised. ## Not verified - Build, link and execution of the LLVM 20.1.5 compiler and its tests on any host. The test results in the PR body are author-reported; I did not reproduce them. - Hosted required checks for this head were not queried. The approval rules need them, so this is a COMMENT, not an APPROVE. - Windows, macOS, MSVC and Mach-O behaviour, and the case-alias branch on a case-insensitive host, were not run here. - Instruction semantics against Intel SDM Volume 2, as cited in `docs/dev/debt/aot.md`: the lifter was read, but each encoding was not checked against the SDM text. - Claims in the PR body that depend on outside state: the 1.66 GiB and 154,024-file measurement, the build durations, the #5021 closing note, the status of #1835, the overlap table, and the rebase onto `c04f8bec02`. - `.gitmodules`, `CMakeLists.txt` and `docs/dev/BUILD.md` were read at the changed hunks and at the lines listed above, not in full. `3rdparty/llvm-project` is a gitlink, so it holds a commit pointer, not text. - Draft status: the PR body says it stays a draft until a production consumer or a committed follow-up integration exists. That is the author's own gate, and this review does not assess it. ## To get this to a good state Nothing is required. The optional point above can be taken or left.
MarcZX10 commented 2026-11-22 23:29:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T23:29:33Z.

Review: COMMENTED


Reviewed — no blocking findings

The reviewed code has no verified blocking defect; I am leaving a formal decision open because the PR itself identifies its missing production consumer or committed integration follow-up as an acceptance blocker.

What I ran

Reviewed head 5cd81c31cb9025423954d24bea54934b50c13baf. I inspected the prepared diff and changed-file manifest; I did not run commands or tests. The author reports Windows build and test results in the PR description.

Results

Check Result Note
Diff review passed 16 text files inspected
LLVM submodule contents not run Gitlink only; contents unavailable
Tests not run Author-reported results only
Linux/macOS execution not run Not confirmed

Findings

Blocking

None verified in the inspected diff.

Non-blocking

  • The PR records that a failure during the final series of output renames can leave earlier destinations updated. This is a documented limitation in docs/dev/debt/aot.md:1216; callers requesting multiple output files should account for the possibility of a partial update.
  • The PR description says there is no production consumer or committed integration follow-up yet. Establishing one remains the PR’s stated acceptance blocker.

Not verified

The pinned LLVM submodule contents were unavailable in the review bundle. I did not independently verify builds, tests, other operating systems, or console behavior. The review bundle lists 17 changed paths: I inspected the diff for the 16 text files; the LLVM gitlink was not available as text.

To get this to a good state

Nothing is required by this review. The PR description identifies a production consumer or committed integration follow-up as needed to clear its acceptance blocker.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6015103855 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9776#pullrequestreview-6015103855). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T23:29:33Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The reviewed code has no verified blocking defect; I am leaving a formal decision open because the PR itself identifies its missing production consumer or committed integration follow-up as an acceptance blocker. ## What I ran Reviewed head `5cd81c31cb9025423954d24bea54934b50c13baf`. I inspected the prepared diff and changed-file manifest; I did not run commands or tests. The author reports Windows build and test results in the PR description. ## Results | Check | Result | Note | |---|---|---| | Diff review | passed | 16 text files inspected | | LLVM submodule contents | not run | Gitlink only; contents unavailable | | Tests | not run | Author-reported results only | | Linux/macOS execution | not run | Not confirmed | ## Findings ### Blocking None verified in the inspected diff. ### Non-blocking - The PR records that a failure during the final series of output renames can leave earlier destinations updated. This is a documented limitation in `docs/dev/debt/aot.md:1216`; callers requesting multiple output files should account for the possibility of a partial update. - The PR description says there is no production consumer or committed integration follow-up yet. Establishing one remains the PR’s stated acceptance blocker. ## Not verified The pinned LLVM submodule contents were unavailable in the review bundle. I did not independently verify builds, tests, other operating systems, or console behavior. The review bundle lists 17 changed paths: I inspected the diff for the 16 text files; the LLVM gitlink was not available as text. ## To get this to a good state Nothing is required by this review. The PR description identifies a production consumer or committed integration follow-up as needed to clear its acceptance blocker.
MarcZX10 commented 2026-11-25 02:25:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T02:25:35Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this draft; the implementation is opt-in and its documented limits match the reviewed code, while production integration remains an explicit follow-up.

What I ran

Reviewed head 938d96cdae3aceb9bcf9177f42f3d241e2fe3b3c. No commands or tests were run in this review; validation details below are author-reported in the PR description.

Results

Check Result Note
Source review passed Reviewed included changed files and diff
Tests not run Windows results are author-reported
Platform coverage not run Linux and macOS execution remain unverified

Findings

Blocking

None.

Non-blocking

  • The description and debt record correctly identify the lack of a production consumer and title qualification. Keep the PR in draft until an integration follow-up or consumer is established.
  • The output staging protects against failures during staging, but final renames across multiple destinations are not atomic; a later rename error can leave an earlier output replaced (core/aot/compiler/src/AotCompilerDriver.cpp:377). This is recorded in the debt file.

Not verified

  • The full text of the 3rdparty/llvm-project submodule entry is unavailable as a plain text file; its pinned commit is visible in the diff.
  • No tests, builds, or conventions checks were run by this reviewer. Windows test results and build measurements in the description are author-reported. Linux and macOS execution, MSVC linking, product integration, and console behavior were not verified.
  • Files reviewed: .gitmodules, CMakeLists.txt, core/aot/CMakeLists.txt, all included compiler and test files under core/aot, docs/dev/BUILD.md, and docs/dev/debt/aot.md. Excluded: 3rdparty/llvm-project (submodule entry is not plain text).

To get this to a good state

Nothing is required. Optional: establish and document a production consumer or committed integration follow-up before taking the PR out of draft.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6050801885 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9776#pullrequestreview-6050801885). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T02:25:35Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this draft; the implementation is opt-in and its documented limits match the reviewed code, while production integration remains an explicit follow-up. ## What I ran Reviewed head `938d96cdae3aceb9bcf9177f42f3d241e2fe3b3c`. No commands or tests were run in this review; validation details below are author-reported in the PR description. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Reviewed included changed files and diff | | Tests | not run | Windows results are author-reported | | Platform coverage | not run | Linux and macOS execution remain unverified | ## Findings ### Blocking None. ### Non-blocking - The description and debt record correctly identify the lack of a production consumer and title qualification. Keep the PR in draft until an integration follow-up or consumer is established. - The output staging protects against failures during staging, but final renames across multiple destinations are not atomic; a later rename error can leave an earlier output replaced (`core/aot/compiler/src/AotCompilerDriver.cpp:377`). This is recorded in the debt file. ## Not verified - The full text of the `3rdparty/llvm-project` submodule entry is unavailable as a plain text file; its pinned commit is visible in the diff. - No tests, builds, or conventions checks were run by this reviewer. Windows test results and build measurements in the description are author-reported. Linux and macOS execution, MSVC linking, product integration, and console behavior were not verified. - Files reviewed: `.gitmodules`, `CMakeLists.txt`, `core/aot/CMakeLists.txt`, all included compiler and test files under `core/aot`, `docs/dev/BUILD.md`, and `docs/dev/debt/aot.md`. Excluded: `3rdparty/llvm-project` (submodule entry is not plain text). ## To get this to a good state Nothing is required. Optional: establish and document a production consumer or committed integration follow-up before taking the PR out of draft.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!9776
No description provided.