feat(libc): export _setjmp and _longjmp #12149

Merged
AlexFigas merged 4 commits from upstream-pr/12149 into main 2026-11-04 05:34:15 +00:00
AlexFigas commented 2026-10-27 23:44:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlexFigas on 2026-10-27T23:44:35Z.


What

AnyPS5's libc had setjmp and longjmp but not _setjmp and _longjmp, the BSD forms that leave the signal mask alone. The libc.prx bundled with PPSA21564 (build J03093718) exports both, and this PR adds them.

That binary's four functions differ only in the signal mask:

  • setjmp (0x548b0). It calls _sigprocmask(SIG_BLOCK, NULL, buffer + 0x48), then runs the same register saves as _setjmp (0x1153a0).
  • longjmp (0x54900). It calls _sigprocmask(SIG_SETMASK, buffer + 0x48, NULL), then runs the same restores as _longjmp (0x1153e0).
  • _longjmp. It keeps the current MXCSR exception flags and takes only the other MXCSR bits from the buffer. A value of 0 returns 1.

This matches FreeBSD 11.4's _setjmp.S.

_setjmp and _longjmp here are setjmp and longjmp from JumpBuffer.cpp without the signal-mask calls, in the same buffer layout. So a buffer from either setjmp is accepted by either longjmp, as on FreeBSD.

  • _setjmp writes 0 at 88, where setjmp marks a saved mask. A longjmp to its buffer therefore restores no mask, where the binary would read whatever is at 0x48.
  • _longjmp keeps the current MXCSR exception flags as the binary does. On Windows it calls GuestStackSwitch_nid_no_patch with the target stack pointer before switching, as longjmp does.

The debt entry records what still differs from the binary: the layout (the binary stores the stack pointer at the call, the x87 control word at 64 and MXCSR at 68), the 0 at 88, and that longjmp restores the saved MXCSR exception flags where the binary's keeps the current ones.

Tested

On Ubuntu 24.04.5 under WSL2 (GCC 13.3, Release). Head 88f89fcdd6 merges main 1a5267fd3f into the previous head 03c2195878 (main 4ac683fe02), which had merged into 4ce41adcaf (main 98ddd9c179 before it, merged into this PR's commit). main has #13220, so the macOS write-watch jobs no longer stop at their CMake configure, and it restored check_skips.py after #14881, so the check_skips tests that failed the relinker jobs pass again.

  • New guest_underscore_jumps. It links libkernel so that sigprocmask is registered, and passes 3 runs on this head:
    • Callee-saved registers. An assembly caller sets rbx, rbp and r12-r15, calls _setjmp, clears them and _longjmps back with 42. All six come back.
    • Return values. 0 → 1, 9 → 9, −2 → −2.
    • Signal mask. _setjmp leaves offsets 72-87 and 92 of a filled buffer untouched and writes 0 at 88. After _longjmp the mask set before the jump stays.
    • Mixed buffers. longjmp to a _setjmp buffer restores no mask, and _longjmp to a setjmp buffer (flag 1 at 88) restores none either.
    • Floating-point state. With round-toward-zero and 53-bit x87 precision at _setjmp, and round-to-nearest, 64-bit precision and the IE, ZE and PE flags at _longjmp, the jump restores round-toward-zero and 53-bit precision, keeps IE, ZE and PE, and leaves the exception masks unchanged.
  • Existing tests. guest_signal_sets (setjmp, longjmp, sigsetjmp, siglongjmp) still passes (3 runs).
  • Exports. The libc.prx built from this head exports sjpkrhugvVI (_setjmp) and +F+9hhi6k9Q (_longjmp).
  • Not tested. I did not run it on Windows or macOS. The Windows path uses the same GuestStackSwitch_nid_no_patch call as longjmp.
  • Conventions. python3 tools/check_conventions.py --base origin/main passes.
  • Overlap. python3 tools/pr_overlap.py --branch feat/libc-underscore-setjmp lists no pull request with the same exports or conflicting lines.
    • #11872 and #11969 edit the setjmp, longjmp debt line. The new entry sits one line below it, and git merge-tree merges both with this branch without conflicts.
    • #12682, and #12688 on top of it, make setjmp, longjmp, sigsetjmp and siglongjmp save an I/O context at offset 92 and restore it through GuestIoStackRestore_nid_no_patch. Neither conflicts with this PR, but _setjmp and _longjmp need the same two calls. Its author agreed that this PR lands first: #12682 adds the context save and restore to _setjmp and _longjmp, and #12682, #12688, #12700 and #12965 declare Depends on: #12149, so the overlap the tool reports with them (_setjmp, _longjmp and GuestUnderscoreJumps.cpp) is this PR's commit inside their stack.
    • The tool could not compare 45 pull requests that conflict with main, #5021 (ARM64 AOT, which touches JumpBuffer.cpp) among them. Merged with this branch, all give the same conflicts as merged with main (git merge-tree) except #14212, which rewrites every debt file and gets one more conflict hunk in libc.md; it has no review yet and this PR does not wait for it.
    • #12605 rewrites the __std_min_8i debt line right below the new entry. It no longer conflicts with main, so merged with this branch it conflicts in that one libc.md hunk, which keeps both lines. It has no review yet and this PR is approved, so I leave the order to be agreed there.

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
  • 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:5042803876 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12149). Originally posted by [AlexFigas](https://github.com/AlexFigas) on 2026-10-27T23:44:35Z. --- ### What AnyPS5's libc had `setjmp` and `longjmp` but not `_setjmp` and `_longjmp`, the BSD forms that leave the signal mask alone. The `libc.prx` bundled with PPSA21564 (build `J03093718`) exports both, and this PR adds them. That binary's four functions differ only in the signal mask: - **`setjmp` (0x548b0).** It calls `_sigprocmask(SIG_BLOCK, NULL, buffer + 0x48)`, then runs the same register saves as `_setjmp` (0x1153a0). - **`longjmp` (0x54900).** It calls `_sigprocmask(SIG_SETMASK, buffer + 0x48, NULL)`, then runs the same restores as `_longjmp` (0x1153e0). - **`_longjmp`.** It keeps the current MXCSR exception flags and takes only the other MXCSR bits from the buffer. A value of 0 returns 1. This matches FreeBSD 11.4's [`_setjmp.S`](https://github.com/freebsd/freebsd-src/blob/8c639945a44588f6cfdddfb057bb5aad88735da0/lib/libc/amd64/gen/_setjmp.S). `_setjmp` and `_longjmp` here are `setjmp` and `longjmp` from `JumpBuffer.cpp` without the signal-mask calls, in the same buffer layout. So a buffer from either `setjmp` is accepted by either `longjmp`, as on FreeBSD. - **`_setjmp`** writes 0 at 88, where `setjmp` marks a saved mask. A `longjmp` to its buffer therefore restores no mask, where the binary would read whatever is at 0x48. - **`_longjmp`** keeps the current MXCSR exception flags as the binary does. On Windows it calls `GuestStackSwitch_nid_no_patch` with the target stack pointer before switching, as `longjmp` does. The debt entry records what still differs from the binary: the layout (the binary stores the stack pointer at the call, the x87 control word at 64 and MXCSR at 68), the 0 at 88, and that `longjmp` restores the saved MXCSR exception flags where the binary's keeps the current ones. ### 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. --> On Ubuntu 24.04.5 under WSL2 (GCC 13.3, Release). Head 88f89fcdd6 merges `main` 1a5267fd3f into the previous head 03c2195878 (`main` 4ac683fe02), which had merged into 4ce41adcaf (`main` 98ddd9c179 before it, merged into this PR's commit). `main` has #13220, so the macOS `write-watch` jobs no longer stop at their CMake configure, and it restored `check_skips.py` after #14881, so the `check_skips` tests that failed the relinker jobs pass again. - **New `guest_underscore_jumps`.** It links libkernel so that `sigprocmask` is registered, and passes 3 runs on this head: - **Callee-saved registers.** An assembly caller sets `rbx`, `rbp` and `r12`-`r15`, calls `_setjmp`, clears them and `_longjmp`s back with 42. All six come back. - **Return values.** 0 → 1, 9 → 9, −2 → −2. - **Signal mask.** `_setjmp` leaves offsets 72-87 and 92 of a filled buffer untouched and writes 0 at 88. After `_longjmp` the mask set before the jump stays. - **Mixed buffers.** `longjmp` to a `_setjmp` buffer restores no mask, and `_longjmp` to a `setjmp` buffer (flag 1 at 88) restores none either. - **Floating-point state.** With round-toward-zero and 53-bit x87 precision at `_setjmp`, and round-to-nearest, 64-bit precision and the IE, ZE and PE flags at `_longjmp`, the jump restores round-toward-zero and 53-bit precision, keeps IE, ZE and PE, and leaves the exception masks unchanged. - **Existing tests.** `guest_signal_sets` (`setjmp`, `longjmp`, `sigsetjmp`, `siglongjmp`) still passes (3 runs). - **Exports.** The `libc.prx` built from this head exports `sjpkrhugvVI` (`_setjmp`) and `+F+9hhi6k9Q` (`_longjmp`). - **Not tested.** I did not run it on Windows or macOS. The Windows path uses the same `GuestStackSwitch_nid_no_patch` call as `longjmp`. - **Conventions.** `python3 tools/check_conventions.py --base origin/main` passes. - **Overlap.** `python3 tools/pr_overlap.py --branch feat/libc-underscore-setjmp` lists no pull request with the same exports or conflicting lines. - #11872 and #11969 edit the `setjmp, longjmp` debt line. The new entry sits one line below it, and `git merge-tree` merges both with this branch without conflicts. - #12682, and #12688 on top of it, make `setjmp`, `longjmp`, `sigsetjmp` and `siglongjmp` save an I/O context at offset 92 and restore it through `GuestIoStackRestore_nid_no_patch`. Neither conflicts with this PR, but `_setjmp` and `_longjmp` need the same two calls. Its author [agreed](https://github.com/boykopovar/AnyPS5/pull/12682#issuecomment-6538525154) that this PR lands first: #12682 adds the context save and restore to `_setjmp` and `_longjmp`, and #12682, #12688, #12700 and #12965 declare `Depends on: #12149`, so the overlap the tool reports with them (`_setjmp`, `_longjmp` and `GuestUnderscoreJumps.cpp`) is this PR's commit inside their stack. - The tool could not compare 45 pull requests that conflict with `main`, #5021 (ARM64 AOT, which touches `JumpBuffer.cpp`) among them. Merged with this branch, all give the same conflicts as merged with `main` (`git merge-tree`) except #14212, which rewrites every debt file and gets one more conflict hunk in `libc.md`; it has no review yet and this PR does not wait for it. - #12605 rewrites the `__std_min_8i` debt line right below the new entry. It no longer conflicts with `main`, so merged with this branch it conflicts in that one `libc.md` hunk, which keeps both lines. It has no review yet and this PR is approved, so I leave the order to be agreed there. ### 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) - [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: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-29 05:48:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T05:48:52Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The implementation and test report are detailed, but this branch is based on main 2227f13661, while current main is 52c09d567d2fa453494dd720fcf53a98149468e4 (500 commits ahead of the branch). CONTRIBUTING.md requires each branch to be based on current main. The reported guest_underscore_jumps and guest_signal_sets runs therefore do not validate the current integration state.

What I ran

  • Reviewed exact head 081d5fd372ca845f8fef72a3623cefeec589bfab and its declared base.
  • Ran a merge preview and git diff --check against current main.
  • Checked the exact-head test report and current hosted-check scope.

Results

Check Result
Current-main merge preview Clean, but current main is not in the branch history
git diff --check Passed
Focused tests Author reports 3 runs each on base 2227f13661; no run against current 52c09d5 is reported
Windows/macOS behavior Not tested in the report

Please refresh the branch onto current main and rerun the focused jump/signal tests on that exact head. I have not independently built or run the C++ tests, so I am not approving the stale integration snapshot.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5693407959 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12149#pullrequestreview-5693407959). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T05:48:52Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The implementation and test report are detailed, but this branch is based on `main` `2227f13661`, while current `main` is `52c09d567d2fa453494dd720fcf53a98149468e4` (500 commits ahead of the branch). `CONTRIBUTING.md` requires each branch to be based on current `main`. The reported `guest_underscore_jumps` and `guest_signal_sets` runs therefore do not validate the current integration state. ## What I ran - Reviewed exact head `081d5fd372ca845f8fef72a3623cefeec589bfab` and its declared base. - Ran a merge preview and `git diff --check` against current `main`. - Checked the exact-head test report and current hosted-check scope. ## Results | Check | Result | |---|---| | Current-main merge preview | Clean, but current `main` is not in the branch history | | `git diff --check` | Passed | | Focused tests | Author reports 3 runs each on base `2227f13661`; no run against current `52c09d5` is reported | | Windows/macOS behavior | Not tested in the report | Please refresh the branch onto current `main` and rerun the focused jump/signal tests on that exact head. I have not independently built or run the C++ tests, so I am not approving the stale integration snapshot.
MarcZX10 commented 2026-10-29 11:07:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T11:07:49Z.

Review: CHANGES_REQUESTED


Re-checked — changes requested

The new report supplies exact-head runs for guest_underscore_jumps and guest_signal_sets, plus the two exports. The branch is based on 1b580f13cf; current main is ba5b5330b3. Since that base, current main changed this PR's libkernel/CMakeLists.txt and docs/dev/debt/libc.md. Please merge current main and rerun the focused tests and export check on the resulting exact head. I am not disputing the reported results on 056c4b4f4a; they do not validate the current-main integration.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5696705879 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12149#pullrequestreview-5696705879). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T11:07:49Z. **Review:** CHANGES_REQUESTED --- ## Re-checked — changes requested The new report supplies exact-head runs for `guest_underscore_jumps` and `guest_signal_sets`, plus the two exports. The branch is based on `1b580f13cf`; current `main` is `ba5b5330b3`. Since that base, current main changed this PR's `libkernel/CMakeLists.txt` and `docs/dev/debt/libc.md`. Please merge current main and rerun the focused tests and export check on the resulting exact head. I am not disputing the reported results on `056c4b4f4a`; they do not validate the current-main integration.
MarcZX10 commented 2026-10-30 10:06:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T10:06:27Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

I reviewed head 4ce41adcafb39c2bb083fd2574a9a5533c6833f9; before approval, the required landing-order agreement with open PR #12688 needs to be resolved because its jump-buffer context changes affect the new underscore variants.

What I ran

Head: 4ce41adcafb39c2bb083fd2574a9a5533c6833f9; PR base: 98ddd9c1792bbab016ceed5db267a93d1d61f00a. I also previewed the PR against current upstream main b7488e1ff53e6cfca82af972df1d09fa71e7051d; it merged cleanly. Environment: Linux 6.1.0-54-amd64, x86_64; no compiler or build was run.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 12149
git diff --check 98ddd9c1792bbab016ceed5db267a93d1d61f00a...refs/review/pr-12149-current
python3 tools/check_conventions.py --base 98ddd9c1792bbab016ceed5db267a93d1d61f00a --head refs/review/pr-12149-current --title 'feat(libc): export _setjmp and _longjmp' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-12149-4ce41adcafb3/pr-body.md
python3 tools/pr_abi_audit.py --base 98ddd9c1792bbab016ceed5db267a93d1d61f00a --head refs/review/pr-12149-current --json
python3 tools/pr_test_quality.py --root /marc/AnyPS5 --json core/libs/tests/GuestUnderscoreJumps.cpp core/libs/prx/libkernel/CMakeLists.txt
git merge-tree --write-tree refs/remotes/upstream/main refs/review/pr-12149-current

Results

Check Result
Precheck, diff, conventions, dependency/mergeability Precheck completed on the exact head/base; diff and conventions pass; current-main merge preview is clean.
ABI audit Passed with lexical warnings: assembly-defined jump symbols are not recognized by the audit; the separate libc___cxa_finalize alias warning is unrelated. I inspected the assembly definitions manually.
Test quality and registration Heuristic flagged the new test path because CMake uses ${LIBS_INCLUDE_DIR}; the PR explicitly registers guest_underscore_jump_tests and guest_underscore_jumps.
Hosted Windows Job passed, but its log says no changed guest test sources were found, so it did not run guest_underscore_jumps.
Hosted macOS write-watch Both jobs failed during separate write-watch CMake configuration because duplicate test names were declared; these jobs do not test this PR's changed paths.
Hosted Linux Skipped.
Author-reported focused tests The author reports guest_underscore_jumps and guest_signal_sets each passed 3 runs on this exact head under WSL2; I did not run these tests locally.
Unedited output from local checks and relevant CI log lines
git diff --check: [no output; exit code 0]

All conventions checks passed.

ABI audit summary:
status: passed_with_warnings
_longjmp_nid_postfix: definition-not-found — No APS5_VABI definition was found in the head tree; check assembly aliases, generated definitions, and platform guards.
_setjmp_nid_postfix: definition-not-found — No APS5_VABI definition was found in the head tree; check assembly aliases, generated definitions, and platform guards.
libc___cxa_finalize: nid-alias-differs-from-symbol-hash — Explicit NID H2e8t5ScQGc differs from computed symbol NID z5JcC5WSmyA; verify intentional aliasing.
longjmp_nid_postfix: definition-not-found — No APS5_VABI definition was found in the head tree; check assembly aliases, generated definitions, and platform guards.
setjmp_nid_postfix: definition-not-found — No APS5_VABI definition was found in the head tree; check assembly aliases, generated definitions, and platform guards.

Test-quality heuristic:
{
  "findings": [
    {
      "path": "core/libs/tests/GuestUnderscoreJumps.cpp",
      "line": 1,
      "kind": "possible-unregistered-cpp-test",
      "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
    }
  ],
  "negative_control_candidates": [],
  "limits": [
    "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
    "A test that passes against base is not by itself proof that the PR test is inadequate.",
    "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
  ]
}

Current-main merge preview:
5203c1bb2dd09865d37cbe3b2aaf88c2615345ec

Windows test step:
No guest core/libs test sources changed
No guest core/libs test sources changed; the libs build still ran

macOS write-watch CMake errors:
CMake Error at CMakeLists.txt:42 (add_test):
  add_test given test NAME "write_watch_execute-fault" which already exists
CMake Error at CMakeLists.txt:42 (add_test):
  add_test given test NAME "write_watch_read-fault" which already exists in

Negative control

I did not run a local negative control: this no-build review did not compile the changed test or binary.

Findings

Blocking

The repository's overlap rule requires authors of PRs touching the same lines/files to agree on landing order and record any dependency. The overlap notice identifies #12688 as sharing core/libs/prx/libc/src/JumpBuffer.cpp; inspecting its exact head shows JumpBufferSaveMask_nid_no_patch stores a per-jump context at offset 92 and JumpBufferRestoreMask_nid_no_patch restores it. This PR's new _setjmp only writes the flag at offset 88 and _longjmp does not save or restore offset 92. If #12688 lands first, underscore jumps will not follow that context behavior; if this PR lands first, #12688's author needs to account for the new entry points. The checklist currently says Depends on: none and does not record an agreed order.

Please coordinate with #12688's author, record the agreed order and dependency (if any) in the checklist, and ensure the selected integration order covers context save/restore for the underscore variants where required. I found no separate blocking source defect in this PR's standalone current-main preview.

Non-blocking

The current hosted workflow does not exercise the new guest test on Windows, and Linux is skipped. The author's exact-head WSL2 results are useful but are not an independent run from this review environment.

Sources

Not verified

  • No local compilation or test execution; no physical-console or title run.
  • The Windows hosted job did not execute the changed guest test, and Linux CI was skipped.
  • macOS product behavior was not tested by the failed write-watch jobs; their failures occurred during CMake setup for that separate test project.

To get this to a good state

Please record the agreed #12149/#12688 order and the required underscore-buffer context handling in the PR checklist or code as appropriate. I will rerun the same relevant checks against the updated head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5710768684 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12149#pullrequestreview-5710768684). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T10:06:27Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested I reviewed head `4ce41adcafb39c2bb083fd2574a9a5533c6833f9`; before approval, the required landing-order agreement with open PR #12688 needs to be resolved because its jump-buffer context changes affect the new underscore variants. ## What I ran Head: `4ce41adcafb39c2bb083fd2574a9a5533c6833f9`; PR base: `98ddd9c1792bbab016ceed5db267a93d1d61f00a`. I also previewed the PR against current upstream `main` `b7488e1ff53e6cfca82af972df1d09fa71e7051d`; it merged cleanly. Environment: Linux 6.1.0-54-amd64, x86_64; no compiler or build was run. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 12149 git diff --check 98ddd9c1792bbab016ceed5db267a93d1d61f00a...refs/review/pr-12149-current python3 tools/check_conventions.py --base 98ddd9c1792bbab016ceed5db267a93d1d61f00a --head refs/review/pr-12149-current --title 'feat(libc): export _setjmp and _longjmp' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-12149-4ce41adcafb3/pr-body.md python3 tools/pr_abi_audit.py --base 98ddd9c1792bbab016ceed5db267a93d1d61f00a --head refs/review/pr-12149-current --json python3 tools/pr_test_quality.py --root /marc/AnyPS5 --json core/libs/tests/GuestUnderscoreJumps.cpp core/libs/prx/libkernel/CMakeLists.txt git merge-tree --write-tree refs/remotes/upstream/main refs/review/pr-12149-current ``` ## Results | Check | Result | |---|---| | Precheck, diff, conventions, dependency/mergeability | Precheck completed on the exact head/base; diff and conventions pass; current-main merge preview is clean. | | ABI audit | Passed with lexical warnings: assembly-defined jump symbols are not recognized by the audit; the separate `libc___cxa_finalize` alias warning is unrelated. I inspected the assembly definitions manually. | | Test quality and registration | Heuristic flagged the new test path because CMake uses `${LIBS_INCLUDE_DIR}`; the PR explicitly registers `guest_underscore_jump_tests` and `guest_underscore_jumps`. | | Hosted Windows | Job passed, but its log says no changed guest test sources were found, so it did not run `guest_underscore_jumps`. | | Hosted macOS write-watch | Both jobs failed during separate write-watch CMake configuration because duplicate test names were declared; these jobs do not test this PR's changed paths. | | Hosted Linux | Skipped. | | Author-reported focused tests | The author reports `guest_underscore_jumps` and `guest_signal_sets` each passed 3 runs on this exact head under WSL2; I did not run these tests locally. | <details> <summary>Unedited output from local checks and relevant CI log lines</summary> ```text git diff --check: [no output; exit code 0] All conventions checks passed. ABI audit summary: status: passed_with_warnings _longjmp_nid_postfix: definition-not-found — No APS5_VABI definition was found in the head tree; check assembly aliases, generated definitions, and platform guards. _setjmp_nid_postfix: definition-not-found — No APS5_VABI definition was found in the head tree; check assembly aliases, generated definitions, and platform guards. libc___cxa_finalize: nid-alias-differs-from-symbol-hash — Explicit NID H2e8t5ScQGc differs from computed symbol NID z5JcC5WSmyA; verify intentional aliasing. longjmp_nid_postfix: definition-not-found — No APS5_VABI definition was found in the head tree; check assembly aliases, generated definitions, and platform guards. setjmp_nid_postfix: definition-not-found — No APS5_VABI definition was found in the head tree; check assembly aliases, generated definitions, and platform guards. Test-quality heuristic: { "findings": [ { "path": "core/libs/tests/GuestUnderscoreJumps.cpp", "line": 1, "kind": "possible-unregistered-cpp-test", "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage." } ], "negative_control_candidates": [], "limits": [ "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.", "A test that passes against base is not by itself proof that the PR test is inadequate.", "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error." ] } Current-main merge preview: 5203c1bb2dd09865d37cbe3b2aaf88c2615345ec Windows test step: No guest core/libs test sources changed No guest core/libs test sources changed; the libs build still ran macOS write-watch CMake errors: CMake Error at CMakeLists.txt:42 (add_test): add_test given test NAME "write_watch_execute-fault" which already exists CMake Error at CMakeLists.txt:42 (add_test): add_test given test NAME "write_watch_read-fault" which already exists in ``` </details> ## Negative control I did not run a local negative control: this no-build review did not compile the changed test or binary. ## Findings ### Blocking The repository's overlap rule requires authors of PRs touching the same lines/files to agree on landing order and record any dependency. The overlap notice identifies #12688 as sharing `core/libs/prx/libc/src/JumpBuffer.cpp`; inspecting its exact head shows `JumpBufferSaveMask_nid_no_patch` stores a per-jump context at offset 92 and `JumpBufferRestoreMask_nid_no_patch` restores it. This PR's new `_setjmp` only writes the flag at offset 88 and `_longjmp` does not save or restore offset 92. If #12688 lands first, underscore jumps will not follow that context behavior; if this PR lands first, #12688's author needs to account for the new entry points. The checklist currently says `Depends on: none` and does not record an agreed order. Please coordinate with #12688's author, record the agreed order and dependency (if any) in the checklist, and ensure the selected integration order covers context save/restore for the underscore variants where required. I found no separate blocking source defect in this PR's standalone current-main preview. ### Non-blocking The current hosted workflow does not exercise the new guest test on Windows, and Linux is skipped. The author's exact-head WSL2 results are useful but are not an independent run from this review environment. ## Sources - [Repository overlap and dependency rule, pinned to current main](https://github.com/boykopovar/AnyPS5/blob/b7488e1ff53e6cfca82af972df1d09fa71e7051d/CONTRIBUTING.md#L62-L67) - [This PR's underscore jump implementation at its reviewed head](https://github.com/boykopovar/AnyPS5/blob/4ce41adcafb39c2bb083fd2574a9a5533c6833f9/core/libs/prx/libc/src/JumpBuffer.cpp) - [PR #12688 context save/restore implementation at its current head](https://github.com/boykopovar/AnyPS5/blob/5dce7fea277f92c9e74db908ba1a0a5e0ebbe5c6/core/libs/prx/libc/src/JumpBuffer.cpp) - [Author's exact-head focused test report](https://github.com/boykopovar/AnyPS5/pull/12149#issuecomment-6519071279) ## Not verified - No local compilation or test execution; no physical-console or title run. - The Windows hosted job did not execute the changed guest test, and Linux CI was skipped. - macOS product behavior was not tested by the failed write-watch jobs; their failures occurred during CMake setup for that separate test project. ## To get this to a good state Please record the agreed #12149/#12688 order and the required underscore-buffer context handling in the PR checklist or code as appropriate. I will rerun the same relevant checks against the updated head.
MarcZX10 commented 2026-10-31 03:42:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T03:42:47Z.

Review: APPROVED


Re-checked — new evidence, looks good

The blocking order concern is resolved: #12682's author agreed that #12149 lands first and confirmed the dependent change will add the I/O context save/restore and declare Depends on: #12149.

What I ran

Rechecked live PR head 4ce41adcafb39c2bb083fd2574a9a5533c6833f9, base 98ddd9c1792bbab016ceed5db267a93d1d61f00a, and the new discussion reply. The no-build precheck below was previously run on this unchanged head/base; I did not rebuild or rerun C++ tests for this follow-up.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 12149

Results

Evidence Result
Existing exact-head review Source, tests, conventions, and current-main merge preview were reviewed; no standalone blocking code finding was recorded.
Author-reported focused run guest_underscore_jumps and guest_signal_sets each passed three runs on head 4ce41adcafb39c2bb083fd2574a9a5533c6833f9 under WSL2.
Hosted CI Windows job passed but did not execute the changed guest test; Linux was skipped. macOS write-watch jobs failed during CMake setup on duplicate test names in that separate project.
Dependency discussion #12682 author explicitly confirmed the landing order and the follow-up dependency/context work.

Findings

Blocking: None. The agreed order allows this standalone export PR to land before the dependent I/O-context change.

Non-blocking: The author says #12682 will record the dependency and add context handling in that PR; its checklist/update is still pending there. This does not block #12149 under the agreed order.

Sources

Not verified

I did not independently rebuild or rerun the guest tests in this follow-up. The hosted Linux job is skipped, and the Windows job did not execute the changed guest test. No console/title behavior was tested.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5720986076 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12149#pullrequestreview-5720986076). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T03:42:47Z. **Review:** APPROVED --- # Re-checked — new evidence, looks good The blocking order concern is resolved: #12682's author agreed that #12149 lands first and confirmed the dependent change will add the I/O context save/restore and declare `Depends on: #12149`. ## What I ran Rechecked live PR head `4ce41adcafb39c2bb083fd2574a9a5533c6833f9`, base `98ddd9c1792bbab016ceed5db267a93d1d61f00a`, and the new discussion reply. The no-build precheck below was previously run on this unchanged head/base; I did not rebuild or rerun C++ tests for this follow-up. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 12149 ``` ## Results | Evidence | Result | |---|---| | Existing exact-head review | Source, tests, conventions, and current-main merge preview were reviewed; no standalone blocking code finding was recorded. | | Author-reported focused run | `guest_underscore_jumps` and `guest_signal_sets` each passed three runs on head `4ce41adcafb39c2bb083fd2574a9a5533c6833f9` under WSL2. | | Hosted CI | Windows job passed but did not execute the changed guest test; Linux was skipped. macOS write-watch jobs failed during CMake setup on duplicate test names in that separate project. | | Dependency discussion | #12682 author explicitly confirmed the landing order and the follow-up dependency/context work. | ## Findings **Blocking:** None. The agreed order allows this standalone export PR to land before the dependent I/O-context change. **Non-blocking:** The author says #12682 will record the dependency and add context handling in that PR; its checklist/update is still pending there. This does not block #12149 under the agreed order. ## Sources - [Author agreement on #12149 landing first and the dependent context changes](https://github.com/boykopovar/AnyPS5/pull/12682#issuecomment-6538525154) - [Reviewed jump implementation](https://github.com/boykopovar/AnyPS5/blob/4ce41adcafb39c2bb083fd2574a9a5533c6833f9/core/libs/prx/libc/src/JumpBuffer.cpp) - [Author's exact-head focused test report](https://github.com/boykopovar/AnyPS5/pull/12149#issuecomment-6519071279) ## Not verified I did not independently rebuild or rerun the guest tests in this follow-up. The hosted Linux job is skipped, and the Windows job did not execute the changed guest test. No console/title behavior was tested.
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!12149
No description provided.