feat(libSceFreeType): implement FT_Outline_Copy #9519
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9519"
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 Ondra97 on 2026-10-22T00:08:55Z.
What
Add the missing guest
FT_Outline_Copyexport (Bhm8Injl0KA) to the existing FreeType bridge. Copy points, tags and contours into the caller's existing storage, preserve the destination ownership flag and descriptor pointers, and retain full 64-bit guest coordinates on Windows. Null outlines and mismatched counts return the bundled FreeType errors; self-copy leaves the outline unchanged.The name/NID matches the pinned PS5 3.20 inventory. The contract follows bundled FreeType 2.13.3 ftoutln.c and the bridge's existing LP64 outline layout. Console version/error equivalence remains unverified and is recorded in library debt. No title unblock or performance improvement is claimed.
Extend the existing
guest_freetypetest with native comparisons, buffer guards, ownership and input preservation, invalid counts, null/self-copy, maximum unsigned counts, full-width coordinate payloads and copied-outline rendering. No CMake change is needed. Merge after #9465 because both PRs insert a debt entry at the same location. Their implementations and tests are independent; #9465 is a merge-order dependency only.Tested
Rebased on upstream
main941ace5f342c24c84b0712b8db0a75e0232bc44d; tested PR heade3536381dc130c54159b94613b532e5d2e5fd7c7. Windows 11 Pro 10.0.26300, Ryzen 9 7900X, 31.7 GiB RAM, NVIDIA GeForce RTX 4070 Ti SUPER, WinLibs MinGW-w64 GCC 15.2.0 UCRT, Ninja, Release,BUILD_TESTING=ON, pinned bundled dependencies. These FreeType/font tests use the CPU.cmake --build <build> --target relinker libs patched_libraries_tests guest_freetype_tests guest_freetype_bitmap_tests guest_freetype_request_size_tests guest_freetype_outline_tests guest_freetype_outline_mutations_tests guest_freetype_charmap_tests guest_freetype_charmap_info_tests guest_freetype_face_info_tests guest_freetype_names_tests guest_freetype_sfnt_names_tests guest_freetype_list_tests guest_font_tests guest_system_font_tests guest_font_writing_line_tests font_face_lifetime_tests --parallel 8: production relinker, all patched libraries and selected fixtures built successfully without a code overlay.ctest --test-dir <build> -R '^(guest_freetype.*|guest_.*font.*|font_.*|patched_libraries)$' -V --output-on-failure --no-tests=error: 18/18 passed, zero skips; 368 patched libraries loaded, none failed.guest_freetypeexercised 178 outline-copy cases, null/count validation, self-copy and three rendered copies with native-matching bitmaps.ctest --test-dir <build> -R '^public_headers($|_compile_)' -j 8 --output-on-failure --no-tests=error: 65/65 passed, zero skips.FT_Outline_Copynow has its sole export declaration in publicApi.hpp; the integrated test uses that declaration and the publicGuestLibrary*type instead of local prototypes.objdump -p <build>/core/libs/libs/libSceFreeType.prxconfirms NIDBhm8Injl0KAin the packaged library. The implementation body is byte-identical to the old hosted PR. The old tip was a main merge commit; I replayed only its four original feature/test commits, whose pre-merge patch-id matched the hosted feature diff, while preserving current-main code and tests.python tools/check_conventions.py --base origin/main,python tools/check_main_sync.py --base origin/main --strict,git diff origin/main...HEAD --checkandpython tools/check_test_registration.py <build>: passed.python tools/pr_overlap.py --branch codex/pr9519-rebase-20261025 --repo boykopovar/AnyPS5 --jobs 12completed. #9465 remains the declared open debt-entry merge-order dependency; #9560 is a separate outline-decomposition export.The missing-feature baseline has no
FT_Outline_Copy_nid_postfix, so this regression cannot link there; no current-main runtime negative control is claimed. A complete CTest suite, console probe and title run were not performed on this rebased head. Console FreeType version/error equivalence remains unverified as recorded in debt.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 MarcZX10 on 2026-10-22T00:11:30Z.
Review: APPROVED
Reviewed the implementation against the bundled FreeType 2.13.3
FT_Outline_Copycontract. It preserves the destination ownership bit, copies only the point/tag/contour arrays for matching counts, returns the same null/count errors and leaves self-copy unchanged;memmovealso handles aliasing safely. The guest outline fields are unsigned 16-bit counts and 64-bit coordinates, and the implementation copies those coordinates without narrowing. I independently recomputedFT_Outline_Copy’s NID asBhm8Injl0KA. The native-reference tests cover count/flag combinations, guard storage, full-width values, invalid/self copies and rendered output. The PR reports focused 3/3 CTest coverage and a full integration build with its stated temporary test-only overlay; current eligibility/intake/conventions/labels/report checks pass. #9465 is correctly declared as the debt-entry merge-order dependency. I did not rerun tests locally.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T02:04:36Z.
Review: APPROVED
Rechecked the current head and dependency after the queue refresh. The
FT_Outline_Copybehavior remains consistent with bundled FreeType 2.13.3, the #9465 debt-entry order is explicit, and the author’s focused 3/3 test report and overlay-qualified full-build details remain unchanged. Eligibility, conventions, intake, labels and report checks pass; hosted product/relinker jobs are skipped. I did not rerun tests locally.Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-22T02:20:26Z.
I opened #9560, which adds FT_Outline_Decompose. I declared #9519 for merge order because the patches add independent debt entries at the same insertion; its #9465 chain also adds distinct guest types at the callback-table insertion. Retain both sets of entries/types. The implementations are independent.
Imported from boykopovar/AnyPS5. Originally posted by fogydes on 2026-10-22T08:41:14Z.
Reviewed; verified against the pinned
ftoutln.ccopy contract. The error mapping is freetype's own:!source || !target→Invalid_Outline, count mismatch →Invalid_Argument, self-copy →Ok; the point/tags/contours copies follow the same element counts asFT_ARRAY_COPY, and the ownership-flag result(source->flags & ~OWNER) | (target->flags & OWNER)is algebraically the source's save-clear-OR sequence, so a caller-owner target never loses ownership. Operating on raw guest outline storage without going through the adapter face is correct here — this export has no host picture of the outline — and the rendering test exercises the one path where the two worlds meet: copy into the guest glyph outline, thenFT_Render_Glyph_nid_postfixwrites the guest outline back and renders, with the bitmaps matching native. Guard bytes around thepoints/tags/contoursdestinations prove thememmoveextents are exact, and the wide-mode/guard/count-matrix cases plus native-comparison on the generated fonts cover the claim. Debt entry links the pinned source and marks the console-build compatibility unverified.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T11:42:42Z.
Current-head recheck:
FT_Outline_Copystill follows the bundled FreeType contract; current diff-check/conventions pass and the branch merges cleanly withmain. Your Windows report gives 178 copy cases, three rendered copies and 3/3 focused tests. The branch is now 4 ahead / 119 behind currentmain(basea6dcea927); please refresh it and rerun the focused FreeType tests/checks. Keep the declared #9465 debt-entry dependency; #9465 remains open.