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

Merged
santhoshkumar-dev merged 10 commits from upstream-pr/9802 into main 2026-10-27 08:06:46 +00:00
santhoshkumar-dev commented 2026-10-22 15:37:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by santhoshkumar-dev on 2026-10-22T15:37:55Z.


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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4970017011 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9802). Originally posted by [santhoshkumar-dev](https://github.com/santhoshkumar-dev) on 2026-10-22T15:37:55Z. --- ### 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](https://github.com/freetype/freetype/blob/42608f77f20749dd6ddc9e0536788eaad70ea4b5/src/base/ftbbox.c), with the name confirmed in the [PS5 3.20 inventory](https://github.com/DNNDHH/PS5-3.20_Libs/blob/b2a77c09cd71c01f34c790cfbe98c751a13262ad/libSceFreeTypeOt.c). 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. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
MarcZX10 commented 2026-10-22 16:12:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T16:12:17Z.

Review: DISMISSED


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5617313832 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9802#pullrequestreview-5617313832). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T16:12:17Z. **Review:** DISMISSED --- 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.
MarcZX10 commented 2026-10-22 16:53:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T16:53:44Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5617823103 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9802#pullrequestreview-5617823103). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T16:53:44Z. **Review:** COMMENTED --- 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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!9802
No description provided.