Skip to content

test(libSceHttp): cover silent offline setters - #26336

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
malekaifa:prime-f/test-http-silent-offline-setters-20261123
Nov 24, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
malekaifa:prime-f/test-http-silent-offline-setters-20261123

Conversation

@malekaifa

Copy link
Copy Markdown
Contributor

What

Cover the two remaining documented libSceHttp silent option setters that had no regression assertions:

  • sceHttpSetChunkedTransferEnabled keeps returning success for arbitrary object IDs and enable values, including before sceHttpInit.
  • sceHttpsSetMinSslVersion keeps returning success for arbitrary object IDs and version values, including before sceHttpInit.

Both are documented silent stubs in docs/dev/debt/libSceHttp.md; this PR only adds regression coverage and does not change runtime behavior.

core/libs/tests/GuestHttpOptions.cpp is also touched by #24528 and #26242, but neither implements these two functions. #24528 covers timeout/retry/size setter validation, while #26242 covers sceHttpAbortRequest; these assertions are semantically separate and can be rebased straightforwardly if either lands first.

Tested

Windows 11, MSYS2 UCRT64 GCC 16.2, Ninja, Release, exact head 7f22ba158a741fe9bd5fe9e655e16cf672269922:

  • cmake --build C:/b/http-silent-offline-setters-20261123 --target guest_http_options_tests --parallel 4 — passed.
  • ctest --test-dir C:/b/http-silent-offline-setters-20261123 -R '^guest_http_options$' --output-on-failure — 1/1 passed.
  • Negative control: temporarily changed sceHttpSetChunkedTransferEnabled to return -1; guest_http_options failed as intended. Restored the runtime source, rebuilt, and the test passed 1/1 again.
  • python -I tools/check_conventions.py --base HEAD^ --head HEAD — passed.
  • git diff --check HEAD^ HEAD — clean.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: none added
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

Copilot AI balanced review requested due to automatic review settings November 23, 2026 18:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@PrivacyOnion PrivacyOnion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 7f22ba158a:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_http_options_tests built cleanly.
  • CTest (guest_http_options):
    1/1 Test #4065: guest_http_options ...............   Passed    0.00 sec
    100% tests passed, 0 tests failed out of 1
    
  • Code reading:
    • Verified sceHttpSetChunkedTransferEnabled and sceHttpsSetMinSslVersion behavior in CheckOfflineSettersBeforeInit (core/libs/tests/GuestHttpOptions.cpp:143-144) to confirm they return 0 before sceHttpInit
    • Verified loop over handles {pattern, connection, request, UnknownId} in CheckUnobservedOptions (core/libs/tests/GuestHttpOptions.cpp:287-290) testing both 0, -1, 1, and uint32 max values
    • Verified AGENTS.md compliance: test-only change adding regression coverage for documented silent stubs without comments, forbidden files, or special-cased game IDs
    • Verified negative control and mechanical test passes as reported by CTest (1/1 guest_http_options passed cleanly)

Looks Good To Me

@Helldiverr

Copy link
Copy Markdown
Contributor

Works on Windows with WinLibs: the merge passes guest_http_options and three neighbouring HTTP tests 3 of 3 times, and each of six realistic mutations of the two stubs is caught by its own assertion message. The author's negative control covered only sceHttpSetChunkedTransferEnabled; this run also covers sceHttpsSetMinSslVersion.

Existing runs: malekaifa ran Windows 11 with MSYS2 UCRT64 GCC 16.2, 1/1, with a negative control returning -1 from sceHttpSetChunkedTransferEnabled. PrivacyOnion approved on Linux from a test run and a code reading. Copilot did not review (quota).

What this run adds.

Code.

  • Test-only change at core/libs/tests/GuestHttpOptions.cpp:143-144 and :287-290. Both stubs ignore their arguments and return 0 (core/libs/prx/libSceHttp/Export.cpp:398-402 and :473-477). The docs/dev/debt/libSceHttp.md:16 silent-stub entry says they "return 0 and keep nothing, for any ID".
  • CheckOfflineSettersBeforeInit runs after sceHttpTerm, CheckTermEndsOptions and CheckRegisteredCtxIds (:351-355). It sits next to the existing BeforeInit assertions for the implemented setters, which confirm the library really is uninitialised at that point.
  • Non-blocking: the pre-init and unknown-ID assertions pin the stub's success, not a console reading. Its implemented neighbours in this file return BeforeInit and InvalidId (for example sceHttpSetHttp09Enabled, Export.cpp:807-811). If one of these two is later implemented the same way, the failure message "started requiring initialisation" will flag a correct change as a regression. That is consistent with the existing sceHttpRemoveRequestHeader(UnknownId, nullptr) assertion (GuestHttpOptions.cpp:292), so this is a note, not a request.
  • No code comments. No debt change is needed, because the stubs and their entry are unchanged. py -3 tools/check_conventions.py --base bfcd717ebc passes, and py -3 tools/debt_fold.py --check exits 0.

Negative control and mutation. The PR adds tests for unchanged code, so main's implementation also passes them. Instead, each mutation is applied to the merge's Export.cpp, followed by a rebuild of the four targets.

Mutation guest_http_options fails with
sceHttpsSetMinSslVersion returns -1 "sceHttpsSetMinSslVersion started validating or storing its inputs"
sceHttpsSetMinSslVersion returns ERROR_BEFORE_INIT when !HttpInitialised() "sceHttpsSetMinSslVersion started requiring initialisation"
sceHttpsSetMinSslVersion refuses a version above 0xffff "sceHttpsSetMinSslVersion started validating or storing its inputs"
sceHttpSetChunkedTransferEnabled returns ERROR_INVALID_ID for an unknown ID once initialised "sceHttpSetChunkedTransferEnabled started validating or storing its inputs"
sceHttpSetChunkedTransferEnabled returns ERROR_BEFORE_INIT when !HttpInitialised() "sceHttpSetChunkedTransferEnabled started requiring initialisation"
sceHttpSetChunkedTransferEnabled refuses enable other than 0 or 1 "sceHttpSetChunkedTransferEnabled started validating or storing its inputs"

The other three tests pass under every mutation. Nothing survived.

Tests. ctest --test-dir build -R '^(guest_http_options|guest_http|guest_http_state_init|guest_http2_options)$' -V

Test main merge 1 merge 2 merge 3
guest_http_options Passed 0.04 s Passed 0.04 s Passed 0.01 s Passed 0.01 s
guest_http Passed 0.44 s Passed 0.35 s Passed 0.35 s Passed 0.35 s
guest_http_state_init Passed 0.19 s Passed 0.02 s Passed 0.01 s Passed 0.04 s
guest_http2_options Passed 0.20 s Passed 0.04 s Passed 0.03 s Passed 0.03 s

Host

  • CPU: Ryzen 9 9950X3D
  • OS: Windows 11 Pro 26300
  • Toolchain: WinLibs GCC 15.2, Release
  • Commits: head 7f22ba158a, merged onto main bfcd717ebc as b65bfbde7b

AI-assisted: yes

@malekaifa

Copy link
Copy Markdown
Contributor Author

Manual overlap audit for the bot warning: #24528 and this PR share core/libs/tests/GuestHttpOptions.cpp, but their edits are semantically separate. #24528 adds pre-init assertions for timeout/retry/size setters, introduces CheckStoredLimits, and calls that helper from main. This PR only adds sceHttpSetChunkedTransferEnabled / sceHttpsSetMinSslVersion silent-stub assertions in CheckOfflineSettersBeforeInit and CheckUnobservedOptions; it does not touch #24528's new helper or the same setter assertions. Helldiverr also independently verified this head merges cleanly with #26242. No code change is needed for the overlap warning.

Exact head 7f22ba158a741fe9bd5fe9e655e16cf672269922 is fully green: Windows, conventions, labels, eligibility, intake, and library-portability all pass. PrivacyOnion independently approved this exact head after building guest_http_options_tests and passing guest_http_options 1/1 on Linux. The PR remains a one-file test-only delta and retains AI-assisted: yes. Maintainer merge requested.

AI-assisted: yes

@oneandonlydean
oneandonlydean merged commit 0789312 into boykopovar:main Nov 24, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants