docs(debt): note how a title calls sem_timedwait #10105

Merged
xXPBSXx merged 1 commit from upstream-pr/10105 into main 2026-10-26 15:06:44 +00:00
xXPBSXx commented 2026-10-23 09:25:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-23T09:25:18Z.


What

The changed entry now reads:

sem_timedwait (libkernel) consumes an available count before checking the timeout and waits indefinitely for a null timeout, following FreeBSD 11's sem_timedwait. Console behavior for null and invalid timeouts when a count is available is unverified. One title (PPSA29866) disassembled for this entry has one call site (0x130916), in a wait helper that reads the clock with id 0 into a zeroed 16-byte time structure, adds the milliseconds multiplied by 1,000,000 to the nanoseconds and normalises them below 1e9, so its deadline is never null. It repeats the wait with the same deadline when the error is 4, returns false for any other error and when reading the clock fails, and does not tell a timeout from other errors. This title therefore gives no evidence on null or invalid timeouts.

Changed: docs/dev/debt/libkernel.md. No code change.

Method: Ghidra 12.1.4 headless on the unwrapped executable of the title named; the addresses are the call sites in that executable as Ghidra maps it, read from the instruction listing (static reading only, nothing run on a console). The listing and decompiled code are game code and are not attached.

Fixes: #10104

Tested

Documentation only. tools/check_conventions.py --base upstream/main passes; git merge-tree against main is clean. Every number in the sentence was recounted against the instruction listing. Not built, not run, no title run.

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: #10137
  • Fixes #10104
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

AI-assisted (Claude Code).

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4980653695 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10105). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-23T09:25:18Z. --- ### What The changed entry now reads: > [sem_timedwait](../../../core/libs/prx/libkernel/Pthread/Posix/Sem.cpp) (libkernel) consumes an available count before checking the timeout and waits indefinitely for a null timeout, following FreeBSD 11's `sem_timedwait`. Console behavior for null and invalid timeouts when a count is available is unverified. One title (PPSA29866) disassembled for this entry has one call site (0x130916), in a wait helper that reads the clock with id 0 into a zeroed 16-byte time structure, adds the milliseconds multiplied by 1,000,000 to the nanoseconds and normalises them below 1e9, so its deadline is never null. It repeats the wait with the same deadline when the error is 4, returns false for any other error and when reading the clock fails, and does not tell a timeout from other errors. This title therefore gives no evidence on null or invalid timeouts. Changed: `docs/dev/debt/libkernel.md`. No code change. Method: Ghidra 12.1.4 headless on the unwrapped executable of the title named; the addresses are the call sites in that executable as Ghidra maps it, read from the instruction listing (static reading only, nothing run on a console). The listing and decompiled code are game code and are not attached. Fixes: #10104 ### Tested Documentation only. `tools/check_conventions.py --base upstream/main` passes; `git merge-tree` against `main` is clean. Every number in the sentence was recounted against the instruction listing. Not built, not run, no title run. ### Checklist - [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: #10137 - [x] Fixes #10104 - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-23 10:34:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T10:34:39Z.

Review: CHANGES_REQUESTED


The sentence stays within what the described PPSA29866 call site shows and explicitly says it does not establish behavior for null or invalid deadlines. This is a documentation-only change; the hosted eligibility/intake/conventions/labels checks pass and the product build jobs are skipped by repository policy.

Please refresh this branch from current main and coordinate the libkernel.md edit with #9167 and #9491. Exact-head sync reports 1 ahead/92 behind, with this debt file changed on both sides since the merge base. Pairwise merges of each PR head with this head produce content conflicts in docs/dev/debt/libkernel.md. Those changes concern different functions, so I found no functional dependency, but the repo asks authors to agree an order for same-file conflicts and declare it with Depends on where applicable. After resolving the file overlap, rerun the conventions and diff checks on the refreshed head. No runtime test applies.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5627060207 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10105#pullrequestreview-5627060207). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T10:34:39Z. **Review:** CHANGES_REQUESTED --- The sentence stays within what the described PPSA29866 call site shows and explicitly says it does not establish behavior for null or invalid deadlines. This is a documentation-only change; the hosted eligibility/intake/conventions/labels checks pass and the product build jobs are skipped by repository policy. Please refresh this branch from current `main` and coordinate the `libkernel.md` edit with #9167 and #9491. Exact-head sync reports 1 ahead/92 behind, with this debt file changed on both sides since the merge base. Pairwise merges of each PR head with this head produce content conflicts in `docs/dev/debt/libkernel.md`. Those changes concern different functions, so I found no functional dependency, but the repo asks authors to agree an order for same-file conflicts and declare it with `Depends on` where applicable. After resolving the file overlap, rerun the conventions and diff checks on the refreshed head. No runtime test applies.
MarcZX10 commented 2026-10-23 12:54:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T12:54:49Z.

Review: DISMISSED


Re-reviewed exact head 1fb179d0f2e294bdc135d8949d472f43bccb61e6. The author has coordinated a clear order: #10137 lands first, then this PR rebases and preserves both the console timeout measurements and title-call observation. The checklist still says Depends on: none, which contradicts that stated prerequisite and the repository rule. Please change it to Depends on: #10137 and keep the stated rebase plan. The other listed semaphore PRs concern adjacent behavior unless they change this same entry. Exact-head eligibility/conventions/labels pass; documentation-only, so no runtime test applies.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5628492732 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10105#pullrequestreview-5628492732). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T12:54:49Z. **Review:** DISMISSED --- Re-reviewed exact head `1fb179d0f2e294bdc135d8949d472f43bccb61e6`. The author has coordinated a clear order: #10137 lands first, then this PR rebases and preserves both the console timeout measurements and title-call observation. The checklist still says `Depends on: none`, which contradicts that stated prerequisite and the repository rule. Please change it to `Depends on: #10137` and keep the stated rebase plan. The other listed semaphore PRs concern adjacent behavior unless they change this same entry. Exact-head eligibility/conventions/labels pass; documentation-only, so no runtime test applies.
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!10105
No description provided.