feat(libSceFreeTypeOt): resolve FT_Stroker_ExportBorder and FT_Stroker_ParseOutline #17772

Merged
zkiller1236 merged 1 commit from upstream-pr/17772 into main 2026-11-12 06:58:44 +00:00
zkiller1236 commented 2026-11-09 15:27:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by zkiller1236 on 2026-11-09T15:27:36Z.


What

libSceFreeTypeOt exported NIDs 7cIS2cFG3PE and RvFx7dv9ThU as throwing placeholders (sceFreeTypeOtStrokerExportBorder, sceFreeTypeOtStrokerParseOutline). tools/nid_names.py shows those NIDs are exactly FT_Stroker_ExportBorder and FT_Stroker_ParseOutline, which libSceFreeType already implements. The module's other stroker exports (FT_Stroker_New, Done, Set, GetCounts, GetBorderCounts, BeginSubPath, …) already reach those libSceFreeType wrappers, as the "Forwarded FreeType exports" debt entry describes.

  • Linux and macOS: the two placeholders are removed, so the NIDs resolve through the module's existing libSceFreeType dependency like the other stroker exports.
  • Windows: ForwardExports.cpp gets two typed thunks with the same NIDs, mirroring the existing stroker thunks.

FT_Stroker_Export (2rcvKZfm5rI) is left as it was; #17580 implements it separately. The debt entry now covers the two exports: their prototypes are assumed to be FreeType's, which are the same from 2.4.11 (the provider's dated version) to the bundled 2.15.0; output is bundled 2.15.0's and is not compared with a console; and on Windows FT_Stroker_ExportBorder throws for a non-null stroker and outline, as the libSceFreeType wrapper already does with a 32-bit native FT_Pos.

Tested

Linux x86-64, GCC, Release with BUILD_TESTING=ON, on main ffe575754a.

  • guest_freetype_ot (raw .prx, names) and guest_freetype_ot_patched (patched .prx, NIDs) pass. The test gains Strokers(): it creates a library through the module's FT_Init_FreeType, strokes an 8-point, two-contour outline with a conic point both closed and open, and compares ParseOutline (including a null outline), the left and right border counts, and every exported point, tag and contour against host FreeType. With a 32-bit FT_Pos it instead expects ExportBorder to throw. On Windows the stroker checks run only in patched mode, because the raw DLL does not export the libSceFreeType names.
  • Negative control: with main's Export.cpp, guest_freetype_ot_patched aborts with sceFreeTypeOtStrokerParseOutline_nid_no_patch not implemented. Raw mode on Linux resolves by name through the libSceFreeType dependency, so it does not exercise the change.
  • The 47 other guest_freetype* tests that were built pass.
  • check_conventions.py --base origin/main passes. pr_overlap.py reports no shared exports. It could not compare ten PRs that conflict with main; their diffs do not touch these NIDs, except that #17580 rewrites the same debt line, which is a text conflict only.
  • Reviewed before opening by a separate AI reviewer (Claude Sonnet). Its findings are applied: the Windows ExportBorder throw is disclosed and tested, and the Windows raw-mode guard is in the commit.

Windows was not built here; PS5/title execution is untested.

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

Claude Code assisted with the investigation, implementation, tests and review.

🤖 Generated with Claude Code

https://claude.ai/code/session_0145C1bggApen1Stz87XDkXo

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5226391720 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17772). Originally posted by [zkiller1236](https://github.com/zkiller1236) on 2026-11-09T15:27:36Z. --- ### What libSceFreeTypeOt exported NIDs `7cIS2cFG3PE` and `RvFx7dv9ThU` as throwing placeholders (`sceFreeTypeOtStrokerExportBorder`, `sceFreeTypeOtStrokerParseOutline`). `tools/nid_names.py` shows those NIDs are exactly `FT_Stroker_ExportBorder` and `FT_Stroker_ParseOutline`, which libSceFreeType already implements. The module's other stroker exports (`FT_Stroker_New`, `Done`, `Set`, `GetCounts`, `GetBorderCounts`, `BeginSubPath`, …) already reach those libSceFreeType wrappers, as the "Forwarded FreeType exports" debt entry describes. - Linux and macOS: the two placeholders are removed, so the NIDs resolve through the module's existing libSceFreeType dependency like the other stroker exports. - Windows: `ForwardExports.cpp` gets two typed thunks with the same NIDs, mirroring the existing stroker thunks. `FT_Stroker_Export` (`2rcvKZfm5rI`) is left as it was; #17580 implements it separately. The debt entry now covers the two exports: their prototypes are assumed to be FreeType's, which are the same from 2.4.11 (the provider's dated version) to the bundled 2.15.0; output is bundled 2.15.0's and is not compared with a console; and on Windows `FT_Stroker_ExportBorder` throws for a non-null stroker and outline, as the libSceFreeType wrapper already does with a 32-bit native `FT_Pos`. ### Tested Linux x86-64, GCC, Release with `BUILD_TESTING=ON`, on `main` ffe575754a. - `guest_freetype_ot` (raw `.prx`, names) and `guest_freetype_ot_patched` (patched `.prx`, NIDs) pass. The test gains `Strokers()`: it creates a library through the module's `FT_Init_FreeType`, strokes an 8-point, two-contour outline with a conic point both closed and open, and compares `ParseOutline` (including a null outline), the left and right border counts, and every exported point, tag and contour against host FreeType. With a 32-bit `FT_Pos` it instead expects `ExportBorder` to throw. On Windows the stroker checks run only in patched mode, because the raw DLL does not export the libSceFreeType names. - Negative control: with `main`'s `Export.cpp`, `guest_freetype_ot_patched` aborts with `sceFreeTypeOtStrokerParseOutline_nid_no_patch not implemented`. Raw mode on Linux resolves by name through the libSceFreeType dependency, so it does not exercise the change. - The 47 other `guest_freetype*` tests that were built pass. - `check_conventions.py --base origin/main` passes. `pr_overlap.py` reports no shared exports. It could not compare ten PRs that conflict with `main`; their diffs do not touch these NIDs, except that #17580 rewrites the same debt line, which is a text conflict only. - Reviewed before opening by a separate AI reviewer (Claude Sonnet). Its findings are applied: the Windows `ExportBorder` throw is disclosed and tested, and the Windows raw-mode guard is in the commit. Windows was not built here; PS5/title execution is untested. <!-- 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 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes Claude Code assisted with the investigation, implementation, tests and review. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0145C1bggApen1Stz87XDkXo
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!17772
No description provided.