fix(libScePlayerInvitationDialog): check common dialog use during initialization #14300

Merged
Teemac42 merged 4 commits from upstream-pr/14300 into main 2026-11-08 13:06:42 +00:00
Teemac42 commented 2026-11-01 07:23:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Teemac42 on 2026-11-01T07:23:52Z.


What

When the player invitation dialog is uninitialized and the common dialog system is already in use, return BUSY (0x80B80008) from scePlayerInvitationDialogInitialize before changing its state. The firmware 13.42 report observed this return value with sceCommonDialogIsUsed stubbed to 1, in three identical native x86-64 module runs.

Preserve main's existing ALREADY_INITIALIZED check first. The report does not establish ordering when both conditions hold, or the complete ownership protocol; these remain in technical debt. The implementation only queries common-dialog use and adds no acquire/release behavior. Open keeps main's behavior, and repeated-open results remain unverified in debt.

Add the busy-initialization regression and explicit common-dialog link dependencies. Exported signatures are unchanged.

Tested

  • Windows GitHub Actions, MSYS2 UCRT64: full-project CMake configuration succeeded; player_invitation_dialog_tests and guest_common_dialog_tests built, and both focused tests passed. Successful run. The tested CI commit contains contribution commit 29b225791bad583ea110daea7088c4d202e5188e plus only the validation workflow change. The full repository build and test suite were not run.
  • Linux x86-64, GCC 13.3 and CMake 3.31: focused standalone validation built the real dialog shared-library targets and libc runtime helper source. player_invitation_dialog and guest_common_dialog both pass. This is not a full repository build.
  • The same lifecycle test against main's player-invitation implementation fails with expected 0x80b80008, got 0x00000000 at busy initialization.
  • Conventions, public-header audit and git diff --check pass.
  • Overlap check examined 1,611 open PRs. No competing Initialize busy check was found. Formatting-only #14212 was reviewed manually; it changes only blank lines in the shared debt file.

No new hardware observation or title test is claimed; the behavior source is the published native firmware-module report.

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: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5105338779 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14300). Originally posted by [Teemac42](https://github.com/Teemac42) on 2026-11-01T07:23:52Z. --- ### What When the player invitation dialog is uninitialized and the common dialog system is already in use, return `BUSY` (`0x80B80008`) from `scePlayerInvitationDialogInitialize` before changing its state. The [firmware 13.42 report](https://github.com/boykopovar/AnyPS5/pull/9815#issuecomment-6417937062) observed this return value with `sceCommonDialogIsUsed` stubbed to 1, in three identical native x86-64 module runs. Preserve main's existing `ALREADY_INITIALIZED` check first. The report does not establish ordering when both conditions hold, or the complete ownership protocol; these remain in technical debt. The implementation only queries common-dialog use and adds no acquire/release behavior. `Open` keeps main's behavior, and repeated-open results remain unverified in debt. Add the busy-initialization regression and explicit common-dialog link dependencies. Exported signatures are unchanged. ### Tested <!-- 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. --> - Windows GitHub Actions, MSYS2 UCRT64: full-project CMake configuration succeeded; `player_invitation_dialog_tests` and `guest_common_dialog_tests` built, and both focused tests passed. [Successful run](https://github.com/Teemac42/AnyPS5/actions/runs/41282221038). The tested CI commit contains contribution commit `29b225791bad583ea110daea7088c4d202e5188e` plus only the validation workflow change. The full repository build and test suite were not run. - Linux x86-64, GCC 13.3 and CMake 3.31: focused standalone validation built the real dialog shared-library targets and libc runtime helper source. `player_invitation_dialog` and `guest_common_dialog` both pass. This is not a full repository build. - The same lifecycle test against main's player-invitation implementation fails with `expected 0x80b80008, got 0x00000000` at busy initialization. - Conventions, public-header audit and `git diff --check` pass. - Overlap check examined 1,611 open PRs. No competing Initialize busy check was found. Formatting-only #14212 was reviewed manually; it changes only blank lines in the shared debt file. No new hardware observation or title test is claimed; the behavior source is the published native firmware-module report. ### 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 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-01 07:34:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T07:34:42Z.

Review: COMMENTED


Reviewed — no blocking findings

The change matches the cited 13.42 firmware report for the busy case, keeps the existing ALREADY_INITIALIZED check first, adds no exports, and I found no blocking defect in the source, but nothing was built or run here.

What I ran

  • Exact PR head 29b225791bad583ea110daea7088c4d202e5188e, PR base 3e29acc3805f15e19a0c8f55eedb0c93e92f2f90. Head and base were unchanged at posting.
  • No-build precheck: python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14300. It reported failed only because pr_abi_audit.py and pr_test_quality.py are absent from its isolated checkout; that is not a finding. Its diff check, conventions and live stack/mergeability checks passed.
  • Helpers run by hand against the same head, reading repository objects without a checkout:
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 3e29acc3805f15e19a0c8f55eedb0c93e92f2f90 --head 29b225791bad583ea110daea7088c4d202e5188e --json
python3 tools/pr_test_quality.py --root <extract of the head files> --json core/libs/tests/PlayerInvitationDialog.cpp core/libs/prx/libScePlayerInvitationDialog/CMakeLists.txt
  • Environment: Linux 6.1 host, Python 3.11.2. No build, no compile, no C++ test run.

Results

Check Result
git diff --check (precheck) passed
tools/check_conventions.py (precheck) passed
Live stack and mergeability (precheck) passed
ABI audit (manual) passed; 7 symbols, 0 findings
Test-quality heuristic (manual) one possible-unregistered-cpp-test finding; false positive, see Findings
Hosted labels, conventions queued when checked; intake completed with success
Build and player_invitation_dialog test not run (no-build policy)
Unedited command output
precheck conventions_and_pr_template — stdout:
All conventions checks passed.

manual pr_abi_audit.py summary:
status: passed
symbols: 7
findings: []

manual pr_test_quality.py --json:
{
  "findings": [
    {
      "path": "core/libs/tests/PlayerInvitationDialog.cpp",
      "line": 1,
      "kind": "possible-unregistered-cpp-test",
      "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
    }
  ],
  "negative_control_candidates": [],
  "limits": [
    "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
    "A test that passes against base is not by itself proof that the PR test is inadequate.",
    "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
  ]
}

Findings

Blocking: none.

Non-blocking:

  • The test-quality finding is a false positive. The test is registered at core/libs/prx/libScePlayerInvitationDialog/CMakeLists.txt line 7 (add_test_executable(player_invitation_dialog_tests ${LIBS_INCLUDE_DIR}/tests/PlayerInvitationDialog.cpp)) and run at line 11 (add_test(NAME player_invitation_dialog ...)). The heuristic missed the ${LIBS_INCLUDE_DIR} prefix.
  • Initialize reads sceCommonDialogIsUsed() and does not acquire common-dialog ownership, unlike the sibling libSceInvitationDialog, which calls CommonDialogAcquire_nid_no_patch() in the same position. The debt entry records this choice. I consider it acceptable because the firmware evidence covers only the query. Noting the difference so it stays deliberate.
  • The PR also edits docs/dev/debt/libScePlayerInvitationDialog.md, as open PR #13585 does. The live stack check passed against current main; this is a merge-order note only.

Sources

Not verified

  • No build, no C++ compile, and the focused player_invitation_dialog test were not run here. The Windows run and the Linux standalone run in the PR body are author-provided and not confirmed by me.
  • The busy result comes from a native x86-64 run of the firmware module with stubbed imports, not from a console. The ordering of ALREADY_INITIALIZED and BUSY when both hold is untested, as the PR's debt entry states.
  • Hosted labels and conventions were queued when I checked; I did not wait for them.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5726987010 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14300#pullrequestreview-5726987010). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T07:34:42Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The change matches the cited 13.42 firmware report for the busy case, keeps the existing `ALREADY_INITIALIZED` check first, adds no exports, and I found no blocking defect in the source, but nothing was built or run here. ## What I ran - Exact PR head `29b225791bad583ea110daea7088c4d202e5188e`, PR base `3e29acc3805f15e19a0c8f55eedb0c93e92f2f90`. Head and base were unchanged at posting. - No-build precheck: `python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14300`. It reported failed only because `pr_abi_audit.py` and `pr_test_quality.py` are absent from its isolated checkout; that is not a finding. Its diff check, conventions and live stack/mergeability checks passed. - Helpers run by hand against the same head, reading repository objects without a checkout: ```sh python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 3e29acc3805f15e19a0c8f55eedb0c93e92f2f90 --head 29b225791bad583ea110daea7088c4d202e5188e --json python3 tools/pr_test_quality.py --root <extract of the head files> --json core/libs/tests/PlayerInvitationDialog.cpp core/libs/prx/libScePlayerInvitationDialog/CMakeLists.txt ``` - Environment: Linux 6.1 host, Python 3.11.2. No build, no compile, no C++ test run. ## Results | Check | Result | |---|---| | `git diff --check` (precheck) | passed | | `tools/check_conventions.py` (precheck) | passed | | Live stack and mergeability (precheck) | passed | | ABI audit (manual) | passed; 7 symbols, 0 findings | | Test-quality heuristic (manual) | one `possible-unregistered-cpp-test` finding; false positive, see Findings | | Hosted `labels`, `conventions` | queued when checked; `intake` completed with success | | Build and `player_invitation_dialog` test | not run (no-build policy) | <details><summary>Unedited command output</summary> ```text precheck conventions_and_pr_template — stdout: All conventions checks passed. manual pr_abi_audit.py summary: status: passed symbols: 7 findings: [] manual pr_test_quality.py --json: { "findings": [ { "path": "core/libs/tests/PlayerInvitationDialog.cpp", "line": 1, "kind": "possible-unregistered-cpp-test", "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage." } ], "negative_control_candidates": [], "limits": [ "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.", "A test that passes against base is not by itself proof that the PR test is inadequate.", "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error." ] } ``` </details> ## Findings **Blocking:** none. **Non-blocking:** - The test-quality finding is a false positive. The test is registered at `core/libs/prx/libScePlayerInvitationDialog/CMakeLists.txt` line 7 (`add_test_executable(player_invitation_dialog_tests ${LIBS_INCLUDE_DIR}/tests/PlayerInvitationDialog.cpp)`) and run at line 11 (`add_test(NAME player_invitation_dialog ...)`). The heuristic missed the `${LIBS_INCLUDE_DIR}` prefix. - `Initialize` reads `sceCommonDialogIsUsed()` and does not acquire common-dialog ownership, unlike the sibling `libSceInvitationDialog`, which calls `CommonDialogAcquire_nid_no_patch()` in the same position. The debt entry records this choice. I consider it acceptable because the firmware evidence covers only the query. Noting the difference so it stays deliberate. - The PR also edits `docs/dev/debt/libScePlayerInvitationDialog.md`, as open PR #13585 does. The live stack check passed against current main; this is a merge-order note only. ## Sources - Busy check at head: [libScePlayerInvitationDialog.cpp line 32](https://github.com/boykopovar/AnyPS5/blob/29b225791bad583ea110daea7088c4d202e5188e/core/libs/prx/libScePlayerInvitationDialog/libScePlayerInvitationDialog.cpp#L32) - Query definition: [libSceCommonDialog/Export.cpp line 23](https://github.com/boykopovar/AnyPS5/blob/29b225791bad583ea110daea7088c4d202e5188e/core/libs/prx/libSceCommonDialog/Export.cpp#L23), which returns the `g_used` flag. - Sibling acquire pattern: [libSceInvitationDialog/Export.cpp lines 50-52](https://github.com/boykopovar/AnyPS5/blob/29b225791bad583ea110daea7088c4d202e5188e/core/libs/prx/libSceInvitationDialog/Export.cpp#L50-L52) - Firmware evidence cited by the PR: [#9815 comment 6417937062](https://github.com/boykopovar/AnyPS5/pull/9815#issuecomment-6417937062). Its table records `Initialize()` with `sceCommonDialogIsUsed` answering 1 as `0x80B80008`, from native x86-64 runs of the firmware module with stubbed imports. - Helper naming: [CONTRIBUTING.md line 14](https://github.com/boykopovar/AnyPS5/blob/29b225791bad583ea110daea7088c4d202e5188e/CONTRIBUTING.md#L14) says helper symbols that must not become NIDs use the `_nid_no_patch` suffix; the `status` rename follows that rule. ## Not verified - No build, no C++ compile, and the focused `player_invitation_dialog` test were not run here. The Windows run and the Linux standalone run in the PR body are author-provided and not confirmed by me. - The busy result comes from a native x86-64 run of the firmware module with stubbed imports, not from a console. The ordering of `ALREADY_INITIALIZED` and `BUSY` when both hold is untested, as the PR's debt entry states. - Hosted `labels` and `conventions` were queued when I checked; I did not wait for them.
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!14300
No description provided.