feat(http2): complete asynchronous sends and reads that pass no kernel queue #11900

Closed
milescoviello wants to merge 7 commits from upstream-pr/11900 into main
milescoviello commented 2026-10-27 12:21:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-27T12:21:35Z.


What

#11630 completes sceHttp2SendRequestAsync and sceHttp2ReadDataAsync when the caller passes a kernel-queue option. A null kqueue_option still goes to NotImplemented_nid_no_patch, which edubox left for a follow-up (comment). This is that follow-up.

With a null kqueue_option, both calls now start the same worker and queue the completion for sceHttp2WaitAsync, without triggering a user event. A non-null option still throws.

Crimson Desert (PPSA25286 01.000.568) uses this form. In its relinked eboot.bin:

  • sceHttp2SendRequestAsync (0x3043c2f) passes kqueue_option NULL and option NULL;
  • sceHttp2ReadDataAsync (0x304591a) passes a 0x2000-byte buffer, kqueue_option NULL and option NULL;
  • each is then waited for with sceHttp2WaitAsync (0x304594a).

On main, and on #11630 alone, the title stops 1 s after launch at sceHttp2SendRequestAsync not implemented. That's in all 7 of my runs (details on #11630).

How

core/libs/prx/libSceHttp2/Export.cpp (on #11630):

  • CompleteAsync takes the kqueue option as std::optional<Http2AsyncOption> and triggers sceKernelTriggerUserEvent only when one was given. The completion is queued under the same per-request lock either way, so retirement and sceHttp2WaitAsync behave as in #11630.
  • sceHttp2SendRequestAsync and sceHttp2ReadDataAsync refuse only a non-null option and copy the kqueue option when there is one.

docs/dev/debt/libSceHttp2.md gets a new entry for the queueless form, 542 characters. The existing asynchronous-requests entry is already over the length limit, so the new form gets its own entry.

core/libs/tests/GuestHttp2Transport.cpp adds AsyncWithoutQueue, run with and without TLS like Async:

  • an asynchronous send and a 64-byte read against the local HTTP/2 server, both with a null kqueue option;
  • sceHttp2WaitAsync must return the send (event type 0, result 0), then the read (event type 1, 13 bytes, "response body").

Tested

Rebased onto #11630's head 501f70bd1f (#11630 rebased onto main 0cd07dc4ab) as 3e774e636d. The rebase was clean and the patch is unchanged. Linux (Ubuntu 26.04, GCC 15.2), Release: guest_http2 and guest_http2_transport pass 3 of 3 at 3e774e636d.

The previous rebase, onto ec16afa08d as 381b728b72, was also clean with the patch unchanged. Linux (Ubuntu 26.04, GCC 15.2), Release: the six guest_http2* tests (ctest -R '^guest_http2', transport, cookies, options and teardown included) pass 3 of 3 at this head. On the Windows 11 VM (GT 1030, WinLibs GCC 15.2, Release), the four guest_http2* test targets I built (six ctest entries) pass 3 of 3 at this head and at its base. I left the teardown target out of that build.

Before the rebase: cmake --build build --target guest_http2_transport_tests and ctest -R '^guest_http2_transport' --repeat until-fail:3 passed 3 of 3 at bfbc6ef86a (on #11630's 3e8c533a37), and so did guest_http2.

As a red control, #11630's head with only this PR's AsyncWithoutQueue scenario fails. The scenario aborts with sceHttp2SendRequestAsync not implemented, the same stop as Crimson Desert.

Crimson Desert (release libs of this change on #11630's previous head 908dc81b00, same code change, cold shader cache, my no-network sandbox, RTX 4070 Ti): the title gets past the asynchronous send. It stops 1 s in at the DNS lookup, sceHttp2: DNS failed; console error mapping is unknown not implemented. MXGP 26 stops at the same place in this sandbox (see #11630). On a connected machine I'd expect the lookup to succeed; I can't run that here.

Windows (Windows 11 VM, GeForce GT 1030, WinLibs GCC 15.2, Release), merge base main 14332cd8d0 against 53a47e85d1 (this patch, unchanged by the later rebase onto 3e8c533a37), 3 runs each: guest_http2_transport and guest_http2 pass in every run on both sides. Earlier heads failed guest_http2_transport there in #11630's own Async scenario. Its 2 s wait was shorter than Windows' ~2.3 s refusal of the ::1 loopback that localhost resolves to first (details). #11630's 9f2b22a27b extends that wait to 10 s.

tools/check_conventions.py --base upstream/main passes, apart from the pre-existing length warning on the asynchronous-requests entry.

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: #11630 (stacked on its head ec16afa08d)
  • Fixes: none
  • Unblocks: Crimson Desert (PPSA25286) past the asynchronous send
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5033803735 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11900). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-27T12:21:35Z. --- ### What #11630 completes `sceHttp2SendRequestAsync` and `sceHttp2ReadDataAsync` when the caller passes a kernel-queue option. A null `kqueue_option` still goes to `NotImplemented_nid_no_patch`, which edubox left for a follow-up ([comment](https://github.com/boykopovar/AnyPS5/pull/11630#issuecomment-6437861815)). This is that follow-up. With a null `kqueue_option`, both calls now start the same worker and queue the completion for `sceHttp2WaitAsync`, without triggering a user event. A non-null `option` still throws. Crimson Desert (PPSA25286 01.000.568) uses this form. In its relinked `eboot.bin`: - `sceHttp2SendRequestAsync` (0x3043c2f) passes `kqueue_option` NULL and `option` NULL; - `sceHttp2ReadDataAsync` (0x304591a) passes a 0x2000-byte buffer, `kqueue_option` NULL and `option` NULL; - each is then waited for with `sceHttp2WaitAsync` (0x304594a). On `main`, and on #11630 alone, the title stops 1 s after launch at `sceHttp2SendRequestAsync not implemented`. That's in all 7 of my runs (details on #11630). ### How `core/libs/prx/libSceHttp2/Export.cpp` (on #11630): - `CompleteAsync` takes the kqueue option as `std::optional<Http2AsyncOption>` and triggers `sceKernelTriggerUserEvent` only when one was given. The completion is queued under the same per-request lock either way, so retirement and `sceHttp2WaitAsync` behave as in #11630. - `sceHttp2SendRequestAsync` and `sceHttp2ReadDataAsync` refuse only a non-null `option` and copy the kqueue option when there is one. `docs/dev/debt/libSceHttp2.md` gets a new entry for the queueless form, 542 characters. The existing asynchronous-requests entry is already over the length limit, so the new form gets its own entry. `core/libs/tests/GuestHttp2Transport.cpp` adds `AsyncWithoutQueue`, run with and without TLS like `Async`: - an asynchronous send and a 64-byte read against the local HTTP/2 server, both with a null kqueue option; - `sceHttp2WaitAsync` must return the send (event type 0, result 0), then the read (event type 1, 13 bytes, "response body"). ### Tested **Rebased onto #11630's head `501f70bd1f`** (#11630 rebased onto `main` `0cd07dc4ab`) as `3e774e636d`. The rebase was clean and the patch is unchanged. Linux (Ubuntu 26.04, GCC 15.2), Release: `guest_http2` and `guest_http2_transport` pass 3 of 3 at `3e774e636d`. The previous rebase, onto `ec16afa08d` as `381b728b72`, was also clean with the patch unchanged. Linux (Ubuntu 26.04, GCC 15.2), Release: the six `guest_http2*` tests (`ctest -R '^guest_http2'`, transport, cookies, options and teardown included) pass 3 of 3 at this head. On the Windows 11 VM (GT 1030, WinLibs GCC 15.2, Release), the four `guest_http2*` test targets I built (six ctest entries) pass 3 of 3 at this head and at its base. I left the teardown target out of that build. Before the rebase: `cmake --build build --target guest_http2_transport_tests` and `ctest -R '^guest_http2_transport' --repeat until-fail:3` passed 3 of 3 at `bfbc6ef86a` (on #11630's `3e8c533a37`), and so did `guest_http2`. As a red control, #11630's head with only this PR's `AsyncWithoutQueue` scenario fails. The scenario aborts with `sceHttp2SendRequestAsync not implemented`, the same stop as Crimson Desert. **Crimson Desert** (release libs of this change on #11630's previous head `908dc81b00`, same code change, cold shader cache, my no-network sandbox, RTX 4070 Ti): the title gets past the asynchronous send. It stops 1 s in at the DNS lookup, `sceHttp2: DNS failed; console error mapping is unknown not implemented`. MXGP 26 stops at the same place in this sandbox (see #11630). On a connected machine I'd expect the lookup to succeed; I can't run that here. **Windows** (Windows 11 VM, GeForce GT 1030, WinLibs GCC 15.2, Release), merge base `main` `14332cd8d0` against `53a47e85d1` (this patch, unchanged by the later rebase onto `3e8c533a37`), 3 runs each: `guest_http2_transport` and `guest_http2` pass in every run on both sides. Earlier heads failed `guest_http2_transport` there in #11630's own `Async` scenario. Its 2 s wait was shorter than Windows' ~2.3 s refusal of the `::1` loopback that `localhost` resolves to first ([details](https://github.com/boykopovar/AnyPS5/pull/11630#issuecomment-6450846876)). #11630's `9f2b22a27b` extends that wait to 10 s. `tools/check_conventions.py --base upstream/main` passes, apart from the pre-existing length warning on the asynchronous-requests entry. ### 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: #11630 (stacked on its head `ec16afa08d`) - [x] Fixes: none - [x] Unblocks: Crimson Desert (PPSA25286) past the asynchronous send - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-27 12:35:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T12:35:53Z.

Review: COMMENTED


I reviewed the incremental no-kernel-queue path and its transport tests at 9be15dc98515a04842fb7840c6892cd3047ca148. The local Linux build of guest_http2_transport_tests succeeded. Native execution is blocked by this host CPU guard (E5-1620 v2 lacks AVX2/FMA/LZCNT/BMI); running the exact test binary under QEMU Haswell completed successfully, including the queueless send/read and asynchronous deletion/publication scenarios. Hosted Windows and policy checks pass; hosted Linux is skipped by repository policy. The PR explicitly depends on #11630 and includes its commits in the stack, so this comment reviews the follow-up behavior and test evidence; I am not treating it as approval of the full stack before the prerequisite is reviewed/lands.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5667112549 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11900#pullrequestreview-5667112549). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T12:35:53Z. **Review:** COMMENTED --- I reviewed the incremental no-kernel-queue path and its transport tests at `9be15dc98515a04842fb7840c6892cd3047ca148`. The local Linux build of `guest_http2_transport_tests` succeeded. Native execution is blocked by this host CPU guard (E5-1620 v2 lacks AVX2/FMA/LZCNT/BMI); running the exact test binary under QEMU Haswell completed successfully, including the queueless send/read and asynchronous deletion/publication scenarios. Hosted Windows and policy checks pass; hosted Linux is skipped by repository policy. The PR explicitly depends on #11630 and includes its commits in the stack, so this comment reviews the follow-up behavior and test evidence; I am not treating it as approval of the full stack before the prerequisite is reviewed/lands.

Pull request closed

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!11900
No description provided.