Skip to content

feat(libSceFreeType): query exact outline curve bounds - #9802

Merged
oneandonlydean merged 10 commits into
boykopovar:mainfrom
santhoshkumar-dev:codex/freetype-curve-bounds
Oct 27, 2026
Merged

oneandonlydean merged 10 commits into
boykopovar:mainfrom
santhoshkumar-dev:codex/freetype-curve-bounds

Conversation

@santhoshkumar-dev

@santhoshkumar-dev santhoshkumar-dev commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What

Implement FT_Outline_Get_BBox for guest outlines using bundled FreeType's quadratic/cubic extrema calculation. Guest 64-bit coordinates are copied into owned native vectors; native output is written to a local box and widened on success. Inputs stay unchanged, empty outlines do not inspect their arrays, and errors preserve the output.

Signatures and calculations follow FreeType 2.13.3 ftbbox.c, with the name confirmed in the PS5 3.20 inventory. This computes curve extrema separately from the control-point box API in #9064.

Each implemented export is declared once in the canonical public API, included by the implementation and tests. The branch preserves the latest upstream PFR APIs and all merged FreeType features.

The named OT-provider import-resolution helpers also have one declaration each in the shared public API already reachable from the OT umbrella. Export.cpp includes that header. Their existing zero-argument placeholder signatures, explicit NID aliases and throwing behavior are unchanged; this does not establish the console prototypes.

The OT debt paragraph still overlaps #10897. Proposed documentation order: these helper-declaration updates first, then the validation PR retaining the generic pending-helper paragraph and its identified validation names. This order awaits the other author's confirmation; no code or build dependency is required.

The adapter belongs to physical libSceFreeType. Same-NID inventory stubs in the distinct physical libSceFreeTypeOl and libSceFreeTypeOt providers remain throwing helpers.

Tested

Submitted and tested head dc6395595c3a9589384786675c41e0ed185a3b7d, including upstream main 48c160c58b589157ebd94ebd53736a182f8303bf.

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 complete libs target and selected test executables build, and 69/69 CTests pass, zero skips: the public-header audit, all 64 public-header compilation batches and 4 focused runtime tests. The new upstream JPEG XR and updated SPIR-V dependencies use their pinned submodule commits. Focused runtime checks include this adapter, existing base/charmap APIs and the packaged-library loader.

Final upstream recheck: 88795ed44801fa719eb2df990cbe1f11a1f9bd81 merges cleanly; no FreeType/LibreSSL production, shared-header, test-registration or debt changes appeared after the tested base. Results remain pinned to the exact submitted head and its stated base.

Conventions, whitespace and all 15 pairwise merge checks across the six maintained PRs pass. Open/closed/merged history was rechecked; no replacement implementation was found. No title or physical-console execution is claimed.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Progress report (88795ed → dc63955)

📉 System libraries: 51.09% (-0.01%, +1 declared functions)

🆕 1 declared as stubs
Library Name
libSceFreeType FT_Outline_Get_BBox_nid_postfix

Changed libraries (implemented exports)

Library Before After Change
libSceFreeType 61/62 (98.39%) 61/63 (96.83%) -1.56 pp

@santhoshkumar-dev

Copy link
Copy Markdown
Contributor Author

@Ondra97 This implements FT_Outline_Get_BBox independently of the control-box and transform work. The overlap audit found no duplicate export or implementation overlap with #9329; the only confirmed conflict is where both debt paragraphs are inserted under Functional.

Proposed documentation order: #9802 first, then #9329 retains the curve-bounds entry when rebasing. There is no code/build dependency. If #9329 lands first, I will rebase this PR and place its debt entry alongside yours instead. Please let me know if another order works better.

The final Windows full build and 4/4 focused checks passed, including the large-coordinate overflow regression and 8,192 generated curves.

@Ondra97

Ondra97 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

@santhoshkumar-dev I agree with #9802 first, then #9329. I compared both current diffs: the shared change is the insertion under Functional in docs/dev/debt/libSceFreeType.md; the transform and curve-bounds implementations and tests are separate.

I have recorded #9802 on the Depends on line in #9329 as documentation merge order. After #9802 lands, I will rebase #9329 and retain both debt entries.

AI-assisted: yes.

@santhoshkumar-dev

Copy link
Copy Markdown
Contributor Author

Additional maintenance validation: this head was combined locally with the other pending FreeType/library contributions on main 093149c5bd. The full Windows build and all 14/14 FreeType, normal/NID protocol and packaged-library checks passed, with no implementation changes needed. Full integration details are recorded on #8286; the PR branches remain separate.

@santhoshkumar-dev

Copy link
Copy Markdown
Contributor Author

Confirmed: #9802 first, followed by #9329 with both debt entries retained. Thank you for recording the documentation dependency. The implementations remain independent.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 9465 docs/dev/debt/libSceFreeTypeOt.md L7
PR 10582 docs/dev/debt/libSceFreeTypeOt.md L7
PR 10591 docs/dev/debt/libSceFreeTypeOt.md L7
PR 10593 docs/dev/debt/libSceFreeTypeOt.md L7
PR 10594 docs/dev/debt/libSceFreeTypeOt.md L7
PR 10598 docs/dev/debt/libSceFreeTypeOt.md L7
PR 10600 docs/dev/debt/libSceFreeTypeOt.md L7
PR 10601 docs/dev/debt/libSceFreeTypeOt.md L7
PR 10604 docs/dev/debt/libSceFreeTypeOt.md L7
PR 10606 docs/dev/debt/libSceFreeTypeOt.md L7
PR 10609 docs/dev/debt/libSceFreeTypeOt.md L7
PR 10611 docs/dev/debt/libSceFreeTypeOt.md L7
PR 10613 docs/dev/debt/libSceFreeTypeOt.md L7
PR 10897 docs/dev/debt/libSceFreeTypeOt.md L7
PR 11426 docs/dev/debt/libSceFreeTypeOt.md L6-7

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.

Pull request Shared files not compared
PR 5021 core/libs/CMakeLists.txt
PR 7275 core/libs/CMakeLists.txt
PR 7622 core/libs/CMakeLists.txt
PR 8285 core/libs/CMakeLists.txt
PR 8650 core/libs/CMakeLists.txt
PR 9156 core/libs/CMakeLists.txt
PR 9162 core/libs/CMakeLists.txt
PR 9284 core/libs/CMakeLists.txt
PR 9293 core/libs/CMakeLists.txt
PR 9297 core/libs/CMakeLists.txt
PR 9302 core/libs/CMakeLists.txt
PR 9383 core/libs/CMakeLists.txt
PR 9571 core/libs/CMakeLists.txt
PR 10427 core/libs/CMakeLists.txt

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wrapper keeps guest arrays in owned native storage, preserves caller inputs, and defers writing the output until FreeType reports success. The bounded-curve arithmetic guard is supported by the documented overflow probe, and the test set compares 8,192 generated curves with native FreeType plus independent extrema and error/canary cases. I reviewed the bundled FreeType 2.13.3 ftbbox.c arithmetic and did not find a defect in the stated coordinate guard. Current-main conventions and git diff --check pass. The reported full Windows build and focused 4/4 tests are contributor-run; hosted product jobs are skipped.

One contribution-rule item remains: this branch is based on b7d1d47a5f, while current upstream/main is 8499ea52e571b0edfc1feecfd3f6b9944012b359 (8 commits ahead). The merge tree is clean, but CONTRIBUTING requires branches to stay up to date. Please refresh the branch and rerun the focused FreeType tests on that head before merge. I found the #9329 debt-entry order agreement recorded in both PRs and no additional blocker.

@santhoshkumar-dev
santhoshkumar-dev force-pushed the codex/freetype-curve-bounds branch from ebb5766 to 991061e Compare October 22, 2026 16:15
@santhoshkumar-dev

Copy link
Copy Markdown
Contributor Author

Final follow-up 991061e640 rebases onto main 8499ea52e5 and validates contour partitions before native decomposition: out-of-range, incomplete, duplicate/decreasing, or excessive contours now throw without writing output. This prevents malformed guest endpoints from indexing beyond the converted native point buffer. The rebuilt FreeType component/dependencies and packaged library pass all 3/3 focused FreeType checks, including the new malformed-partition cases. Earlier full-build and 14-test integration results remain labeled by their tested heads in the description.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rechecked the exact head 991061e6401f37882d3def52caa57c8ae26f9b8e against current main (11f976b27c16ed91633f00039dba5dfd97dd7cc1). The conventions check, git diff --check, and merge-tree check pass. The reported focused Windows tests and build are contributor-reported; I did not rerun them here because this VM has 432 MB free on / and no matching build artifacts, so a new build risks exhausting the filesystem. The hosted product build jobs are skipped. The earlier current-main request remains applicable: please rebase onto current main and rerun the focused FreeType tests on that head before merge.

@Ondra97

Ondra97 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

@santhoshkumar-dev I prepared and validated the current-main update requested by @MarcZX10. The inputs were PR head 991061e6401f37882d3def52caa57c8ae26f9b8e and upstream main 11f976b27c16ed91633f00039dba5dfd97dd7cc1. They merge cleanly, with all five PR files unchanged. No implementation or test changes were needed.

Independent validation on Windows 11 Pro 10.0.26300, Ryzen 9 7900X, 31.66 GiB RAM, RTX 4070 Ti SUPER; supported WinLibs GCC 15.2.0 r7, Ninja Release, bundled dependencies, BUILD_TESTING=ON:

  • Full all-target build passed with submitted sources and no overlay.
  • The three FreeType tests plus patched_libraries passed 4/4, zero skips. All 367 libraries loaded; the bounds test executed the 8,192 generated curves and malformed-contour rejection cases.
  • Conventions, whitespace, strict main-sync and registration passed (1,177 executables, none built and unregistered).
  • The feat(libSceFreeType): implement FT_Set_Transform #9329 debt-entry order is retained. The eight automatically uncomparable shared-CMake patches have distinct hunks from the appended CurveBounds.cmake include; I did not run joint builds with them.

The validated local merge is d8dfc3d2a00b1b7ff367b402293b40b2dc17740e, tree ef1056e75571ae6385a9995e06d590e4ed579bd0. It is local only: my account Ondra97 has READ access and push=false on your fork, so I cannot update this PR's branch or description.

Please merge the pinned upstream main into codex/freetype-curve-bounds and push the same branch. With those two pinned inputs, the clean merge should produce the tree above; a recreated merge can have a different commit hash. Please record the actual submitted head in Tested, attributing these results as independent local validation. No replacement PR is needed.

AI-assisted: yes (Codex ran the builds and tests above on my Windows host).

@MarcZX10

Copy link
Copy Markdown
Contributor

I saw the follow-up validation on main 11f976b27c and the clean merge-tree there. GitHub still shows this PR based on 8499ea52e5; current main is 6a6a35fdf5c2 (29 commits newer). Please update the branch to the current tip before merge and rerun the focused FreeType checks on that final head. The reported 4/4 and 3/3 test results are useful; the hosted product jobs are skipped.

@santhoshkumar-dev

Copy link
Copy Markdown
Contributor Author

@MarcZX10 Updated the existing branch to current main 1da03c6f34fcff493a5d09966fa30b4269b4da93; submitted head is ef05248c922b63e357abcf9c96b78dcc55acd0d6. The contribution source and tests are unchanged.

Fresh Windows 11 / supported GCC 15.2.0 r7 / Ninja Release validation on that final head: full default build passed, then 4/4 focused tests passed with zero skips (bounds, base FreeType, charmap and all 367 packaged libraries). The malformed-contour guard and 8,192 generated curves are included. Strict main-sync, conventions, whitespace and test registration pass. The description now records this actual submitted head.

Thanks @Ondra97 for the independent earlier full build and 4/4 run on 991061e640 plus main 11f976b27c. I attributed those pinned results separately; this update includes newer main and does not claim the older merge's tree hash. The agreed #9802-before-#9329 order is retained. New #9848 documentation coordination is recorded as pending author confirmation.

Ready for re-review of the current-main request; hosted product builds were not run here.

@Dom3005

Dom3005 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Linux run (the description lists Linux as not tested). Docker on Windows: Ubuntu 26.04, GCC 15, glibc 2.43, WSL2 kernel 6.6, Release, BUILD_TESTING=ON. Head ef05248 merged onto main fcd4558 (clean).

guest_freetype_curve_bounds passes 5 of 5 (--repeat until-fail:5). No baseline, since the export is new on main. No findings.

AI-assisted: yes

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed build docs prx labels Oct 23, 2026
@santhoshkumar-dev

Copy link
Copy Markdown
Contributor Author

Refreshed to f3da59fe87dfd33db0cde8bb260fc2d29522ced0 on fetched main e3d03fbae64e1b49e5d4e84e753ccce6edf60da5. All merged FreeType entries and registrations are retained; the implementation/fixtures are unchanged.

Full default Windows build and 4/4 focused CTests pass. Local Ubuntu 24.04.1/WSL2, GCC 13.3/glibc 2.39: complete libs build and 4/4 focused tests, each repeated three times, including the 368-library loader, pass. The body now separates these fresh local results from the earlier independent Linux report.

Newer main 74f6fa8e31 was checked immediately before publication: its FreeType source/test/debt files are unchanged, and this branch merges cleanly. No fresh title, console or macOS result is claimed.

@Dom3005 previously reported five successful Linux repetitions on ef05248c92 plus main fcd455870: #9802 (comment). The new Linux results here were run locally.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 23, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 25, 2026
@oneandonlydean
oneandonlydean dismissed MarcZX10’s stale review October 25, 2026 06:22

The branch was refreshed to f3da59f on main e3d03fb and the focused FreeType tests pass on that head on Windows and Linux.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@santhoshkumar-dev I found two review blockers. FT_Outline_Get_BBox has a definition and a test-local extern declaration, but no declaration in the checked public FreeType headers. Please add the declaration once in a public header reachable from libSceFreeType.hpp, include it in the implementation/tests, and remove the local extern.

The new tests also require the currently unsupported wide-coordinate paths to throw (the curved-coordinate loop and the narrow-native-FT_Pos branch). Please drop those unsupported-path throw assertions, keeping the production safety guards, debt, implemented extrema tests and argument-validation coverage. Please rerun public-header checks and guest_freetype_curve_bounds on the refreshed head.

@santhoshkumar-dev

Copy link
Copy Markdown
Contributor Author

@oneandonlydean Declare the curve-box export once in the canonical public API and include it in the implementation and tests; remove the test-local declaration. Remove assertions that unsupported wide curved coordinates or narrow host FT_Pos values must throw. Retain supported extrema, LP64 linear coordinates where native FT_Pos permits them, and argument-validation coverage.

Updated head: 379b8a550dd17796d1b2fa4fa5455ae7d41f541c; refreshed base: d5e493883f82816d212f734e135a45e88a2e05eb. Windows complete libs plus selected test executables built; local Ubuntu/WSL2 complete libs build pass. On each platform, 69/69 CTests pass with zero skips: public_headers, all 64 compile batches, and 4 runtime tests. Identified OT-provider placeholders retain their original NID aliases and throwing behavior.

Overlap note: #10897 implements different validation exports; the remaining shared change is the OT debt paragraph. When combining the branches, retain the generic pending-helper description and both sets of identified names. There is no function or build dependency.

@santhoshkumar-dev

Copy link
Copy Markdown
Contributor Author

Refreshed this branch onto main 48c160c58b589157ebd94ebd53736a182f8303bf without rewriting the published history. New head: dc6395595c3a9589384786675c41e0ed185a3b7d. All merged PFR/FreeType, LibreSSL and dependency changes are preserved.

Local Windows/WinLibs GCC 15.2 and Ubuntu/WSL2/GCC 13.3 complete libs builds pass. Each platform passes 69/69 selected CTests, zero skips: public_headers, all 64 header compile batches and 4 runtime cases. Conventions and whitespace pass; the six maintained branches also merge cleanly in all 15 pairings.

Applied the public-declaration clarification from #10897 to these named OT helpers too: sceFreeTypeOtOutlineGetBBox_nid_no_patch. They are declared once in the shared API reachable through the OT umbrella, and Export.cpp includes it. Existing placeholder signatures, NID aliases and throwing behavior are preserved; no unsupported-path assertions were added.

The OT debt paragraph still overlaps #10897; the proposed documentation order is being coordinated on #10178. It is not an agreed dependency yet.

@oneandonlydean
oneandonlydean merged commit 9bc2b99 into boykopovar:main Oct 27, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants