Skip to content

test(ghidra): probe PSP Allegrex bridge compatibility - #2

Closed
jaelliot wants to merge 3 commits into
feat/mips-elf-ghidrafrom
spike/psp-allegrex-compatibility
Closed

jaelliot wants to merge 3 commits into
feat/mips-elf-ghidrafrom
spike/psp-allegrex-compatibility

Conversation

@jaelliot

@jaelliot jaelliot commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Scope and status

Historical result: the direct PSP/Allegrex bridge compatibility experiment passed at its verified source checkpoint. Since then, upstream REA #1599 merged on October 11, 2026, establishing bounded PSP ELF admission through an installed Allegrex extension. This older fork experiment is not the current production implementation.

Separate experiment for morluto/rea#1330, stacked on the unchanged generic MIPS checkpoint adf1cda29859ffcc063f40418b8ba39a0eac4fab.

Last executable-tested source head: 442bb1eacf63b99fd9827c2cc31091a250242ad9. Current PR head: 66b33f4c3f94198544ba7f375b33969e2d8678f6; the two intervening commits only add 49 lines of acceptance-boundary documentation to docs/ghidra-psp-compatibility.md. The later documentation was source-reviewed but not rerun through real Ghidra.

This fork research PR targets feat/mips-elf-ghidra to keep its original seven-file PSP experiment separate. It is not an instruction to merge PSP work into or expand morluto/rea#1362. The generic admission policy, production provider routing and public contracts are unchanged.

Changes

  • Add maintained C, Allegrex assembly and a PSPSDK Makefile for a source-owned static ELF. No commercial binary, PBP/ISO, emulator, PRX or proprietary SDK.
  • Build into an owned temporary directory; check ELF32/little-endian/ET_EXEC/EM_MIPS and PSP flags without weakening the generic MIPS guard.
  • Obtain defined function/data symbol addresses independently with PSP GNU readelf, and require PSP objdump to recognize the source-owned BITREV probe.
  • Exercise the existing Ghidra launcher/client directly with an explicitly test-only profile. Check the observed PSP loader, Allegrex language/compiler, loaded-input hashes, known functions/direct call, fixed instruction bytes/immediate, BITREV decoding, global/string bytes, source-file correspondence and pseudocode liveness.
  • Reuse existing structured result readers and process ownership/cleanup. No new processor semantics, provider, MCP tool or product installer.
  • Register the experiment entry point in Knip without adding ignores or relaxing thresholds; document prerequisites, commands, findings that a pass establishes, and remaining product work.

Completed current-source verification

Final hosted run 38009065963, including job 114084584822, completed successfully. All listed steps ran and passed.

The workflow lives on the separate fork-only branch ci/psp-compatibility. Its orchestration commit is a41e55cdf2668f6b4d516b5a3703527497a12697; it explicitly checks out and asserts the source head 442bb1eacf63b99fd9827c2cc31091a250242ad9. The orchestration SHA is not the tested source SHA.

Repository checks

  • Locked installation and package build passed with Node 24.18.0 and npm 11.16.0.
  • npm run check:ci: all eight tasks passed, including typecheck, lint/module boundaries, formatting, Knip, duplication and metadata/TODO gates.
  • Actual focused Vitest: 100 passed, no skipped tests, across seven affected suites. These are the existing affected regression suites, not 100 newly added PSP tests.
  • All 700 test files were discovered exactly once, and npm run docs:check passed.
  • Source remained unchanged after verification.

This focused run is not a new full repository test-shard/coverage/platform matrix. The full generic MIPS baseline remains documented separately in #1 and upstream morluto#1362.

Real tools and source-owned PSP fixture

Initial verified configuration: Linux x64; Ghidra 12.1.3; ghidra-allegrex v21.4; PSPDEV v20261001; compatible caller-selected JDK 21. The Ghidra, extension and PSPDEV archives passed their pinned SHA-256 checks. The extension's published archive targets Ghidra 12.1.3; this experiment does not infer compatibility with Ghidra 12.1.4.

The completed run established:

  • Before installation, the verifier refused the absent extension with PSP_EXTENSION_UNAVAILABLE, before fixture or bridge startup. This is an experiment prerequisite diagnostic, not implemented production PSP extension-error handling.
  • The production profile and built public CLI/MCP still rejected the PSP target with the intended dedicated-profile diagnostic. The CLI exited unsuccessfully and MCP returned a typed failure rather than silently admitting the target.
  • The direct bridge, using its explicit test-only profile, observed PSP Executable (ELF), Allegrex:LE:32:default and compiler specification default, with analysis completion and matching original/loaded input hashes.
  • Known function addresses matched independently reported PSP readelf symbols; the expected direct call was recovered.
  • The fixed ADDIU encoding 34120224 exposed immediate 0x1234; the following instruction decoded as Allegrex bitrev. The instruction bytes matched their original file-offset range.
  • The known global word 7 and NUL-terminated marker bytes matched. Pseudocode was nonempty, which is explicitly only a liveness check.
  • Input hashes remained unchanged and final owned-process lineage was verified with zero live descendants. The target was never executed.

Generic MIPS remains separate with the extension installed

The existing real-Ghidra verifier also passed for both little- and big-endian generic MIPS fixtures through the built public CLI and MCP with Allegrex installed. Observed languages remained MIPS:LE:32:default and MIPS:BE:32:default, not Allegrex. Existing independent ELF/ABI/symbol, instruction/data, target/profile/Evidence, snapshot-reopening and final cleanup checks passed.

Initial hosted run 38008355394 also passed. Afterward, the fork-only workflow was corrected to tie the generic follow-up condition to the actual extension-install step and to print retained PSP stderr on failure. The final run above passed with those orchestration fixes; the source head did not change.

Compact reports and diagnostics are retained as the psp-compatibility-442bb1e workflow artifact for three days. Tool installations are not uploaded.

Meaning of the result and remaining work

At this historical checkpoint, a successful direct bridge experiment was not production PSP support in rea analyze, rea function, or MCP open_binary, and its test-only profile was not a public Evidence support claim. Current supported admission is provided separately by merged upstream morluto#1599 and its narrower verified scope.

Those admission, extension-identity, diagnostics, Evidence, and snapshot/cache requirements were subsequently addressed within the bounded upstream contribution morluto#1599. Remaining work concerns correctness and coverage beyond that admitted subset, not a new parallel PSP provider.

No target execution, PRX relocation behavior, VFPU semantic completeness, behavioral equivalence, additional host platform or arbitrary PSP executable correctness was established. Reader agreement and pseudocode liveness are not semantic proofs.

This fork PR remains open and unmerged, and it is not currently marked draft. Generic MIPS PR morluto#1362 and bounded PSP admission PR morluto#1599 are merged upstream; issue morluto#1330 is closed. This historical experiment should not be mistaken for a new production feature request.

Keep production admission unchanged and explicitly verify its PSP rejection through the profile, CLI and MCP. Build a static PSPSDK ELF with an Allegrex BITREV probe and inspect it through the existing Ghidra launcher/client using a test-only profile. Check observed loader/language, independent symbol addresses, instruction/data bytes and owned cleanup. Document the exact initial Ghidra/extension/toolchain pairing and remaining public-admission work.

Local Node syntax and locked Oxfmt/Oxlint checks passed for the new scripts. Hosted static checks and real-toolchain verification are pending for this checkpoint.
Append a bounded source-reviewed acceptance note to the existing compatibility document. Derive target-neutral A/B/A identity, partial-fact and independent-expectation checks from pinned MHP2G, Yakumo and ModKit material without copying source, introducing title-specific parsing, or expanding morluto#1330 to whole-game reconstruction.

All proposed new executable checks remain unimplemented and unrun. Preserve the earlier bridge/prod-admission distinction and historical verifier results. Generic MIPS implementation, public contracts, runtime and dependencies are unchanged.

Validation: original blob identity and additive diff checked locally; Markdown whitespace, fence and heading checks passed; pinned source references inspected. Repository-wide npm/docs gates and real Ghidra/PPSSPP runs were not executed in this documentation-only extraction.
Correct a one-character transcription change caught by comparing the uploaded blob against the locally reviewed content. The resulting file is an exact additive extension of the previous compatibility document; no prerequisite or historical acceptance text changes.

Copy link
Copy Markdown
Owner Author

Source-review checkpoint: 66b33f4c3f94198544ba7f375b33969e2d8678f6 appends research-derived acceptance boundaries to the existing PSP compatibility document. The only net file change since 442bb1e is that Markdown document; production admission, fixtures, verifiers and public contracts are unchanged.

Pinned MHP2G, Yakumo and ModKit material motivates: A→B→A target/profile identity checks for different bytes at the same address; preserving partial facts; independent expected results and a held-out published target; and explicit separation of unsupported raw overlays/PRX from positive static-analysis coverage. This does not add Monster Hunter-specific parsing or make live overlays a new completion requirement for morluto#1330.

These are proposed checks, not newly executed tests. The last real-provider result remains bound to source 442bb1eacf63b99fd9827c2cc31091a250242ad9. This extraction performed source review, local Markdown/invariant checks and upload-blob identity verification only; no new npm/real-Ghidra run is claimed.

Detailed title-specific guidance is separate in Reverse-Engineering-Studies draft PR #1, inside its existing MHFU skill reference. No source code, address table, game data or new dependency was imported into either repository.

@jaelliot
jaelliot marked this pull request as ready for review October 10, 2026 05:04
jaelliot pushed a commit that referenced this pull request Oct 11, 2026
* feat(ghidra): recover signed AArch64 relative jump tables

Generalise the AArch64 relative-table matcher to signed byte/halfword entries, UXTW indexes, byte or LSL #2 offsets, B.CS/B.HS bounds and a CBZ route for zero entries. Cross-check it against Ghidra's own load table when one exists, and add a fixture modelled on the RenderScript blend kernel.

Refs morluto#487

* fix(ghidra): preserve typed labels for normalized switch selectors

---------

Co-authored-by: morluto <[email protected]>

jaelliot commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

Closing this fork-only historical PSP/Allegrex bridge experiment as an archival checkpoint. The maintained PSP admission implementation is already merged upstream in morluto#1599; this older experiment is not the production path. No source branches or historical evidence are deleted, and later PSP-specific validation is tracked through upstream morluto#8614, morluto#8615, and morluto#6931.

@jaelliot jaelliot closed this Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant