feat(libSceFreeType): implement vector and matrix geometry #9419

Merged
Felipebmaitan merged 5 commits from upstream-pr/9419 into main 2026-11-08 08:17:14 +00:00
Felipebmaitan commented 2026-10-21 21:20:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Felipebmaitan on 2026-10-21T21:20:12Z.


What

Implement FT_Vector_Transform (g1Rc0MQddG0), FT_Matrix_Multiply (SaJj4xMf2Sc) and FT_Matrix_Invert (TfB3QTQN-Ek) using the existing LP64 guest vector/matrix records. Products narrow operands and individual rounded results to signed 32 bits before 64-bit geometry combines them; inversion keeps unsigned 64-bit division intermediates on Windows. Multiplication snapshots both operands before storing, including self-aliasing. Null transform/multiply inputs are no-ops; null and zero rounded-determinant inversion returns FT_Err_Invalid_Argument without mutation.

Behavior follows bundled FreeType 2.13.3 ftcalc.c and ftoutln.c, with names/NIDs from the PS5 3.20 inventory. Console ABI/build options and wider-input results remain unverified in the library debt file.

Merged current main 1e658521a0a599872612bb91949311e2956b5283 into published head bf0c6fbdec42ab11d27307d87b53e2e8f716d5e1 without rewriting history; merge commit 3783a8441b6ceec05125d27788138d2fc5891657, followed by test compatibility fix 8caaba1dc3d066387047c48854cff5cb46b14b59. The first parent is the published PR head. The additive Api.hpp conflict retains both geometry and main's face-compatibility declarations; automatic CMake/layout/debt composition retains all upstream entries, including merged #9465. Changes over this main snapshot remain additions in the original seven geometry files. Geometry.cpp, the oracle arithmetic/case generation and watched shared-GuestArena helper are unchanged from bf0c6fbdec. The test output now declares whether a matching native reference is available: only LP64 FreeType 2.13.3 supplies the recorded native baseline. This avoids treating main's FreeType 2.15.0 wider-input differences as an adapter failure; all guest cases always run against the unchanged arbitrary-precision oracle. The library debt entry records this version difference. Main pins native FreeType 2.15.0; the adapter's recorded 2.13.3 behavioral baseline remains unchanged. #9848's native-export work is not integrated, and no other PR branch was changed.

Nov 7 PC verification preserved published head 8caaba1dc3d066387047c48854cff5cb46b14b59 and all published history/authorship by fast-forwarding the existing owner checkout; no source change, rebase or branch push was necessary. A clean git merge-tree with main 87473937d31ca4f64d819805b8f0c2b80ac55b53 produced tree e3f1cb03b9cd888728327b97676eda9bee62d26f: geometry source, oracle and watched helper are identical to the published head, while every upstream Api.hpp/CMake/debt line is retained. This is static composition evidence; the execution below tests the published head, not the synthetic merge tree. The resolved HostWrite discussion stays resolved. No #9410/#9848 source was integrated or edited. No functional dependency on either topic was identified; the #9848 owner also confirmed this for its linkage changes. The optional native comparison remains gated to compatible LP64 FreeType 2.13.3, and every guest case always runs through the independent oracle.

The direct assignments follow current conventions: ordinary CPU stores fault into the write watch. The native FT_MulFix call returns a scalar and does not fill the guest outputs. The resolved HostWrite discussion remains addressed.

Tested

Nov 7 Windows execution — exact published head 8caaba1dc3d066387047c48854cff5cb46b14b59. Native Windows x86-64, supported WinLibs MinGW GCC 15.2.0, Release, bundled FreeType 2.15.0. Refreshed clean archived head/pinned dependency sources inside the bound worktree, reusing only this thread's CMake build cache. Stock root configuration (BUILD_TESTING=ON, ANYPS5_RELINKER_ONLY=OFF) and selected actual FreeType/libc/libkernel/test/packager targets built with cmake --build ... --parallel 2; no source workaround, compiler aliases or omitted dependency. Existing submodule modifications were preserved and not used. Artifacts/logs remain in ignored directories.

  • Verbose CTest selection ^(guest_freetype($|_charmap$|_geometry($|_watched$)|_stroker$|_glyph$|_advances$)|windows_write_watch($|_verify_direct$)): 9/9 passed, 9.72 s. Includes 138,636 independent-oracle geometry cases, protected shared GuestArena output writes without skips/HostWrite guards, two Windows write-watch modes, advances, glyph, stroker, charmap and FreeType runtime controls.
  • Fresh copied libc/libkernel/FreeType package, repository NID packager and libc export-preservation list; separate Windows raw-NID loader: 138,636 oracle cases passed through all three geometry NIDs. Native geometry names remained hidden. The current test's native-reference flag is unavailable on this LLP64/2.15.0 build; no oracle cases are skipped. No native 2.13.3 LP64 execution is newly claimed on this PC.
  • Strict geometry syntax (-Wall -Wextra -Werror), standalone Api.hpp/umbrella compilation, public-header audit (406 libraries / 28,305 exports), and whitespace checks passed. Conventions: 0 errors, the existing 1,023-character debt-length advisory remains. Final conventions/whitespace checks use the refreshed main snapshot.
  • Official overlap script run in an isolated Git metadata cache under this worktree to avoid collisions with other owners' refs: 1,766 open heads / 1,765 external comparisons, exit 2 (fail-closed). It flags matching geometry export names in #16823, whose inspected paths are the distinct libSceFreeTypeOt library; that PR declares Depends on: #9410. The arithmetic owner was informed. This is not a functional dependency of this libSceFreeType implementation, and no contributor agreement or combined-runtime/import-routing validation is claimed. Incomplete shared-file comparisons remain for #10606, #10611, #10613, #10897, #12004, #12373, #13486, #14212, #16120 and #16636. No no-overlap or verified combined-composition claim is made.

