Skip to content

feat(libSceFreeType): implement FT_Request_Size - #9846

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
Felipebmaitan:feat/freetype-request-size
Oct 23, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
Felipebmaitan:feat/freetype-request-size

Conversation

@Felipebmaitan

@Felipebmaitan Felipebmaitan commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What

Implement FT_Request_Size through the bundled FreeType backend with an explicit 32-byte LP64 guest request record. Preserve native validation order, support all five request modes and bitmap strikes, and synchronize size metrics after backend success or failure without refreshing glyph data. Requests outside the Windows host FT_Long range throw; console ABI assumptions and host-width limits are recorded in technical debt.

Tested

Ubuntu 24.04 x86-64 in Docker on Apple Silicon/Rosetta, GCC 13.3, Release, bundled dependencies, BUILD_TESTING=ON. Software Vulkan: llvmpipe / Mesa 25.2.8, LLVM 20.1.2; LP_NUM_THREADS=2 and VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.json.

  • Complete build, including all patched libraries: passed at 2cfe0735a94d3564fe8a1aea75ffeb98f7142578.
  • Unfiltered ctest --test-dir /tmp/anyps5-build --output-on-failure --parallel 4: 1,836 tests attempted; 1,698 passed, 97 skipped, 41 failed, in 409 seconds. The full suite is not green on this host.
  • All nine font/FreeType tests passed, including the new request-mode, fractional/DPI, bitmap, invalid-input, wide-input and partial-metric-update coverage. All nine passed again after restoring the feature branch from the baseline check.
  • Built unchanged upstream main at 6a6a35fdf5c2612821345be89309180622782d89 and reran all 41 failing tests with the same environment and parallelism: 40 also failed on main. Observed failures include unavailable userfaultfd write watching, Rosetta memory/ELF mapping errors, and existing libc/graphics assertions.
  • The remaining case, agc_driver_queued_index_read_order, passed on main, passed on the feature branch rerun, and passed 10 consecutive additional feature-branch runs. Its full-suite diagnostic was the image write left no pending result to order against.
  • python3 tools/check_conventions.py --base origin/main: passed with existing upstream debt-length warnings and zero errors. Checking against the upstream baseline reports all checks passed. git diff --check: passed.
  • Independent Windows validation reported by @Dom3005: Windows 11 10.0.26200, WinLibs GCC 15.2.0 r7, Release, head 2cfe0735a9 merged onto main 1a745ae38e. guest_freetype_request_size passed 5/5 repeated runs, exercising the Windows 32-bit FT_Long range-rejection exception path. A negative control replacing the wrapper with NotImplemented_nid_no_patch aborted as expected. No findings were reported. These Windows results were supplied by that contributor, not run by this PR author. Console titles were not tested.
Failures reproduced on unchanged main (40)
agc_driver_bc_block_copy
agc_driver_depth_compare_copy
agc_driver_guest_memory_lifetime_converted
agc_driver_image_srgb_sample_copy
agc_driver_image_srgb_sample_copy_forced
agc_driver_image_table_vouch_queued_draws
agc_driver_lookup_log_fits_build
agc_driver_msaa_dcc_clear_2
agc_driver_msaa_dcc_clear_4
agc_driver_msaa_dcc_clear_8
agc_driver_native_depth_bda_clear
agc_driver_native_depth_clear_refusals
agc_driver_native_depth_clears
agc_driver_native_depth_retirement
agc_driver_native_multisample_depth
agc_driver_resource_cache_lookup_changed
agc_driver_resource_cache_replaced_texture
agc_driver_staged_clear_sampled_read
agc_storage_kept_unit_settle
amd64_only_converter
file_writer_binary
file_writer_text
guest_allocator_failures
guest_closed_standard_descriptors
guest_deferred_dependencies
guest_floating_point
guest_interfaces
guest_memory
guest_module_args
guest_module_dir
guest_named_shm_concurrency
guest_system_load_exec_standard_error
guest_system_relaunch
guest_unused_import_dependencies
linux_entry_argv
linux_executable_exports
linux_input_program_headers
linux_trace_imports
loadexec_arguments
tls_function_coverage_register_address_loads

Merge-order coordination (review record): #8286, #9350 and #9384 were declared as merge-order prerequisites. @santhoshkumar-dev confirmed #8286 before this PR; @Ondra97 confirmed both #9350 and #9384 before this PR. All requested author confirmations are recorded. This PR has since merged as 3875f8c8ff83fb1506c7fa62142befbf93bb4318, before the declared prerequisites had all landed, so the earlier future-rebase plan for this branch no longer applies. Remaining integrations must retain the distinct bitmap, list, size-selection and size-request debt entries, their source/test registrations, and #9384's size-selection coverage in guest_freetype alongside guest_freetype_request_size.

Checklist

@github-actions

Copy link
Copy Markdown

Progress report (9062485 → 2cfe073)

➖ System libraries: 43.24% (+0.0%, +1 declared functions)

🆕 1 declared as stubs
Library Name
libSceFreeType FT_Request_Size_nid_postfix

@MarcZX10

MarcZX10 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

I checked the wrapper against the bundled FreeType 2.13.3 implementation and the LP64 guest record layout. Its invalid-face/size/request ordering matches FT_Request_Size; the new tests cover all request modes, bitmap strikes, invalid arguments, metrics synchronization, and unchanged glyph data. The reported paired baseline run also clearly separates the 40 host failures from the one transient failure that passed on repeated reruns. I have not run this FreeType test locally; the full focused and suite results in the description are author-reported, while CI product jobs are skipped.

One contribution-rule coordination item remains: the PR notes shared insertions with open #8286 and #9350, but says Depends on: none and describes reconciliation as something for the later merge. CONTRIBUTING asks authors to agree which overlapping PR lands first and declare that dependency. Could you confirm the order with those authors and update the checklist/overlap note? The branch currently targets the then-current main SHA 9062485e, so no rebase is needed at this snapshot.

@Felipebmaitan

Copy link
Copy Markdown
Contributor Author

@MarcZX10 Thanks for checking this. I updated the checklist to Depends on: #8286, #9350 and replaced the overlap note with an explicit merge order: both of those PRs first (in either order), then #9846. I will rebase #9846 after both land and retain both debt entries and all CMake registrations.

@santhoshkumar-dev @Ondra97, can you confirm that landing #8286 and #9350 before #9846 works for your plans? The overlaps are the debt-file insertion with #8286 and the CMake insertion with #9350; the implementations are independent. I am holding #9846 behind both rather than asking either of you to reconcile a later merge. The description marks author confirmation as pending until you reply.

No source or test changes were requested or made for this coordination update, so the recorded build and test results still apply.

@Ondra97

Ondra97 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

@Felipebmaitan I confirm that #9350 landing before #9846 works for my plans.

I checked both patches: the guest list APIs and FT_Request_Size are independent; the shared CMake insertion needs to retain both src/List.cpp and src/SizeRequest.cpp. When rebasing #9846 after the prerequisites land, please keep both guest_freetype_list and guest_freetype_request_size registrations and the distinct debt entries.

This confirms the #9350 side of the proposed order. No source or test change is needed for this coordination.

@oneandonlydean oneandonlydean self-assigned this Oct 22, 2026
@Felipebmaitan

Copy link
Copy Markdown
Contributor Author

@Ondra97 Recorded your #9350-before-#9846 confirmation in the description. When rebasing after the prerequisites land, I will retain both source files, both test registrations, and the distinct debt entries you listed. Confirmation for #8286 is still pending.

@Felipebmaitan

Copy link
Copy Markdown
Contributor Author

The updated overlap report identifies a shared debt-file insertion with #9384 (FT_Select_Size), with no duplicate export or source-file collision. I added #9384 to the merge-order dependencies: #8286, #9350 and #9384 first, then #9846. I will rebase this PR after those land and preserve their distinct entries and registrations.

@Ondra97, can you also confirm that #9384 landing before #9846 works for your plans? Your confirmation for #9350 is already recorded; this request concerns the newly reported #9384 overlap. Confirmation for #8286 remains pending separately.

@santhoshkumar-dev

Copy link
Copy Markdown
Contributor

@Felipebmaitan Confirmed from the #8286 side: landing #8286 before #9846 works for my plans. Please keep #8286 on the Depends on line for the agreed merge order.

The bitmap APIs and FT_Request_Size implement different functions. After rebasing, retain both the bitmap and size-request debt entries, along with their source and test registrations. This confirms the #8286 part of the order; the separate #9384 confirmation remains with its author.

@Felipebmaitan

Copy link
Copy Markdown
Contributor Author

@santhoshkumar-dev Recorded your #8286-before-#9846 confirmation in the description. #8286 remains on the Depends on line, and the rebase note explicitly preserves the bitmap and size-request debt entries and source/test registrations. Only the separate #9384 confirmation is still pending.

@Ondra97

Ondra97 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

@Felipebmaitan I also confirm that #9384 landing before #9846 works for my plans. Please retain #9384 on the Depends on line; my earlier confirmation for #9350 still stands.

I checked the patches: FT_Select_Size and FT_Request_Size are distinct guest exports. Their shared debt-file insertion should retain both entries. When rebasing #9846 after the prerequisites land, please preserve #9384's size-selection coverage in guest_freetype alongside guest_freetype_request_size.

No source change is needed for this merge-order confirmation.

@Dom3005

Dom3005 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Windows validation (Windows 11 10.0.26200, WinLibs GCC 15.2.0 r7, Release), head 2cfe073 merged onto main 1a745ae:

  • guest_freetype_request_size passes 5 of 5 (--repeat until-fail:5). On Windows, native FT_Long is 32 bits, so this run covers the throwing path for widths above that range that the debt entry describes, and the test's std::runtime_error catch handles it.
  • Baseline: with the test kept and FT_Request_Size_nid_postfix reduced to NotImplemented_nid_no_patch (main doesn't export it), it aborts with what(): FT_Request_Size_nid_postfix not implemented.

No findings.

AI-assisted: yes

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 9462 FT_Request_Size
PR 9922 FT_Request_Size

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.

Pull request Shared files not compared
PR 9530 docs/dev/debt/libSceFreeType.md
PR 9545 docs/dev/debt/libSceFreeType.md
PR 9550 docs/dev/debt/libSceFreeType.md
PR 9560 core/libs/prx/libSceFreeType/CMakeLists.txt
core/libs/prx/libSceFreeType/include/GuestFreeType.hpp
docs/dev/debt/libSceFreeType.md
PR 9574 core/libs/prx/libSceFreeType/CMakeLists.txt
docs/dev/debt/libSceFreeType.md
PR 9802 docs/dev/debt/libSceFreeType.md
PR 9924 docs/dev/debt/libSceFreeType.md
PR 9933 docs/dev/debt/libSceFreeType.md

@oneandonlydean
oneandonlydean merged commit 3875f8c into boykopovar:main Oct 23, 2026
19 checks passed
@Felipebmaitan

Copy link
Copy Markdown
Contributor Author

@MarcZX10 All requested author confirmations are now linked in the PR description: #8286, #9350, and #9384. The declared dependencies remain recorded. #9846 has since merged as 3875f8c8ff83fb1506c7fa62142befbf93bb4318; the description now records that chronology instead of promising a future rebase of this merged PR. The preservation note includes both debt entries and #9384's size-selection coverage alongside the size-request test.

@Dom3005 I also linked your Windows validation in Tested, explicitly attributed to your run: 5/5 repeated passes including the 32-bit FT_Long rejection path, the expected failing stub negative control, and no findings. No source changes were needed for either update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants