Skip to content

feat(libSceAmpr): implement Dinkumware thread launch helpers - #3742

Closed
MarcZX10 wants to merge 1 commit into
boykopovar:mainfrom
MarcZX10:codex/ampr-pad-launch-3361
Closed

MarcZX10 wants to merge 1 commit into
boykopovar:mainfrom
MarcZX10:codex/ampr-pad-launch-3361

Conversation

@MarcZX10

Copy link
Copy Markdown
Contributor

What

Implements the four Dinkumware std::_Pad thread helpers, adds guest tests for launch/release/destruction and failures, and documents the modeled layout and remaining differences in TechnicalDebt.

Carried David's ready commit unchanged onto current main, preserving author metadata. #3499 and #3679 touch the same libSceAmpr/Export.cpp and TechnicalDebt files for different exports; neither is a dependency, though the second change to merge may need a rebase.

Tested

Local Linux Release build and guest_ampr_threads: passed (1/1). tools/check_conventions.py --base upstream/main and git diff upstream/main --check pass.

Independent Linux verification reports guest_ampr_threads and the full suite (520/520) passed. The original Windows Release report records guest_ampr_threads 3/3 and full suite 513/513, with the #3329 test fix applied locally. Verification details are in issue #3361.

Checklist

  • Based on current main; no other open PR implements these exports
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw
  • No notes or investigation files added
  • Generic behavior
  • Depends on: none
  • AI-assisted: yes

Implement _ZNSt4_PadC2Ev, _ZNSt4_PadD2Ev, _ZNSt4_Pad7_LaunchEPP7pthread
and _ZNSt4_Pad8_ReleaseEv, which Deathloop (PPSA01670) and Minecraft
Legends (PPSA05510) import from libSceAmpr for the std::thread launch path.

The algorithm and object layout follow Dinkumware V6.00 thr/xthread and
thr/threadcall.cpp of Visual C++ 2013 (ganboing/crt.vc12 f1d47126): a
vtable pointer whose first slot is the pure virtual _Go(), then the
condition and mutex handles and bool _Started (0x8, 0x10, 0x18), with the
console's pointer-to-slot handles of libc Threads.cpp (boykopovar#3079). The pad
uses libc's _Cnd_*/_Mtx_* exports, starts the guest thread with
pthread_create and an entry that calls _Go() and returns its result as
the exit code, as _Call_func does. The unverified layout, thread
attributes and error reporting are recorded in TechnicalDebt.md.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit c387c15)
@github-actions

Copy link
Copy Markdown

Progress report (a11c8f7 → be2b77f)

📈 System libraries: 85.93% (+0.12%, +5 implemented functions)

✅ 5 implemented
Library Name
libSceAmpr PadEntry
libSceAmpr _ZNSt4_Pad7_LaunchEPP7pthread_nid_postfix
libSceAmpr _ZNSt4_Pad8_ReleaseEv_nid_postfix
libSceAmpr _ZNSt4_PadC2Ev_nid_postfix
libSceAmpr _ZNSt4_PadD2Ev_nid_postfix

@github-actions

github-actions Bot commented Oct 11, 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
#3743 _ZNSt4_Pad7_LaunchEPP7pthread_nid_postfix
_ZNSt4_Pad8_ReleaseEv_nid_postfix
_ZNSt4_PadC2Ev_nid_postfix
_ZNSt4_PadD2Ev_nid_postfix

@blawesom

Copy link
Copy Markdown
Contributor

Cross-reference: #3743 implements the same functions (the std::_Pad thread-launch helpers) — opened at the same minute (16:16 UTC).

CONTRIBUTING.md asks authors to "check that no open pull request already implements the same functions" before starting — both PRs are open, so flagging for the maintainers.

The limitation this creates: only one of the two can be merged; the other gets closed as duplicate.

Related: this is also the fix tracked in #3361, which has a two-platform-verified branch (blawesom:verify/3361, full suite green on Linux and macOS) — cross-linking so the maintainers can compare against the original author's commit if they prefer that.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 11, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

Closing: #3743 carries the same commit, merges cleanly with main and keeps PadEntry out of the export inventory.

You're welcome to reopen this if you think it was closed by mistake or the situation changes.

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

Labels

docs needs rebase Conflicts with main, rebase needed prx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants