[DO NOT MERGE - TEST ONLY] feat(sio2man): priority-ceiling sio2man, misses measurable (#340) - #356
Draft
NathanNeurotic wants to merge 3 commits into
Draft
[DO NOT MERGE - TEST ONLY] feat(sio2man): priority-ceiling sio2man, misses measurable (#340)#356NathanNeurotic wants to merge 3 commits into
NathanNeurotic wants to merge 3 commits into
Conversation
…rvation (#340) ps2sdk PR ps2homebrew#709 (Jan 2025) removed sio2man's dedicated priority-24 worker thread; a SIO2 transaction now runs every bus phase in the calling client's thread while holding a plain semaphore with no priority inheritance. On real hardware a low-priority holder (mcserv's RPC thread runs at 104) preempted by usbd (30/36) mid-transaction stalls freepad's priority-20 vblank pad poll past its window, and the EE sees padRead misses -- the dropped/queued menu input of #340. Old ~2023 builds (the uOPL-era binaries that stay smooth on the same console) ran all bus phases on the module's own prio-24 thread, which outranks usbd, so the window did not exist. ps2sdk PR ps2homebrew#898 acknowledges the failure class ('inputs not working and hang on reading') but only swapped padman variants; the threadless sio2man was left in place and no pre-rewrite build of it exists in the SDK anymore. Build sio2man in-tree from pinned SDK source (f08e889fe, upstream style kept verbatim for a reviewable diff -- see modules/sio2man/PROVENANCE.md) with one patch: boost the transaction holder to priority 24 between the transfer-init WaitSema and the transfer-reset SignalSema, restoring its previous priority on release. Threads at or above 24 are untouched, a blocked holder yields the CPU exactly as stock, and the export surface is unchanged, so mmceman's sio2man hook and the post-PR#862 mx4sio driver keep working. The embed replaces the SDK's prebuilt freesio2.irx. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tion) The HUD 'PAD miss:' line has had no writers since the PR #328 revert -- it always rendered miss:0 regardless of hardware behavior. Count ready- state polls that produce no fresh sample so testers can see whether the priority-ceiling sio2man actually drives the miss rate to zero. No behavior change: diagnostics only, repeat handling untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…340) - Depend the .irx rule on the module's source files instead of the directory: a directory mtime does not change on an in-place edit, so local incremental builds silently re-embedded a stale module -- fatal for the HW A/B experiments this branch exists for. - Guard the priority restore on the acquiring thread and document that the restore-before-SignalSema order is load-bearing: a legacy SDK-1.3 double-reset (stock-identical exposure) can no longer de-boost the next holder or leak a boosted priority. - Update README/docs/MX4SIO.md wording now that the embedded sio2man is built in-tree, and narrow PROVENANCE's game-side claim to MX4SIO launches (the only game-core path that loads OPL's sio2man). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TEST BUILD B of 3 — do not merge. If this candidate wins, a clean PR will replace it.
What this tests (Layer 1: the trigger)
ps2sdk PR #709 (Jan 2025) deleted sio2man's dedicated priority-24 worker thread; every SIO2 transaction now runs in the calling client's thread under a semaphore with no priority inheritance. A low-priority holder (mcserv RPC thread = prio 104) preempted by usbd (30/36) mid-transaction stalls freepad's prio-20 vblank pad poll past its window → EE-side
padReadmisses → #340. ps2sdk PR #898 admits the failure class ("inputs not working and hang on reading") but only swapped padman variants. uOPL's binaries come from a CI container created 2023-09-09 — pre-rewrite, threaded — which is why uOPL stays smooth on the same console while wOPL/official/RiptOPL (all post-rewrite SDKs) do not.src/pad.cis byte-identical between uOPL and official OPL — the app source was never the differentiator.This branch builds sio2man in-tree from pinned SDK source (
modules/sio2man/, upstream style kept verbatim — the whole local patch is ~40 lines, see PROVENANCE.md) with one change: the transaction holder is boosted to priority 24 between acquire and release, restoring the retired worker thread's scheduling guarantee without changing the API — mmceman's hook and post-PR#862 mx4sio keep working, unlike a straight module revert.Includes the Debug-HUD miss counters but NOT the repeat-pause — so the HUD shows directly whether this module drives the miss rate to ~0.
Tester instructions (zackcage6)
PAD miss:stays at/near 0 even while navigating hard with art loading. Falsified if misses climb like on stock while D-pad still hangs.Relationship
A = amplifier fix (EE-side, stock sio2man). C = KrahJohlito's 2023-module confirmation build. If C fixes the D-pad and B does too → ship B (+A) clean. If C fixes it and B doesn't → the ceiling theory is wrong; the 2023-vs-new delta gets a deeper look.
🤖 Generated with Claude Code