build(libs): support Emscripten memory64 compilation #11341
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11341"
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 SteelCrab on 2026-10-26T04:50:38Z.
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 head98248606d4ef786f04329ec815334b6539e88035.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-outputEFAULTresult.video_out_output_mode_policyon the same machine: main 1/1; change 1/1 passed. Both verbose runs usedANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1, andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. Neither log contained the missing-layer message or aVUID-error. This CPU-only test does not exercise Vulkan or GPU rendering.git diff --checkpassed.CI coverage:
library-portabilitylinuxandwindowsconventionsRemote 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:
GuestLongDoubleLoadand avoiding host long-double layout assumptions when rebased.ScanningWide.cppat the%Lfstore:GuestLongDoubleStorewrites 16 bytes, while #12514 requires a 10-byte write preserving padding and canonicalizing NaNs. A scratch merge of #12514 headccdd878bd9184e5031ddf1108c9d7044821ebeb9with the preceding rebased heade212645586b8db1cd67beaf8cd66fc990040b5c9encoded into a temporary 16-byte buffer and copied 10 bytes. A focused scanner harness passed 4 cases (finite value, negative zero, infinity and canonical NaN, with padding and canaries checked) on native and memory64/Node. This is a candidate integration test, not a test of the future rebased #12514 or full suite.91a69952, the scanner reports conflicts with #7938 (guest arena), #10025 (direct memory), and #7532 / #10345 (debt entries). Some branches could not be compared because they already conflict with main, including #11332 and #12514, so no blanket overlap-free claim is made. The scanner also listsgetcontext,setcontextandswapcontextas already in main: this PR adds their mutually exclusive Emscripten unsupported branches, while retaining the existing native definitions. Its #11341 entry compares this PR against its previous remote head.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T04:55:15Z.
Review: CHANGES_REQUESTED
Blocking Emscripten runtime path: this new
__EMSCRIPTEN__branch delegates tosceKernelGetModuleInfoForUnwind. Incore/libs/prx/libkernel/Module/src/Module.cpp, Emscripten falls through to the generic non-Apple implementation, which callsHostMapping::Find;HostMapping.hppreads/proc/self/mapsand throws if it cannot open it. The Emscripten portability workflow compileslibSceSysmodule/Export.cppbut omitslibkernel/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 tonone: #10017 is already merged, so it is no longer a PR that must land first.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T05:19:22Z.
Review: APPROVED
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 fcb72551ab. 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.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T05:59:46Z.
Review: DISMISSED
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
fcb72551ab9ad72d21290ab8d4f1b818abb3fbadis now 4 commits ahead and 52 behind currentmain(14c99b52ac), with a clean merge preview. The reported native/memory64 builds and Node regressions were run against9b197b6ce4583e64bf2427e6beb7270bcfa1528e.CONTRIBUTING.mdasks branches to stay current; please rebase onto currentmain, 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.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T06:18:28Z.
Review: CHANGES_REQUESTED
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. Currentmainis2960e9a6e7e1fc99c4ed180c71495b5eb83464c7, and this branch is 831 commits behind. Nine touched paths changed on both sides since the tested base, includinglibc/libkernelsource 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.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T09:05:43Z.
Review: CHANGES_REQUESTED
Re-check — changes requested\n\nThe refreshed validation on exact head d5ba05c0f4035d306b5a839c9c506393e03bd53a 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
aaccd0ba39, 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.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T13:40:04Z.
Review: CHANGES_REQUESTED
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
5f2d45501d2acb9b7407df37f7842ac39d8f427bagainst currentmaindfcc0e17cb254d08fec9ec120e362620795d59a0; the merge preview is clean.main.7aabd03d0a32bb928311ef1323b95dffb4618f7e;Process.cppanddocs/dev/debt/libkernel.mdoverlap this PR.git diff --check upstream/main...refs/remotes/review/pr-11341; it passed with no output.Results
maind4014a7a4ed1d5220dca5debd46ef0089663d896core/libs/prx/libkernel/System/src/Process.cpp;docs/dev/debt/libkernel.mdd5ba05c0f4035d306b5a839c9c506393e03bd53a, not the reviewed5f2d45501d2acb9b7407df37f7842ac39d8f427bUnedited command output
Negative control
d5ba05c0f4035d306b5a839c9c506393e03bd53aFindings
Blocking
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 currentmainand rerun the native and memory64 portability tests on the exact updated head.%Lfstore inScanningWide.cppas #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 withDepends 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
dfcc0e17%Lfimplementation at reviewed headNot 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 inDepends on; I will repeat the same checks on that head.