Skip to content

build(libs): support Emscripten memory64 compilation - #11341

Merged
adriadam10 merged 7 commits into
boykopovar:mainfrom
SteelCrab:review/emscripten-libraries
Oct 30, 2026
Merged

adriadam10 merged 7 commits into
boykopovar:mainfrom
SteelCrab:review/emscripten-libraries

Conversation

@SteelCrab

@SteelCrab SteelCrab commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What

Compile shared system-library sources with Emscripten memory64: adapt guest memory, module/file/process interfaces and ABI declarations, and load/store guest x87 long doubles on a binary128 host. Unsupported context switching, module unwind queries, vnode watches, mapping operations and the new host-region release path throw; the remaining limitations are recorded in library debt files.

Replaces closed #9092 and follows merged #10017. The module-unwind review is addressed by an explicit unsupported Emscripten path and a linked Node regression. #8864 and #9506 are already in main; their native Bessel and DNS changes are retained.

Tested

Ubuntu 26.04.1 x86-64, GCC 15.2, Emscripten 6.0.12, Node 26.12.0. Refreshed on 2026-10-30 onto main 91a69952c10099966378a6a9006b8ef616ae22da; tested head 98248606d4ef786f04329ec815334b6539e88035.

  • Native Release portability build: 18 library translation units compiled; guest_long_double 1/1 passed.
  • Emscripten memory64 Release portability build: the same 18 units compiled; Node tests 2/2 passed (guest_long_double, emscripten_module_unwind). The latter links both production module sources, checks unsupported queries preserve output across addresses and flags, and preserves the kernel null-output EFAULT result.
  • Native video_out_output_mode_policy on the same machine: main 1/1; change 1/1 passed. Both verbose runs used ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. Neither log contained the missing-layer message or a VUID- error. This CPU-only test does not exercise Vulkan or GPU rendering.
  • Public-header audit: 373 libraries / 14243 exports verified. Code and PR-template Conventions against the refreshed base and git diff --check passed.
  • The new upstream guest arena host-region release path does not compile on WebAssembly because its native reservation helper is unavailable. On WebAssembly it now throws explicitly, with the limitation recorded in the existing libc debt entry; native behavior is unchanged.
  • Full native-library suites, Windows/macOS host execution, browser/title runs and GPU rendering were not run locally.

CI coverage:

Claim Workflow / job
Native/memory64 compilation of 18 sources; native long-double and both Node regressions Emscripten library portability / library-portability
Native relinker, register-context and write-watch checks Build / corresponding jobs
Full native libraries and runtime tests Maintainer-dispatched Build / linux and windows
Repository and PR rules Conventions / conventions

Remote validation for the new head is pending. The prior head's hosted portability and Conventions jobs passed; its automatic Build skipped Linux and its Windows configure/link job did not establish full-library CTest coverage. A maintainer dispatch of the full native Build remains needed for the refreshed head.

Overlap coordination:

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: No GPU rendering tested; native VideoOut policy regression is CPU-only
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Progress report (91a6995 → 9824860)

📉 System libraries: 43.22% (-0.02%, +2 declared, -1 reverted functions)

🆕 2 declared as stubs
Library Name
libkernel getcontext_nid_postfix
libkernel swapcontext_nid_postfix
⚠️ 1 went back to stubs
Library Name
libkernel sceKernelGetModuleInfoForUnwind

Changed libraries (implemented exports)

Library Before After Change
libkernel 700/746 (93.83%) 699/748 (93.45%) -0.38%

@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.

Blocking Emscripten runtime path: this new __EMSCRIPTEN__ branch delegates to sceKernelGetModuleInfoForUnwind. In core/libs/prx/libkernel/Module/src/Module.cpp, Emscripten falls through to the generic non-Apple implementation, which calls HostMapping::Find; HostMapping.hpp reads /proc/self/maps and throws if it cannot open it. The Emscripten portability workflow compiles libSceSysmodule/Export.cpp but omits libkernel/Module/src/Module.cpp, and its test only exercises long-double conversion, so this route is neither compiled nor runtime-tested by the new check. Please add an explicit Emscripten implementation (or make this operation fail as an explicitly unsupported path) and include its translation unit and a focused test in the portability workflow. Please also change the checklist dependency from #10017 to none: #10017 is already merged, so it is no longer a PR that must land first.

@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.

The prior blocking issue is resolved at this head. Under Emscripten, the generic HostMapping implementation is excluded, the kernel unwind query reports the unsupported path explicitly, and the sysmodule entry point forwards to that same path. The new Node regression links both production translation units, checks unsupported queries leave output unchanged across representative addresses and flags, and preserves the kernel null-output EFAULT result. The focused library-portability check and conventions check pass at fcb7255. The checklist now correctly lists no dependency on already-merged #10017. I did not independently run the full native library build; the automatic workflow reports the full native library jobs as skipped.

@github-actions

github-actions Bot commented Oct 26, 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 7532 docs/dev/debt/libkernel.md L144
PR 7938 core/libs/prx/libc/src/GuestArena.cpp L154
PR 10025 core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp L780-781
PR 10345 docs/dev/debt/libc.md L109

Exports introduced here that are already present in main:

  • getcontext
    setcontext
    swapcontext

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 1835 core/libs/prx/libc/src/GuestAllocations.cpp
core/libs/prx/libc/src/GuestArena.cpp
PR 4449 core/libs/prx/libc/src/GuestArena.cpp
core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp
PR 4630 docs/dev/debt/libkernel.md
PR 5021 core/libs/prx/libSceSysmodule/Export.cpp
core/libs/prx/libc/include/WindowsFormatting.hpp
core/libs/prx/libc/include/general/ExportMacros.hpp
core/libs/prx/libc/src/ApplicationProcessParameters.cpp
core/libs/prx/libc/src/General.cpp
core/libs/prx/libc/src/GuestAllocations.cpp
core/libs/prx/libc/src/GuestArena.cpp
core/libs/prx/libc/src/Strings.cpp
core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp
core/libs/prx/libkernel/Equeue/src/FileEvent.cpp
core/libs/prx/libkernel/File/src/NativeStat.cpp
core/libs/prx/libkernel/File/src/Stdio.cpp
core/libs/prx/libkernel/Module/src/Module.cpp
core/libs/prx/libkernel/System/src/Process.cpp
docs/dev/debt/libc.md
docs/dev/debt/libkernel.md
PR 5303 docs/dev/debt/libc.md
PR 5836 core/libs/prx/libSceNet/Export.cpp
PR 6321 core/libs/prx/libc/src/GuestAllocations.cpp
PR 6936 core/libs/prx/libkernel/File/src/Stdio.cpp
docs/dev/debt/libkernel.md
PR 6977 core/libs/prx/libSceVideoOut/include/VideoOutDriver.hpp
PR 7081 docs/dev/debt/libc.md
PR 7088 core/libs/prx/libkernel/Equeue/src/FileEvent.cpp
docs/dev/debt/libkernel.md
PR 7105 core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp
docs/dev/debt/libkernel.md
PR 7121 core/libs/prx/libkernel/Equeue/src/FileEvent.cpp
core/libs/prx/libkernel/File/src/Stdio.cpp
docs/dev/debt/libkernel.md
PR 7135 docs/dev/debt/libkernel.md
PR 7149 core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp
docs/dev/debt/libkernel.md
PR 7192 docs/dev/debt/libkernel.md
PR 7386 docs/dev/debt/libc.md
PR 7447 core/libs/prx/libkernel/File/src/Stdio.cpp
docs/dev/debt/libc.md
docs/dev/debt/libkernel.md
PR 7464 docs/dev/debt/libkernel.md
PR 7509 docs/dev/debt/libkernel.md
PR 7622 core/libs/prx/libkernel/Equeue/src/FileEvent.cpp
PR 7631 core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp
PR 7715 docs/dev/debt/libc.md
PR 7804 core/libs/prx/libkernel/System/src/Process.cpp
docs/dev/debt/libkernel.md
PR 8150 docs/dev/debt/libc.md
PR 8605 docs/dev/debt/libkernel.md
PR 8965 core/libs/prx/libc/src/Strings.cpp
docs/dev/debt/libc.md
PR 9156 docs/dev/debt/libkernel.md
PR 9162 core/libs/prx/libkernel/System/src/Process.cpp
PR 9242 docs/dev/debt/libkernel.md
PR 9293 core/libs/prx/libkernel/File/src/Stdio.cpp
docs/dev/debt/libkernel.md
PR 9297 core/libs/prx/libkernel/File/src/Stdio.cpp
docs/dev/debt/libkernel.md
PR 9302 core/libs/prx/libkernel/File/src/Stdio.cpp
docs/dev/debt/libkernel.md
PR 9326 docs/dev/debt/libkernel.md
PR 9340 docs/dev/debt/libc.md
PR 9371 core/libs/prx/libc/src/General.cpp
docs/dev/debt/libc.md
PR 9389 docs/dev/debt/libkernel.md
PR 9432 core/libs/prx/libSceVideoOut/include/VideoOutDriver.hpp
PR 9447 docs/dev/debt/libc.md
PR 9526 docs/dev/debt/libc.md
PR 9557 docs/dev/debt/libkernel.md
PR 9566 docs/dev/debt/libkernel.md
PR 9688 docs/dev/debt/libc.md
PR 9843 docs/dev/debt/libkernel.md
PR 9863 core/libs/prx/libc/src/ScanningWide.cpp
docs/dev/debt/libc.md
PR 9867 docs/dev/debt/libc.md
PR 9932 core/libs/prx/libSceNet/Export.cpp
PR 9938 docs/dev/debt/libkernel.md
PR 10113 docs/dev/debt/libc.md
PR 10222 docs/dev/debt/libc.md
PR 10226 docs/dev/debt/libc.md
PR 10229 docs/dev/debt/libc.md
PR 10349 docs/dev/debt/libc.md
PR 10405 docs/dev/debt/libc.md
PR 10442 docs/dev/debt/libkernel.md
PR 10552 core/libs/prx/libkernel/File/src/NativeStat.cpp
core/libs/prx/libkernel/File/src/Stdio.cpp
docs/dev/debt/libkernel.md
PR 10620 docs/dev/debt/libc.md
PR 10645 docs/dev/debt/libkernel.md
PR 10729 core/libs/prx/libc/src/Strings.cpp
docs/dev/debt/libc.md
PR 11002 docs/dev/debt/libkernel.md
PR 11215 docs/dev/debt/libkernel.md
PR 11332 core/libs/prx/libc/include/WindowsFormatting.hpp
docs/dev/debt/libc.md
PR 11628 core/libs/prx/libkernel/System/src/Process.cpp
docs/dev/debt/libkernel.md
PR 11661 core/libs/prx/libkernel/System/src/Process.cpp
docs/dev/debt/libc.md
docs/dev/debt/libkernel.md
PR 11689 core/libs/prx/libkernel/System/src/Process.cpp
docs/dev/debt/libc.md
docs/dev/debt/libkernel.md
PR 11698 core/libs/prx/libkernel/System/src/Process.cpp
docs/dev/debt/libc.md
docs/dev/debt/libkernel.md
PR 11939 core/libs/prx/libkernel/System/src/Process.cpp
docs/dev/debt/libkernel.md
PR 11948 core/libs/prx/libSceVideoOut/include/VideoOutDriver.hpp
PR 12053 docs/dev/debt/libc.md
PR 12057 docs/dev/debt/libc.md
PR 12135 docs/dev/debt/libkernel.md
PR 12157 core/libs/prx/libc/src/GuestAllocations.cpp
PR 12598 docs/dev/debt/libc.md
PR 12605 docs/dev/debt/libc.md
PR 12622 core/libs/prx/libc/include/WindowsFormatting.hpp
docs/dev/debt/libc.md
PR 12688 core/libs/prx/libSceNet/Export.cpp
core/libs/prx/libkernel/File/src/Stdio.cpp
core/libs/prx/libkernel/System/src/UserContext.cpp
docs/dev/debt/libc.md
docs/dev/debt/libkernel.md
PR 12700 core/libs/prx/libSceNet/Export.cpp
core/libs/prx/libkernel/File/src/Stdio.cpp
core/libs/prx/libkernel/System/src/UserContext.cpp
docs/dev/debt/libc.md
docs/dev/debt/libkernel.md
PR 12741 docs/dev/debt/libkernel.md
PR 12854 docs/dev/debt/libkernel.md
PR 12863 core/libs/prx/libSceVideoOut/include/VideoOutDriver.hpp
PR 12908 core/libs/prx/libkernel/File/src/Stdio.cpp
docs/dev/debt/libkernel.md
PR 12965 core/libs/prx/libSceNet/Export.cpp
core/libs/prx/libkernel/File/src/Stdio.cpp
core/libs/prx/libkernel/System/src/UserContext.cpp
docs/dev/debt/libc.md
docs/dev/debt/libkernel.md
PR 12970 docs/dev/debt/libkernel.md
PR 13119 docs/dev/debt/libc.md

