feat(libSceFreeType): implement the legacy integer square root #11878
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11878"
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 santhoshkumar-dev on 2026-10-27T11:11:10Z.
What
Add
FT_Sqrt32(C7N2GuwqTA0) to the physicallibSceFreeTypeadapter. Its signed 32-bit argument is interpreted as unsigned input bits, and its result is the integer floor square root. A bounded integer search uses 64-bit products for all input bit patterns.The name/NID is in the PS5 3.20 inventory. The interface and unsigned interpretation follow legacy FreeType 2.4.12 ftcalc.h and ftcalc.c. Console ABI/arithmetic equivalence is unverified and recorded in debt.
The matching OT inventory helper is named and declared in the public header reachable through its umbrella. Its existing no-parameter placeholder, explicit NID alias and throwing behavior remain; this is not an OT-provider implementation or a claim about its console prototype. Implementation and tests include the canonical square-root header.
Merge order: #11613 first, confirmed by its author. Its removal of the neighbouring OT sine stub conflicts textually with identifying the square-root helper. No code from that PR is included and there is no functional/build dependency. A rebase will be needed after it merges. The author of #12370 has committed to hold that inventory PR until this PR lands and rebase afterward; I confirm the order #11613 → #11878 → #12370. The earlier #9465/#10897 debt-file conflicts were rechecked at their newer heads on October 29; the results below supersede the old conflict report. No confirmation from those two authors has been received.
Tested
Submitted and tested head
576c7ed4d8d5c70e83f5de2086371fdeee1cc94d, including upstream main61e96fecbd6df49dfd56d50bfa212cd14c84a95a.Windows 11 x64 / WinLibs GCC 15.2.0 r7 and local Ubuntu 24.04.1 x86-64 under WSL2 / GCC 13.3.0 / glibc 2.39: Ninja Release, bundled dependencies,
BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=OFF. On each platform the completelibstarget and selected executables build, and 70/70 CTests pass, zero skips: public-header audit, all 64 header compilation batches, both square-root export modes, base/charmap checks and the packaged-library loader.The feature fixture resolves the actual unpatched symbol and packaged NID separately. Each mode checks 262,143 cases: boundaries for every one of the 65,536 square-root intervals and 65,536 deterministic samples checked against square inequalities. This includes signed-negative bit patterns. Regression-only head
d015ec968ce728eb5901e897e58e1dc2f4da7e49reproduced the missing unpatched entry before implementation.No full application/test-suite, macOS, title or physical-console run is claimed.
The published implementation head is unchanged. On October 29, upstream
4c7d275bef89d309313d16bc2bc05d37a1b50be2merges cleanly with it. This is a merge-tree check, not a fresh build or runtime validation of that composition. #11613 remains a declared textual ordering dependency.Refreshed whole-branch checks use private integration
c0d3470ce52526c28fdb23d54aab171cadb4d760(parents: upstream4c7d275bef89d309313d16bc2bc05d37a1b50be2and this published head). #10897 head39e096c534b2ccd77ab93b0e364de4a3cf64bb9bmerges cleanly with both main and this integration. #9465 head7f3a3a3f39b0fa44fd0171dc0418ce16c3e3d8f5conflicts in exactlylibSceFreeType/CMakeLists.txtandinclude/Api.hppagainst both: those conflicts are inherited from main. Neither comparison now conflicts indocs/dev/debt/libSceFreeTypeOt.md, which this PR does not modify. #11613 and #12370 still conflict with this integration inlibSceFreeTypeOt/Export.cpp; the confirmed landing order above covers those conflicts. Earlier individual-file checks were insufficient to establish whole-branch mergeability. Reviewer reassessment of the older #9465/#10897 ordering request is pending; no author agreement is claimed.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 MarcZX10 on 2026-10-27T12:14:19Z.
Review: CHANGES_REQUESTED
The integer square-root implementation and tests are well scoped. The unsigned reinterpretation matches FreeType 2.4.12's
FT_Sqrt32contract, the search bound covers the fulluint32_tdomain, and the tests cover every square interval boundary plus deterministic samples. I found no implementation defect in the reviewed code.Changes requested — contribution ordering/overlap. The body says the four shared files with #9465 and #10897 merge cleanly, but I independently ran
git merge-treefor this head against both current PR heads. Both combinations conflict indocs/dev/debt/libSceFreeTypeOt.md: this PR replaces the unidentified-export-count entry with provider-specific import-resolution wording, while #9465/#10897 update the count and identified-name list. Please coordinate an agreed order with those PR authors and declare it inDepends on; correct the claim that these combinations merge cleanly. The declared #11613 dependency also has a real conflict inlibSceFreeTypeOt/Export.cpp, which your description already identifies and correctly says needs a rebase after it lands.The hosted Windows job and conventions, intake, labels, and report checks pass. The Linux product job is skipped by repository path policy. No code change is required for the implementation finding above, but the shared debt entry and ordering need to be made reviewable before merge.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T10:06:49Z.
Review: APPROVED
Rechecked the exact unchanged head
576c7ed4d8d5c70e83f5de2086371fdeee1cc94after the coordination updates. The #11613 → #11878 → #12370 order is recorded and confirmed by the relevant authors; #10897 reports no ordering requirement. The refreshed whole-branch comparison shows the #9465 conflict is the same with or without #11878, so it is not a new overlap introduced by this PR. Current main has a clean merge preview with this branch, andgit diff --checkpasses. Hosted Windows, conventions, intake and report checks pass; Linux product tests are skipped. I did not rerun the C++ suite locally. The implementation finding was already clear, and the outstanding coordination point from my prior review is resolved. Approved, with the declared #11613 dependency still governing merge order.Pull request closed