feat(libSceFreeType): implement vector and matrix geometry #9419
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9419"
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 Felipebmaitan on 2026-10-21T21:20:12Z.
What
Implement
FT_Vector_Transform(g1Rc0MQddG0),FT_Matrix_Multiply(SaJj4xMf2Sc) andFT_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 returnsFT_Err_Invalid_Argumentwithout 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
1e658521a0a599872612bb91949311e2956b5283into published headbf0c6fbdec42ab11d27307d87b53e2e8f716d5e1without rewriting history; merge commit3783a8441b6ceec05125d27788138d2fc5891657, followed by test compatibility fix8caaba1dc3d066387047c48854cff5cb46b14b59. 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 frombf0c6fbdec. 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
8caaba1dc3d066387047c48854cff5cb46b14b59and all published history/authorship by fast-forwarding the existing owner checkout; no source change, rebase or branch push was necessary. A cleangit merge-treewith main87473937d31ca4f64d819805b8f0c2b80ac55b53produced treee3f1cb03b9cd888728327b97676eda9bee62d26f: 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_MulFixcall 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 withcmake --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.^(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.-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.libSceFreeTypeOtlibrary; that PR declaresDepends on: #9410. The arithmetic owner was informed. This is not a functional dependency of thislibSceFreeTypeimplementation, 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 upstreamlibkernel/Pthread/src/Thread.cpp:383,596:pthread_getattr_npandpthread_getcpuclockidare unavailable on macOS. This file is identical to main1e658521a0a599872612bb91949311e2956b5283. 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.@loader_path/libc.prxbefore 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.-Wall -Wextra -Werrorsyntax passed. Geometry implementation, oracle arithmetic/case generation and watched helper preservation were checked against publishedbf0c6fbdec.python3 tools/check_conventions.py --base origin/mainwith 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...HEADpassed.tools/pr_overlap.py --branch fix/pr-9419-nov03 --repo boykopovar/AnyPS5 --jobs 2was 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 —
bf0c6fbdec42ab11d27307d87b53e2e8f716d5e1on main snapshot1189ec3003672bb364dd9f3119ead7b3976e3c83: 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 ignoredbuild-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.-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) andgit diff --check origin/main...HEAD: passed. Original geometry source, oracle and watched-output test are byte-for-byte unchanged from9f0ff98f59; every upstream Api.hpp line remains present.tools/pr_overlap.py --branch fix/pr-9419-review-feedback --repo boykopovar/AnyPS5 --jobs 2against 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 libkernelFile/src/NativeStat.cpp:132-137usesst_atim,st_mtim,st_ctim, which macOSstatlacks. A diagnostic retry with compiler-only aliases-Dst_atim=st_atimespec -Dst_mtim=st_mtimespec -Dst_ctim=st_ctimespecthen failed atFile/src/SharedMemory.cpp:660, where the non-Windows path uses Linuxmemfd_create/MFD_CLOEXEC. At that historical revision, both files were identical to mainfacac6a4c52fa6e4bfb2b77ba98cab5e449555d4; 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.@loader_path/libc.prxbefore NID patching, used the repository packager with the libc export-preservation list, and ad-hoc signed the copies. An x86-64 dlopen/dlsym loader resolvedg1Rc0MQddG0,SaJj4xMf2Sc,TfB3QTQN-Ekand 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.-Wall -Wextra -Werror.python3 tools/check_conventions.py --base origin/main, an additional check against pinned mainfacac6a4c52fa6e4bfb2b77ba98cab5e449555d4, andgit diff --check facac6a4c52fa6e4bfb2b77ba98cab5e449555d4...HEAD: passed.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 ignoredbuild-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 withoutHostWriteguards.-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/mainandgit diff --check origin/main...HEAD: passed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-10-21T22:41:40Z.
Windows run of aa5a7f6157 merged onto
maina6dcea9279(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
libSceFreeTypeandguest_freetype_geometry_testswith no errors or warnings.ctest --repeat until-fail:2onguest_freetype_geometry: passes on both repeats. That test runstest_guest_freetype_geometry.pyagainst the executable. Not run: a title.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 27These exports write caller-provided guest memory directly (
*vector,*b, and*matrix). The output buffers are not wrapped inGuestArena::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 withHostWriteand add a test using a write-watched GuestArena output; the current stack-based oracle tests do not cover this.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
main524398151f1e(merge base0c6a5bd5938f), 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.