feat(freetype): implement font table validation #10897
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10897"
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 HSNADM on 2026-10-25T08:15:25Z.
What
Add FT_OpenType_Validate/Free, FT_TrueTypeGX_Validate/Free and FT_ClassicKern_Validate/Free through the existing guest face adapter. Enable the bundled FreeType gxvalid and otvalid modules so validation checks the tables and returns allocated table copies that the matching Free calls release.
The six exports are listed in the PS5 3.20 libfreetype symbol table. Signatures and behavior follow bundled FreeType 2.13.3; console equivalence remains unverified and is recorded in technical debt. No game compatibility is claimed.
The four identified validator helpers in libSceFreeTypeOt retain their explicit inventory NIDs and throwing provider-specific placeholder behavior, with one declaration each in the provider umbrella.
Tested
Latest revision
53011a03a74955e229f6f6350818c71e0f72cd5d, merged withmainat1f2c1da1fb:-Wall -Wextra -Werror: repeated umbrella inclusion, the four actual provider definitions with-Wmissing-declarations, and the complete provider translation unit with its umbrella included all pass. Each of the four names has exactly one public-header declaration. Their no-argumentintplaceholder signatures are preserved._nid_no_patchhelpers, so the explicit count and compiler checks above cover these four functions.git diff --check origin/main...HEADpass. Hosted conventions and labels checks pass on this revision.Earlier runtime evidence, before subsequent main merges:
f8a3347: full library build and NID patching; 368 patched libraries loaded; all 13 focused FreeType/loader tests passed. Validator fixtures cover valid, malformed and missing OpenType, GX and classic kern tables, flags, null inputs, output lengths and matching deallocation, compared with native FreeType. System builds without validator modules check Unimplemented_Feature.689971fa6c: Ubuntu 24.04, GCC 14, bundled recursive submodules; fulllibstarget andguest_freetype_validation_testsbuilt, andguest_freetype_validationpassed. Source/toolchain and configure/build/CTest logs are in the linux-freetype-evidence artifact. This does not claim the complete CTest suite passed.427dd36164; removing the validator module configuration makes the validation test fail in all three control runs.The latest main-merge revision has compiler/header validation, not a new full runtime build. No PS5 hardware or title testing; no game compatibility claim. Console signatures and behavior remain unverified in debt.
Checklist
Based on current
main; no other open PR implements the same functionsOne 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 fileNo notes, investigation
.mdfiles 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
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T10:19:46Z.
Review: APPROVED
I reviewed the exact head
f8a3347ae8c321ff72b8976ec18ffe8c265a98be, including the six wrappers, bundled FreeType module registration, error/output ownership paths, regression cases, and debt entry. The wrappers delegate to the corresponding FreeType validators and free functions using the host face associated with the guest face. The bundled build includesgxvalidandotvalidand registers both; the system-dependency path explicitly tests the absent-module behavior. The exact-head diff check andpython3 tools/check_conventions.py --base upstream/main --head upstream/pr-10897pass. The PR reports a native Windowsguest_freetype_validationrun; no Linux runtime was reported or independently run here, and the hosted checks shown are policy checks rather than runtime builds. The remaining console signatures and behavior are appropriately recorded as unverified in the debt entry. I found no blocking issue.Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T20:01:22Z.
Review: COMMENTED
Correction (2026-11-01): this review's claim that maintainers close PRs without a title ID is wrong. CONTRIBUTING allows
Unblocks: none; a title is only required when the PR fixes a title. The technical points below are unaffected.No title evidence, and it widens the bundled FreeType build. The template says
Unblocks: none, and the body says "No PS5 hardware or title testing; no game compatibility claim". There is no title ID and no log line showing a title reachingFT_OpenType_Validate,FT_TrueTypeGX_ValidateorFT_ClassicKern_Validateon main. That is the shape that gets closed.It also compiles
gxvalid.candotvalid.cinto the bundledfreetypetarget and generates a replacementftmodule.hviaFT_CONFIG_MODULES_H(file(GENERATE ...)in the CMake change), which changes the module list of the bundled library, not just these six exports. Please show a title that needs them before taking on that build surface.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T09:02:22Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
254b59f30085d6961ee15ea57518cbdc945056f4, basemain.repo_read.py search,repo_read.py cat) for the face helper, the GX header macro and theNotImplemented_nid_no_patchuses.Results
libSceFreeTypeOt.hpp53011a03Findings
Blocking
Non-blocking
docs/dev/debt/libSceFreeTypeOt.md:3: the list readsFT_Vector_Polarize FT_Vector_From_Polar, FT_OpenType_Validate/Free. The word "and" is missing beforeFT_Vector_From_Polar, as it was in the previous line.core/libs/prx/libSceFreeType/CMakeLists.txt:55: the newif(BUILD_TESTING)block sits betweentarget_link_librariesand the remainingtarget_sourcescalls. Moving it below them would keep the file easier to scan.Sources
Not verified
FT_OpenType_Free,FT_TrueTypeGX_FreeandFT_ClassicKern_Freebehave when the owner face is null.Validation.cpp:18passes a null host in that case. The testInvalidcalls them with a null face; the author reports it passes.53011a03. The head is254b59f3, which the author describes as having compiler and header validation only.freetype-validation-modules.h(rootCMakeLists.txt, lines 690–696) includesftmodule.hcorrectly in a bundled build. Not verified without the submodule.To get this to a good state
Nothing is required.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.