fix(libkernel,agc): unblock RetroArch Windows select and 8_8 UINT #5999
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5999"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-14T18:45:15Z.
What
Two independent Windows bring-up blockers affected the local RetroArch PPSA99169 dump. Clearing the regular-file
selectfailure exposed the AGC format failure.selecton regular files: main already polls pipes on Windows throughHostPoll, but selecting a disk file (FD 5 early in the local RetroArch startup) threwneither a socket nor a pipe. AddHostFileReady:FILE_TYPE_DISKis always ready for the requested read/write bits, matching the FreeBSD disk semantics already documented for Linuxpoll. Non-file, non-pipe, non-socket descriptors still throw.COLOR_8_8+ UINT: after clearingselect, local menu startup creates an8_8color target with number type UINT (format 3,number type 4).DecodeColorFormatcase 3 previously handled only UNORM/SNORM. UINT now maps toVK_FORMAT_R8G8_UINTwith the component-swap mapping used by the existing 8 / 8_8_8_8 UINT paths. Newuint8x2TargetTestscover it.Linux
HostPollis unchanged (#ifndef _WIN32continues to use hostpoll). AGC decoding is shared, and the new graphics unit test exercises it on both hosts.Title evidence and reproducibility
The screenshots below come from the local Ozone dump on this host. Its exact local build identity is not recorded here. This run reached both failures before the changes and reached the Ozone menu and libretro content afterward.
Independent Windows review used the catalog release with build identity
fd8f648f5b51…, which ships the XMB menu driver. That copy reached neither failure on main and showed no regression with this PR. It therefore does not reproduce the local Ozone before/after claim. The portable confirmation is the reviewer's unit tests and negative controls; the title screenshots are evidence for the local dump.After screenshots use a solid black backdrop, without desktop wallpaper. Asset gallery (personal gist, not in-repo): gist.
Before → after on the local Ozone dump
selecton FD 5 abortsformat 3 / UINTaborts (black window)Select crash → menu
AGC format crash → Ozone menu
Content follow-up on this host
With the same HostFileReady + COLOR_8_8 UINT build, stock libretro
.socores load through the title's in-process ELF loader, rather than relinker.prxcores.checker.nesucity.gbcMore cores on the same stack
checker.smschecker.sfcTested
Windows 11, RTX 3080, WinLibs MinGW-w64 GCC 15.2.0; Ubuntu under WSL2, GCC 13.3.0. Release,
BUILD_TESTING=ON.Local title run to Ozone Main Menu;
agc_driver_graphics, includinguint8x2TargetTests.Content: FCEUmm +
checker.nes; mGBA +ucity.gbcthrough Generate Map, usingAPS5_PAD_INPUT_FILEfor pad injection. Screenshots are in the personal gist above.Diff against main: select/HostFileReady + COLOR_8_8 UINT + unit tests + debt.
Following the Windows review, tip
a214a4e2crequires both disk-file readiness bits, uses a per-process temporary filename, and removes the three explanatory comments. Rebuiltlibkernel+guest_select_tests;ctest -R '^guest_select$' --repeat until-fail:3passed 3/3. Validation note.Revalidated 2026-10-15 at exact head
a214a4e2cb2a6b09d24d0a4acc529b22c71d19e4: built that revision's completelibcandlibkernelCMake targets plus originalGuestSelect.cppandGuestSelectWait.cpp. Both Windows tests passed three consecutive runs (6/6). This focused check does not rerun the Agc graphics or title validation.Not tested: macOS or console hardware. Full PR CI needs a collaborator's manual Build run; automatic successful metadata checks are not full build/test coverage.
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)agc_driver_graphics)Note
Continues closed #5795 (GitHub refused reopening after a force-push while closed). Same branch/topic; tip rebased cleanly onto current
main.Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-14T18:45:31Z.
Replaces closed #5795 (GitHub blocks reopen after force-push). Tip
ea74ddd10= cherry-pick of the RetroArch select + 8_8 UINT fix onto currentmain(post-#5163).Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-14T18:45:41Z.
Closing — keeping #5795 instead of a replacement.
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-15T04:05:06Z.
A second title for the 8_8 UINT part: Doom 3 BFG (PPSA99313, catalog release) on Linux (Ubuntu 24.04, GCC 13.3, Release, RTX 4070 Ti),
maina077a88dfplus #6213, which it needs to get past start-up.AGC graphics: unsupported color format 3 number type 4 component swap 0.VK_FORMAT_R8G8_UINTwith the 8_8 mapping), the draw goes through. The title then runs to its ownSys_Error: Could not load default font "Arial_Narrow", which is expected since the catalog build ships no game data.I only ran the 8_8 UINT change, not the RetroArch
selectpart.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T06:39:08Z.
Live Windows verification (PPSA99169)
Re-ran RetroArch on Windows with a freshly built + NID-patched
libkernelcontaining this PR'sHostFileReadyselect fix (Agc/VideoOut/AgcDriver left on a known-good prior pair so LoadLibrary stays clean).RetroArch | FPS: ~80 (3700+)neither a socket nor a pipe/ select abortrun/frame_*.bmpat 960x540 with mean luminance ~60 (non-black menu path)So the libkernel half is confirmed on hardware (RTX 3080). The Agc
COLOR_8_8UINT half remains covered by the Graphics unit test in this PR; a full AgcDriver rebuild from this commit alone is the next clean deploy check (a WIP AgcDriver tree currently breakslibSceAgcLoadLibrary 127 and is out of scope here).Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T06:52:09Z.
Test follow-up
Pushed
test(libkernel): cover Windows select on regular files— opens a temp disk file andselects it on Windows soHostFileReadycannot regress to the old neither-socket-nor-pipe throw.Local:
ctest -R '^guest_select$'passed on this machine after the change.Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T07:00:04Z.
Live title evidence (PPSA99169 RetroArch)
On Windows with this PR’s NID-patched
libkernel(HostFileReady) plus the pre-main Agc stack:APS5_PAD_INPUT_FILE) navigated into Load Core → FCEUmm.app0/cores/fceumm_libretro.so(not a converted.prx) six times; FCEUmm metadata +savestates/FCEUmm/were touched.StorageTexturecreates (NES framebuffer size) and the window settled at ~120 FPS / 24k+ frames while still titledRetroArch.So this PR is load-bearing for the title path that actually runs cores. Relinker conversion of cores is a separate question (#5927); the console path uses the title loader on the stock
.so.Not claiming a playable ROM yet —
smoke.neshas not shown up insceKernelOpenlogs; next step is content load + post-core frame dumps.Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T07:08:47Z.
Breakthrough: RetroArch loaded FCEUmm + ROM on this stack
Unattended run of PPSA99169 with this PR’s HostFileReady
libkernel(NID-patched) + pre-main Agc libs:/app0/test-run.txt(required — without it the title deletesargs.txtas a stale test file) and/app0/args.txt:argv extras from /app0/args.txt = 6retroarch.log: loaded stockfceumm_libretro.sovia the title ELF loader, thenLoading content file: "/app0/content/smoke.nes", geometry 256×224 @ 60.10 FPS/app0/screenshots/smoke.pngafter ~9s of content (Content ran for a total of: 00 hours, 00 minutes, 09 seconds)HostFileReady is on the path that keeps this title alive through menu + core/content bring-up. No claim that every core works — this is one converted-free
.so+ one NES ROM on Windows.Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T07:08:51Z.
Note on the screenshot:
smoke.pngand the GPU frame dumps are a flat mid-gray (mean luma ~86), not a recognizable NES scene. So this is core+ROM load and a timed run, not proven pixel-correct presentation yet. Next poke is RGB565 / present path for the 256×224 core framebuffer.Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T07:11:02Z.
Pixel proof (follow-up)
smoke.neshad an empty CHR bank — the flat gray screenshot was the ROM, not a present failure.Built a tiny
checker.nes(nonzero CHR tile + nametable fill). Unattended run with/app0/test-run.txt+args.txtproduced/app0/screenshots/checker.pngshowing a visible tile grid (dark squares on light background) from FCEUmm at 256×224.So on this HostFileReady stack: title ELF loader → stock
fceumm_libretro.so→ ROM → on-screen NES framebuffer.Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T07:18:43Z.
Second title/core: mGBA + µCity (homebrew GBC)
mgba_libretro.soucity.gbc(homebrew)/app0/screenshots/ucity.pngtest-run.txt/args.txtrecipe as FCEUmmSo this is not a one-core fluke.
Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T07:22:49Z.
Interaction proof (mGBA + µCity)
Pad inject advanced past the title screen:
ucity-play.pngshows the Select Slot menu (cursor on1. Empty,Page 1 / 4). So input + core + present are all live on this stack, not just a static boot frame.Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T07:57:51Z.
Content follow-up (screenshots)
With #5999 HostFileReady + COLOR_8_8 UINT on Windows, RetroArch loads stock libretro cores and homebrew content:
Gallery: https://gist.github.com/mazen320/232ab464aa28adb78c9f9757294f3eaf
Windows 11, RTX 3080; title in-process ELF loader (not relinker
.prxcores). Pad inject viaAPS5_PAD_INPUT_FILEfor the µCity path.Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T08:09:21Z.
Overlap (#6235)
Bot flagged
tests/Graphics.cppwith #6235 (fix(shader): preserve raw fragment exports for integer attachments). That PR changes shader export / integer-attachment paths; this PR only addsuint8x2TargetTestsforCOLOR_8_8UINT. Same file, different topic — no shared production change and no Depends on. Agree #6235 can merge first if the test file conflicts; rebase is mechanical.Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T08:25:43Z.
More cores (same HostFileReady stack)
While soak/poll idle: stock cores + tiny homebrew ROMs via title ELF loader.
checker.sms(homebrew)checker.sfc(minimal LoROM)Already proven earlier: FCEUmm+checker.nes tiles; mGBA+µCity through playfield.
Gallery: https://gist.github.com/mazen320/3911ee2028c238c8b2ed6744f7792fdb
Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-15T08:59:22Z.
Windows run of head
4a054f683alone, merged ontomaind92a8dad3(clean merge; it also merges cleanly onto the newerdb81992c5, not built).libspass with 0 errors and no warnings in the rebuilt files (Socket.cpp,State.cppand both test files).--repeat until-fail:3:guest_select: 3/3.core/libs/prx/libkernel/CMakeLists.txt(includingguest_poll,guest_select_waitandguest_socket_*): 429/429 runs.agc_driver_graphics(with the newuint8x2TargetTests) and 11 colour-target and format tests (agc_driver_uint8x4_color_target,srgb8,packed_unorm,color1555and others): 36/36 runs.main's libraries, fail with the two messages from the description:guest_select_tests.exewithmain'slibkernel.prx:what(): select on descriptor 3 (neither a socket nor a pipe) not implementedagc_driver_graphics_tests.exewithmain'slibSceAgcDriver.prx:AGC graphics: unsupported color format 3 number type 4 component swap 0ctest -j8 --timeout 120 -E '^agc_driver_|^video_out_flip'): 810/814. All four were load-related and none involvesselector the AGC formats:hardware_oracle_compare,guest_file_lock_processandguest_pthread_starttimed out, andaudio_out2_timingexited0xc0000409, while the host was busy.audio_out2_timingandguest_pthread_startpass.guest_file_lock_processpassed 3/3 in the libkernel run above with the same build.hardware_oracle_comparealso times out on other branches here under load.tools/check_conventions.pyandgit diff --checkpass.Title: RetroArch PPSA99169, catalog release (its
trace.txtreportsbuild identity: fd8f648f5b51…), relinked with--executable picker/picker.binby each side's own relinker. Runs were 60 s in a window (ANYPS5_REQUIRE_DISPLAY=1), with input fromAPS5_PAD_INPUT_FILE.maind92a8dad3RetroArch | FPS: 46.09 (1628)picker: retroarch -> LoadExec(/app0/eboot.bin, "--ps5-mode=retroarch"), RetroArch 1.22.2 XMB Main Menu,RetroArch | FPS: 48.34 (656)at 60 s, no stop lineRetroArch | FPS: 40.97 (1086), no stop linecore loader: ready symbols=192 relocations=961580 …,[INFO] [Core] Geometry: 320x240, Aspect: 1.333, FPS: 119.88 …, menu keeps rendering, no stop lineWith this copy of the title,
mainnever reaches either stop. No run logsselect on descriptor … (neither a socket nor a pipe)orunsupported color format 3 number type 4, in stdout, intrace.txtor inretroarch.log. This release ships only the XMB menu driver: settingmenu_driver = "ozone"givesCouldn't find any menu driver named "ozone"and a fallback to XMB. So I could not reproduce the before state (FD 5 select abort, then the 8_8 UINT abort before the Ozone menu). The title runs show no regression, and the frame dumps show the same XMB menu on both sides. They do not confirm the fix. If your copy of PPSA99169 differs from the catalog release (Ozone menu, a different build identity), the exact build would let others reproduce it.Minor points:
guest_selectblock acceptsready >= 1and either bit.HostFileReadysets both bits for a disk file in both sets (FreeBSD'svop_stdpolldoes the same), so the test could require both.aps5_select_disk_ready.txtstays behind when the test aborts.Socket.cpp, 2 in the test) are explanations. CONVENTIONS.md allows comments only for technical debt.Verdict: on Windows both changes are confirmed at the unit level. The new tests pass, and fail on
main's libraries with the messages the PR describes. The libkernel and AGC colour-target sets and the non-GPU suite pass, apart from load timeouts. The catalog copy of PPSA99169 does not reach either code path onmain, so the title claim is not confirmed here; that title shows no regression.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T09:05:19Z.
Thanks @screamm — addressed the three minors on tip
a214a4e2c:guest_selectnow requires both ready bits (read.Has(file) && write.Has(file)).aps5_select_disk_ready_<pid>.txt) and cleared before create, so an abort does not leave a fixed colliding name.Verified here before pushing: rebuilt
libkernel+guest_select_testsandctest -R '^guest_select$' --repeat until-fail:3→ 3/3 passed.On the catalog RetroArch copy not hitting either stop: agreed — that is a title/build difference. Our dump reaches HostFileReady (regular-file select during bring-up) and the COLOR_8_8 UINT path; yours staying on XMB without those stops is consistent with a different
build identity/ menu driver. Unit + negative-control evidence you ran is the portable confirmation; title screenshots remain dump-specific evidence, not a claim that every catalog copy hits the same abort sequence.Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T09:33:31Z.
Thanks @milescoviello — good second-title signal for the COLOR_8_8 UINT half. Doom 3 BFG hitting the same
format 3 / number type 4stop without the mapping, and clearing it with the one-lineVK_FORMAT_R8G8_UINTchange, matches what the Graphics unit test covers here. Noted that you only exercised the Agc side (not the RetroArchselecthalf).Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:13:03Z.
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.
main)docs/dev/debt/libSceAgcDriver.mdL68Some 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.
core/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppcore/libs/prx/libSceAgcDriver/Graphics/src/State.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Graphics.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdImported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-15T13:47:53Z.
Re-test on Windows 11 Pro 26220, NVIDIA RTX 4070 (596.21), MinGW GCC 15.2, PR head
a214a4e2cmerged on main3ee537191:4a054f683: onlySocket.cpp(one comment removed, no code change) andGuestSelect.cpp(both ready bits required, per-process temp file name removed before create, comments removed). That covers all three minors.libspass with 0 warnings.--repeat until-fail:3:guest_select3/3.guest_pollandguest_select_waitalso pass. The libkernel set (143 tests): 142 passed every repeat. In one repeatguest_select_waitaborted ("twenty 1 ms selects did not stay close to their deadlines"), under-j8load; that test usesselectwithout descriptors, and it fails the same way on plain main here (3 of 25 runs on main, 4 of 25 with the PR, 0 of 25 on a second round each). The AGC colour-target set (agc_driver_graphicswith theuint8x2test and 7 colour-target tests): 24/24 runs.Socket.cppreverted to main givesselect on descriptor 3 (neither a socket nor a pipe) not implemented;State.cppreverted givesAGC graphics: unsupported color format 3 number type 4 component swap 0. AHostFileReadythat reports only the readable bit now failsguest_select(the previous||would have accepted it).conventions_function_bodies,debt_split,hardware_oracle_compare,guest_none_relocations,tls_function_coverage_register_address_loads,windows_diagnostic_fixture_isolationandelf_header; none involves select or the AGC formats.tools/check_conventions.py --base origin/mainandgit diff origin/main --checkpass.selector the 8_8 UINT path on main, so this run shows no regression and does not confirm the title claim.No concerns with the code.
Written with Claude Code assistance.
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-16T03:13:12Z.
Another title that needs the 8_8 UINT part: Doom 3 BFG (PPSA99313) from the homebrew catalog. @nicolasfalesy first saw its stop on Intel Arc (https://github.com/boykopovar/AnyPS5/pull/6213#issuecomment-6206823042). It reaches the color target only once #6213 gets it past
guest allocation is not registered. Linux, RTX 4070 Ti, NVIDIA 595.99, 60 s runs with pad input, two runs each:main5d9dcc42dguest allocation is not registered(2 of 2)AGC graphics: unsupported color format 3 number type 4 component swap 0(2 of 2)a214a4e2c)Sys_Error: Could not load default font "Arial_Narrow"and exits 0 (2 of 2), because no game data was installedAI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T20:50:50Z.
Checked the diff against main:
HostFileReadyonly acceptsFILE_TYPE_DISKand every other descriptor type still throws;COLOR_8_8+ UINT maps toR8G8_UINTwith the same swap mapping as UNORM/SNORM.agc_driver_graphicsfails without the change and passes with it,guest_selectandguest_select_waitpass, and the Windows runs by @screamm and the Doom 3 BFG run by @milescoviello cover the two halves on other hosts. Merging once the Windows build is green.