Repository navigation
feat(libs): finish the CesCs conversions and the AudioOut, AudioIn and GameUpdate exports - #6170
Conversation
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
A title reaches Its only Sys carrier is the one this PR implements, AI-assisted: yes |
|
Cross-validation on Windows 11 Pro 26220, NVIDIA RTX 4070 (596.21), MinGW GCC 15.2, PR head 13a54c3 merged on main 8276a1d: Surround Sound Studio (PPSA99051), catalog 01.000.003, relinked with
On With the PR, the title's own log ( The panel shows "Playing - check your receiver" and then "Finished" with 1080 bursts, 0 errors, 5.4 s. The clip is 6.1 s at 2112 kbps, so the 192 kHz pacing holds. The title does not import libSceCesCs, so the CesCs half is covered by tests only. Tests (merged tree):
Conversions checked against public tables:
Findings:
Written with Claude Code assistance. |
|
FYI from #6380, which I closed as a duplicate of this one. Two things in it that you may want here, if useful:
|
|
Thanks all — the GameUpdate test gap is fixed in 2b8930f, and the size checks are in as suggested. @Kurenaiiiii Right, I missed the test update #5919 pairs with the same Export.cpp change. 2b8930f now asserts @screamm Thanks for the cross-validation, especially the PPSA99051 run — good to see the full Sys path ( @Capmare Good suggestions, both are in 2b8930f: compile-time size checks for the mastering states structs ( @DavidSamir Thanks for the PPSA99051 pointer — that's the same title screamm used, and with this branch it now gets past Verification on the merged tree (Linux x86-64, GCC 15.2-equivalent toolchain, relinker-only build 169/169): |
|
Re-validation of 2b8930f merged on main 44df216 (Windows 11 Pro 26220, RTX 4070 596.21, MinGW GCC 15.2). The new head changes only two test files, so this covers those and the title.
Written with Claude Code assistance (validation by a subagent, reviewed in this session). |
|
Additional Windows boundary coverage for the CesCs portion of head 2b8930f, complementing the existing mapping/title reports. I compiled the unchanged Export.cpp as its own translation unit with the upstream headers and called the actual APS5_VABI exports. The original GuestCes.cpp passes. A separate harness uses Python 3.12.14 euc_jp as an independent oracle and passes 267,457 assertions:
WinLibs GCC 15.2r7 UCRT, C++20, -O2 -static, native Windows. Original test: 0.125 s; boundary harness: 0.110 s. No defect found in these checks. Reproducer, oracle generator, source hashes and exact results are attached. Limits: direct native source tests only; no full CMake build/CTest, PRX packaging/NID patching/dynamic module loading, audio, console/title, GPU/FPS, Linux/macOS or current-main composition. This is additional review evidence, not validation of all 18 implementations or console behavior. No production changes. AI-assisted: OpenAI Codex. |
|
Thanks @simonbronk — that is a thorough boundary pass, and the euc_jp oracle is a stronger independent reference than the table-driven checks we used while writing the conversions. For the record, your results line up with what the in-tree tests pin:
No action items from this side — the harness and results archive are good evidence for the mapping portion of the PR. |
Progress report (f03a2da → 827df2d)📈 System libraries: 90.68% (+0.44%, +17 implemented functions) ✅ 17 implemented
⚪ 1 behaviourally empty (constant return or throw)
|
…d GameUpdate exports libSceCesCs goes to 17 of 17: three-byte EUC-JP JIS X 0212 (0x8F) characters convert through a table read from the Unicode consortium's JIS0212.TXT, both directions, so sceCesEucJpToUcs2, the MbcsStrTo* and *Get*Len forms and the context conversions accept them, and a character with cells in both JIS X 0208 and JIS X 0212 still encodes to the two-byte form. sceCesRefersUcsProfileCp1250 returns a profile with the Windows-1250 table of Microsoft's bestfit1250.txt, accepted by the SBC and context conversions. The AudioOut HDMI bitstream Sys family follows the Ex ports: SysOpen opens a port only for mode 5, the TrueHD MAT route EVO-PLAYER-PS5 reads from the firmware 12.70 mode tables, paced at 192 kHz with no host device; SysConfigureOutput accepts the observed HDMI MAT switch; SysClose closes a Sys port. sceAudioOut2MasteringGetState fills the states by states id with the descriptors KytyPS5 declares, SetParam answers a null parameter with the mastering invalid-API-parameter error, Set3DLatency follows KytyPS5's output validation (0x80268001 above 2, any user), SetSystemDebugState records the debug state id, and GetSpeakerArrayCoefficients returns the front pair KytyPS5 and prosper both return. sceAudioInOpen accepts param 0x10 as float mono like KytyPS5; HqOpen answers a longer grain or a lower rate with the invalid-size and invalid-frequency errors; AsyncOpen also accepts the 384-sample grain SharpProspero documents. sceGameUpdateGetAddcontLatestVersion answers a null entitlement label with 0x80412803, as prosper does.
…ing states layout guest_gameupdate still asserted the throw that sceGameUpdateGetAddcontLatestVersion no longer raises for a null entitlement label since it answers 0x80412803, so the test aborts; it now asserts the error, the same change boykopovar#5919 makes. The mastering states layout is pinned with compile-time size checks for the descriptors, the compressor and limiter states and both states structs, as boykopovar#6380 suggested.
…Close main replaced g_outputMutex with g_outputMutexes[], so the Sys close no longer compiled. Mirror sceAudioOutExClose: range-check the handle, lock its mutex. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
67e3da2 to
827df2d
Compare
|
Thanks @adriadam10 for taking this over — the rebase and the SysClose fix are exactly what the branch needed after main's Since the platform CI jobs are skipped for this fork PR, I compiled the head and ran the touched test set locally on
The range-check-then-lock order in |
What
Implements 18 remaining exports and takes the System libraries metric from 88.71% to 89.20% (
tools/progress.py: 3270/3686 → 3288/3686 at PR creation; re-measured on 2026-10-16main5d9dcc4: 3292/3706 → 3310/3706, 88.83% → 89.31%, the same +18 with no regressions; re-measured on 2026-10-17main673f740, after #5919 merged the same libSceGameUpdate null-label change: 3345/3732 → 3362/3732, 89.63% → 90.09%, +17 with no regressions — this branch's GameUpdate Export.cpp and test are now byte-identical tomain, so the PR carries the other three libraries only).Trajectory on
main673f740: 89.63% (3345/3732) → this PR: 90.09% (3362/3732, +17) → staged follow-up batch (+15): 90.49% (3377/3732).libSceCesCs 11/17 → 17/17
0x8F) characters now convert in both directions through a new table (JisX0212.hpp, 6067 of 8836 cells) read from the Unicode consortium's JIS0212.TXT — the same provenance style as the existing JisX0208.hpp (Microsoft CP932). This completessceCesEucJpToUcs2,sceCesMbcsStrToUtf8Str,sceCesMbcsStrGetUtf8Len,sceCesMbcsStrToUcs2StrandsceCesMbcsStrGetUcs2Len, and extends the reverse encoding: a character with cells in both X 0208 and X 0212 still encodes to the two-byte form, one only in X 0212 to the three-byte form.sceCesRefersUcsProfileCp1250returns a profile wired into the SBC and context conversions, with the Windows-1250 table of Microsoft's bestfit1250.txt — the same source the Cp1251 table documents (PPSA34501 needs this export to load).libSceAudioOut 39/49 → 47/49
sceAudioOutSysOpen,sceAudioOutSysConfigureOutput,sceAudioOutSysClose: the HDMI bitstream Sys family follows the Ex-port precedent — signatures and the TrueHD MAT mode 5 (a 768 kHz-labelled port of 1024 S16 8-channel frames consumed at 192 kHz) from EVO-PLAYER-PS5, whose carrier table reads firmware 12.70's own mode tables. Like an Ex port it has no host device:sceAudioOutOutputpaces it and drops the MAT bursts.sceAudioOut2MasteringGetStatefills the states by states id (1 default, 2 V2) with the compressor/limiter descriptors, andsceAudioOut2MasteringSetParamanswers a null parameter with0x80268201, both following KytyPS5.sceAudioOut2Set3DLatencyfollows KytyPS5's validation: an output above 2 returns0x80268001, every user id is accepted.sceAudioOut2SetSystemDebugStaterecords the debug state id and returns 0, as KytyPS5 does.sceAudioOut2GetSpeakerArrayCoefficientsvalidates the handle and count like the ambisonics call and returns the front pair at full gain, which both KytyPS5 and prosper return.libSceAudioIn 4/8 → 7/8
sceAudioInOpenaccepts param0x10as float mono like0x11, as KytyPS5 accepts both.sceAudioInHqOpenanswers a longer grain with the invalid-size error and a lower rate with the invalid-frequency error (KytyPS5 restricts the HQ path to 128 samples at 48 kHz; SharpProspero describes it the same way).sceAudioInAsyncOpenalso accepts the 384-sample grain, the largest SharpProspero documents for the low-latency path.libSceGameUpdate 7/7 — superseded by #5919
sceGameUpdateGetAddcontLatestVersion's null-entitlement-label0x80412803landed onmainthrough fix(libSceGameUpdate): return INVALID_ARGUMENT for null entitlement label #5919 with the same test assertion; this branch's version is byte-identical, so the GameUpdate files no longer appear in the merge diff. The third commit aligns this branch's debt wording with the merged one.New tests:
AudioOutSys.cpp(Sys open/pace/configure/close, Ex-port isolation),GuestCes.cppextended with the full 6067-cell X 0212 round-trip, Cp1250 vectors and context conversions,AudioOut2Latency.cppextended for the new validation and states layout, andGuestAudioIn.cppfor the new open behaviour.sceAudioInIsPadEmbeddedMicandsceAudioOutDeviceIdOpen/MasteringInitremain unimplemented with the debt entries updated accordingly.Tested
Linux x86-64, GCC 14.2.0. Relinker-only build: 172/172 ctest pass. The changed libraries' guest tests (GuestCes, GuestAudioIn capture with the SDL disk driver and no-device, AudioOut2Latency, the new AudioOutSys, and AudioOutEx as a regression check) were compiled with the same sources and include paths as their CMake targets and pass; the full CMake build cannot run in this environment (no root, missing libxrandr-dev and audio dev packages), so Windows, macOS and the remaining in-lib tests are not tested.
tools/progress.pyreports +18 implemented, no regressions. Not measured on a console; every reference used is named above and in the updated debt files.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)The branch is based on the fork's
main(an ancestor of current upstreammain); the changed files have no overlapping hunks with whatmainadded since, so it merges cleanly —python3 tools/debt_split.py resolvewas not needed. The previous #6143 (libSceIme) was closed to free the single open-PR slot of an author with no merged PRs; itssceImeOpenfilters now ride in the staged follow-up batch instead of a reopen. Splitting this batch further is impossible under that limit, and per-library follow-ups are welcome once it lifts. That follow-up batch (libSceHmd2 +6, libSceContentExport and libSceBluetoothHid to 100%,sceNpTrophy2GetRewardIcon,sceAudioOut2MasteringInitflags,sceImeOpen) is implemented, tested and conflict-free on the samemain, staged on the fork asfeat/hmd2-contentexport-bluetoothhid; it opens as the next PR the moment this one merges, landing the +15 → 90.49% of the trajectory above.The
needs rebaseconflict was only the libSceGameUpdate debt entry (both this branch and #5919 reworded the same line); 67e3da2 adoptsmain's merged wording, and the PR merges cleanly into currentmainagain.