docs(libSceHttp2): record the synchronous WebSocket exports as unestablished #16936

Open
Deftera186 wants to merge 1 commit from upstream-pr/16936 into main
Deftera186 commented 2026-11-07 23:55:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Deftera186 on 2026-11-07T23:55:26Z.


What

Record in the libSceHttp2 technical-debt file that the four synchronous WebSocket exports have no established prototype, so they stay throwing.

  • sceHttp2WebSocketClose
  • sceHttp2WebSocketSendTextMessage
  • sceHttp2WebSocketSendDataMessage
  • sceHttp2WebSocketSetCloseTimeout

This started as an implementation of those four exports, mirroring their async twins. Review correctly showed there was no cited source for the prototypes: the debt entry claimed SharpProspero's Http2.cs, which at 5dfdb4b has no WebSocket declarations at all. prosper's hle_http2.cpp and rps5e's http.rs are the same — async twins and the two ping setters only — and a GitHub code search for the four names finds only this PR, its forks and NID maps.

Dropping asyncOption from an async twin is also unsound as a rule, not just uncited: the async forms take (…, kqueueOption, option) and this library's synchronous forms drop both. sceHttp2ReadData and sceHttp2SendRequest take three arguments where their async twins take five. A prototype one parameter longer than the console's would read the guest's unset register as option and reject a valid call with 0x817B11FE instead of 0x817B1065.

So the exports stay in InventoryExports.cpp as parameterless int placeholders that throw through NotImplemented_nid_no_patch, exactly as on main, and the new debt entry states what would close the gap: a read of the 13.40 libSceHttp2.sprx exports, or a title call site, giving each prototype.

This PR now changes no code, only docs/dev/debt/libSceHttp2.md (two added lines). The earlier commits' implementations, argument guards, SetCloseTimeout floor and their tests are dropped, because all of them depended on the inferred prototypes and nothing may assert behavior for exports that take no verified arguments.

Tested

Not tested — documentation only. python3 tools/check_conventions.py --base origin/main passes (debt entry 871 characters, under the 1000 limit).

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
  • 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:5206999445 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16936). Originally posted by [Deftera186](https://github.com/Deftera186) on 2026-11-07T23:55:26Z. --- ### What Record in the libSceHttp2 technical-debt file that the four synchronous WebSocket exports have no established prototype, so they stay throwing. - `sceHttp2WebSocketClose` - `sceHttp2WebSocketSendTextMessage` - `sceHttp2WebSocketSendDataMessage` - `sceHttp2WebSocketSetCloseTimeout` This started as an implementation of those four exports, mirroring their async twins. [Review](https://github.com/boykopovar/AnyPS5/pull/16936#pullrequestreview-3041030650) correctly showed there was no cited source for the prototypes: the debt entry claimed SharpProspero's `Http2.cs`, which at `5dfdb4b` has no WebSocket declarations at all. prosper's `hle_http2.cpp` and rps5e's `http.rs` are the same — async twins and the two ping setters only — and a GitHub code search for the four names finds only this PR, its forks and NID maps. Dropping `asyncOption` from an async twin is also unsound as a rule, not just uncited: the async forms take `(…, kqueueOption, option)` and this library's synchronous forms drop **both**. `sceHttp2ReadData` and `sceHttp2SendRequest` take three arguments where their async twins take five. A prototype one parameter longer than the console's would read the guest's unset register as `option` and reject a valid call with `0x817B11FE` instead of `0x817B1065`. So the exports stay in `InventoryExports.cpp` as parameterless `int` placeholders that throw through `NotImplemented_nid_no_patch`, exactly as on `main`, and the new debt entry states what would close the gap: a read of the 13.40 `libSceHttp2.sprx` exports, or a title call site, giving each prototype. This PR now changes no code, only `docs/dev/debt/libSceHttp2.md` (two added lines). The earlier commits' implementations, argument guards, `SetCloseTimeout` floor and their tests are dropped, because all of them depended on the inferred prototypes and nothing may assert behavior for exports that take no verified arguments. ### Tested Not tested — documentation only. `python3 tools/check_conventions.py --base origin/main` passes (debt entry 871 characters, under the 1000 limit). ### 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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical debt file - [x] No notes, investigation `.md` files or images added to the repository - [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
adriadam10 commented 2026-11-11 23:48:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-11-11T23:48:10Z.

Review: CHANGES_REQUESTED


Thanks for this. One blocker:

  • docs/dev/debt/libSceHttp2.md:49 says the signatures follow SharpProspero Http2.cs, but that file at 5dfdb4b has no WebSocket declarations at all, so the sync prototypes (Export.cpp:543-565: argument order and the trailing option) have no cited source. They are inferred from the async twins by dropping asyncOption. Please either point to a real source for each signature (e.g. the firmware 13.40 module disassembly you already rely on for the async exports, showing where flags/option sit in the registers) or, if that can't be established, keep these exports throwing and record them in the debt file.
  • Once the source is cited, fix that sentence in the debt entry so it doesn't claim SharpProspero.

The rest (guards mirroring the async twins, SetCloseTimeout floor, header move, test coverage) looks fine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5866872962 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16936#pullrequestreview-5866872962). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-11-11T23:48:10Z. **Review:** CHANGES_REQUESTED --- Thanks for this. One blocker: - `docs/dev/debt/libSceHttp2.md:49` says the signatures follow SharpProspero `Http2.cs`, but that file at 5dfdb4b has no WebSocket declarations at all, so the sync prototypes (`Export.cpp:543-565`: argument order and the trailing `option`) have no cited source. They are inferred from the async twins by dropping `asyncOption`. Please either point to a real source for each signature (e.g. the firmware 13.40 module disassembly you already rely on for the async exports, showing where `flags`/`option` sit in the registers) or, if that can't be established, keep these exports throwing and record them in the debt file. - Once the source is cited, fix that sentence in the debt entry so it doesn't claim SharpProspero. The rest (guards mirroring the async twins, `SetCloseTimeout` floor, header move, test coverage) looks fine.
Deftera186 commented 2026-11-18 23:04:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Deftera186 on 2026-11-18T23:04:07Z.

Review: COMMENTED


You're right, and I've taken your fallback: the four exports stay throwing and the gap is now recorded in the debt file instead of claimed as an ABI.

Verified before changing anything:

  • SharpProspero Http2.cs at 5dfdb4b has zero WebSocket declarations (339 lines, grep -i websocket → 0 hits). So does prosper hle_http2.cpp and rps5e's http.rs: async twins and the two ping setters only.
  • A code search across GitHub for the four sync names returns this PR, its forks and NID maps, and no prototype anywhere public. The 3.20 export list is a name/NID table with no signatures.
  • I could not close it from firmware either: there is no libSceHttp2.sprx image here, and the libSceHttp2.prx in the local probe tree is this repo's own stub build (every export a NotImplemented thunk at 0x34b60), so disassembling it would only have read back my own placeholders.

On the derivation itself, dropping asyncOption is also unsafe as a rule, not just uncited. The async twins take (…, kqueueOption, option), and this library's synchronous forms drop both:

sceHttp2ReadData      (int reqId, void* data, size_t size);
sceHttp2ReadDataAsync (int reqId, void* data, size_t size, void* kqueueOption, void* option);
sceHttp2SendRequest      (int reqId, const void* postData, size_t size);
sceHttp2SendRequestAsync (int reqId, const void* postData, size_t size, Http2AsyncOption* kqueueOption, void* option);

Removing only asyncOption would leave a trailing option parameter that the console does not have, so the guest's unset register would be read as option and a valid call would come back 0x817B11FE instead of 0x817B1065. Keeping them throwing is the only version that cannot be wrong in that direction.

What's in the PR now (rebased onto main, two added lines in docs/dev/debt/libSceHttp2.md, no code changes):

  • the false SharpProspero citation is gone;
  • a new entry under Additional HTTP2 exports records that no source gives these four prototypes, states the ReadData/SendRequest counterexample, and ends with Closes when: a read of the 13.40 libSceHttp2.sprx exports or a title call site gives each prototype;
  • sceHttp2WebSocketClose, …SendTextMessage, …SendDataMessage and …SetCloseTimeout still live in InventoryExports.cpp as parameterless int placeholders that throw through NotImplemented_nid_no_patch, as on main.

Dropped from the branch, since they depended on the inferred prototypes: the real signatures in Export.cpp/Http2.hpp, the argument guards mirroring the async twins, and the SetCloseTimeout floor. The websocket guard and ping-setter tests go with them, so nothing asserts behavior for exports that no longer take arguments.

If you'd rather have the implemented versions than the record, the missing piece is a 13.40 module read of these four exports showing the flags/option register positions; with that I'll restore the code on top of this. tools/check_conventions.py --base origin/main passes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5966607547 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16936#pullrequestreview-5966607547). Originally posted by [Deftera186](https://github.com/Deftera186) on 2026-11-18T23:04:07Z. **Review:** COMMENTED --- You're right, and I've taken your fallback: the four exports stay throwing and the gap is now recorded in the debt file instead of claimed as an ABI. Verified before changing anything: - `SharpProspero` `Http2.cs` at `5dfdb4b` has zero WebSocket declarations (339 lines, `grep -i websocket` → 0 hits). So does [prosper `hle_http2.cpp`](https://github.com/mattias800/prosper/blob/b1bec57186a0/prosper/src/hle/net/hle_http2.cpp) and `rps5e`'s `http.rs`: async twins and the two ping setters only. - A code search across GitHub for the four sync names returns this PR, its forks and NID maps, and no prototype anywhere public. The 3.20 export list is a name/NID table with no signatures. - I could not close it from firmware either: there is no `libSceHttp2.sprx` image here, and the `libSceHttp2.prx` in the local probe tree is this repo's own stub build (every export a `NotImplemented` thunk at `0x34b60`), so disassembling it would only have read back my own placeholders. On the derivation itself, dropping `asyncOption` is also unsafe as a rule, not just uncited. The async twins take `(…, kqueueOption, option)`, and this library's synchronous forms drop *both*: ```c sceHttp2ReadData (int reqId, void* data, size_t size); sceHttp2ReadDataAsync (int reqId, void* data, size_t size, void* kqueueOption, void* option); sceHttp2SendRequest (int reqId, const void* postData, size_t size); sceHttp2SendRequestAsync (int reqId, const void* postData, size_t size, Http2AsyncOption* kqueueOption, void* option); ``` Removing only `asyncOption` would leave a trailing `option` parameter that the console does not have, so the guest's unset register would be read as `option` and a valid call would come back `0x817B11FE` instead of `0x817B1065`. Keeping them throwing is the only version that cannot be wrong in that direction. What's in the PR now (rebased onto `main`, two added lines in `docs/dev/debt/libSceHttp2.md`, no code changes): - the false SharpProspero citation is gone; - a new entry under *Additional HTTP2 exports* records that no source gives these four prototypes, states the `ReadData`/`SendRequest` counterexample, and ends with `Closes when: a read of the 13.40 libSceHttp2.sprx exports or a title call site gives each prototype`; - `sceHttp2WebSocketClose`, `…SendTextMessage`, `…SendDataMessage` and `…SetCloseTimeout` still live in `InventoryExports.cpp` as parameterless `int` placeholders that throw through `NotImplemented_nid_no_patch`, as on `main`. Dropped from the branch, since they depended on the inferred prototypes: the real signatures in `Export.cpp`/`Http2.hpp`, the argument guards mirroring the async twins, and the `SetCloseTimeout` floor. The websocket guard and ping-setter tests go with them, so nothing asserts behavior for exports that no longer take arguments. If you'd rather have the implemented versions than the record, the missing piece is a 13.40 module read of these four exports showing the `flags`/`option` register positions; with that I'll restore the code on top of this. `tools/check_conventions.py --base origin/main` passes.
Deftera186 commented 2026-11-18 23:13:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Deftera186 on 2026-11-18T23:13:34Z.

Review: COMMENTED


One correction to my previous message: I first edited docs/dev/debt/libSceHttp2.md directly, then found that docs/dev/TechnicalDebt.md Fragments says a pull request must not edit the debt files, only add docs/dev/debt/changes/<branch>.md. The branch now carries just that fragment, and the debt file is byte-identical to main.

So the PR's whole diff is one new file, docs/dev/debt/changes/http2-sync-websocket.md, +5 lines:

# libSceHttp2

## add Unknown function info

- [libSceHttp2 synchronous WebSocket exports](../../../core/libs/prx/libSceHttp2/InventoryExports.cpp) - …

python3 tools/debt_fold.py --check passes, and --show libSceHttp2 folds the entry in once, under Unknown function info, right after the NID table that lists the four names. tools/check_conventions.py --base origin/main passes.

Everything in my previous message about the evidence still holds: the SharpProspero citation is gone, no public source gives these four prototypes, and the sceHttp2ReadData/sceHttp2SendRequest pairs show the synchronous forms drop both trailing option arguments rather than just asyncOption. The four exports remain throwing placeholders in InventoryExports.cpp, as on main.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5966706241 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16936#pullrequestreview-5966706241). Originally posted by [Deftera186](https://github.com/Deftera186) on 2026-11-18T23:13:34Z. **Review:** COMMENTED --- One correction to my previous message: I first edited `docs/dev/debt/libSceHttp2.md` directly, then found that `docs/dev/TechnicalDebt.md` *Fragments* says a pull request must not edit the debt files, only add `docs/dev/debt/changes/<branch>.md`. The branch now carries just that fragment, and the debt file is byte-identical to `main`. So the PR's whole diff is one new file, `docs/dev/debt/changes/http2-sync-websocket.md`, +5 lines: ``` # libSceHttp2 ## add Unknown function info - [libSceHttp2 synchronous WebSocket exports](../../../core/libs/prx/libSceHttp2/InventoryExports.cpp) - … ``` `python3 tools/debt_fold.py --check` passes, and `--show libSceHttp2` folds the entry in once, under *Unknown function info*, right after the NID table that lists the four names. `tools/check_conventions.py --base origin/main` passes. Everything in my previous message about the evidence still holds: the SharpProspero citation is gone, no public source gives these four prototypes, and the `sceHttp2ReadData`/`sceHttp2SendRequest` pairs show the synchronous forms drop both trailing option arguments rather than just `asyncOption`. The four exports remain throwing placeholders in `InventoryExports.cpp`, as on `main`.
MarcZX10 commented 2026-11-23 06:13:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T06:13:05Z.

Review: COMMENTED


Reviewed — comments

This documentation-only change records the lack of verified prototypes for four synchronous WebSocket exports and keeps the existing throwing placeholders.

What I ran

I read the full changed file and the prepared description, commit list, manifest, and diff for head a44ef1307ad40bb943159ae2dfce5cd782c29bd6. No commands were run.

Results

Check Result Note
Changed file review passed All five added lines read
Automated checks not run Documentation-only change

Findings

Blocking

None.

Non-blocking

None.

Not verified

The author reports python3 tools/check_conventions.py --base origin/main passes; I did not run it. I did not independently verify the external-source and console-export claims summarized in the new entry. No other repository files were read; files.json was not available in the prepared artifacts, so the full set of files classified as reviewed could not be confirmed.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6017271843 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16936#pullrequestreview-6017271843). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-23T06:13:05Z. **Review:** COMMENTED --- # Reviewed — comments This documentation-only change records the lack of verified prototypes for four synchronous WebSocket exports and keeps the existing throwing placeholders. ## What I ran I read the full changed file and the prepared description, commit list, manifest, and diff for head `a44ef1307ad40bb943159ae2dfce5cd782c29bd6`. No commands were run. ## Results | Check | Result | Note | |---|---|---| | Changed file review | passed | All five added lines read | | Automated checks | not run | Documentation-only change | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The author reports `python3 tools/check_conventions.py --base origin/main` passes; I did not run it. I did not independently verify the external-source and console-export claims summarized in the new entry. No other repository files were read; `files.json` was not available in the prepared artifacts, so the full set of files classified as reviewed could not be confirmed. ## To get this to a good state Nothing is required.
ligmaSec commented 2026-12-03 12:06:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T12:06:54Z.

Review: COMMENTED


Ran the debt fold check on this head. The new note applies cleanly, and the four synchronous WebSocket exports still use the repository’s throwing path. The note records the missing prototype evidence.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6169448591 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16936#pullrequestreview-6169448591). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T12:06:54Z. **Review:** COMMENTED --- Ran the debt fold check on this head. The new note applies cleanly, and the four synchronous WebSocket exports still use the repository’s throwing path. The note records the missing prototype evidence. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/16936:upstream-pr/16936'
git switch 'upstream-pr/16936'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/16936'
git switch 'upstream-pr/16936'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/16936'
git switch 'upstream-pr/16936'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/16936'
git switch 'main'
git merge --squash 'upstream-pr/16936'
git switch 'main'
git merge --ff-only 'upstream-pr/16936'
git switch 'main'
git merge 'upstream-pr/16936'
git push origin 'main'
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!16936
No description provided.