@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.

The previous module-unwind blocker is resolved, and the current hosted Emscripten portability, relinker, register-context and write-watch checks pass. The native full-library Linux and Windows jobs are still skipped by the automatic gate, as the report correctly says.

The reviewed head fcb72551ab9ad72d21290ab8d4f1b818abb3fbad is now 4 commits ahead and 52 behind current main (14c99b52ac), with a clean merge preview. The reported native/memory64 builds and Node regressions were run against 9b197b6ce4583e64bf2427e6beb7270bcfa1528e. CONTRIBUTING.md asks branches to stay current; please rebase onto current main, resolve the debt-file overlaps, and rerun the library-portability job at the refreshed head. I found no changed production file overlap on the intervening commits, but this broad portability change needs exact-head validation after the refresh.

@MarcZX10 MarcZX10 mentioned this pull request Oct 26, 2026
12 tasks done
@MarcZX10

Copy link
Copy Markdown
Contributor

Follow-up to my existing review: current upstream main is b27cc8416f820e40ce187f165d34138e24373dd7; this head is 5 commits ahead and 160 behind, with a clean merge preview. Since its base 9b197b6ce4583e64bf2427e6beb7270bcfa1528e, main changed three touched paths: core/libs/prx/libkernel/File/src/Stdio.cpp, docs/dev/debt/libc.md, and docs/dev/debt/libkernel.md. In Stdio, the existing sceKernelRename dot-path rejection was removed, so the Emscripten path must be reconciled with that current behavior rather than blindly carrying the older code. Please rebase, preserve the newer debt entries and reconcile the rename change, then rerun the Emscripten library-portability job and relevant Node regressions on the exact new head. The latest hosted library-portability run succeeds on the old head; native full-library jobs remain path-skipped.

@MarcZX10

Copy link
Copy Markdown
Contributor

Current-main follow-up (5b5d24cb223ede690fe5eab1fe2f7a1736b801a5): the reviewed head fcb72551ab9ad72d21290ab8d4f1b818abb3fbad is 5 commits ahead and 247 behind merge base 9b197b6ce4583e64bf2427e6beb7270bcfa1528e. The Emscripten portability workflow and current-head conventions pass, and the current merge preview is clean. However, main has since changed libkernel/File/src/Stdio.cpp plus both libc and libkernel debt files that this PR edits; the native change removes unreachable post-return code, while the debt files gained separate entries that must be retained. Please rebase onto current main, preserve those updates and rerun the portability workflow plus focused native tests on the resulting exact head. Full native Linux/Windows library jobs remain skipped by the automatic gate and require maintainer dispatch.

@Queuse

Queuse commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

My draft #11332 rewrites the narrow formatter and conflicts with your FormatArguments changes in WindowsFormatting.hpp. I propose #11341 first, then resolving my formatter on top while retaining GuestLongDoubleLoad and the removal of native long-double layout assumptions. Does that order work for you? #11332 also waits for #9087, whose author confirmed its landing order; #9958 has now merged. I have recorded this proposal without treating it as agreed.

@SteelCrab

Copy link
Copy Markdown
Contributor Author

Published the current-main refresh at bb065fccc0b2a5ee3fc3b8deeceb94b2245de901, based on main d7fd41699238337a84cc61de848b5523a938031d. The updated Tested section records the exact head: native and memory64 compilation of 18 sources, native long-double 1/1, Node regressions 2/2, and the native VideoOut policy test 1/1 on each tree. Public-header audit, complete Conventions and whitespace checks pass locally. Current-main rename/mprotect behavior and the newer debt entries are retained.

@MarcZX10 The fresh library-portability run is running on this head. The earlier stale-head results have been replaced in the description; merge-order replies and the remaining unconfirmed overlaps are recorded separately. Please take another look after this run completes.

@adriadam10 Could you dispatch the full native Build on main for pr=11341, full=true, at this new head? My attempt to dispatch it returned HTTP 403 because this account lacks maintainer access. The automatic Build skips the Linux job, so its overall result cannot substitute for full native-library verification.

gh workflow run build.yml --repo boykopovar/AnyPS5 --ref main --field pr=11341 --field full=true

Thanks for the review and CI help.

@adriadam10
adriadam10 dismissed MarcZX10’s stale review October 28, 2026 09:10

Dismissing a stale review: the requested changes were addressed after it (new head) and the merge queue blocks on it. Please request changes again if anything is still open.

@Queuse

Queuse commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Thanks for confirming #11341 before #11332. I have updated my draft's description/checklist to record the agreement. I will preserve GuestLongDoubleLoad and host-layout independence when resolving the formatter after its prerequisites land; the existing test results remain scoped to their published heads.

@JJenkx

JJenkx commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

@SteelCrab an overlap note from #12514 (swscanf floating fields measured on titles' libc.prx). It changes the same %Lf store in ScanningWide.cpp that this PR turns into GuestLongDoubleStore(target, std::strtold(...)). The titles write only the 10 bytes of the value there (the other 6 of the 16 stay untouched), and store the default quiet NaN for any NaN, so #12514 copies 10 bytes of a value it has already filtered. Either can land first. If yours does, I'll rebase #12514 onto GuestLongDoubleStore (provided it can write 10 bytes); if mine does, the rebase is a one-liner on your side. Just flagging it so neither surprises the other.

AI-assisted: yes (Claude Code).

@JJenkx

JJenkx commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

@SteelCrab a merge-order question, following my earlier note about the shared %Lf store: a maintainer asked the authors of #12514 (swscanf floating fields as titles' libc.prx does) and of the PRs it overlaps to agree an order. git merge-tree conflicts in core/libs/prx/libc/src/ScanningWide.cpp (the %Lf store your GuestLongDoubleStore replaces) and in docs/dev/debt/libc.md. When I rebase, I'd keep your helper for the conversion and write only the 10 value bytes, as the titles do.

Proposed order: this PR lands first, and #12514 rebases afterwards (#12514 will declare it in Depends on). Your PR needs no changes. Could you confirm that order works for you, or say if you'd rather #12514 went first?

AI-assisted: yes (Claude Code).

@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.

Re-checked — changes requested

The author has now published current-main validation on head bb065fccc0b2a5ee3fc3b8deeceb94b2245de901: the report includes native and memory64 compilation of 18 sources, long-double and Node regressions, and the VideoOut policy test. The hosted portability, relinker, register-context, write-watch, Windows, conventions, and policy checks pass; Linux product CI is skipped.

The tested base is d7fd41699238337a84cc61de848b5523a938031d. Current main is 2960e9a6e7e1fc99c4ed180c71495b5eb83464c7, and this branch is 831 commits behind. Nine touched paths changed on both sides since the tested base, including libc/libkernel source files compiled by the memory64 validation. The merge preview is clean, but those source changes are part of the feature’s compile surface. Please refresh the branch and rerun the native/memory64 source compilation and focused regressions against that integrated head before I can approve.

I did not run Emscripten or Node tests locally.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 29, 2026
@SteelCrab
SteelCrab force-pushed the review/emscripten-libraries branch from bb065fc to d5ba05c Compare October 29, 2026 08:59
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 29, 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.

Re-check — changes requested\n\nThe refreshed validation on exact head d5ba05c is substantial: the author reports 18 native and memory64 translation units compiled, native long-double 1/1, Node regressions 2/2, and the CPU-only VideoOut policy comparison passing on both main and the change. The branch is based on current main aaccd0b, and the report clearly distinguishes the maintainer-dispatched full native suites and GPU rendering that were not run.\n\nOne repository coordination blocker remains, and the PR body confirms it is unresolved: #12514 changes the same %Lf store in ScanningWide.cpp and reports a 10-byte store with preserved padding/NaN normalization, while this PR's GuestLongDoubleStore writes 16 bytes. The proposed order is #11341 first, but #12514's author has not confirmed it and the checklist still says Depends on: none. Please confirm the order with that author, record Depends on #12514 only if this PR must follow it (otherwise record the agreed order on both PRs), and resolve the 10-byte interaction before landing. No combined behavior has been tested. I did not independently run the author-reported builds or Node tests.

