Repository navigation
Conversation
[Low impact] The reviewed changes appear safe to merge, with no outstanding findings. SummaryAdds an optional PSP/Allegrex verifier with source-owned fixtures for two unresolved computed jumps, a return, and a direct jump.
Reviews (13) · Last reviewed commit: "test(ghidra): clean up interrupted PSP v..." · Reviewed by Greptile |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
There was a problem hiding this comment.
🟡 Changes recommended
The verifier can accept missing branch-inspection data, fabricated targets, and recomputed results instead of snapshot replay, while timed-out builds can leave compiler descendants running.
4 open issues
What changed in this PR
Adds an opt-in PSP/Allegrex conformance verifier for the unresolved indirect-branch reporting introduced by #2977. This is test-only coverage within REA’s existing static-analysis workflow; it does not change production behavior or execute target code.
Changes:
- Adds synthetic computed-branch fixtures with ordinary return and direct-jump controls.
- Exercises real Ghidra through public MCP operations, checking Evidence, residual unknowns, snapshot replay, unchanged ELF bytes, and cleanup.
- Documents prerequisites and the #2977 dependency, and registers the verifier with Knip.
| File | Description |
|---|---|
tests/conformance/psp/control-flow/Makefile |
Builds the isolated PSP ELF fixture. |
tests/conformance/psp/control-flow/main.c |
References the four static control-flow probes. |
tests/conformance/psp/control-flow/control-flow.S |
Defines computed jumps and ordinary branch controls. |
scripts/verify-real-ghidra-psp-indirect.mjs |
Adds the real-provider conformance verifier. |
knip.json |
Registers the verifier as an entry point. |
docs/ghidra-psp.md |
Documents invocation, dependency, and coverage limits. |
Review effort: Balanced
|
The PSP verifier requires |
|
Hi! This PR's checks pass, but GitHub shows a merge conflict with 🤖 Written with Claude Code (Opus 5.5), posted with my OK 🦊 |
|
@jaelliot thanks for the PR — this branch has merge conflicts with |
Use the replayable procedure inventory to check snapshot provenance. Verify native API results separately because Ghidra reobserves that workflow. The focused replay control passed on a source-owned PSP ELF.
2468329 to
13ac3fa
Compare

Summary
Add an opt-in, source-owned PSP/Allegrex control-flow verifier, as a separate follow-up requested by the author of #2977. Related: #1330.
Dependency: #2977 → #6931. The verifier requires the unresolved computed-branch inventory from canonical #2977. That implementation stays with its author; #5137 was incorporated there and closed as superseded. This PR remains six conformance/fixture/documentation files and does not copy production bridge or schema changes.
Problem and expected behavior
Once #2977 is present, two synthetic parameter-derived
jr $t9sites must remain explicitly unresolved, with no invented listing destinations and with retained reachability unknowns. An ordinaryjr $rareturn and directjmust be inspected and excluded from that inventory. Snapshot reuse must retain the observation and identify its replay provenance.Review fixes
Commits
d7360edand1dc5521address the four review findings in the existing verifier only: 30 additions, 14 deletions.createVerifierCommandsand awaitcommands.close()before completing the verifier, so timeout cleanup retains ownership of compiler descendants.unresolved_indirect_branchesto be an array; omission or null cannot establish an inspected empty result.listing_targetsfor both synthetic computed jumps.SNAPSHOT_REPLAY_LIMITATIONbefore comparing values. Recognize the provider/operation attribution added by REA's composed-Evidence formatter, following the existing Ghidra MCP replay test.Change and scope
The existing source-owned ELF32/Allegrex fixture is compiled and statically analyzed through public REA MCP operations. The verifier checks independent ELF/ABI facts, listing observations, Evidence, residual unknowns, snapshot identity/replay, unchanged target bytes, and owned cleanup. Its entry is registered in
knip.json; invocation and prerequisites are documented indocs/ghidra-psp.md.Expected effects on the test host:
The checked effects describe host compilation, analyzer execution, and temporary files; target code is never executed.
Evidence and validation
Current verifier revision
npm ci: passed.npm run test:focused -- tests/boundary/process/nativeVerifierCommandOwnership.test.ts tests/boundary/process/verifierCommandSemantics.test.ts tests/boundary/process/verifierSourceLoading.test.ts tests/conformance/ghidra/psp-checks.test.ts tests/boundary/mcp/ghidraNativeApiMcp.test.ts: 55 tests passed in five files. This includes real timed-out leader/descendant cleanup with zero survivors, retained artifacts, command cleanup retry, and simulated Ghidra MCP snapshot behavior.npm run test:focused -- tests/boundary/mcp/ghidraNativeApiMcp.test.ts: 11/11 passed again.node --check, focused formatter check, andgit diff --check: passed.npm run check: passed, including typecheck, ordinary/typed lint, formatting, Knip, metadata, module boundaries, and architecture guards. Typed lint reported zero errors with repository advisories. The final two-line assertion adjustment additionally passed focused syntax, formatting, and lint checks.Dependent real-provider qualification
Current fork run 41854251564 passed at
173c85a. It retains the existing #2977 integration and pinned workflow, using the exact final PR verifier blob9e335c7f71e795f14b3b7ac7d154c9b47dd91fdd. Its parents are the previous qualificationf093496and current PR commit1dc5521.The pinned Linux Ghidra 12.1.3 / Allegrex v21.4 / PSPDEV v20261001 / JDK 21 lane passed 153 focused contract tests, missing-extension refusal, the unchanged PSP acceptance baseline, and the final indirect-branch verifier. Both computed
jr $t9sites remained unresolved with empty listing targets; return/direct controls had inspected empty inventories. The replay assertion passed, the snapshot retained 26 Evidence records, ELF bytes stayed unchanged, and cleanup was verified with zero surviving descendants. Source/working-tree hygiene also passed. This qualifies the final verifier against the retained #2977 integration; it does not establish standalone success against plainmain.The first review-fix qualification, 41852710078, passed the branch checks but failed the new replay assertion: exact array membership did not recognize REA's provider/operation-qualified replay marker. The follow-up corrects that verifier mismatch; the canonical marker remains mandatory. This failed run is retained as evidence.
Current upstream CI 41854491389 completed successfully on
1dc5521: 17 successful jobs, 23 intentionally skipped jobs, and no failures or cancellations. All eight built-test shards, source tests, static checks, documentation, package build, bundled Windows-controls build, Linux native package verification, Portable tests, and CI required passed. Skipped provider/platform lanes remain unexecuted. This standard CI result is separate from the successful dependent real-provider qualification above.Historical evidence — earlier verifier revisions
Standard upstream CI 41757456999 passed at
b71a0c6. Dependent real-Ghidra run 41766913011 passed at191d759with Ghidra 12.1.3 / Allegrex v21.4 / PSPDEV v20261001 / JDK 21: 153 focused tests, two unresolved computed branches, ordinary controls excluded, 26 snapshot Evidence records, unchanged ELF bytes, and complete cleanup. These runs predate the new assertions and do not validate the current1dc5521revision.The earlier main-only negative control observed listing-computed branches without #2977's unresolved inventory. Earlier pcap worker-OOM observations and retries concern historical runs; they are not evidence about this revision.
Remaining limits
The dependent provider run and current-head upstream CI both passed. The optional verifier still requires #2977. No runtime game behavior, VFPU semantics, PRX/PBP/ISO/CSO, arbitrary PSP binary support, or cross-platform qualification is claimed.
For evidence-bearing changes:
Author readiness
Human owner: @jaelliot
Before merge
type(scope): outcome.