fix(loader): defer Linux runtime module starts until requested #6586

Merged
JJenkx merged 14 commits from upstream-pr/6586 into main 2026-10-24 06:54:29 +00:00
JJenkx commented 2026-10-15 21:23:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-15T21:23:46Z.


What

Double Dragon Gaiden (PPSA16018, 01.000.013) historically stopped before main when a linked Unity plugin started through Linux DT_INIT without engine context. This change keeps explicit runtime-directory modules mapped for bindings and starts each module when the title explicitly loads it, forwarding the caller's exact argument pair, including zero/null.

The Linux loader initializes each requested module once, returns the entry result to the load that performs initialization, handles concurrent/reentrant loads, and runs generated finalizers only after initialization completes. Standard SDK folders keep eager initialization, including browser conversions. Present zero-address DT_INIT entries retain their relocation; absent tags leave a null lifecycle slot. No title-specific contexts or default argument blocks are supplied.

Rebased onto main d6eafa54d0464258574fd2f71889754d05a5bc93, head fa3e35112131790755dcddadc54cf2c7b8dea37e. Prerequisite #6684 is merged; this branch contains only the fourteen topic commits, with no merge commits. The rebase preserves the production and test changes; range-diff differences are documentation context. A merge-tree check against newer main 7e2ba73e4c8c26b5d632b0d2f46166ffc1b8a29d is clean, and conventions pass against it. Build and test results below apply to the stated d6eafa54 base.

Review focus: initialization timing for linked runtime-directory modules and repeated-load result semantics. Uniform Windows deferral was accepted in the #8162 review; that is related design precedent, not a console measurement or approval of this Linux implementation. An additional real-kernel diagnostic on production-source head cea585242429fe0e20df3a92d670fa51e8a6437d observed entry result 0x5a17 for the first load and 0 for a repeated load, including a concurrent waiter; the entry and init array still ran once. Console repeated-load result semantics are unmeasured, so result retention across subsequent loads is not claimed. Earlier integration runs reached Double Dragon Gaiden character selection; gameplay is not established. Evergate remained black with and without the change. Those title observations are historical and were not rerun on this head.

Tested

Current-main refresh, 2026-10-23: head 2c98914fe4d95fc406b585c377412c7b48675bdc is a linear 14-commit rebase onto pinned main 4997726a5f6b8cd263461508945a4676647ef482. The only conflict was the dlopen load-failure block: this refresh preserves main's LoadFailure diagnostics and keeps deferred initialization after a successful load. The existing reentrancy, nested-handle, unload/reload and real condition-wait coverage is retained.

Fresh Linux GCC 16.2.1 Release, independent worktree/build with exact submodules: guest_runtime_lifecycle passes three consecutive repetitions, and relinker_conversion passes three consecutive repetitions, with no skips. The relinker and lifecycle probe are freshly built. Conventions and whitespace checks pass. These are CPU synthetic module/loader and conversion regressions; no new native title, Windows, GPU or performance result is claimed. The existing documented lifecycle/ABI limitations remain.

Arch Linux x86-64, GCC 16.2.1, Ryzen 9 7950X. Results below distinguish the public test head from the private runtime integration.

  • At public head fa3e35112131790755dcddadc54cf2c7b8dea37e, clean-configured and built the relinker, all runtime libraries (libs) and guest_runtime_lifecycle_tests. Passed 239/239 relinker tests and the real-kernel lifecycle wrapper covering all six modes: never-start, start, zero-start, concurrent, reentrant and reload. No failures or skips. The concurrent initializer remains blocked until the second loader thread enters pthread_cond_wait, and the test requires that wait to return. This wrapper is confined to the Linux test executable. Source and artifact hashes were independently checked; conventions and whitespace checks pass. This is not the complete runtime test suite.
  • Clean-rebase patch, range-diff, build log, test logs/JUnit and independent review, SHA-256 fcf647f928390b33f0fa21374c136d3ed72f8236687078e80a2d376fdd1cb1cd.
  • Darkest Dungeon II (PPSA19591) on that pinned private integration passed the narrated opening and prologue selection, rendered the stagecoach scene, and reached the party tutorial. The 573-second run exited 0 after the scheduled ordinary window close at 571 seconds; the temporary kernel limit was restored to 64 MiB. Screenshots at 300/450/550 seconds show those scenes. Combat, overall rendering correctness and performance remain unverified.
  • Waiter regression, test log and patch, native report, supervisor log and screenshots, SHA-256 3bfa3c0f62f8257ef7dd6980c52077b16442c182c4f426954f1abbfd1c3d0b80.
  • Historical GitHub CI at previous public head 624609bfe2: relinker jobs pass on Linux, Windows and both macOS configurations; relinker ASan passes. These do not establish full Windows/macOS runtime or runtime sanitizer coverage. Full Linux/Windows jobs were skipped in the automatic PR workflow. The current upstream workflow runs them on main or via manual workflow dispatch; marking this ready for review does not trigger them. A maintainer-run full build is still requested.