@adriadam10
adriadam10 force-pushed the review/emscripten-libraries branch from d5ba05c to 5f2d455 Compare October 29, 2026 13:31

@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.

Re-checked — new head, changes requested

The branch has advanced, but its test report still names the older head and the required landing order with the overlapping #12514 remains unconfirmed.

What I ran

  • Reviewed head 5f2d45501d2acb9b7407df37f7842ac39d8f427b against current main dfcc0e17cb254d08fec9ec120e362620795d59a0; the merge preview is clean.
  • Checked the branch distance: it is 37 commits behind and 6 ahead of current main.
  • Compared current-main changes since the PR's integrated main 7aabd03d0a32bb928311ef1323b95dffb4618f7e; Process.cpp and docs/dev/debt/libkernel.md overlap this PR.
  • Ran git diff --check upstream/main...refs/remotes/review/pr-11341; it passed with no output.
  • Read the current Tested section and exact-head hosted checks. I did not run a native or Emscripten build locally.
git merge-tree --write-tree upstream/main refs/remotes/review/pr-11341
git rev-list --left-right --count upstream/main...refs/remotes/review/pr-11341
git diff --name-only 7aabd03d0a32bb928311ef1323b95dffb4618f7e upstream/main
git diff --check upstream/main...refs/remotes/review/pr-11341
gh pr checks 11341 -R boykopovar/AnyPS5

Results

Check Result
Merge preview against current main Pass; clean tree d4014a7a4ed1d5220dca5debd46ef0089663d896
Branch distance 37 behind / 6 ahead
Diff check Pass; no output
Current-main changes overlapping this PR core/libs/prx/libkernel/System/src/Process.cpp; docs/dev/debt/libkernel.md
Tested-section head Still says d5ba05c0f4035d306b5a839c9c506393e03bd53a, not the reviewed 5f2d45501d2acb9b7407df37f7842ac39d8f427b
Hosted conventions, eligibility, labels, portability, and report Pending
Unedited command output
d4014a7a4ed1d5220dca5debd46ef0089663d896
37	6
core/libs/prx/libkernel/System/src/Process.cpp
docs/dev/debt/libkernel.md
conventions	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/40882774691/job/123478414631
eligibility	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/40882780480/job/123478432352
labels	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/40882774743/job/123478414774
library-portability	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/40882780502/job/123478432302
report	pending	0	https://github.com/boykopovar/AnyPS5/actions/runs/40882780516/job/123478431998

Negative control

Assertion Change made to code under test New test failed?
The native and Emscripten portability regressions distinguish this head from main None Could not exercise; the reported runs target d5ba05c0f4035d306b5a839c9c506393e03bd53a

Findings

Blocking

  • Current-main integration and test evidence: the PR is 37 commits behind current main; two touched paths changed since the integrated base, while the Tested section names an older head and the portability CI for this head is pending. Please integrate current main and rerun the native and memory64 portability tests on the exact updated head.
  • Unconfirmed overlap order: the PR changes the same %Lf store in ScanningWide.cpp as #12514, and its own Tested section says the proposed order is not confirmed. The current contribution rules require the authors to agree an order and declare it with Depends on. Please confirm the order with #12514's author and update the checklist.

Non-blocking

The merge preview is clean. The body accurately distinguishes the earlier test results from validation still pending on this head.

Sources

Not verified

I did not build native or Emscripten targets, run Node tests, or run host, browser, title, or console execution on this head.

To get this to a good state

Rebase onto current main, rerun native and memory64 portability tests on the resulting head, and record the author-agreed #12514 order in Depends on; I will repeat the same checks on that head.

@JJenkx

JJenkx commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

@MarcZX10 @SteelCrab from the author of #12514, to settle the order on this side: #11341 lands first. #12514 already declares Depends on: #11341 in its checklist, and its description says it rebases onto this PR's %Lf store (GuestLongDoubleStore(target, std::strtold(...))) rather than the other way round. So #11341 doesn't need a Depends on for #12514, and nothing here has to change for the overlap. Whichever way it lands, the ScanningWide.cpp conflict is mine to resolve in #12514.

