feat(libc): export the money_get facet vtable as data #12511
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12511"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-28T16:42:01Z.
What
Export
money_get<char>'s vtable (NID3n3wCJGFP7o) as eight zeroeduintptr_tslots so titles that resolve it as data get a 64-byte object matching console titlelibc.prx(PPSA26344). Facet calls through the slots still fault until methods are wired (debt note).Stacked on #12510 (
time_putvtable). Tip includes that commit soGuestLocale.cpp/docs/dev/debt/libc.mdkeep both tests and debt entries. #12518 (money_put) stacks next.Tested
guest_locale_tests— passed (Windows MinGW).python tools/check_conventions.py --base upstream/main— passed.3n3wCJGFP7ois STT_OBJECTst_size64 in PPSA26344sce_module/libc.prx(dynsym via PT_DYNAMIC; FTP from the console).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)Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-28T21:11:16Z.
Review: COMMENTED
Reviewed exact head
f2e5b8ca07(which contains #12510d1571b8973). It merges cleanly onto main319621ba2e. This is the first run on macOS (arm64, Apple clang, ASan+UBSan and a plain -O1 build).Setup. I built
LocaleSupport.cpp,ApplicationHeap.cppandGuestLocale.cppstandalone. Leaf symbols were shimmed:__errorreturns hosterrno,_Znwm/_ZdlPvuse malloc/free, andsnprintf/strftimeforward to the host. Everything else aborts. Every check throughCheckMoneyGetVtableObjectpasses, including both new ones. The laterCheckTimePutfails identically on main, because my shim forwards to macOSstrftime(%k), so it is not caused by this PR.NIDs.
tools/nid_names.compute_nidgivesOwfBD-2nhJQfor_ZTVSt8time_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEEand3n3wCJGFP7ofor_ZTVSt9money_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE. Both match the body and the debt lines. 7×8 = 56 and 8×8 = 64 match the quotedst_size. I did not re-measure the console.Mutants (array size in
LocaleSupport.cpp; the test'sexterndeclaration is unchanged):The PR's point is the
st_size(56 / 64 bytes), but the new tests never check it. A larger object always passes. A smaller one is only caught under ASan, because the test's ownextern ...[7]/[8]declarations fix the iteration count regardless of the definition.num_put<char>in the same file already avoids this withkNumPutCharVtableSlots+static_assertinGuestLocale.hppand asizeofcheck in the test.Suggested diff. This follows the
num_putprecedent; conventions pass:With it, all four size mutants fail at compile time in both builds (the definition and the shared declaration conflict), and the unmutated head still passes. The same pattern would apply to #12518's
money_putnext in the stack.Gates:
check_conventions --base upstream/mainclean on head and with the diff;git merge-treevs319621ba2eclean.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T05:15:50Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The rebased stack now includes a compile-time slot-count/size contract and the object test that was previously missing, but the checklist still uses
Unblocksfor the next PR rather than a title bring-up.What I ran
470a5c88c53f3bd5ad2a71f1da82d52a6d15621dagainst currentmain52c09d567d2fa453494dd720fcf53a98149468e4.git diff --checkfor the exact-head diff.guest_locale_testsand conventions passed on the updated Windows MinGW stack tip; current conventions, eligibility, labels, report, Ubuntu/Windows relinker, Ubuntu register-context and relinker ASan pass. Linux product tests are skipped; macOS jobs are queued.kTimePutCharVtableSlots/kMoneyGetCharVtableSlotsconstants andstatic_asserts, plussizeofchecks for both writable objects.Results
f3845236258f29585d1a0c38b96b40da8eca98eeguest_locale_testspassed on the updated Windows MinGW stack tipRaw output
Negative control
Findings
Blocking
Unblocks: #12518, but that is the next PR in the stack, not a title ID and Game bring-up discussion for a measured title stop or wrong result. CONTRIBUTING requiresUnblocks: PPSA... #...for such a title-specific fix, andnoneotherwise. Please set this field toUnblocks: none; the stack order is already captured byDepends on: #12510and the PR body.Non-blocking
Sources
Not verified
guest_locale_testslocally or independently inspect the console ELF measurements. macOS jobs are queued and Linux product tests were skipped.To get this to a good state
Change the checklist to
Unblocks: none. The current-main rebase and the added size contract address the previous technical concern.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T05:37:32Z.
Review: APPROVED
Re-checked — approved
The checklist now uses
Unblocks: none; the dependency on #12510 remains correctly declared, and the stack position is unchanged. The current stack test report and the previous macOS review support the implementation and layout.What I ran
470a5c88c53f3bd5ad2a71f1da82d52a6d15621dagainst currentmain52c09d567d2fa453494dd720fcf53a98149468e4and its declared base #12510.git merge-tree --write-treeandgit diff --check.Results
git diff --checkUnblocks: none; dependency on #12510 retainedguest_locale_testsand conventions passed on the stack tip containing this head; an independent macOS review reported its focused layout/object checks passed on the prior stack headI did not run a local build. The stack-specific focused evidence and resolved checklist blocker are sufficient for approval; queued checks are not represented as completed.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T04:21:02Z.
Review: APPROVED
Reviewed — looks good
The
money_get<char>export adds the documented 64-byte placeholder alongside the earliertime_put<char>entry, with matching test coverage and debt documentation.What I ran
Reviewed head
8c1c5dca13ce745ae2adde1675a69c93c9b8e91dagainst current main5ecef095b61e7a406b279c97896f3a8a6fbd6353; merge preview tree7a01089e490359b7bb0bb7fc56004f8877a24f3c.Results
Not verified
I did not run a local build/test or independently inspect the console image. The title-image symbol-size evidence and MinGW test result are reported by the author. This PR depends on #12510 and is ordered after it.