No new macOS/Linux/title/PS5/sanitizer/full-product/full-suite run is claimed. These are stock Windows focused-library/test results. Prior macOS execution below is separately attributed to its date and head, including its focused-harness and stock-build limits. Reviewer re-review, hosted checks and unresolved cross-PR composition/routing coordination remain external gates; no contributor message or review-request notification was sent by this pass.

Previously reported Nov 3 macOS validation — same head 8caaba1dc3d066387047c48854cff5cb46b14b59 — macOS 27.0.1 (26A434), AppleClang 21.0.0, x86-64 through Rosetta, Release; clean archived final-head source plus pinned bundled submodules. No existing submodule changes were used or modified.

Stock root CMake configuration (BUILD_TESTING=ON, ANYPS5_RELINKER_ONLY=OFF) succeeded. The build produced libc and pinned FreeType 2.15.0, then stopped in unchanged upstream libkernel/Pthread/src/Thread.cpp:383,596: pthread_getattr_np and pthread_getcpuclockid are unavailable on macOS. This file is identical to main 1e658521a0a599872612bb91949311e2956b5283. No workaround was applied and no successful stock integration/full product build is claimed. The older NativeStat/shared-memory blockers below are historical; those files compiled in this run.

To finish useful validation, a temporary CMake harness under ignored build-nov03/ used the unchanged FreeType library CMakeLists/source/tests, the root-build FreeType archive and stock-built libc, omitting the unused libkernel link dependency. No source patch, compiler alias or implementation change was needed for this focused build:

  • ctest --test-dir build-nov03/focused -R '^guest_freetype($|_)' -E '(module_properties|memory_record_nid)' -V: 22/22 passed, 6.54 s. Includes all 138,636 oracle cases, watched geometry with no skip/HostWrite guards, upstream advances (#9465), glyph, stroker, face compatibility, outline storage and other registered neighboring adapter regressions.
  • Same current geometry test also compiled with the preserved pinned FreeType 2.13.3 LP64 native reference: 138,636 cases passed, including both guest-vs-oracle and native-vs-oracle comparisons. The current 2.15.0 test reports that this native reference is unavailable; no cases are dropped from the independent oracle.
  • Documented standalone x86-64 write-watch selection: 15/15 passed, 2.22 s (the ten collect/fresh/armed/register/mapped/host/empty/protection/overlaps/threads controls plus five backing modes).
  • Copied focused adapter and stock-built libc, changed the adapter's libc dependency to @loader_path/libc.prx before packing, applied the repository NID packager with libc export preservation and ad-hoc signed the copies. A separate x86-64 dlopen/dlsym loader resolved all three raw geometry NIDs and passed 138,636 oracle cases. The packaged memory-record regression also passed. These are focused-package results; libkernel/stock packaging remains blocked. Native geometry names remain visible on macOS, within #9848's distinct open scope; that branch was neither changed nor integrated. Module-property tests requiring the stock package were not run.
  • Public-header audit: 406 libraries / 28,305 exports; standalone FreeType Api.hpp/umbrella compilation and geometry -Wall -Wextra -Werror syntax passed. Geometry implementation, oracle arithmetic/case generation and watched helper preservation were checked against published bf0c6fbdec.
  • python3 tools/check_conventions.py --base origin/main with origin/main refreshed to the pinned upstream snapshot: 0 errors, one advisory debt-length warning (1,023 characters in this library's existing geometry entry after recording the native-version gap). Explicit pinned-main check also used; git diff --check 1e658521a0...HEAD passed.
  • Final tools/pr_overlap.py --branch fix/pr-9419-nov03 --repo boykopovar/AnyPS5 --jobs 2 was run in an isolated local Git repository after a shared-ref collision in the first attempt. It scanned 1,738 open heads (1,737 external comparisons). Its fail-closed external-conflict limits remain: #10897 shares the CMake source insertion line, and 19 conflicting external heads have incomplete shared-file comparisons. Fetched shared additions were inspected; no other geometry implementation was found. #10897 adds Validation.cpp, a separate implementation; no functional dependency or merge-order agreement is claimed. No no-change overlap comment was posted separately.

These results do not claim Windows/Linux/title/PS5/full-suite execution on this head. The next section preserves the Oct 30 Windows 7/7 and 138,636 packaged-NID evidence only for its original revision bf0c6fbdec42ab11d27307d87b53e2e8f716d5e1.

Historical Windows validation — bf0c6fbdec42ab11d27307d87b53e2e8f716d5e1 on main snapshot 1189ec3003672bb364dd9f3119ead7b3976e3c83: native Windows x86-64, supported WinLibs GCC 15.2.0, Release, bundled dependencies including main's FreeType 2.15.0 pin. A clean Git archive snapshot with pinned submodules was configured through the stock root CMake (BUILD_TESTING=ON, ANYPS5_RELINKER_ONLY=OFF); no source patches, compiler aliases or omitted link dependencies were used. Built only the actual FreeType/libc/libkernel libraries, selected tests and NID packager, with at most two compiler jobs. Artifacts are isolated under ignored build-maint/ in the bound worktree; existing submodule changes were preserved.

  • ctest --test-dir build-maint/win -R '^(guest_freetype($|_charmap$|_geometry($|_watched$)|_stroker$)|windows_write_watch($|_verify_direct$))' -V: 7/7 passed, 6.08 s. Geometry: 138,636 arbitrary-precision oracle cases. The protected shared-GuestArena output test passed without skips or HostWrite guards; both Windows write-watch modes, FreeType, charmap and upstream stroker tests passed.
  • Copied the newly built libc/libkernel/FreeType binaries and applied the repository NID packager with the libc export-preservation list. The independent loader resolved all three geometry NIDs and passed 138,636 cases with the unchanged oracle; native geometry names were hidden on Windows.
  • Strict geometry test syntax (-Wall -Wextra -Werror) and standalone FreeType Api.hpp/umbrella compilation passed. Public-header audit: 373 libraries / 14,010 exports, unique declarations and umbrella coverage passed.
  • python3 tools/check_conventions.py --base origin/main (using the documented Windows Python executable equivalent) and git diff --check origin/main...HEAD: passed. Original geometry source, oracle and watched-output test are byte-for-byte unchanged from 9f0ff98f59; every upstream Api.hpp line remains present.
  • Refreshed tools/pr_overlap.py --branch fix/pr-9419-review-feedback --repo boykopovar/AnyPS5 --jobs 2 against 1,432 open heads. The duplicate geometry row is this PR's old remote head. Other results concern shared insertion hunks/registrations; reported external FreeType additions were inspected for these geometry exports, with no additional implementation found. Incomplete comparisons remain for conflicting external heads (#9465, #10589, #10602, #10606, #10897); no clean combined composition, author agreement or merge order is claimed. No other PR branch was changed or integrated.

These are stock Windows focused library/build-test results, not an entire product/test-suite or title run. No new macOS/Linux/PS5/title/sanitizer run is claimed. The previous macOS 14/14 focused harness and its stock-build blockers are preserved below as historical evidence for 9f0ff98f59; they are not a successful stock macOS product build and are not rerun results for this head.

Historical focused macOS evidence — head 9f0ff98f59063f1af8d4ff7cd631c720faf48cf2: macOS 27.0.1 (26A434), AppleClang 21.0.0, x86-64 through Rosetta on Apple Silicon, Release. Clean Git archive snapshot and pinned bundled submodule sources; existing submodule changes were not used or modified. No repository source patches or changes from other open PRs were applied.

Historical macOS stock-build limitation at 9f0ff98f59. The supported full configuration succeeded, but libkernel File/src/NativeStat.cpp:132-137 uses st_atim, st_mtim, st_ctim, which macOS stat lacks. A diagnostic retry with compiler-only aliases -Dst_atim=st_atimespec -Dst_mtim=st_mtimespec -Dst_ctim=st_ctimespec then failed at File/src/SharedMemory.cpp:660, where the non-Windows path uses Linux memfd_create / MFD_CLOEXEC. At that historical revision, both files were identical to main facac6a4c52fa6e4bfb2b77ba98cab5e449555d4; both failures were reproduced with final-head sources. Neither issue is patched here. No successful stock full-build or full-runtime integration run is claimed.

A temporary focused CMake harness under ignored build-review/ used the unchanged FreeType library CMakeLists/source/test files, the pinned FreeType 2.13.3 archive built by the full configuration, and the built libc (from the diagnostic compiler-alias configuration). It omitted the unused libkernel link dependency so geometry and neighboring adapters could execute. These are focused source/runtime results, not a stock product build:

  • ctest --test-dir build-review/focused -R '^guest_freetype($|_geometry($|_watched$)|_charmap$|_bitmap$|_outline$|_charmap_info$|_outline_mutations$|_face_info$|_names$|_sfnt_names$|_list$|_request_size$|_stroker$)' -V: 14/14 passed, 4.48 s. Geometry: 138,636 arbitrary-precision oracle cases, all also matching bundled native LP64 FreeType. Watched geometry passed without skipping or HostWrite guards; null, alias and singular behavior preserved.
  • Documented standalone x86-64 macOS write-watch build: 10/10 passed, 0.49 s (collect, fresh, armed, register, mapped, host, empty, protection, overlaps, threads).
  • Copied the focused adapter and libc, set the adapter's libc dependency to @loader_path/libc.prx before NID patching, used the repository packager with the libc export-preservation list, and ad-hoc signed the copies. An x86-64 dlopen/dlsym loader resolved g1Rc0MQddG0, SaJj4xMf2Sc, TfB3QTQN-Ek and passed 138,636 cases through the unchanged oracle. This validates those exports of the focused package, not the blocked stock package. Native geometry names remain visible on macOS; #9848 handles symbol isolation separately and was not integrated or modified.
  • Public-header audit: 368 libraries / 12,993 exports, unique declarations and umbrella coverage passed. FreeType Api.hpp and umbrella compiled standalone for x86-64; geometry test syntax passed -Wall -Wextra -Werror.
  • python3 tools/check_conventions.py --base origin/main, an additional check against pinned main facac6a4c52fa6e4bfb2b77ba98cab5e449555d4, and git diff --check facac6a4c52fa6e4bfb2b77ba98cab5e449555d4...HEAD: passed.
  • Final python3 tools/pr_overlap.py --branch fix/pr-9419-geometry-integration --repo boykopovar/AnyPS5 --jobs 2: completed against 1,350 open PRs. The duplicate geometry export/new-file row is this PR's old remote head. Other incomplete comparisons involve conflicting external FreeType heads sharing CMake/header/layout/debt files; fetched additions inspected, distinct functions/build changes, no additional geometry implementation found. Mechanical composition remains unverified for those conflicting external heads; no author agreement or merge order is claimed. Depends on remains none for geometry implementation.

No Windows/Linux/title/PS5-hardware/full-suite run was claimed for historical head 9f0ff98f59. #9410, #9465, #9399 and #9848 were not changed.

Historical Windows evidence only — revision e7249365321f5ea2678a57f74af38893fa4fa329, not the current head:

Native Windows x86-64, WinLibs MinGW-w64 GCC 15.2.0, Release, bundled dependencies, ANYPS5_RELINKER_ONLY=OFF, BUILD_TESTING=ON. Built the actual FreeType/libc/libkernel libraries, three FreeType test executables, Windows write-watch test and NID packager with at most two compiler jobs. Build/source/runtime artifacts stayed inside this worktree's ignored build-review/ directory; clean snapshots of pinned submodules avoided pre-existing local submodule modifications.

  • ctest --test-dir build-review/win -R '^(guest_freetype($|_charmap$|_geometry($|_watched$))|windows_write_watch($|_verify_direct$))' -V: 6/6 passed, 7.24 s. Geometry checked 138,636 cases against the independent arbitrary-precision Python oracle, including null/error behavior, ties, signed 32/64-bit limits, multiplication order, aliasing and canaries. The protected shared-mapping regression passed without HostWrite guards.
  • Copied and NID-patched the newly built libc/libkernel/FreeType libraries with the repository's export-preservation procedure. A separate loader resolved all three raw NIDs and passed 138,636 cases using the same Python oracle. Native geometry symbols remained hidden.
  • Geometry test syntax check with -Wall -Wextra -Werror: passed. Public-header audit: 368 libraries / 12,372 exports, unique declarations and umbrella coverage passed.
  • python3 tools/check_conventions.py --base origin/main and git diff --check origin/main...HEAD: passed.

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:4958524401 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9419). Originally posted by [Felipebmaitan](https://github.com/Felipebmaitan) on 2026-10-21T21:20:12Z. --- ### What Implement `FT_Vector_Transform` (`g1Rc0MQddG0`), `FT_Matrix_Multiply` (`SaJj4xMf2Sc`) and `FT_Matrix_Invert` (`TfB3QTQN-Ek`) using the existing LP64 guest vector/matrix records. Products narrow operands and individual rounded results to signed 32 bits before 64-bit geometry combines them; inversion keeps unsigned 64-bit division intermediates on Windows. Multiplication snapshots both operands before storing, including self-aliasing. Null transform/multiply inputs are no-ops; null and zero rounded-determinant inversion returns `FT_Err_Invalid_Argument` without mutation. Behavior follows bundled [FreeType 2.13.3 ftcalc.c](https://github.com/freetype/freetype/blob/42608f77f20749dd6ddc9e0536788eaad70ea4b5/src/base/ftcalc.c) and [ftoutln.c](https://github.com/freetype/freetype/blob/42608f77f20749dd6ddc9e0536788eaad70ea4b5/src/base/ftoutln.c), with names/NIDs from the [PS5 3.20 inventory](https://github.com/DNNDHH/PS5-3.20_Libs/blob/b2a77c09cd71c01f34c790cfbe98c751a13262ad/libSceFreeTypeOt.c). Console ABI/build options and wider-input results remain unverified in the library debt file. Merged current main `1e658521a0a599872612bb91949311e2956b5283` into published head `bf0c6fbdec42ab11d27307d87b53e2e8f716d5e1` without rewriting history; merge commit `3783a8441b6ceec05125d27788138d2fc5891657`, followed by test compatibility fix `8caaba1dc3d066387047c48854cff5cb46b14b59`. The first parent is the published PR head. The additive Api.hpp conflict retains both geometry and main's face-compatibility declarations; automatic CMake/layout/debt composition retains all upstream entries, including merged #9465. Changes over this main snapshot remain additions in the original seven geometry files. Geometry.cpp, the oracle arithmetic/case generation and watched shared-GuestArena helper are unchanged from `bf0c6fbdec`. The test output now declares whether a matching native reference is available: only LP64 FreeType 2.13.3 supplies the recorded native baseline. This avoids treating main's FreeType 2.15.0 wider-input differences as an adapter failure; all guest cases always run against the unchanged arbitrary-precision oracle. The library debt entry records this version difference. Main pins native FreeType 2.15.0; the adapter's recorded 2.13.3 behavioral baseline remains unchanged. #9848's native-export work is not integrated, and no other PR branch was changed. Nov 7 PC verification preserved published head `8caaba1dc3d066387047c48854cff5cb46b14b59` and all published history/authorship by fast-forwarding the existing owner checkout; no source change, rebase or branch push was necessary. A clean `git merge-tree` with main `87473937d31ca4f64d819805b8f0c2b80ac55b53` produced tree `e3f1cb03b9cd888728327b97676eda9bee62d26f`: geometry source, oracle and watched helper are identical to the published head, while every upstream Api.hpp/CMake/debt line is retained. This is static composition evidence; the execution below tests the published head, not the synthetic merge tree. The resolved HostWrite discussion stays resolved. No #9410/#9848 source was integrated or edited. No functional dependency on either topic was identified; the #9848 owner also confirmed this for its linkage changes. The optional native comparison remains gated to compatible LP64 FreeType 2.13.3, and every guest case always runs through the independent oracle. The direct assignments follow current conventions: ordinary CPU stores fault into the write watch. The native `FT_MulFix` call returns a scalar and does not fill the guest outputs. The resolved [HostWrite discussion](https://github.com/boykopovar/AnyPS5/pull/9419#discussion_r4385174285) remains addressed. ### Tested **Nov 7 Windows execution — exact published head `8caaba1dc3d066387047c48854cff5cb46b14b59`.** Native Windows x86-64, supported WinLibs MinGW GCC 15.2.0, Release, bundled FreeType 2.15.0. Refreshed clean archived head/pinned dependency sources inside the bound worktree, reusing only this thread's CMake build cache. Stock root configuration (`BUILD_TESTING=ON`, `ANYPS5_RELINKER_ONLY=OFF`) and selected actual FreeType/libc/libkernel/test/packager targets built with `cmake --build ... --parallel 2`; no source workaround, compiler aliases or omitted dependency. Existing submodule modifications were preserved and not used. Artifacts/logs remain in ignored directories. - Verbose CTest selection `^(guest_freetype($|_charmap$|_geometry($|_watched$)|_stroker$|_glyph$|_advances$)|windows_write_watch($|_verify_direct$))`: **9/9 passed**, **9.72 s**. Includes **138,636** independent-oracle geometry cases, protected shared GuestArena output writes without skips/HostWrite guards, two Windows write-watch modes, advances, glyph, stroker, charmap and FreeType runtime controls. - Fresh copied libc/libkernel/FreeType package, repository NID packager and libc export-preservation list; separate Windows raw-NID loader: **138,636 oracle cases passed** through all three geometry NIDs. Native geometry names remained hidden. The current test's native-reference flag is unavailable on this LLP64/2.15.0 build; no oracle cases are skipped. No native 2.13.3 LP64 execution is newly claimed on this PC. - Strict geometry syntax (`-Wall -Wextra -Werror`), standalone Api.hpp/umbrella compilation, public-header audit (**406 libraries / 28,305 exports**), and whitespace checks passed. Conventions: **0 errors**, the existing **1,023-character debt-length advisory** remains. Final conventions/whitespace checks use the refreshed main snapshot. - Official overlap script run in an isolated Git metadata cache under this worktree to avoid collisions with other owners' refs: **1,766 open heads / 1,765 external comparisons**, **exit 2 (fail-closed)**. It flags matching geometry export names in **#16823**, whose inspected paths are the distinct `libSceFreeTypeOt` library; that PR declares `Depends on: #9410`. The arithmetic owner was informed. This is not a functional dependency of this `libSceFreeType` implementation, and no contributor agreement or combined-runtime/import-routing validation is claimed. Incomplete shared-file comparisons remain for #10606, #10611, #10613, #10897, #12004, #12373, #13486, #14212, #16120 and #16636. No no-overlap or verified combined-composition claim is made. No new macOS/Linux/title/PS5/sanitizer/full-product/full-suite run is claimed. These are stock Windows focused-library/test results. Prior macOS execution below is separately attributed to its date and head, including its focused-harness and stock-build limits. Reviewer re-review, hosted checks and unresolved cross-PR composition/routing coordination remain external gates; no contributor message or review-request notification was sent by this pass. Previously reported Nov 3 macOS validation — same head `8caaba1dc3d066387047c48854cff5cb46b14b59` — macOS 27.0.1 (26A434), AppleClang 21.0.0, x86-64 through Rosetta, Release; clean archived final-head source plus pinned bundled submodules. No existing submodule changes were used or modified. Stock root CMake configuration (`BUILD_TESTING=ON`, `ANYPS5_RELINKER_ONLY=OFF`) succeeded. The build produced libc and pinned FreeType 2.15.0, then stopped in unchanged upstream `libkernel/Pthread/src/Thread.cpp:383,596`: `pthread_getattr_np` and `pthread_getcpuclockid` are unavailable on macOS. This file is identical to main `1e658521a0a599872612bb91949311e2956b5283`. No workaround was applied and no successful stock integration/full product build is claimed. The older NativeStat/shared-memory blockers below are historical; those files compiled in this run. To finish useful validation, a temporary CMake harness under ignored `build-nov03/` used the unchanged FreeType library CMakeLists/source/tests, the root-build FreeType archive and stock-built libc, omitting the unused libkernel link dependency. No source patch, compiler alias or implementation change was needed for this focused build: - `ctest --test-dir build-nov03/focused -R '^guest_freetype($|_)' -E '(module_properties|memory_record_nid)' -V`: **22/22 passed**, **6.54 s**. Includes all **138,636 oracle cases**, watched geometry with no skip/HostWrite guards, upstream advances (#9465), glyph, stroker, face compatibility, outline storage and other registered neighboring adapter regressions. - Same current geometry test also compiled with the preserved pinned **FreeType 2.13.3 LP64 native reference**: **138,636 cases passed**, including both guest-vs-oracle and native-vs-oracle comparisons. The current 2.15.0 test reports that this native reference is unavailable; no cases are dropped from the independent oracle. - Documented standalone x86-64 write-watch selection: **15/15 passed**, **2.22 s** (the ten collect/fresh/armed/register/mapped/host/empty/protection/overlaps/threads controls plus five backing modes). - Copied focused adapter and stock-built libc, changed the adapter's libc dependency to `@loader_path/libc.prx` before packing, applied the repository NID packager with libc export preservation and ad-hoc signed the copies. A separate x86-64 dlopen/dlsym loader resolved all three raw geometry NIDs and passed **138,636 oracle cases**. The packaged memory-record regression also passed. These are focused-package results; libkernel/stock packaging remains blocked. Native geometry names remain visible on macOS, within #9848's distinct open scope; that branch was neither changed nor integrated. Module-property tests requiring the stock package were not run. - Public-header audit: **406 libraries / 28,305 exports**; standalone FreeType Api.hpp/umbrella compilation and geometry `-Wall -Wextra -Werror` syntax passed. Geometry implementation, oracle arithmetic/case generation and watched helper preservation were checked against published `bf0c6fbdec`. - `python3 tools/check_conventions.py --base origin/main` with origin/main refreshed to the pinned upstream snapshot: **0 errors**, one advisory debt-length warning (1,023 characters in this library's existing geometry entry after recording the native-version gap). Explicit pinned-main check also used; `git diff --check 1e658521a0...HEAD` passed. - Final `tools/pr_overlap.py --branch fix/pr-9419-nov03 --repo boykopovar/AnyPS5 --jobs 2` was run in an isolated local Git repository after a shared-ref collision in the first attempt. It scanned 1,738 open heads (1,737 external comparisons). Its fail-closed external-conflict limits remain: #10897 shares the CMake source insertion line, and 19 conflicting external heads have incomplete shared-file comparisons. Fetched shared additions were inspected; no other geometry implementation was found. #10897 adds Validation.cpp, a separate implementation; no functional dependency or merge-order agreement is claimed. No no-change overlap comment was posted separately. These results do not claim Windows/Linux/title/PS5/full-suite execution on this head. The next section preserves the Oct 30 Windows **7/7 and 138,636 packaged-NID** evidence only for its original revision `bf0c6fbdec42ab11d27307d87b53e2e8f716d5e1`. Historical Windows validation — `bf0c6fbdec42ab11d27307d87b53e2e8f716d5e1` on main snapshot `1189ec3003672bb364dd9f3119ead7b3976e3c83`: native Windows x86-64, supported WinLibs GCC 15.2.0, Release, bundled dependencies including main's FreeType **2.15.0** pin. A clean Git archive snapshot with pinned submodules was configured through the stock root CMake (`BUILD_TESTING=ON`, `ANYPS5_RELINKER_ONLY=OFF`); no source patches, compiler aliases or omitted link dependencies were used. Built only the actual FreeType/libc/libkernel libraries, selected tests and NID packager, with at most two compiler jobs. Artifacts are isolated under ignored `build-maint/` in the bound worktree; existing submodule changes were preserved. - `ctest --test-dir build-maint/win -R '^(guest_freetype($|_charmap$|_geometry($|_watched$)|_stroker$)|windows_write_watch($|_verify_direct$))' -V`: **7/7 passed**, **6.08 s**. Geometry: **138,636** arbitrary-precision oracle cases. The protected shared-GuestArena output test passed without skips or HostWrite guards; both Windows write-watch modes, FreeType, charmap and upstream stroker tests passed. - Copied the newly built libc/libkernel/FreeType binaries and applied the repository NID packager with the libc export-preservation list. The independent loader resolved all three geometry NIDs and passed **138,636** cases with the unchanged oracle; native geometry names were hidden on Windows. - Strict geometry test syntax (`-Wall -Wextra -Werror`) and standalone FreeType Api.hpp/umbrella compilation passed. Public-header audit: **373 libraries / 14,010 exports**, unique declarations and umbrella coverage passed. - `python3 tools/check_conventions.py --base origin/main` (using the documented Windows Python executable equivalent) and `git diff --check origin/main...HEAD`: passed. Original geometry source, oracle and watched-output test are byte-for-byte unchanged from `9f0ff98f59`; every upstream Api.hpp line remains present. - Refreshed `tools/pr_overlap.py --branch fix/pr-9419-review-feedback --repo boykopovar/AnyPS5 --jobs 2` against **1,432** open heads. The duplicate geometry row is this PR's old remote head. Other results concern shared insertion hunks/registrations; reported external FreeType additions were inspected for these geometry exports, with no additional implementation found. Incomplete comparisons remain for conflicting external heads (#9465, #10589, #10602, #10606, #10897); no clean combined composition, author agreement or merge order is claimed. No other PR branch was changed or integrated. These are stock Windows **focused library/build-test** results, not an entire product/test-suite or title run. No new macOS/Linux/PS5/title/sanitizer run is claimed. The previous macOS 14/14 focused harness and its stock-build blockers are preserved below as historical evidence for `9f0ff98f59`; they are not a successful stock macOS product build and are not rerun results for this head. Historical focused macOS evidence — head `9f0ff98f59063f1af8d4ff7cd631c720faf48cf2`: macOS 27.0.1 (26A434), AppleClang 21.0.0, x86-64 through Rosetta on Apple Silicon, Release. Clean Git archive snapshot and pinned bundled submodule sources; existing submodule changes were not used or modified. No repository source patches or changes from other open PRs were applied. **Historical macOS stock-build limitation at `9f0ff98f59`.** The supported full configuration succeeded, but libkernel `File/src/NativeStat.cpp:132-137` uses `st_atim`, `st_mtim`, `st_ctim`, which macOS `stat` lacks. A diagnostic retry with compiler-only aliases `-Dst_atim=st_atimespec -Dst_mtim=st_mtimespec -Dst_ctim=st_ctimespec` then failed at `File/src/SharedMemory.cpp:660`, where the non-Windows path uses Linux `memfd_create` / `MFD_CLOEXEC`. At that historical revision, both files were identical to main `facac6a4c52fa6e4bfb2b77ba98cab5e449555d4`; both failures were reproduced with final-head sources. Neither issue is patched here. No successful stock full-build or full-runtime integration run is claimed. A temporary focused CMake harness under ignored `build-review/` used the unchanged FreeType library CMakeLists/source/test files, the pinned FreeType 2.13.3 archive built by the full configuration, and the built libc (from the diagnostic compiler-alias configuration). It omitted the unused libkernel link dependency so geometry and neighboring adapters could execute. These are focused source/runtime results, not a stock product build: - `ctest --test-dir build-review/focused -R '^guest_freetype($|_geometry($|_watched$)|_charmap$|_bitmap$|_outline$|_charmap_info$|_outline_mutations$|_face_info$|_names$|_sfnt_names$|_list$|_request_size$|_stroker$)' -V`: **14/14 passed**, 4.48 s. Geometry: **138,636 arbitrary-precision oracle cases**, all also matching bundled native LP64 FreeType. Watched geometry passed without skipping or HostWrite guards; null, alias and singular behavior preserved. - Documented standalone x86-64 macOS write-watch build: **10/10 passed**, 0.49 s (collect, fresh, armed, register, mapped, host, empty, protection, overlaps, threads). - Copied the focused adapter and libc, set the adapter's libc dependency to `@loader_path/libc.prx` before NID patching, used the repository packager with the libc export-preservation list, and ad-hoc signed the copies. An x86-64 dlopen/dlsym loader resolved `g1Rc0MQddG0`, `SaJj4xMf2Sc`, `TfB3QTQN-Ek` and passed **138,636 cases** through the unchanged oracle. This validates those exports of the focused package, not the blocked stock package. Native geometry names remain visible on macOS; #9848 handles symbol isolation separately and was not integrated or modified. - Public-header audit: **368 libraries / 12,993 exports**, unique declarations and umbrella coverage passed. FreeType Api.hpp and umbrella compiled standalone for x86-64; geometry test syntax passed `-Wall -Wextra -Werror`. - `python3 tools/check_conventions.py --base origin/main`, an additional check against pinned main `facac6a4c52fa6e4bfb2b77ba98cab5e449555d4`, and `git diff --check facac6a4c52fa6e4bfb2b77ba98cab5e449555d4...HEAD`: passed. - Final `python3 tools/pr_overlap.py --branch fix/pr-9419-geometry-integration --repo boykopovar/AnyPS5 --jobs 2`: completed against 1,350 open PRs. The duplicate geometry export/new-file row is this PR's old remote head. Other incomplete comparisons involve conflicting external FreeType heads sharing CMake/header/layout/debt files; fetched additions inspected, distinct functions/build changes, no additional geometry implementation found. Mechanical composition remains unverified for those conflicting external heads; no author agreement or merge order is claimed. Depends on remains none for geometry implementation. No Windows/Linux/title/PS5-hardware/full-suite run was claimed for historical head `9f0ff98f59`. #9410, #9465, #9399 and #9848 were not changed. **Historical Windows evidence only — revision `e7249365321f5ea2678a57f74af38893fa4fa329`, not the current head:** Native Windows x86-64, WinLibs MinGW-w64 GCC 15.2.0, Release, bundled dependencies, `ANYPS5_RELINKER_ONLY=OFF`, `BUILD_TESTING=ON`. Built the actual FreeType/libc/libkernel libraries, three FreeType test executables, Windows write-watch test and NID packager with at most two compiler jobs. Build/source/runtime artifacts stayed inside this worktree's ignored `build-review/` directory; clean snapshots of pinned submodules avoided pre-existing local submodule modifications. - `ctest --test-dir build-review/win -R '^(guest_freetype($|_charmap$|_geometry($|_watched$))|windows_write_watch($|_verify_direct$))' -V`: **6/6 passed**, 7.24 s. Geometry checked **138,636 cases** against the independent arbitrary-precision Python oracle, including null/error behavior, ties, signed 32/64-bit limits, multiplication order, aliasing and canaries. The protected shared-mapping regression passed without `HostWrite` guards. - Copied and NID-patched the newly built libc/libkernel/FreeType libraries with the repository's export-preservation procedure. A separate loader resolved all three raw NIDs and passed **138,636 cases** using the same Python oracle. Native geometry symbols remained hidden. - Geometry test syntax check with `-Wall -Wextra -Werror`: passed. Public-header audit: **368 libraries / 12,372 exports**, unique declarations and umbrella coverage passed. - `python3 tools/check_conventions.py --base origin/main` and `git diff --check origin/main...HEAD`: passed. <!-- 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 -->
ycbuzi commented 2026-10-21 22:41:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-10-21T22:41:40Z.


Windows run of aa5a7f6157 merged onto main a6dcea9279 (a5909e7567, clean), the platform the description lists as not tested. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release, BUILD_TESTING=ON.

Built libSceFreeType and guest_freetype_geometry_tests with no errors or warnings. ctest --repeat until-fail:2 on guest_freetype_geometry: passes on both repeats. That test runs test_guest_freetype_geometry.py against the executable. Not run: a title.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6328162763 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9419#issuecomment-6328162763). Originally posted by [ycbuzi](https://github.com/ycbuzi) on 2026-10-21T22:41:40Z. --- Windows run of aa5a7f6157 merged onto `main` a6dcea9279 (a5909e7567, clean), the platform the description lists as not tested. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release, `BUILD_TESTING=ON`. Built `libSceFreeType` and `guest_freetype_geometry_tests` with no errors or warnings. `ctest --repeat until-fail:2` on `guest_freetype_geometry`: passes on both repeats. That test runs `test_guest_freetype_geometry.py` against the executable. Not run: a title.
MarcZX10 commented 2026-10-22 04:59:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T04:59:56Z.

Code review location: core/libs/prx/libSceFreeType/src/Geometry.cpp; line 27

@@ -0,0 +1,55 @@
+#include "prx/libSceFreeType/include/GuestFreeType.hpp"
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#include <bit>
+#include <cstdint>
+
+using namespace FreeType;
+
+namespace {
+
+std::int64_t Multiply(std::int64_t a, std::int64_t b) {
+    const auto left = std::bit_cast<std::int32_t>(static_cast<std::uint32_t>(a));
+    const auto right = std::bit_cast<std::int32_t>(static_cast<std::uint32_t>(b));
+    return std::bit_cast<std::int32_t>(static_cast<std::uint32_t>(FT_MulFix(left, right)));
+}
+
+}
+
+extern "C" {
+
+void APS5_VABI FT_Vector_Transform_nid_postfix(GuestVector* vector, const GuestMatrix* matrix) {
+    if (!vector || !matrix) return;
+    const GuestVector result{Multiply(vector->x, matrix->xx) + Multiply(vector->y, matrix->xy),
+                             Multiply(vector->x, matrix->yx) + Multiply(vector->y, matrix->yy)};
+    *vector = result;

These exports write caller-provided guest memory directly (*vector, *b, and *matrix). The output buffers are not wrapped in GuestArena::HostWrite, unlike the SFNT data destination in #9420. On Apple, the GuestWriteWatch host-write path temporarily opens protected guest pages and records them; when these outputs point into a watched guest arena page, the direct stores can fault or bypass that tracking. Please guard each mutated guest range with HostWrite and add a test using a write-watched GuestArena output; the current stack-based oracle tests do not cover this.

<!-- greyfinch-sync:boykopovar/AnyPS5:review-comment:4344710079 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9419#discussion_r4344710079). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T04:59:56Z. **Code review location:** `core/libs/prx/libSceFreeType/src/Geometry.cpp`; line 27 ~~~~diff @@ -0,0 +1,55 @@ +#include "prx/libSceFreeType/include/GuestFreeType.hpp" + +#include <ft2build.h> +#include FT_FREETYPE_H + +#include <bit> +#include <cstdint> + +using namespace FreeType; + +namespace { + +std::int64_t Multiply(std::int64_t a, std::int64_t b) { + const auto left = std::bit_cast<std::int32_t>(static_cast<std::uint32_t>(a)); + const auto right = std::bit_cast<std::int32_t>(static_cast<std::uint32_t>(b)); + return std::bit_cast<std::int32_t>(static_cast<std::uint32_t>(FT_MulFix(left, right))); +} + +} + +extern "C" { + +void APS5_VABI FT_Vector_Transform_nid_postfix(GuestVector* vector, const GuestMatrix* matrix) { + if (!vector || !matrix) return; + const GuestVector result{Multiply(vector->x, matrix->xx) + Multiply(vector->y, matrix->xy), + Multiply(vector->x, matrix->yx) + Multiply(vector->y, matrix->yy)}; + *vector = result; ~~~~ --- These exports write caller-provided guest memory directly (`*vector`, `*b`, and `*matrix`). The output buffers are not wrapped in `GuestArena::HostWrite`, unlike the SFNT data destination in #9420. On Apple, the GuestWriteWatch host-write path temporarily opens protected guest pages and records them; when these outputs point into a watched guest arena page, the direct stores can fault or bypass that tracking. Please guard each mutated guest range with `HostWrite` and add a test using a write-watched GuestArena output; the current stack-based oracle tests do not cover this.
MarcZX10 commented 2026-10-22 04:59:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T04:59:56Z.

Review: CHANGES_REQUESTED


The arithmetic coverage is extensive and the author-reported Linux/Windows runs include useful independent-oracle, sanitizer and packaged-export checks. The branch is 417 commits behind current main 524398151f1e (merge base 0c6a5bd5938f), so it does not meet the repository's current-main requirement. Please rebase and rerun the focused geometry tests, conventions and overlap scan on the new merge result. Current hosted product build/test jobs are skipped; I did not run a local build for this head because no matching configured build is available.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5609461399 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9419#pullrequestreview-5609461399). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T04:59:56Z. **Review:** CHANGES_REQUESTED --- The arithmetic coverage is extensive and the author-reported Linux/Windows runs include useful independent-oracle, sanitizer and packaged-export checks. The branch is 417 commits behind current `main` `524398151f1e` (merge base `0c6a5bd5938f`), so it does not meet the repository's current-main requirement. Please rebase and rerun the focused geometry tests, conventions and overlap scan on the new merge result. Current hosted product build/test jobs are skipped; I did not run a local build for this head because no matching configured build is available.
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!9419
No description provided.