Skip to content

test(libSceFont): cover the limits of sceFontStringRefersRenderCharacters - #12794

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
xXPBSXx:test/font-render-characters
Nov 4, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
xXPBSXx:test/font-render-characters

Conversation

@xXPBSXx

@xXPBSXx xXPBSXx commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds a test for sceFontStringRefersRenderCharacters, which had none. The test builds strings from a text source and checks the cases that do not depend on bidirectional text: an empty string gives no characters and a count of zero, a missing count output or string gives a null result, no start character means the first one, a start or last character before or after the characters of the string, or a start after the last character, gives no characters, and sub-ranges of a left-to-right run return the start character and the number of characters from start to last.

The first commit adds the test; the library code is unchanged. The second commit adds an entry for the function to the libSceFont technical debt: it follows the shadPS4 implementation (src/core/libraries/font/font.cpp, commit 0614ce324b), its results are unmeasured on a console, and the test does not cover the widening of the range over bidirectional levels, the handling of cluster and synthetic characters or the trimming at the end. Four of the local titles import the function (imported, not measured as called).

Tested

Windows 10 (MinGW GCC 15.2, Release) and WSL2 Ubuntu 24.04 (GCC 13.3, Release; virtualised kernel, not bare-metal), on this head over main 951f374:

  • ctest -R guest_font_render_characters --repeat until-fail:3 passes 3 of 3 on both.
  • Deliberate changes to the function make the test fail, 3 of 3 on each system: letting a start after the last character through, counting the start character twice, and dropping the default start character fail an assertion of the test; removing the check that the start character lies after the first character crashes it in five of six runs and fails an assertion in the sixth, removing the check that it lies before the end crashes it in all six. Removing the range check of the last character is not caught: the walk that follows reaches the same result. The code was restored afterwards.
  • The other guest_font* tests pass on Windows (12 of 12, including this one).
  • tools/check_conventions.py --base upstream/main passes.
    Not tested: macOS, bidirectional text.

Overlap

I took the changed files of each of the 1450 other open pull requests from git diff --name-only against its merge base. Three of them change core/libs/prx/libSceFont/CMakeLists.txt: #12018, #12025 and #8250. Six change docs/dev/debt/libSceFont.md: #12870, #12869, #12867, #12757, #12674 and #8250. None changes the new test file. git merge-tree against main 951f374: this head alone merges cleanly, and so do its pairs with #12870, #12869, #12867, #12674, #12025 and #12018. The pairs with #12757 and #8250 conflict, but each of them conflicts with main on its own.

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 (test(libSceFont): cover the sceFontRebindRenderer return codes #12585 is merged)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

AI-assisted (Claude Code).

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 29, 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 14879 docs/dev/debt/libSceFont.md L54

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 13486 docs/dev/debt/libSceFont.md
PR 14212 docs/dev/debt/libSceFont.md

@oneandonlydean oneandonlydean self-assigned this Oct 29, 2026
@github-actions github-actions Bot added build docs prx needs rebase Conflicts with main, rebase needed labels Oct 29, 2026
xXPBSXx and others added 2 commits October 29, 2026 21:32
…ters

sceFontStringRefersRenderCharacters had no test. The new one builds strings
from a text source and checks the cases that do not depend on bidirectional
text: an empty string gives no characters and a count of zero, a missing
count output or string gives a null result, no start character means the
first one, and a start or last character that lies before or after the
characters of the string, or a start after the last character, gives no
characters. Sub-ranges of a left-to-right run return the start character and
the number of characters from start to last.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…mes from

The results of sceFontStringRefersRenderCharacters come from our shadPS4-based
port and are unmeasured; the new test pins only the cases that do not depend
on the bidirectional rules, so the debt file now says so.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@xXPBSXx
xXPBSXx force-pushed the test/font-render-characters branch from 75b9a3e to 754278e Compare October 29, 2026 21:40
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 29, 2026
@xXPBSXx

xXPBSXx commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main 951f374 (new head 754278e) because #12585 landed and the font CMake and debt entries conflicted. In both conflicts I kept both entries; the diff against main is still only the RenderChars test and its debt entry. The Depends on line no longer applies. Re-ran on the new head: guest_font_render_characters passes 3 of 3 on Windows and WSL2, the other guest_font* tests pass on Windows (12 of 12), and the deliberate changes still fail the test as described above. Body updated for the new base.

AI-assisted (Claude Code).

# Conflicts:
#	docs/dev/debt/libSceFont.md
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head 918f128 merged onto main 1e65852 · tested 2026-11-03 22:00 UTC · 15 min

GPU AMD Radeon RX 6300 (RADV NAVI24), driver Mesa 25.2.8-0ubuntu0.24.04.4, Vulkan 1.4.318
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,233 passed · 11 failed (0 new, 10 also fail on main, 1 unstable on main) · 9 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,253 of 3,818 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (961 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.3 s, ⚠️ agc_driver_graphics_maps_fallback 100.1 s, ⚠️ agc_driver_graphics 89.6 s, ⚠️ public_headers 81.3 s, ⚠️ agc_driver_image_sample_unnormalized 47.8 s
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 7 of the last 9 main runs
Failing on main too (10, not counted against this PR)
agc_driver_alpha_to_coverage_sample_mask_export
agc_driver_guest_memory_lifetime_direct
agc_driver_image_table
agc_driver_job_manager_compute_capacity
agc_driver_native_depth_bda_clear
agc_driver_native_depth_buffer_clear
agc_driver_native_depth_clears
agc_driver_native_multisample_depth
agc_driver_store_over_untracked
agc_driver_submit_progress
Validation IDs already present on main (4 IDs in 727 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (727 tests): agc_compute_pipeline_replay, agc_driver_address_passes, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_alpha_to_coverage_sample_mask_export, agc_driver_array_layer_target, and 719 more
VUID-vkCmdCopyImage-srcImage-01548 (9 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, and 1 more
VUID-vkCmdCopyImage-srcImage-01551 (9 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store_image_copy, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, and 1 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (9)
agc_driver_copied_writer_label_order: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_copied_writer_label_order_drain: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_float16_unused_nan_payloads: skipped, the device has no native f16 conversions with RTE rounding and kept f16 denormals
agc_driver_linear_target_direct_write_completion: skipped, the device does not keep host imports write-watched, so no completion stamp over the target is tracked
agc_driver_ngg_vertex_wave_reduction: skipped, s3 describes a 32-lane wave only on 32-lane subgroups, and the device has 64 lanes
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
video_out_flip_unopened: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
Reproduce
git fetch origin 918f128fd1e3ec55784653583f410af610f52f49 1e658521a0a599872612bb91949311e2956b5283
git checkout 1e658521a0a599872612bb91949311e2956b5283 && git merge --no-ff 918f128fd1e3ec55784653583f410af610f52f49
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 12 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 16 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@oneandonlydean
oneandonlydean merged commit 2b20e42 into boykopovar:main Nov 4, 2026
12 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