Repository navigation
feat(libSceFreeType): query Type 1 private dictionaries - #9933
santhoshkumar-dev wants to merge 4 commits into
Conversation
|
I reviewed the LP64 guest layout assertions, field-by-field adapter, error-path output preservation, CMake/test registration and font fixtures. The adapter avoids copying the native Windows layout and widens the guest long/fixed-point fields explicitly; the tests compare each field against bundled FreeType, cover maximum arrays and negative fixed-point values, and include patched-NID loading. The console ABI remains clearly marked unverified. I found no code defect in this diff. I independently ran |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Upstream main now includes #9054, adding SFNT-name entries to |
MarcZX10
left a comment
There was a problem hiding this comment.
The field-by-field LP64 adapter, output-preserving errors and font fixtures look sound; current-main whitespace and conventions pass. The author reports the Windows full build and 5/5 focused tests, including patched-NID loading and native-FreeType field comparisons. I inspected the bundled FreeType implementation: it returns Invalid_Argument for a null output before the adapter writes, matching the tested unchanged-output behavior.\n\nCurrent check_main_sync.py reports the branch is 308 commits behind and has a merge conflict in docs/dev/debt/libSceFreeType.md; core/libs/CMakeLists.txt also changed on both sides. Please refresh onto current main, retain the merged debt entries as well as this Type 1 entry, and keep the test registration. The implementation/test source paths are otherwise untouched by intervening main changes.
MarcZX10
left a comment
There was a problem hiding this comment.
Please refresh this branch onto current main and resolve the reported conflict in docs/dev/debt/libSceFreeType.md; current sync also reports a shared core/libs/CMakeLists.txt edit. Preserve the intervening FreeType debt entries and the new PostScript-private test registration. The exact-head implementation review and author-reported Windows tests are positive, and current-main conventions/whitespace pass; the request is solely to resolve the real merge conflict and validate the refreshed merge.
There was a problem hiding this comment.
macOS test: guest_freetype_postscript_private_nid loads the unpatched libc
Apple M2 Max, macOS 27.2, Apple clang (Xcode 27), x86-64 Release build under Rosetta 2, BUILD_TESTING=ON, full default build. Head c45cf89081. main does not build on macOS, so the platform is #8658 (feat/macos-port) @ fa063d8b07 with this PR's diff applied (3-way, no conflicts there; GitHub reports a conflict with current main).
guest_freetype_postscript_private passes. guest_freetype_postscript_private_nid aborts:
dlopen(.../build/core/libs/libs/libSceFreeType.prx, 0x0006): Symbol not found: _QuRm8bUpMP0
Referenced from: <...> .../build/core/libs/libs/libSceFreeType.prx
Expected in: <...> .../build/core/libs/libs/unpatched/libc.prx
guest_freetype_postscript_private_tests links libc on every platform, so the process starts with unpatched/libc.prx loaded. Both libc builds have the install name @rpath/libc.prx, so when the patched libSceFreeType.prx asks for @rpath/libc.prx, dyld reuses the unpatched image that is already loaded, and it has no NID exports.
Linking libc only on Windows in PostScriptPrivate.cmake, as guest_jxr_lookup_tests in #9954 does, fixes it here:
target_link_libraries(guest_freetype_postscript_private_tests PRIVATE freetype ${CMAKE_DL_LIBS})
if(WIN32)
target_link_libraries(guest_freetype_postscript_private_tests PRIVATE libc)
endif()With that change both tests pass 3/3 (--repeat until-fail:3). I did not run Linux here, but the same pattern failed on Linux in #9646 (patched tests could not resolve NIDs until libc was linked only on Windows), so this is likely not macOS-only. #9785 has the same pattern.
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact head c45cf89081770fa3b9d2c9deb2404069067e5fc2. A focused macOS test report exposes a real portability failure in the new test target: guest_freetype_postscript_private_tests links both freetype and libc unconditionally. On macOS the test process loads unpatched libc.prx first; dyld then reuses its @rpath/libc.prx when loading patched libSceFreeType.prx, which lacks the expected NID symbol _QuRm8bUpMP0, so guest_freetype_postscript_private_nid aborts. Please link the NID libc only on Windows (or otherwise ensure the patched test resolves patched libc) and rerun both focused tests on macOS; the reported temporary conditional-link workaround passes 3/3. Separately, current-main sync reports a real conflict in docs/dev/debt/libSceFreeType.md and 308 commits behind, with core/libs/CMakeLists.txt also touched since the merge base. Please refresh onto current main, resolve the debt entry, and rerun the focused suite on the combined tree. Local conventions pass; I did not run the FreeType runtime tests. This request is based on a platform test failure and an actual merge conflict, not queue size.
Sync current main and keep the unpatched libc test dependency Windows-only.
|
Addressed the sync and test-loader requests in
The body now credits @jotitadev's pinned macOS report and removes the obsolete future ordering against already-merged PRs. #9924 then #9933 remains documentation-only merge order. A fresh macOS run on this head is still outstanding; @jotitadev, please rerun both modes on your #8658 stack when available. @MarcZX10, the requested refresh and loader changes are ready for re-review; existing change requests remain in place. |
What
Implement
FT_Get_PS_Font_Private(+yNEa4OFH1M) through the existing guest face bridge. The returned dictionary uses an explicit 224-byte LP64 guest record: every scalar, count, flag and fixed-size array is copied field by field, widening native fixed-point and long values. The Windows native record is 196 bytes. Errors leave the output unchanged, and the query does not refresh unrelated guest face or glyph data.The name/NID matches the PS5 3.20 inventory. Layout and behavior follow bundled FreeType 2.13.3 t1tables.h, fttype1.c and the native Type 1 font driver. Console ABI/backend equivalence remains unverified and is recorded in debt.
Refresh: merge fetched main
e3d03fbae64e1b49e5d4e84e753ccce6edf60da5while retaining the intervening features and test registrations. Link the test executable tolibconly on Windows. Linux/macOS start without that dependency and load the selected normal or packaged module explicitly. On Windows, the normal test prepends the unpatched dependency directory and the NID test prepends the packaged directory, so libc is selected consistently before module loading. Loader failures now print the Windows error code. The production adapter and behavioral fixtures are unchanged.Overlap: #9453 declares the private-dictionary NID as a throwing placeholder in
libSceFreeTypeOl. This PR implements only the distinctlibSceFreeTypeprovider. Documentation order remains #9924, then #9933, preserving both entries and the already-merged SFNT/naming/charmap/outline/size entries. Each branch builds independently on main. File-specific three-way checks against 25 older shared-CMake branches add no CMake conflict and keep this registration outside their existing conflict hunks; no joint builds with those branches are claimed.Tested
Final submitted head
276360b78d63a25ccccb672e8d6b251ff492a8db, based on maine3d03fbae64e1b49e5d4e84e753ccce6edf60da5.Windows 11 x64, supported WinLibs GCC 15.2.0 r7, Ninja Release, bundled dependencies,
BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=OFF: full default build passed; 5/5 focused CTests passed, zero skips.Local Linux: Ubuntu 24.04.1 x86-64 under WSL2 (kernel 6.6.87.2, GCC 13.3.0, glibc 2.39), Ninja Release with the same dependency/testing options. Built the complete
libstarget and selected test executables; 5/5 focused CTests each passed three consecutive runs, including actual packaged-NID loading and the 368-module loader.Four generated Type 1 fonts cover default and populated private dictionaries, maximum blue/snap arrays and negative fixed-point values. Every scalar and array is compared with bundled native FreeType. Canaries, null/error output preservation, repeated queries and unchanged face/font records are checked. Historical Windows negative controls at
c45cf89081made both modes fail for a raw native-record copy and for zero-extending signed fixed-point fields; the adapter and fixtures are unchanged by this refresh.Conventions, whitespace and current-main integration checks pass. The Linux runs above are local. The independent macOS report by @jotitadev used Apple M2 Max, macOS 27.2, AppleClang/Xcode 27, x86-64 under Rosetta, #8658 at
fa063d8b07plus the original PR diff: both focused tests reportedly pass three times with this same conditional-link correction. That report is attributed evidence on that pinned platform stack, not a macOS run on this refreshed head. A fresh macOS run remains outstanding; no title or console-hardware result is claimed.A local Linux linkage control on the preceding head
77342636eb253275bff1e75ac99abc42b92c0382restored only the unconditional libc test dependency. The normal test passed; the packaged-NID test failed withlibkernel.prx: undefined symbol: g5PTgiKQ9Eo. Restoring the conditional dependency passed both tests three consecutive times. The production source and test fixtures are unchanged between that control and this refresh.Upstream freshness: rechecked fetched main
74f6fa8e312462bc4b373b5ec498b2eea2b28efcimmediately before publication. The branch merges cleanly. The full build/runtime results above are pinned to the submitted head and its stated base, rather than claiming a build of newer upstream commits. No FreeType production, behavioral-test or debt file changed in that intervening upstream range.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)