Repository navigation
fix(libScePosixForWebKit): implement SCHED_OTHER wrapper - #23347
Conversation
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 50b1c7157b:
- Conventions:
tools/check_conventions.pypassed. - Build:
guest_posix_wrap_testsbuilt cleanly. - CTest (
guest_posix_wrap):1/1 Test #4927: guest_posix_wrap ................. Passed 0.02 sec 100% tests passed, 0 tests failed out of 1 - Negative control: with
core/libs/prx/libScePosixForWebKit/Export.cppreverted tomainand the new tests kept, the suite fails:Restoring the change makes it pass again.1/1 Test #4927: guest_posix_wrap .................Subprocess aborted***Exception: 0.34 sec 0% tests passed, 1 tests failed out of 1 - Code reading:
- Verified guest pointer validation in pthread_setschedparam_np: GuestCopyIn_nid_no_patch(&requested, param, sizeof(requested)) correctly catches null or invalid guest addresses (e.g. 0x10) and returns PosixEfault (14).
- Verified error code precedence and return values: when policy == 2 (SCHED_OTHER), GuestCopyIn_nid_no_patch failure returns PosixEfault without dereferencing, while invalid thread handles or priorities are validated by pthread_setprio_nid_postfix returning Einval.
- Verified non-SCHED_OTHER pass-through: policy != 2 forwards directly to pthread_setschedparam_nid_postfix(thread, policy, param), matching firmware 13.42 behavior.
- Verified test coverage in core/libs/tests/GuestPosixWrap.cpp: exercises successful SCHED_OTHER priority update, restoration of original priority, invalid priority rejection (Einval), null/invalid param pointers (Efault), and non-SCHED_OTHER passthrough without polluting error state.
- Verified AGENTS.md conventions: no illegal comments added, technical debt fragment added under docs/dev/debt/changes/, and commit/PR conventions satisfied.
Looks Good To Me
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
The changed wrapper, focused tests, and debt entry are consistent with the stated SCHED_OTHER behavior; the author reports passing checks that I did not run.
What I ran
Reviewed head 50b1c7157b139994821fa473ae0b0f9d9d64046a. I read the description, commits, diff, manifest, all three changed files, and targeted scheduler implementation and test context. No commands or tests were run.
Results
| Check | Result | Note |
|---|---|---|
| Source review | passed | All changed files read |
| Reported checks | not run | Reported by the author |
| Negative control | not run | No test mutation or control run |
Negative control
A negative control could not be run in this review.
Findings
Blocking
None.
Non-blocking
None.
Sources
The relevant implementation and test context were read at the pinned head. No external sources used.
Not verified
I did not run the reported build, test, audit, convention, or overlap checks. I did not verify behavior on a physical console or firmware 13.42.
To get this to a good state
Nothing is required.
|
Windows result for head Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release,
AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
|
Tested on an Apple M1 (macOS 26.5, Apple clang 21.0.0), x86_64 Release under Rosetta 2. The tree was
I only ran this test, and I did not run a title that sets SCHED_OTHER through AI-assisted: yes (Claude Code) |
|
Tested head Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release,
Whole batch: the full This is one combined tree, not a run of this PR alone. AI-assisted: yes (Claude Code) |
6818aa6 to
498c7db
Compare
498c7db to
d8a9c14
Compare
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The reviewed change at d8a9c14864a4408ff96e70fcf7e79b3013686572 has no verified blocking defects; the PR-reported checks were not run by me.
What I ran
Read the prepared description, commits, manifest, diff, and all three changed files listed in the manifest at the pinned head. Inspected the priority setter and scheduling code touched by the wrapper. No build or tests were run.
Results
| Check | Result | Note |
|---|---|---|
| Changed files reviewed | passed | All three manifest files read |
| Build and tests | not run | PR description reports successful checks |
| Priority setter behavior | passed | Range, thread, and error handling inspected |
Findings
Blocking
None.
Non-blocking
None.
Sources
The wrapper copies the requested parameter before calling the priority setter; that setter validates the thread and accepted priority ranges. The added tests cover success, invalid priority, null and unreadable parameter, and forwarding for other policies.
Not verified
No independent build, tests, or console behavior were verified. The review-folder files.json inventory was unavailable; the prepared manifest listed three changed files, and all three were read. The PR-reported checks were not independently confirmed.
To get this to a good state
Nothing is required.
|
Retested head Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release,
AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
What
Implement
pthread_setschedparam_np'sSCHED_OTHERpath from firmware 13.42 evidence. The wrapper reads the requested priority first and uses libkernel's measured priority setter for the firmware import identified aspthread_setschedother_np(thread, priority), preserving pointer, thread and priority error precedence. Add focused success and error-path coverage and update the pending technical-debt fragment for the unmodelled host timesharing class.Tested
Linux x86-64 (Ubuntu 24.04, GCC 13.3, Release) in
anyps5-dev:24.04: fullBUILD_TESTING=ONconfigure; builtguest_posix_wrap_tests;ctest -R ^guest_posix_wrap$ --output-on-failurepassed 1/1.tools/debt_fold.py --check,tools/guest_pointer_audit.py libScePosixForWebKit(six existing findings, none in this function),test_public_headers.py --audit-only(413 libraries, 34,732 exports),tools/check_conventions.py --base origin/main, and both required overlap scans passed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)