feat(libs): resolve four sysctl names and stub the IME clause setter #15781

Merged
fishingpvalues merged 2 commits from upstream-pr/15781 into main 2026-11-07 23:38:33 +00:00
fishingpvalues commented 2026-11-04 14:40:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fishingpvalues on 2026-11-04T14:40:39Z.


What

Two measured exports that titles reach are still short of the console on current main. This replaces the closed #8553, rebased onto current main; the IME entry is under Silent stubs as requested in the review there.

  • libkernel: sysctlnametomib did not resolve kern.smp.maxcpus, kern.stackprot, kern.sched.name and kern.timecounter.hardware, while a PS5 (firmware 12.70) payload process resolves them to {1, 2147482816, 2147482814}, {1, 2147483151}, {1, 2147483182, 2147483181} and {1, 2147482838, 2147482834}. The four names and MIBs live in the table sysctl already uses for its measured-absent check, and sysctlnametomib resolves them from that same table, so the two paths cannot drift. Size queries and short output buffers keep the behaviour of the other names. sysctl by those exact MIBs still returns -1 with ENOENT as measured, and sysctlbyname keeps returning ENOENT for the names.
  • libSceIme: sceImeSetConsecutiveClauseConversionEnabled threw through NotImplemented_nid_no_patch, but PPSA24191 calls it with 1 before every sceImeOpen and only opens the panel when it returns 0. It is now a silent stub that returns 0 for any byte and stores nothing, because the panel is not drawn and no conversion consumes the flag. The unknown effect on conversion, the result while a panel is open and the error codes stay in the library's technical debt file.

The pr_overlap.py check lists only documentation-file adjacency with open PRs; no open PR implements these exports or changes these code paths.

Tested

  • Linux x86-64 (Ubuntu 24.04, GCC 13.3, CMake 3.28) in a container under OrbStack: built libc, libkernel, libSceIme, and both guest_system_configuration_tests and guest_ime_parameters_tests.
  • Both tests passed; the run set LD_PRELOAD to bypass the host-CPU guard because OrbStack exposes an emulated VirtualApple CPU without AVX2, unrelated to this change.
  • Rebased onto main 1e24993fa3; both tests were rebuilt and pass on the rebased tree.
  • Windows job on the rebased head passed in 5m7s (41990425622), and Conventions passed.
  • The new regression resolves each of the four names with sysctlnametomib, calls sysctl with the returned MIB and checks the measured ENOENT with the buffer and length untouched; it also checks the ENOMEM partial copy of a three-component MIB into a two-word buffer.
  • python3 tools/check_conventions.py --base origin/main: passed.
  • git diff --check: clean.

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:5156155981 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15781). Originally posted by [fishingpvalues](https://github.com/fishingpvalues) on 2026-11-04T14:40:39Z. --- ### What Two measured exports that titles reach are still short of the console on current `main`. This replaces the closed #8553, rebased onto current `main`; the IME entry is under Silent stubs as requested in the review there. - `libkernel`: `sysctlnametomib` did not resolve `kern.smp.maxcpus`, `kern.stackprot`, `kern.sched.name` and `kern.timecounter.hardware`, while a PS5 (firmware 12.70) payload process resolves them to `{1, 2147482816, 2147482814}`, `{1, 2147483151}`, `{1, 2147483182, 2147483181}` and `{1, 2147482838, 2147482834}`. The four names and MIBs live in the table `sysctl` already uses for its measured-absent check, and `sysctlnametomib` resolves them from that same table, so the two paths cannot drift. Size queries and short output buffers keep the behaviour of the other names. `sysctl` by those exact MIBs still returns `-1` with `ENOENT` as measured, and `sysctlbyname` keeps returning `ENOENT` for the names. - `libSceIme`: `sceImeSetConsecutiveClauseConversionEnabled` threw through `NotImplemented_nid_no_patch`, but PPSA24191 calls it with 1 before every `sceImeOpen` and only opens the panel when it returns 0. It is now a silent stub that returns 0 for any byte and stores nothing, because the panel is not drawn and no conversion consumes the flag. The unknown effect on conversion, the result while a panel is open and the error codes stay in the library's technical debt file. The `pr_overlap.py` check lists only documentation-file adjacency with open PRs; no open PR implements these exports or changes these code paths. ### 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. --> - Linux x86-64 (Ubuntu 24.04, GCC 13.3, CMake 3.28) in a container under OrbStack: built `libc`, `libkernel`, `libSceIme`, and both `guest_system_configuration_tests` and `guest_ime_parameters_tests`. - Both tests passed; the run set `LD_PRELOAD` to bypass the host-CPU guard because OrbStack exposes an emulated VirtualApple CPU without AVX2, unrelated to this change. - Rebased onto `main` `1e24993fa3`; both tests were rebuilt and pass on the rebased tree. - Windows job on the rebased head passed in 5m7s (`41990425622`), and Conventions passed. - The new regression resolves each of the four names with `sysctlnametomib`, calls `sysctl` with the returned MIB and checks the measured `ENOENT` with the buffer and length untouched; it also checks the `ENOMEM` partial copy of a three-component MIB into a two-word buffer. - `python3 tools/check_conventions.py --base origin/main`: passed. - `git diff --check`: clean. ### 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
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!15781
No description provided.