AI-assisted: yes (Claude Code).

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 5f2d455 merged onto main bb04a4f · tested 2026-10-29 20:56 UTC · 29 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,844 passed · 6 failed (0 new, 6 also fail on main) · 40 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,890 of 2,918 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 (1162 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_lookup_log_fits_build 72.0 s, ⚠️ agc_driver_bda_device 48.9 s, ⚠️ agc_driver_pipeline_journal 31.7 s
Failing on main too (6, not counted against this PR)
agc_compute_pipeline_inspection
agc_driver_image_table
agc_submit_progress
agc_submit_progress_no_timeline
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (5 IDs in 686 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (686 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 678 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 (40)
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_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
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_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_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: 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_in_order: 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_eop: 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_eop_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_eop_main: 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_fresh: 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_labels: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not
Reproduce
git fetch origin 5f2d45501d2acb9b7407df37f7842ac39d8f427b bb04a4f1ea0175e9e4f149f0359a764d62ff3296
git checkout bb04a4f1ea0175e9e4f149f0359a764d62ff3296 && git merge --no-ff 5f2d45501d2acb9b7407df37f7842ac39d8f427b
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 32 --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 4 --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 NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

SteelCrab and others added 7 commits October 30, 2026 10:50
Emscripten targets wasm64 without x86 assembly, Linux-only headers or the
x87 long double. These changes add __EMSCRIPTEN__ paths beside the host
ones; native builds compile the same code as before.

- libc: long doubles in guest varargs and scanf go through
  GuestLongDouble, a plain copy where long double is the x87 format;
  APS5_EXPORT emits no assembler alias; the guest arena is one aligned
  allocation that zeroes pages when they are committed again; getifaddrs
  keeps its link-level entries on Linux; /proc lookups and the host
  stderr duplicate are left out.
- libkernel: file-backed mmap, EVFILT_VNODE watches, getcontext and
  setcontext throw; getdents replaces the raw getdents64 syscall;
  getdtablesize takes the resource limit alone.
- VideoOut leaves SDL, the display window and the HDR probe out,
  Sysmodule asks libkernel for unwind information and Net includes
  sys/time.h.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@SteelCrab
SteelCrab force-pushed the review/emscripten-libraries branch from 5f2d455 to 9824860 Compare October 30, 2026 01:55
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 9824860 merged onto main 98ddd9c · tested 2026-10-30 10:02 UTC · 31 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,907 passed · 5 failed (0 new, 3 also fail on main, 2 unstable on main) · 41 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,953 of 2,987 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 (1175 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_lookup_log_fits_build 70.8 s, ⚠️ agc_driver_bda_device 64.3 s, ⚠️ agc_driver_pipeline_journal 38.8 s
Intermittent validation messages (1, seen once in the parallel run, not reproduced when the test was re-run alone 2 times; not counted against this PR)
agc_driver_depth_clear_hle: VUID-vkCmdCopyBuffer-commonparent (6x)
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_depth_clear_hle: failed in 1 of the last 8 main runs
agc_driver_submit_progress: failed in 5 of the last 8 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (5 IDs in 689 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (689 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 681 more
VUID-vkCmdCopyImage-srcImage-01548 (13 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_plane_sampling, and 5 more
VUID-vkCmdCopyImage-srcImage-01551 (13 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_plane_sampling, and 5 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 (41)
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_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
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_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_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: 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_in_order: 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_eop: 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_eop_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_eop_main: 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_fresh: 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 plat
Reproduce
git fetch origin 98248606d4ef786f04329ec815334b6539e88035 98ddd9c1792bbab016ceed5db267a93d1d61f00a
git checkout 98ddd9c1792bbab016ceed5db267a93d1d61f00a && git merge --no-ff 98248606d4ef786f04329ec815334b6539e88035
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 32 --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 4 --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 NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@adriadam10
adriadam10 merged commit 8304cca into boykopovar:main Oct 30, 2026
19 of 21 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the x87/binary128 long-double load and store (zeros, normals, denormals, inf/NaN, sign), the Emscripten guest arena including the new host-region release throw, the unsupported paths (context switching, module unwind, vnode watches, file/shared mappings) and the new workflow and tests; the native digits == 64 path is unchanged and the landing order with #11332 and #12514 is agreed by both authors (this lands first). Our docs/dev/debt/libkernel.md entry on direct-memory contents lost across unmap/map under WebAssembly is already on the branch; merged.

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.

7 participants