Earlier validation at its recorded revisions: 238/238 relinker tests passed; the reentrant negative control deadlocked when only the same-thread reentrancy return was removed; unload/reload coverage confirmed mapping removal and one finalizer sequence per initialized lifetime. Nested-handle regression and negative-control evidence, unload/reload evidence, and earlier full relinker validation.

No full runtime suite, Windows/macOS runtime, runtime sanitizer, GPU-validation or performance result is claimed.

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; #6684 is merged
  • Fixes: none
  • Unblocks: none; Double Dragon Gaiden PPSA16018 evidence is historical
  • GPUs tested: n/a; loader and relinker fixtures
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4880050252 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6586). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-15T21:23:46Z. --- ### What Double Dragon Gaiden (PPSA16018, 01.000.013) historically stopped before main when a linked Unity plugin started through Linux `DT_INIT` without engine context. This change keeps explicit runtime-directory modules mapped for bindings and starts each module when the title explicitly loads it, forwarding the caller's exact argument pair, including zero/null. The Linux loader initializes each requested module once, returns the entry result to the load that performs initialization, handles concurrent/reentrant loads, and runs generated finalizers only after initialization completes. Standard SDK folders keep eager initialization, including browser conversions. Present zero-address `DT_INIT` entries retain their relocation; absent tags leave a null lifecycle slot. No title-specific contexts or default argument blocks are supplied. Rebased onto main `d6eafa54d0464258574fd2f71889754d05a5bc93`, head `fa3e35112131790755dcddadc54cf2c7b8dea37e`. Prerequisite #6684 is merged; this branch contains only the fourteen topic commits, with no merge commits. The rebase preserves the production and test changes; range-diff differences are documentation context. A merge-tree check against newer main `7e2ba73e4c8c26b5d632b0d2f46166ffc1b8a29d` is clean, and conventions pass against it. Build and test results below apply to the stated d6eafa54 base. **Review focus:** initialization timing for linked runtime-directory modules and repeated-load result semantics. Uniform Windows deferral was accepted in [the #8162 review](https://github.com/boykopovar/AnyPS5/pull/8162#issuecomment-6311678668); that is related design precedent, not a console measurement or approval of this Linux implementation. An additional real-kernel diagnostic on production-source head `cea585242429fe0e20df3a92d670fa51e8a6437d` observed entry result `0x5a17` for the first load and `0` for a repeated load, including a concurrent waiter; the entry and init array still ran once. Console repeated-load result semantics are unmeasured, so result retention across subsequent loads is not claimed. Earlier integration runs reached Double Dragon Gaiden character selection; gameplay is not established. Evergate remained black with and without the change. Those title observations are historical and were not rerun on this head. ### Tested Current-main refresh, 2026-10-23: head `2c98914fe4d95fc406b585c377412c7b48675bdc` is a linear 14-commit rebase onto pinned main `4997726a5f6b8cd263461508945a4676647ef482`. The only conflict was the `dlopen` load-failure block: this refresh preserves main's `LoadFailure` diagnostics and keeps deferred initialization after a successful load. The existing reentrancy, nested-handle, unload/reload and real condition-wait coverage is retained. Fresh Linux GCC 16.2.1 Release, independent worktree/build with exact submodules: `guest_runtime_lifecycle` passes three consecutive repetitions, and `relinker_conversion` passes three consecutive repetitions, with no skips. The relinker and lifecycle probe are freshly built. Conventions and whitespace checks pass. These are CPU synthetic module/loader and conversion regressions; no new native title, Windows, GPU or performance result is claimed. The existing documented lifecycle/ABI limitations remain. Arch Linux x86-64, GCC 16.2.1, Ryzen 9 7950X. Results below distinguish the public test head from the private runtime integration. - At public head `fa3e35112131790755dcddadc54cf2c7b8dea37e`, clean-configured and built the relinker, all runtime libraries (`libs`) and `guest_runtime_lifecycle_tests`. Passed 239/239 relinker tests and the real-kernel lifecycle wrapper covering all six modes: never-start, start, zero-start, concurrent, reentrant and reload. No failures or skips. The concurrent initializer remains blocked until the second loader thread enters `pthread_cond_wait`, and the test requires that wait to return. This wrapper is confined to the Linux test executable. Source and artifact hashes were independently checked; conventions and whitespace checks pass. This is not the complete runtime test suite. - [Clean-rebase patch, range-diff, build log, test logs/JUnit and independent review](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/20261022-pr6586-clean-runtime-d6eafa.tar.gz), SHA-256 `fcf647f928390b33f0fa21374c136d3ed72f8236687078e80a2d376fdd1cb1cd`. - Darkest Dungeon II (`PPSA19591`) on that pinned private integration passed the narrated opening and prologue selection, rendered the stagecoach scene, and reached the party tutorial. The 573-second run exited 0 after the scheduled ordinary window close at 571 seconds; the temporary kernel limit was restored to 64 MiB. Screenshots at 300/450/550 seconds show those scenes. Combat, overall rendering correctness and performance remain unverified. - [Waiter regression, test log and patch, native report, supervisor log and screenshots](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/20261022-pr6586-waiter-and-darkest-prologue.tar.gz), SHA-256 `3bfa3c0f62f8257ef7dd6980c52077b16442c182c4f426954f1abbfd1c3d0b80`. - Historical GitHub CI at previous public head `624609bfe2`: relinker jobs pass on Linux, Windows and both macOS configurations; relinker ASan passes. These do not establish full Windows/macOS runtime or runtime sanitizer coverage. Full Linux/Windows jobs were skipped in the automatic PR workflow. The current upstream workflow runs them on main or via manual workflow dispatch; marking this ready for review does not trigger them. A maintainer-run full build is still requested. Earlier validation at its recorded revisions: 238/238 relinker tests passed; the reentrant negative control deadlocked when only the same-thread reentrancy return was removed; unload/reload coverage confirmed mapping removal and one finalizer sequence per initialized lifetime. [Nested-handle regression and negative-control evidence](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/20261021-pr6586-nested-handle-validation.tar.gz), [unload/reload evidence](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/20261021-pr6586-unload-reload-validation.tar.gz), and [earlier full relinker validation](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/20261021-pr6586-main27bc-runtime-validation.tar.gz). No full runtime suite, Windows/macOS runtime, runtime sanitizer, GPU-validation or performance result is claimed. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none; #6684 is merged <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none; Double Dragon Gaiden PPSA16018 evidence is historical <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a; loader and relinker fixtures <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
SandstromPL commented 2026-10-16 04:50:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-16T04:50:43Z.


Hi @JJenkx, a heads-up on how this interacts with #6684. That PR runs a guest DT_INIT of 0 as the module initializer, for the bundled libc.prx/libSceFios2.prx of PS4 Until Dawn (CUSA02636), where tag 12 is present with value 0. It adds GuestImage::HasInit, set when tag 12 is present, and the writers test it instead of Init != 0.

Merging the two:

  • The only textual conflict is passesModuleArgs in LinuxGuestModuleWriter.cpp (L32). I resolved it as image.HasInit && !deferInitialization.
  • One line that doesn't conflict also has to change: pointer(image.Init, image.Init != 0); (L98 at 8838a92bb) becomes pointer(image.Init, image.HasInit);. Otherwise a deferred module whose DT_INIT is 0 gets no relocation for lifecycle slot 2. InitializeLinuxGuestModule then sees table[2] == 0 (DynamicLoader.cpp L144) and skips the initializer, recording result 0 with no error.

I checked this on main 5d9dcc42d + #6684 + 8838a92bb (relinker-only build) with a --module-dir plugins module whose DT_INIT is 0. With only the textual resolution, the slot at table+0x10 has no relocation. With the one-line change it gets R_X86_64_RELATIVE (0x4010, addend 0). The relinker-only suite passes 183/183 either way, so it won't catch this. Whichever PR lands second needs that line. If this one lands first, I'll add it to #6684.

AI Assisted

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6208338590 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6586#issuecomment-6208338590). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-16T04:50:43Z. --- Hi @JJenkx, a heads-up on how this interacts with #6684. That PR runs a guest DT_INIT of 0 as the module initializer, for the bundled `libc.prx`/`libSceFios2.prx` of PS4 Until Dawn (CUSA02636), where tag 12 is present with value 0. It adds `GuestImage::HasInit`, set when tag 12 is present, and the writers test it instead of `Init != 0`. Merging the two: - The only textual conflict is `passesModuleArgs` in `LinuxGuestModuleWriter.cpp` (L32). I resolved it as `image.HasInit && !deferInitialization`. - One line that doesn't conflict also has to change: `pointer(image.Init, image.Init != 0);` ([L98 at 8838a92bb](https://github.com/boykopovar/AnyPS5/blob/8838a92bb84e3839852f62a3103a1fdf56080214/core/relinker/elfpatcher/src/linux/LinuxGuestModuleWriter.cpp#L98)) becomes `pointer(image.Init, image.HasInit);`. Otherwise a deferred module whose DT_INIT is 0 gets no relocation for lifecycle slot 2. `InitializeLinuxGuestModule` then sees `table[2] == 0` ([DynamicLoader.cpp L144](https://github.com/boykopovar/AnyPS5/blob/8838a92bb84e3839852f62a3103a1fdf56080214/core/libs/prx/libkernel/Module/src/DynamicLoader.cpp#L144)) and skips the initializer, recording result 0 with no error. I checked this on `main` 5d9dcc42d + #6684 + 8838a92bb (relinker-only build) with a `--module-dir plugins` module whose DT_INIT is 0. With only the textual resolution, the slot at table+0x10 has no relocation. With the one-line change it gets `R_X86_64_RELATIVE` (0x4010, addend 0). The relinker-only suite passes 183/183 either way, so it won't catch this. Whichever PR lands second needs that line. If this one lands first, I'll add it to #6684. AI Assisted
JJenkx commented 2026-10-16 05:05:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-16T05:05:12Z.


Addressed in 6c8ff59838b5dfcff2cf64cd32e71eb1dff415ce. The branch is refreshed onto current main 5d9dcc42d plus #6684 (ab9d21afcfbc, authorship retained), now declared as a prerequisite. The textual resolution uses image.HasInit && !deferInitialization, and lifecycle slot 2 now uses pointer(image.Init, image.HasInit).

I extended guest_zero_initializer with deferred Linux cases: DT_INIT zero with/without preinit, native initializer argument/return verification on Linux x86-64, and an absent-tag control. The new regression fails on the textual-resolution-only tree because table+0x10 has no relocation. With the one-line correction, the relinker-only build and all 183/183 tests pass; conventions/whitespace pass. No fresh full-runtime/title run on this head. The PR remains a draft for the existing initialization-timing review.

Windows CI then exposed a test-fixture portability issue (a Windows host path supplied as a Linux guest run path). Fixed in a17a8daf10acc9fbbf192b92e7b9ad0ae3e82bbf by using $ORIGIN/libs; the production initializer correction is unchanged. All 183 local tests pass again. The fresh GitHub relinker matrix now passes Linux, Windows and macOS on this exact head. Full runtime builds were skipped.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6208503658 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6586#issuecomment-6208503658). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-16T05:05:12Z. --- Addressed in `6c8ff59838b5dfcff2cf64cd32e71eb1dff415ce`. The branch is refreshed onto current main `5d9dcc42d` plus #6684 (`ab9d21afcfbc`, authorship retained), now declared as a prerequisite. The textual resolution uses `image.HasInit && !deferInitialization`, and lifecycle slot 2 now uses `pointer(image.Init, image.HasInit)`. I extended `guest_zero_initializer` with deferred Linux cases: DT_INIT zero with/without preinit, native initializer argument/return verification on Linux x86-64, and an absent-tag control. The new regression fails on the textual-resolution-only tree because `table+0x10` has no relocation. With the one-line correction, the relinker-only build and all **183/183 tests** pass; conventions/whitespace pass. No fresh full-runtime/title run on this head. The PR remains a draft for the existing initialization-timing review. Windows CI then exposed a test-fixture portability issue (a Windows host path supplied as a Linux guest run path). Fixed in `a17a8daf10acc9fbbf192b92e7b9ad0ae3e82bbf` by using `$ORIGIN/libs`; the production initializer correction is unchanged. All 183 local tests pass again. The [fresh GitHub relinker matrix](https://github.com/boykopovar/AnyPS5/actions/runs/38854649107) now passes Linux, Windows and macOS on this exact head. Full runtime builds were skipped.
JJenkx commented 2026-10-16 07:09:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-16T07:09:11Z.


Temporarily closing this draft to free a slot under the project's 20-open-PR limit for the validated ATRAC9 vibration startup fix. The source branch fix/linux-runtime-module-start is retained at a17a8daf10acc9fbbf192b92e7b9ad0ae3e82bbf for later reopening. The zero-DT_INIT feedback is addressed and its relinker checks pass; the initialization-timing review remains outstanding.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6210110080 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6586#issuecomment-6210110080). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-16T07:09:11Z. --- Temporarily closing this draft to free a slot under the project's 20-open-PR limit for the validated ATRAC9 vibration startup fix. The source branch fix/linux-runtime-module-start is retained at a17a8daf10acc9fbbf192b92e7b9ad0ae3e82bbf for later reopening. The zero-DT_INIT feedback is addressed and its relinker checks pass; the initialization-timing review remains outstanding.
SandstromPL commented 2026-10-19 02:35:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-19T02:35:32Z.


@JJenkx heads-up, since this carries #6684's first commit: with #6112 reverted, I've updated #6684 by merging main and adding two commits.

  • 0500362ff adds add_asan_test_options(guest_zero_initializer verify_asan_link_order=0).
  • f77a9eaa0 changes #6106's check in GuestModuleBuilder.cpp (images[index].Init != 0, which adds the libkernel.prx dependency the Linux DT_INIT stub imports from) to HasInit. Without it, a converted module with DT_INIT 0 gets the stub but not the dependency, and loading it fails with undefined symbol: __aps5_get_pending_module_args_nid_no_patch. The test now copies the host to libs/libkernel.prx and checks that dependency. Your copy (2197de555) predates #6106, so it doesn't have this.

I replayed your branch onto main plus updated #6684 locally. The first five of your own commits apply cleanly, and 25266b497 has one conflict in test_guest_zero_initializer.py, where both add lines around the native load. After #6684 lands, the rebase should drop 2197de555 as already applied.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6258439091 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6586#issuecomment-6258439091). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-19T02:35:32Z. --- @JJenkx heads-up, since this carries #6684's first commit: with #6112 reverted, I've updated #6684 by merging `main` and adding two commits. - `0500362ff` adds `add_asan_test_options(guest_zero_initializer verify_asan_link_order=0)`. - `f77a9eaa0` changes #6106's check in `GuestModuleBuilder.cpp` (`images[index].Init != 0`, which adds the `libkernel.prx` dependency the Linux DT_INIT stub imports from) to `HasInit`. Without it, a converted module with DT_INIT 0 gets the stub but not the dependency, and loading it fails with `undefined symbol: __aps5_get_pending_module_args_nid_no_patch`. The test now copies the host to `libs/libkernel.prx` and checks that dependency. Your copy (`2197de555`) predates #6106, so it doesn't have this. I replayed your branch onto `main` plus updated #6684 locally. The first five of your own commits apply cleanly, and `25266b497` has one conflict in `test_guest_zero_initializer.py`, where both add lines around the native load. After #6684 lands, the rebase should drop `2197de555` as already applied. AI-assisted: yes (Claude Code)
JJenkx commented 2026-10-19 02:44:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-19T02:44:35Z.


Updated to main 8a526d4495 and carried all three topic commits from #6684 at f77a9eaa08, preserving authorship and omitting its merge commit. The HasInit dependency check and ASan host-loading option are retained. The deferred zero-initializer fixture now supplies libkernel.prx and checks dependency presence for present/absent DT_INIT.

At 85b281b22c: 149/149 relinker-directory CTests and all four focused loader/initializer tests pass without skips; conventions and whitespace pass. Local ASan execution was not tested. The PR remains draft for lifecycle-timing review. Thanks for identifying the dependency update.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6258535823 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6586#issuecomment-6258535823). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-19T02:44:35Z. --- Updated to main 8a526d4495 and carried all three topic commits from #6684 at f77a9eaa086166d9417b2d31a39a80efd815c2a3, preserving authorship and omitting its merge commit. The HasInit dependency check and ASan host-loading option are retained. The deferred zero-initializer fixture now supplies libkernel.prx and checks dependency presence for present/absent DT_INIT. At 85b281b22c: 149/149 relinker-directory CTests and all four focused loader/initializer tests pass without skips; conventions and whitespace pass. Local ASan execution was not tested. The PR remains draft for lifecycle-timing review. Thanks for identifying the dependency update.
JJenkx commented 2026-10-20 16:30:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-20T16:30:43Z.


Rebased without merge commits onto main f6ce8e34a20a9d6728a728c4769335ecaf5edea0 and pushed head e643956fb984a8f0378985fe56949c6331df9534.

Resolved the GuestModuleWriter/GuestModuleBuilder conflicts by retaining main's Windows/macOS message callbacks and this branch's deferred Linux runtime start. Updated main's new unused-import dependency regression to distinguish mapping from initialization: its dependency/export assertions remain, startup records no plugin initializer, and explicit initialization checks the argument pair and return result.

Rebuilt: 161/161 relinker tests and 4/4 focused lifecycle tests pass, no skips; conventions/whitespace pass. #6684 remains the unchanged prerequisite at f77a9eaa086166d9417b2d31a39a80efd815c2a3. Still draft pending lifecycle review; no new native title or performance claim. AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6295854684 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6586#issuecomment-6295854684). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-20T16:30:43Z. --- Rebased without merge commits onto main `f6ce8e34a20a9d6728a728c4769335ecaf5edea0` and pushed head `e643956fb984a8f0378985fe56949c6331df9534`. Resolved the GuestModuleWriter/GuestModuleBuilder conflicts by retaining main's Windows/macOS message callbacks and this branch's deferred Linux runtime start. Updated main's new unused-import dependency regression to distinguish mapping from initialization: its dependency/export assertions remain, startup records no plugin initializer, and explicit initialization checks the argument pair and return result. Rebuilt: 161/161 relinker tests and 4/4 focused lifecycle tests pass, no skips; conventions/whitespace pass. #6684 remains the unchanged prerequisite at `f77a9eaa086166d9417b2d31a39a80efd815c2a3`. Still draft pending lifecycle review; no new native title or performance claim. AI-assisted: yes.
JJenkx commented 2026-10-21 13:35:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T13:35:10Z.


Rebased the ten topic commits without merge commits onto main 27bcd6a29e2fd69aba0626610b2350eb8f2847f6, now head cea585242429fe0e20df3a92d670fa51e8a6437d. The conflicts were in documentation: main’s newer Windows executable-module deferral is preserved, and the usage/debt entries distinguish it from this branch’s Linux behavior. Source/test patches are preserved by range-diff.

At this head: 238/238 relinker tests and 1/1 real-kernel runtime lifecycle test passed, with conventions and whitespace checks passing. A merge-tree check is clean against newer main 80565c59424190cd0f660f8097945443a0017c42; the test results apply to the stated head. No new native title, Windows or performance result is claimed. Still draft pending initialization-timing review.

Logs, patch and range-diff, SHA-256 802e470b86e6b351a809bba7635f205ee97904c2cf4e1f123111df6138182fa1. AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6317423671 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6586#issuecomment-6317423671). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-21T13:35:10Z. --- Rebased the ten topic commits without merge commits onto main `27bcd6a29e2fd69aba0626610b2350eb8f2847f6`, now head `cea585242429fe0e20df3a92d670fa51e8a6437d`. The conflicts were in documentation: main’s newer Windows executable-module deferral is preserved, and the usage/debt entries distinguish it from this branch’s Linux behavior. Source/test patches are preserved by range-diff. At this head: 238/238 relinker tests and 1/1 real-kernel runtime lifecycle test passed, with conventions and whitespace checks passing. A merge-tree check is clean against newer main `80565c59424190cd0f660f8097945443a0017c42`; the test results apply to the stated head. No new native title, Windows or performance result is claimed. Still draft pending initialization-timing review. [Logs, patch and range-diff](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/20261021-pr6586-main27bc-runtime-validation.tar.gz), SHA-256 `802e470b86e6b351a809bba7635f205ee97904c2cf4e1f123111df6138182fa1`. AI-assisted: yes.
JJenkx commented 2026-10-22 02:38:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T02:38:12Z.


Darkest Dungeon II (PPSA19591) now reaches its narrated opening on a private integration of this PR with main a6dcea9279b53b3a39c13695eac66f7c8b5b503c, tested head a6383f401ea2aaf4e6d90905510ad30c957cd864 using PR head b1eb0dd1eba18aeeabf15bfed8e081eb8af78a0a.

The baseline debugger maps the null argument read to NativePluginPS5Example.prx.guest.prx, file offset 0x423a. With deferred initialization, the first native run reaches the readable confirmation screen; a second run with controller inputs passes that screen and renders the illustrated opening with readable subtitles. Both runs exit 0 after ordinary window-close requests, with the temporary kernel memory limit restored. Gameplay and performance are unverified.

At the stated private integration: the full runtime built, 238/238 relinker tests passed, and the real-kernel lifecycle test passed its never-start, start, zero-start, concurrent, reentrant and reload modes. The concurrent case does not establish that the second thread reached the loader before the initializer was released, so it is not a complete waiter-timing test. No Windows/macOS or sanitizer result is claimed.

Evidence: reports, focused test logs, mapped baseline fault, tested patch and screenshots, SHA-256 e2da36750e8ea38c3d027e10bf3133fcf427b6e74c062b08ccd6fd8bbd9c9764.

The public branch is unchanged and this remains draft pending initialization-timing review. AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6331339091 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6586#issuecomment-6331339091). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-22T02:38:12Z. --- Darkest Dungeon II (`PPSA19591`) now reaches its narrated opening on a private integration of this PR with main `a6dcea9279b53b3a39c13695eac66f7c8b5b503c`, tested head `a6383f401ea2aaf4e6d90905510ad30c957cd864` using PR head `b1eb0dd1eba18aeeabf15bfed8e081eb8af78a0a`. The baseline debugger maps the null argument read to `NativePluginPS5Example.prx.guest.prx`, file offset `0x423a`. With deferred initialization, the first native run reaches the readable confirmation screen; a second run with controller inputs passes that screen and renders the illustrated opening with readable subtitles. Both runs exit 0 after ordinary window-close requests, with the temporary kernel memory limit restored. Gameplay and performance are unverified. At the stated private integration: the full runtime built, 238/238 relinker tests passed, and the real-kernel lifecycle test passed its never-start, start, zero-start, concurrent, reentrant and reload modes. The concurrent case does not establish that the second thread reached the loader before the initializer was released, so it is not a complete waiter-timing test. No Windows/macOS or sanitizer result is claimed. [Evidence: reports, focused test logs, mapped baseline fault, tested patch and screenshots](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/20261022-pr6586-darkest-opening-a6dc.tar.gz), SHA-256 `e2da36750e8ea38c3d027e10bf3133fcf427b6e74c062b08ccd6fd8bbd9c9764`. The public branch is unchanged and this remains draft pending initialization-timing review. AI-assisted: yes.
JJenkx commented 2026-10-22 03:07:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T03:07:25Z.


Pushed 624609bfe2e3bbf58e0a66f1e46349158e39d661 to strengthen the concurrent lifecycle regression. The first initializer now stays blocked until the second loader thread enters pthread_cond_wait; the test also requires that wait to return. This addresses the timing gap noted in my previous report. The wrapper is confined to the Linux test executable; production loader code is unchanged.

All six lifecycle modes pass with the fixture compiled from this public branch, against the previously full-built private integration a6383f401ea2aaf4e6d90905510ad30c957cd864 (main a6dcea9279 plus PR head b1eb0dd1eb). Its DynamicLoader.cpp is identical to the public branch. Conventions and whitespace checks pass. This is not a full rebuild of the new public head.

A further native Darkest Dungeon II (PPSA19591) run on that same pinned integration passed the narration and prologue selection, rendered the stagecoach scene, and reached the party tutorial. It exited 0 after the scheduled ordinary window close at 571 seconds; the temporary kernel limit was restored to 64 MiB. The attached 300/450/550-second screenshots show those scenes. Combat, overall rendering correctness and performance remain unverified.

Reports, test log and patch, native supervisor log and screenshots, SHA-256 3bfa3c0f62f8257ef7dd6980c52077b16442c182c4f426954f1abbfd1c3d0b80.

Still draft pending initialization-timing review. AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6331696963 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6586#issuecomment-6331696963). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-22T03:07:25Z. --- Pushed `624609bfe2e3bbf58e0a66f1e46349158e39d661` to strengthen the concurrent lifecycle regression. The first initializer now stays blocked until the second loader thread enters `pthread_cond_wait`; the test also requires that wait to return. This addresses the timing gap noted in my previous report. The wrapper is confined to the Linux test executable; production loader code is unchanged. All six lifecycle modes pass with the fixture compiled from this public branch, against the previously full-built private integration `a6383f401ea2aaf4e6d90905510ad30c957cd864` (main `a6dcea9279` plus PR head `b1eb0dd1eb`). Its `DynamicLoader.cpp` is identical to the public branch. Conventions and whitespace checks pass. This is not a full rebuild of the new public head. A further native Darkest Dungeon II (`PPSA19591`) run on that same pinned integration passed the narration and prologue selection, rendered the stagecoach scene, and reached the party tutorial. It exited 0 after the scheduled ordinary window close at 571 seconds; the temporary kernel limit was restored to 64 MiB. The attached 300/450/550-second screenshots show those scenes. Combat, overall rendering correctness and performance remain unverified. [Reports, test log and patch, native supervisor log and screenshots](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/20261022-pr6586-waiter-and-darkest-prologue.tar.gz), SHA-256 `3bfa3c0f62f8257ef7dd6980c52077b16442c182c4f426954f1abbfd1c3d0b80`. Still draft pending initialization-timing review. AI-assisted: yes.
JJenkx commented 2026-10-22 03:39:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T03:39:59Z.


Marked ready for review at unchanged head 624609bfe2e3bbf58e0a66f1e46349158e39d661.

The maintainer decision on #8162 accepts uniform Windows deferral with documented limitations. That is related design precedent for this Linux implementation; it does not establish console module-start ordering or repeated-load result semantics. Those limitations remain documented. The deterministic concurrent waiter regression and pinned Darkest Dungeon II party-tutorial evidence are in the description and preceding report.

Could a maintainer dispatch the full Linux/Windows build for this PR? Current automatic PR runs cover the relinker and ASan; full runtime jobs require main or manual dispatch. Marking ready alone does not start those jobs. No new test result or performance claim is implied. AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6332100135 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6586#issuecomment-6332100135). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-22T03:39:59Z. --- Marked ready for review at unchanged head `624609bfe2e3bbf58e0a66f1e46349158e39d661`. The [maintainer decision on #8162](https://github.com/boykopovar/AnyPS5/pull/8162#issuecomment-6311678668) accepts uniform Windows deferral with documented limitations. That is related design precedent for this Linux implementation; it does not establish console module-start ordering or repeated-load result semantics. Those limitations remain documented. The deterministic concurrent waiter regression and pinned Darkest Dungeon II party-tutorial evidence are in the description and preceding report. Could a maintainer dispatch the full Linux/Windows build for this PR? Current automatic PR runs cover the relinker and ASan; full runtime jobs require main or manual dispatch. Marking ready alone does not start those jobs. No new test result or performance claim is implied. AI-assisted: yes.
JJenkx commented 2026-10-22 08:44:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T08:44:20Z.


Refreshed to fa3e35112131790755dcddadc54cf2c7b8dea37e: fourteen topic commits cleanly rebased onto main d6eafa54, without merge commits. The relinker and all runtime libraries build from this head. All 239 relinker tests and the real-kernel lifecycle wrapper (six modes, including the deterministic concurrent waiter) pass, with no skips or failures. Conventions and whitespace checks pass.

The branch also merges cleanly with newer main 7e2ba73e, and conventions pass against it; build/test evidence remains pinned to d6eafa54. No new title, GPU, performance or Windows/macOS runtime result is claimed. The complete runtime suite was not run.

Patch, range-diff, build/test logs, JUnit and independent verification, SHA-256 fcf647f928390b33f0fa21374c136d3ed72f8236687078e80a2d376fdd1cb1cd. Description updated. Maintainer-dispatched full cross-platform CI remains useful. AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6336607520 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6586#issuecomment-6336607520). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-22T08:44:20Z. --- Refreshed to `fa3e35112131790755dcddadc54cf2c7b8dea37e`: fourteen topic commits cleanly rebased onto main `d6eafa54`, without merge commits. The relinker and all runtime libraries build from this head. All 239 relinker tests and the real-kernel lifecycle wrapper (six modes, including the deterministic concurrent waiter) pass, with no skips or failures. Conventions and whitespace checks pass. The branch also merges cleanly with newer main `7e2ba73e`, and conventions pass against it; build/test evidence remains pinned to d6eafa54. No new title, GPU, performance or Windows/macOS runtime result is claimed. The complete runtime suite was not run. [Patch, range-diff, build/test logs, JUnit and independent verification](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/20261022-pr6586-clean-runtime-d6eafa.tar.gz), SHA-256 `fcf647f928390b33f0fa21374c136d3ed72f8236687078e80a2d376fdd1cb1cd`. Description updated. Maintainer-dispatched full cross-platform CI remains useful. AI-assisted: yes.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!6586
No description provided.