Repository navigation
test(libSceFreeType): leave a valid autofitter default script set - #13512
adriadam10 merged 1 commit into
Conversation
The script loop set default-script to 999 and 0xFFFFFFFF last. FreeType stores any default-script value, so both libraries kept 0xFFFFFFFF, and the per-face x-height queries that follow computed the face globals with it: af_face_globals_compute_style_coverage found no style for that script and read af_style_classes[0xFFFF], past the 88-entry table (afglobal.c:254). Try the invalid values first so the loop ends on a valid script.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The reordered test still checks both invalid script values against native FreeType and leaves a valid default script selected before the later face-property queries.
What I ran
Reviewed head c1aff9498d1519fefb3f2a5906e6d8bdbdd1fabc against base 6a3afa4deb18ea58a90efb8040fff8c60e4f2aab; the exact-head merge preview is clean. Environment: Linux x86_64, Python 3.11.2, Git 2.39.5. No compiler or C++ test binary was run locally.
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13512
git diff --check 6a3afa4deb18ea58a90efb8040fff8c60e4f2aab c1aff9498d1519fefb3f2a5906e6d8bdbdd1fabc
python3 tools/check_conventions.py --base 6a3afa4deb18ea58a90efb8040fff8c60e4f2aab --head c1aff9498d1519fefb3f2a5906e6d8bdbdd1fabc --title 'test(libSceFreeType): leave a valid autofitter default script set' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13512-c1aff9498d15/pr-body.md
python3 tools/pr_stack_check.py 13512 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13512-c1aff9498d15/stack
python3 tools/pr_test_quality.py --root /marc/AnyPS5 --json core/libs/tests/GuestFreeTypeModuleProperties.cpp
gh pr checks 13512 --repo boykopovar/AnyPS5Results
| Check | Result |
|---|---|
| Diff and conventions | Passed. |
| Dependency/mergeability | Exact head previews cleanly against the PR base; no declared dependency. |
| Test-quality heuristic | It flagged the C++ test as possibly unregistered because the source path is constructed by CMake. Exact-head ModuleProperties.cmake registers guest_freetype_module_properties and _nid; this is a false positive. |
| Hosted CI | Five policy checks were pending at final refresh; none runs these C++ tests. |
| FreeType tests and sanitizer control | The PR reports normal RelWithDebInfo runs passing and both FreeType module-property tests passing five times under ASan+UBSan after failing on main with an out-of-bounds style-table access. The author reports applying #12894 locally to make the sanitizer build complete. I did not reproduce these runs. |
Unedited output from local checks
git diff --check exited 0 and emitted no output.
All conventions checks passed.
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13512-c1aff9498d15/head-c1aff9498d15-d69626aa/tools/pr_test_quality.py': [Errno 2] No such file or directory
The local heuristic rerun returned:
{
"findings": [
{
"path": "core/libs/tests/GuestFreeTypeModuleProperties.cpp",
"line": 1,
"kind": "possible-unregistered-cpp-test",
"message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
}
],
"negative_control_candidates": [],
"limits": [
"Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
"A test that passes against base is not by itself proof that the PR test is inadequate.",
"Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
]
}# PR stack check — fresh
Target: https://github.com/boykopovar/AnyPS5/pull/13512
Target branch tip: `6a3afa4deb18ea58a90efb8040fff8c60e4f2aab`
All heads unchanged: **True**
Dependency order: #13512
## Individual merge previews
- PR #13512: **clean** against current base; head `c1aff9498d1519fefb3f2a5906e6d8bdbdd1fabc`; changed paths: none reported
## Dependency relationships
No declared PR dependencies were found in the target PR chain.
conventions pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41098477063/job/124210316841
eligibility pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41098476946/job/124210312647
intake pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41098477084/job/124210316263
labels pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41098477014/job/124210315650
library-portability pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41098477038/job/124210312574
Sources
- The pinned FreeType submodule stores
default-scriptwithout range validation - The same pinned FreeType revision indexes
af_style_classesusing the selected default-script index - The reordered values and subsequent face-property queries at the reviewed head
- The test's CMake registration at the reviewed head
Not verified
I did not build or run the tests locally, independently reproduce the sanitizer failure or fix, verify the author's reported base commit, or run Windows or console tests. The reported sanitizer run used #12894 applied locally; that PR remains open.
|
Windows result for head Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, The tree also carried the open PR #13490, merged cleanly, so the run is a joint one. AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
|
Checked the reorder: both invalid script values are still compared against native FreeType for |
What
GuestFreeTypeModulePropertiessets the autofitterdefault-scriptto999and0xFFFFFFFFlast. FreeType stores anydefault-scriptvalue without validating it, so the native and the guest libraries both keep0xFFFFFFFF. The per-faceincrease-x-heightqueries added in #12668 then build the face globals with it:af_face_globals_compute_style_coveragefinds no style for that script, keepsdflt = 0xFFFFand readsaf_style_classes[0xFFFF], past the 88-entry table. It passes in normal builds only because the HarfBuzz-lessaf_shaper_get_coverageignores the style class it gets.Under ASan+UBSan both tests stop there:
The loop now tries the invalid values first and ends on a valid script, so every value is still compared against native FreeType. Test only; the adapter is unchanged. The nightly sanitizer run does not show this yet because
guest_freetype_*are "Not Run" there until #12894 lets the ASan build finish.Tested
Linux (Ubuntu 26.04, GCC 15.2, i7-8700), main
9f748f4d8e, with #12894 applied locally so the ASan build completes:-DANYPS5_ENABLE_ASAN=ON,-fsanitize=undefined -fno-sanitize-recover=undefined -fno-sanitize=vptr, RelWithDebInfo),UBSAN_OPTIONS=halt_on_error=1:guest_freetype_module_propertiesand_nidfail on main with the report above and pass with this change (5 repeats). The rest of the non-GPU suite (1833 tests) had no other sanitizer report.check_conventions.pyandgit diff --checkpass.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)🤖 Generated with Claude Code