Skip to content

fix(libSceFreeType): guard stroker count outputs - #16281

Merged
oneandonlydean merged 4 commits into
boykopovar:mainfrom
Noxy-HNR:fix/freetype-stroker-output-guards
Nov 6, 2026
Merged

oneandonlydean merged 4 commits into
boykopovar:mainfrom
Noxy-HNR:fix/freetype-stroker-output-guards

Conversation

@Noxy-HNR

@Noxy-HNR Noxy-HNR commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

What

FT_Stroker_GetCounts and FT_Stroker_GetBorderCounts create output write guards but ignore refusal. They now check both non-null destinations before writing either count, so a read-only guest output produces a controlled error without partially changing the other output.

The native query still runs first. Writable destinations retain FreeType's zero-on-error writes, optional-null outputs and points-before-contours alias order. A refused output preserves an existing native error; otherwise it returns FT_Err_Invalid_Argument. This is host-boundary policy, not measured console behavior, and is recorded in debt. Ordinary write-watch CPU stores are not the issue addressed here. Native output order follows the bundled ftstroke.c.

Tested

Current-head hosted verification (8024e45a47): the Windows changed-test job passed; the existing stroker test and both new raw/NID output regressions passed. The job reports zero failures among 3,344 selected CTest entries, including skipped entries. Its log identifies this exact PR head. This is not a fresh full Linux run; earlier local and Linux results below retain their stated commits and scope.

Windows x86-64, WinLibs GCC 15.2.0, Ninja, Release, full project configuration and source-built dependencies.

  • New raw and NID-patched runtime tests compare empty, completed and unfinished strokers with bundled FreeType, including both borders, invalid borders, null strokers, optional outputs and aliased outputs.
  • Two guest direct-memory pages are protected independently and together. The tests check whole-buffer preservation on refusal and compare results after restoring writes. A host-writable/logically-read-only mode gives an assertion-based negative control; actual PAGE_READONLY is confirmed with VirtualQuery for the protected cases.
  • With the unchanged implementation at c55222cfc4 (new tests on main f5844034d9), both regressions fail by assertion at the refused-output result check.

Final validation at 8024e45a47, including main 3cb1cd29ec:

No Linux, console or retail-title run.

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

@Noxy-HNR
Noxy-HNR marked this pull request as ready for review November 6, 2026 04:04
@JJenkx

JJenkx commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Windows check of head 8024e45a47, merged onto main 7015a659ca (15a416b77b, clean merge).

Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.

  • guest_freetype_stroker_outputs and guest_freetype_stroker_outputs_nid pass in 3 of 3 runs, none skipped.

AI-assisted: yes.

@oneandonlydean oneandonlydean self-assigned this Nov 6, 2026
@oneandonlydean
oneandonlydean merged commit d0d66c3 into boykopovar:main Nov 6, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants