Skip to content

feat(libc): read 16-bit wide fields in fscanf on Linux - #11724

Open
cocoa55 wants to merge 5 commits into
boykopovar:mainfrom
cocoa55:feat/libc-fscanf-wide-fields
Open

cocoa55 wants to merge 5 commits into
boykopovar:mainfrom
cocoa55:feat/libc-fscanf-wide-fields

Conversation

@cocoa55

@cocoa55 cocoa55 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What

On Linux, fscanf, vfscanf, scanf and vscanf threw NotImplemented on the 16-bit wide conversions (%ls, %lc, %l[, %S, %C), and so did the _s stream forms. sscanf already reads them with the guest scanner (ScanSource), which also has a StreamSource, but its wide branch only ran for contiguous strings (if constexpr (TSource::Contiguous)). The UTF-8 decoding is the existing sscanf behaviour; #12468 replaces it with the byte-by-byte rule measured on titles’ libc.prx.

  • The wide branch of ScanSource no longer walks a const char*. Each source gets PeekWide, which decodes the next character without consuming it, and the branch calls Skip for its bytes only once the field takes the character. StringSource::PeekWide is the old ReadWideScanCharacter call. StreamSource::PeekWide reads the UTF-8 sequence with fgetc and pushes it back with ungetc, as the fwscanf stream reader in ScanningWide.cpp already does. A rejected character therefore stays in the stream, and the accept/reject logic is the same code for strings and streams.
  • fscanf/vfscanf use the scanner when the format has a wide conversion (same check as sscanf, ScansWideInProcess) and the host vfscanf otherwise. ScanGuestStream (fscanf_s and friends) no longer rejects wide conversions and keeps the positional-argument check.
  • RejectGuestWideScan is removed. ScanWideField gets WideScanCharacterLength, which DecodeUtf8 now uses too.
  • docs/dev/debt/libc.md: the scanf family and _s stream entries no longer list fscanf as throwing.

Overlap: #9087 and #9340 change the same wide branch of ScanSource (secure-size violations, and surrogate pairs / non-ASCII scansets). Neither reads wide fields from a stream, so they don't duplicate this PR. Agreed order (asked on both PRs): #9087, then #9340, then this PR, which I'll rebase after each one merges. StringSource::Remaining is kept because #12530 uses it. #11726 and #12468 build on this PR.

Tested

Ubuntu 24.04, GCC 13.3, full build. New CheckNarrowFormatWideFields in core/libs/tests/GuestWideStreamScan.cpp (Linux only, like the sscanf wide tests): fscanf %ls/%lc on UTF-8, vfscanf %S with %ln, wide and narrow fields in one call, a scanset stopping before é and the é read by the next call, %3lc with the next character left in the stream, matching failure and EOF, fscanf_s/vfscanf_s sizes, scanf/vscanf on the guest stdin. It fails on main with fscanf 16-bit wide conversion on Linux not implemented. guest_formatting, guest_scan_count, guest_wide_stream_scan and file_streams pass. Full ctest: 2476 of 2491 pass, and the 15 failures (agc_* submit/metadata, guest_net_*, guest_tcp, guest_socket_*) fail the same way on main in the same container (no GPU, sandboxed network). No title tested.

Checklist

fscanf, vfscanf, scanf, vscanf and the _s stream forms threw on %ls,
%lc, %l[, %S and %C on Linux. Route those formats through the guest
scanner sscanf already uses, reading the stream through StreamSource.

The wide field reader now works on any source through Peek and Skip
instead of a contiguous buffer: it decides whether to take a character
from its lead byte, then consumes the whole UTF-8 sequence, so a
rejected character stays in the stream without multi-byte pushback.

AI-assisted: yes
Deciding from the lead byte only holds while scanset members are ASCII.
Each source now decodes its next character with PeekWide without
consuming it, and the field reader skips its bytes only once it takes
the character. StreamSource peeks by reading the UTF-8 sequence and
pushing it back with ungetc, as the fwscanf stream reader in
ScanningWide.cpp already does. Keep TSource::Contiguous.

AI-assisted: yes
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Progress report (f2d874c → 0193ac7)

📈 System libraries: 26.26% (+0.01%, +3 implemented functions)

✅ 3 implemented
Library Name
libc fscanf_nid_postfix
libc vfscanf_nid_postfix
libc vfscanf_s_nid_postfix

Changed libraries (implemented exports)

Library Before After Change
libc 1489/1505 (98.94%) 1492/1505 (99.14%) +0.20%

@cocoa55 cocoa55 changed the title Feat/libc fscanf wide fields feat(libc): read 16-bit wide fields in fscanf on Linux Oct 27, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the scanner changes and the reported build/test results. git diff --check and the current-base conventions check pass. The author reports a full Ubuntu build, the focused scanner tests, and a main-vs-change control for the wider CTest failures; hosted product build jobs are currently skipped.

There is one repository-policy blocker before this can be approved. Both overlapping PRs #9087 and #9340 are still open, and I independently confirmed that merging this head with either branch produces a content conflict in core/libs/prx/libc/src/Formatting.cpp (#9340 also conflicts in docs/dev/debt/libc.md). CONTRIBUTING requires the authors to agree which overlapping PR goes first and declare that order with Depends on. The PR description identifies the overlaps and says the second merge will need a textual rebase, but its checklist still says Depends on: none, and I found no coordination with those authors in the PR discussion.

Please coordinate the merge order with the authors of #9087 and #9340, update the dependency line accordingly, and rebase when appropriate. This is a merge-order request; I did not find a separate correctness blocker in the reviewed code.

@cocoa55

cocoa55 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

I reviewed the scanner changes and the reported build/test results. git diff --check and the current-base conventions check pass. The author reports a full Ubuntu build, the focused scanner tests, and a main-vs-change control for the wider CTest failures; hosted product build jobs are currently skipped.

There is one repository-policy blocker before this can be approved. Both overlapping PRs #9087 and #9340 are still open, and I independently confirmed that merging this head with either branch produces a content conflict in core/libs/prx/libc/src/Formatting.cpp (#9340 also conflicts in docs/dev/debt/libc.md). CONTRIBUTING requires the authors to agree which overlapping PR goes first and declare that order with Depends on. The PR description identifies the overlaps and says the second merge will need a textual rebase, but its checklist still says Depends on: none, and I found no coordination with those authors in the PR discussion.

Please coordinate the merge order with the authors of #9087 and #9340, update the dependency line accordingly, and rebase when appropriate. This is a merge-order request; I did not find a separate correctness blocker in the reviewed code.

Thanks for the review and for checking the conflicts yourself. I've asked the authors of #9087 and #9340 to go first (#9087 comment, #9340 comment) and changed the checklist to Depends on: #9087, #9340. I'll rebase this PR once they merge and re-request review then. If either author would rather go second, I'll update the dependency line.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

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 3965 docs/dev/debt/libc.md
PR 5021 docs/dev/debt/libc.md
PR 5303 docs/dev/debt/libc.md
PR 6819 docs/dev/debt/libc.md
PR 7447 docs/dev/debt/libc.md
PR 7544 docs/dev/debt/libc.md
PR 7715 docs/dev/debt/libc.md
PR 7851 docs/dev/debt/libc.md
PR 8150 docs/dev/debt/libc.md
PR 8417 docs/dev/debt/libc.md
PR 8965 docs/dev/debt/libc.md
PR 9371 docs/dev/debt/libc.md
PR 9447 docs/dev/debt/libc.md
PR 9466 docs/dev/debt/libc.md
PR 9526 docs/dev/debt/libc.md
PR 9677 docs/dev/debt/libc.md
PR 10002 docs/dev/debt/libc.md
PR 10007 docs/dev/debt/libc.md
PR 10113 docs/dev/debt/libc.md
PR 10226 docs/dev/debt/libc.md
PR 10253 docs/dev/debt/libc.md
PR 10274 docs/dev/debt/libc.md
PR 10321 docs/dev/debt/libc.md
PR 10397 docs/dev/debt/libc.md
PR 10506 docs/dev/debt/libc.md
PR 10510 docs/dev/debt/libc.md
PR 10512 docs/dev/debt/libc.md
PR 10569 docs/dev/debt/libc.md
PR 10780 docs/dev/debt/libc.md
PR 10987 docs/dev/debt/libc.md
PR 11109 docs/dev/debt/libc.md
PR 11172 docs/dev/debt/libc.md
PR 11262 docs/dev/debt/libc.md
PR 11266 docs/dev/debt/libc.md
PR 11332 core/libs/prx/libc/src/Formatting.cpp
docs/dev/debt/libc.md
PR 11625 docs/dev/debt/libc.md
PR 11634 docs/dev/debt/libc.md
PR 11661 docs/dev/debt/libc.md
PR 11664 docs/dev/debt/libc.md
PR 11689 docs/dev/debt/libc.md
PR 11698 docs/dev/debt/libc.md
PR 11831 docs/dev/debt/libc.md
PR 11848 docs/dev/debt/libc.md
PR 11870 docs/dev/debt/libc.md
PR 11895 docs/dev/debt/libc.md
PR 12053 docs/dev/debt/libc.md
PR 12057 docs/dev/debt/libc.md
PR 12184 docs/dev/debt/libc.md
PR 12514 docs/dev/debt/libc.md
PR 12518 docs/dev/debt/libc.md
PR 12558 core/libs/prx/libc/src/Formatting.cpp
PR 12574 docs/dev/debt/libc.md
PR 12592 docs/dev/debt/libc.md
PR 12593 docs/dev/debt/libc.md
PR 12594 docs/dev/debt/libc.md
PR 12598 docs/dev/debt/libc.md
PR 12605 docs/dev/debt/libc.md
PR 12622 core/libs/prx/libc/src/Formatting.cpp
docs/dev/debt/libc.md
PR 12627 docs/dev/debt/libc.md
PR 12682 docs/dev/debt/libc.md
PR 12688 docs/dev/debt/libc.md
PR 12700 docs/dev/debt/libc.md
PR 12704 docs/dev/debt/libc.md
PR 12849 docs/dev/debt/libc.md
PR 12920 docs/dev/debt/libc.md
PR 12947 docs/dev/debt/libc.md
PR 12965 docs/dev/debt/libc.md
PR 13390 docs/dev/debt/libc.md
PR 13449 docs/dev/debt/libc.md
PR 13486 core/libs/prx/libc/src/Formatting.cpp
docs/dev/debt/libc.md
PR 13794 docs/dev/debt/libc.md
PR 13804 docs/dev/debt/libc.md
PR 13809 docs/dev/debt/libc.md
PR 13828 docs/dev/debt/libc.md
PR 14212 docs/dev/debt/libc.md
PR 14298 docs/dev/debt/libc.md
PR 14326 docs/dev/debt/libc.md
PR 14588 docs/dev/debt/libc.md
PR 14595 docs/dev/debt/libc.md
PR 14610 docs/dev/debt/libc.md
PR 14915 docs/dev/debt/libc.md
PR 15095 docs/dev/debt/libc.md
PR 15199 docs/dev/debt/libc.md
PR 15206 docs/dev/debt/libc.md
PR 15236 docs/dev/debt/libc.md
PR 15336 docs/dev/debt/libc.md
PR 15471 docs/dev/debt/libc.md
PR 15484 docs/dev/debt/libc.md
PR 15486 docs/dev/debt/libc.md
PR 15490 docs/dev/debt/libc.md
PR 15501 docs/dev/debt/libc.md
PR 15519 docs/dev/debt/libc.md
PR 15535 docs/dev/debt/libc.md
PR 15552 docs/dev/debt/libc.md
PR 15561 docs/dev/debt/libc.md
PR 15602 docs/dev/debt/libc.md
PR 15614 docs/dev/debt/libc.md
PR 15667 docs/dev/debt/libc.md
PR 15683 docs/dev/debt/libc.md
PR 15713 docs/dev/debt/libc.md
PR 15714 docs/dev/debt/libc.md
PR 15768 docs/dev/debt/libc.md
PR 15773 docs/dev/debt/libc.md
PR 15778 docs/dev/debt/libc.md
PR 15791 docs/dev/debt/libc.md
PR 15796 docs/dev/debt/libc.md
PR 15800 docs/dev/debt/libc.md
PR 15801 core/libs/prx/libc/src/Formatting.cpp
core/libs/tests/GuestWideStreamScan.cpp
docs/dev/debt/libc.md
PR 15802 core/libs/prx/libc/src/Formatting.cpp
core/libs/tests/GuestWideStreamScan.cpp
docs/dev/debt/libc.md
PR 15803 core/libs/prx/libc/src/Formatting.cpp
core/libs/tests/GuestWideStreamScan.cpp
docs/dev/debt/libc.md
PR 15804 core/libs/prx/libc/src/Formatting.cpp
core/libs/tests/GuestWideStreamScan.cpp
docs/dev/debt/libc.md
PR 15807 core/libs/prx/libc/src/Formatting.cpp
core/libs/tests/GuestWideStreamScan.cpp
docs/dev/debt/libc.md
PR 15809 docs/dev/debt/libc.md
PR 15834 docs/dev/debt/libc.md
PR 15879 docs/dev/debt/libc.md
PR 15973 docs/dev/debt/libc.md
PR 16004 docs/dev/debt/libc.md
PR 16017 docs/dev/debt/libc.md
PR 16083 docs/dev/debt/libc.md
PR 16084 docs/dev/debt/libc.md
PR 16107 docs/dev/debt/libc.md
PR 16170 docs/dev/debt/libc.md
PR 16178 docs/dev/debt/libc.md
PR 16210 docs/dev/debt/libc.md
PR 16214 docs/dev/debt/libc.md
PR 16216 docs/dev/debt/libc.md
PR 16280 docs/dev/debt/libc.md

@maskym

maskym commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Windows result for head 6a95925815, merged into main f759e165d9 (the PR's Tested section names no Windows run).

Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, BUILD_TESTING=ON, Ninja. Build clean.

The tree also carried the open PRs #11644, #11639, #11636, #11635, #11630, #11353, #11347, #11221, #10925, #11706, #11693, #11686, #11682, all merged cleanly, so the run is a joint one; the tests of this PR are guest_wide_stream_scan (0.05 s); note wchar_t is 16 bits on this host, so the Windows side of the change is what ran, all passed (the batch's mapped tests: 16/16, plus 43/43 for the Ngs2 and host-import suites). Not run on a PS5.

AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine.

@adriadam10 adriadam10 self-assigned this Oct 28, 2026
@JJenkx

JJenkx commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

@cocoa55 measurements that bear on this PR's decoding: titles' own libc.prx doesn't decode UTF-8 in the wide scanf conversions. I ran the sscanf of PPSA07923, PPSA05916 and PPSA13934 natively on Windows 11 (a scratch loader calls it by NID, 1Pk0qZQGeWo) on about 70 input/format pairs. All three titles agree on every row.

What they do. Each byte goes to mbrtowc on its own, and the field width counts bytes. Since MB_CUR_MAX is 1, any byte ≥ 0x80 ends the conversion:

input (hex) format titles main on Windows (UCRT)
c3 a9 ("é" in UTF-8) %ls 0, nothing stored 1, 00c3 00a9 0000
61 c3 a9 %ls 0, 0061 stored, no terminator 1, 0061 00c3 00a9 0000
80 %ls -1 1, 0080 0000
7f 80 %ls 0, 007f stored 1
c3 (end of input) %ls -1 1
c3 20 78 %ls -1 1
61 c3 62 %2ls -1, 0061 stored 1, 0061 00c3 0000
c3 a9 %lc -1 1, 00c3
c3 61 %2lc 0 1
35 20 c3 a9 %d %ls 1 2
61 62 63 %C 0, nothing stored (throws here)
61 62 63 %S 1, as %ls (throws here)

Rules that fit every row.

  • Lead byte (0xC0–0xEF, where mbrtowc returns -2): the byte is held.
    • Any further byte the field would take then fails the conversion as a matching failure.
    • If the field ends (width used up, a space for %ls, a byte outside the set for %l[, or the end of input) while the byte is held, it's an input failure.
  • Invalid byte (0x80–0xBF, 0xF0–0xFF): an input failure if it's the field's first byte, a matching failure otherwise.
  • Return values: an input failure returns EOF unless an earlier conversion succeeded. A matching failure returns the count so far.
  • Stored units: units read before the failure are stored, without a terminator, and the scan stops.
  • %C is not a conversion at all: with any width or length it stores nothing and ends the scan.
  • %S is %ls.
  • %l[ tests membership on the raw byte.

So the UTF-8 decoding on main (and in this PR's PeekWide) differs from the titles for any byte ≥ 0x80. Windows differs too, in another way: main hands these conversions to the UCRT, which stores each byte as one unit.

Proposal. I'd like to make the wide branch follow these rules on both platforms. Your PR already makes the branch source-generic, so the natural order is yours first, with mine stacked on it (Depends on: #11724) changing only the per-character step. #11726 should be unaffected beyond a rebase. If you'd rather fold the rules into this PR yourself, say so and I'll stay out of it. Fields cut by fscanf on a stream are the one part I can't measure with this loader, so the stream position after a failure would follow the string case.

Probes and full outputs: widescan*.cpp and widescan*-PPSA*.txt (local, attachable on request).

AI-assisted: yes (Claude Code).

@JJenkx

JJenkx commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

@cocoa55 following up on my note above: I've opened the stacked follow-up as #12468 (Depends on: #11724), so it's reviewable alongside yours. Your two commits come first there, unchanged. If you'd still prefer to fold the byte-by-byte rule into this PR, say so and I'll close #12468.

AI-assisted: yes (Claude Code).

@cocoa55

cocoa55 commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

@cocoa55 following up on my note above: I've opened the stacked follow-up as #12468 (Depends on: #11724), so it's reviewable alongside yours. Your two commits come first there, unchanged. If you'd still prefer to fold the byte-by-byte rule into this PR, say so and I'll close #12468.

AI-assisted: yes (Claude Code).

Thanks a lot for measuring this on the titles’ libc.prx, that’s much better evidence than the UTF-8 assumption both main and this PR carry. I’d prefer to keep them separate: #11724 stays “wide conversions work on streams” with today’s decoding, and #12468 switches both strings and streams to the byte-by-byte rule on top. Happy to rebase or adjust PeekWide if it makes #12468 simpler.

boykopovar#12530 reads source.Remaining() in the contiguous branch of ScanSource,
so dropping the accessor here would break the build whichever of the
two lands second, without a textual conflict.

AI-assisted: yes
…-fields

# Conflicts:
#	docs/dev/debt/libc.md
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 30, 2026
@ryanc2112

Copy link
Copy Markdown
Contributor

Linux run of head 7f4610561, merged locally onto main 3bc58629fb (clean merge). Arch distrobox on SteamOS, Ryzen 5 2600, GCC 16.2.1, Release, BUILD_TESTING=ON, 3 runs each:

tree guest_formatting, guest_wide_stream_scan, guest_scan_count, guest_wide_formatting, guest_stdio_variadic, guest_daemon
main 6/6 passed, 3/3 runs
this PR merged onto main 6/6 passed, 3/3 runs
main libc + only this PR's GuestWideStreamScan.cpp guest_wide_stream_scan failed, 3/3 runs

The control aborts with fscanf 16-bit wide conversion on Linux not implemented, the throw this PR removes. Merged onto main, tools/progress.py --module libc no longer lists fscanf, vfscanf and vfscanf_s as todo.

#11726 contains this PR's commits; my run of #11726 is there.

AI-assisted: yes (Claude Code)

@SnekPolylepis

Copy link
Copy Markdown
Contributor

@cocoa55 I opened #13696 for the same stream forms before I saw this PR. I'm closing it in favour of this one. Two things from it that may be useful here:

  1. Look-ahead without ungetc. feat(libc): read 16-bit wide conversions in the scanf stream forms #13696 decides whether the next character belongs to the field from its lead byte alone, through StreamSource::Peek(), so it never needs to push back more than one byte. That still holds with byte-by-byte rules (fix(libc): read wide scanf fields byte by byte, as titles' libc.prx does #12468): any byte from 0x80 up ends the field, so a one-byte peek is enough to stop the stream right after the last byte used.
  2. Null destination in the secure wide branch. In feat(libc): read 16-bit wide conversions in the scanf stream forms #13696, fscanf_s(stream, "%ls", static_cast<char16_t*>(nullptr), 1u) reached target[0] = u'\0' without checking the pointer. %l[ and %2lc with capacity 1 took the same path, and other capacities consumed input and returned 0 instead of EOF (oneandonlydean's review on feat(libc): read 16-bit wide conversions in the scanf stream forms #13696). If this PR's secure stream path has the same shape, it's worth rejecting a null destination before the capacity check, as the narrow branch does, and testing capacities 0, 1 and a larger one.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 1, 2026
…-fields

# Conflicts:
#	docs/dev/debt/libc.md
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 1, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head 0193ac7 merged onto main f2d874c · tested 2026-11-01 22:48 UTC · 16 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 ✅ 3,053 passed · 15 failed (0 new, 9 also fail on main, 6 unstable on main) · 58 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 3,126 of 3,168 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 (1232 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.5 s, ⚠️ agc_driver_graphics 117.7 s, ⚠️ agc_driver_graphics_maps_fallback 116.9 s, ⚠️ public_headers 71.4 s, ⚠️ agc_driver_bda_device 56.1 s
Unstable on main (6, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_array_layer_target_cpu: failed in 1 of the last 5 main runs
agc_driver_job_manager_compute_capacity: failed in 4 of the last 5 main runs
agc_driver_pipeline_journal: failed in 3 of the last 5 main runs
agc_driver_submit_progress: failed in 3 of the last 5 main runs
agc_submit_progress: failed in 4 of the last 5 main runs
agc_submit_progress_no_timeline: failed in 4 of the last 5 main runs
Failing on main too (9, not counted against this PR)
agc_driver_guest_memory_lifetime_direct
agc_driver_image_table
agc_driver_native_depth_bda_clear
agc_driver_native_depth_buffer_clear
agc_driver_native_depth_clears
agc_driver_native_multisample_depth
agc_idle_publish_wait
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (5 IDs in 711 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (711 tests): agc_compute_pipeline_replay, agc_driver, 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_array_layer_target, and 703 more
VUID-vkCmdCopyImage-srcImage-01548 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, 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, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, and 3 more
VUID-vkCmdCopyImage-srcImage-01551 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, 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, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, and 3 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
VUID-VkShaderModuleCreateInfo-pCode-08737 (1 test): agc_driver_image_sample_derivatives
Skipped (58)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
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_image_table_vouched_lookups: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a watched imported table cannot be vouched for
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_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_driver_unit_shadow_budget: skipped, the device does not import watched host memory for unit shadows
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_pipeline_binary_vulkan: skipped, the device lacks VK_KHR_pipeline_binary
agc_shadowed_key_stores: skipped, the device imports no watched host memory under a unit shadow
agc_small_tiled_shadow_label: skipped, host imports are unavailable: the test block is not imported and watched
agc_storage_clear_hand_over: skipped, the device imports no watched host memory for the clear-key hand-over
agc_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: 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
video_out_flip_backtoback: 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
video_out_flip_controls: 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
video_out_flip_cpuflip: skipp
Reproduce
git fetch origin 0193ac78e6f2c3f6356e40298e7c3928a21cc3ad f2d874c1fdccf781c0fa5d86619bb5dd8894b958
git checkout f2d874c1fdccf781c0fa5d86619bb5dd8894b958 && git merge --no-ff 0193ac78e6f2c3f6356e40298e7c3928a21cc3ad
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.

This branch has not been deployed

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

Labels

docs libc needs rebase Conflicts with main, rebase needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants