fix(libkernel): follow kern_cpuset for the base cpuset, level checks and interrupt targets #14885

Merged
oneandonlydean merged 3 commits from upstream-pr/14885 into main 2026-11-03 05:14:20 +00:00
oneandonlydean commented 2026-11-01 22:33:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-11-01T22:33:22Z.


Carries #7135 by @AlexOfTheForest, with credit.

What

Carry the remaining cpuset changes after #6540's guest-thread lookup landed: read the base cpuset, check the setter's level before resolving the target, and follow the FreeBSD level/scope ordering for interrupt and domain errors. Affinity remains guest bookkeeping, with no host scheduling change. The base set is still assumed to be sceKernelGetAvailableCpumask; that console assumption remains unverified in the debt entry.

The carry keeps @adriadam10's review points. It preserves current main's checked guest-memory copies and their host-safety debt qualifications, retains unrelated debt, and drops the ten new tests that assert unsupported calls throw. Implemented success and error tests remain. Existing clipping is explicitly distinguished from FreeBSD's subset check.

Original head: eb4e07e8a9. Base: e0caf13600. Only the original three files change. #11872's proposed debt merge order has not been agreed and is not a runtime dependency; both sets of debt must survive later composition.

Tested

  • Carry checks (ours, Linux workstation, on main e0caf13600 plus this change): guest_available_cpumask and guest_sched_priority passed, and so did the neighbouring guest_thread_self, guest_pthread_attr, guest_pthread_attr_errors and guest_pthread_start ctests (6/6). Not run: Windows, macOS, any GPU/game.

Source checks confirm that the original two cpuset bodies are retained with main's checked-copy adaptations, production outside them is unchanged, only the two cpuset debt entries change, both host-safety qualifications remain, and exactly ten new unsupported-throw assertions are absent while all other added test lines remain. tools/check_conventions.py and git diff --check pass. No compiler, native test, title or GPU result is claimed here. Prior contributor runs of #7135 are not runs of this carry. Console size-range reports remain separate evidence; this carry retains main's existing size handling.

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:5112242409 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14885). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-11-01T22:33:22Z. --- Carries #7135 by @AlexOfTheForest, with credit. ### What Carry the remaining cpuset changes after #6540's guest-thread lookup landed: read the base cpuset, check the setter's level before resolving the target, and follow the FreeBSD level/scope ordering for interrupt and domain errors. Affinity remains guest bookkeeping, with no host scheduling change. The base set is still assumed to be `sceKernelGetAvailableCpumask`; that console assumption remains unverified in the debt entry. The carry keeps @adriadam10's review points. It preserves current main's checked guest-memory copies and their host-safety debt qualifications, retains unrelated debt, and drops the ten new tests that assert unsupported calls throw. Implemented success and error tests remain. Existing clipping is explicitly distinguished from FreeBSD's subset check. Original head: eb4e07e8a92b4c8260426e0a500ebcdffac4bbda. Base: e0caf1360035286bd22b9f2a3030e97b880ffb28. Only the original three files change. #11872's proposed debt merge order has not been agreed and is not a runtime dependency; both sets of debt must survive later composition. ### Tested - Carry checks (ours, Linux workstation, on main `e0caf13600` plus this change): `guest_available_cpumask` and `guest_sched_priority` passed, and so did the neighbouring `guest_thread_self`, `guest_pthread_attr`, `guest_pthread_attr_errors` and `guest_pthread_start` ctests (6/6). Not run: Windows, macOS, any GPU/game. Source checks confirm that the original two cpuset bodies are retained with main's checked-copy adaptations, production outside them is unchanged, only the two cpuset debt entries change, both host-safety qualifications remain, and exactly ten new unsupported-throw assertions are absent while all other added test lines remain. `tools/check_conventions.py` and `git diff --check` pass. No compiler, native test, title or GPU result is claimed here. Prior contributor runs of #7135 are not runs of this carry. Console size-range reports remain separate evidence; this carry retains main's existing size handling. <!-- 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. --> ### 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
BunnyFl commented 2026-11-02 02:03:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-02T02:03:06Z.

Review: APPROVED


Windows 11, WinLibs GCC 15.2.0 r7, Release. Head f82fb8a9c9 merged into upstream/main 93dbd0f82a:

  • guest_available_cpumask, guest_sched_priority, guest_thread_self, guest_pthread_attr, guest_pthread_attr_errors, guest_pthread_start: 6/6 pass.
  • Negative control: with main's Pthread/Posix/Thread.cpp, guest_available_cpumask aborts, and the five neighbours still pass.

That covers Windows, which the description lists as not run.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5731392386 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14885#pullrequestreview-5731392386). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-02T02:03:06Z. **Review:** APPROVED --- Windows 11, WinLibs GCC 15.2.0 r7, Release. Head f82fb8a9c9 merged into upstream/main 93dbd0f82a: - `guest_available_cpumask`, `guest_sched_priority`, `guest_thread_self`, `guest_pthread_attr`, `guest_pthread_attr_errors`, `guest_pthread_start`: 6/6 pass. - Negative control: with main's `Pthread/Posix/Thread.cpp`, `guest_available_cpumask` aborts, and the five neighbours still pass. That covers Windows, which the description lists as not run.
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!14885
No description provided.