test(libSceRudp): cover empty poll wait behavior #10954
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10954"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by AZLisme on 2026-10-25T11:20:46Z.
What
Add focused regressions for empty
sceRudpPollWaitcalls: argument precedence, zero/finite timeouts, an infinite wait that remains blocked until destruction, untouched event output, and empty polls after removing or terminating their context. ProductionExport.cppand the existing nonempty-poll fixture match main unchanged.The contract is the firmware 13.42 execution report: it executes the firmware library under emulation with imported primitives stubbed. It reports waiting for the remaining timeout, which agrees with main and contradicts Vita3K’s immediate empty return. This is reported firmware-library evidence; it has not been independently reproduced here or measured on console hardware.
The debt entry records that disagreement and the incomplete cancellation implementation. The detailed 13.42 report also supplies the signed 32-bit Cancel argument/basic errors, two idle cancels coalescing per poll, zero-timeout consumption, scripted two-waiter Cancel/Destroy broadcasts and drain, and End during an active wait. These are now recorded as reported emulated-library observations rather than unanswered questions. Cancel still throws, and the host Destroy/End waiter results and missing drain are not fixed here. Real-kernel wake/timeout races and unprobed simultaneous controls remain qualified. @harisibrar1 owns the separate PollCancel follow-up; this PR changes neither its implementation nor its API.
Agreed merge order: this PR first, then #10993, as confirmed with its author. This PR has no predecessor; #10993 declares this PR in Depends on and will preserve both adjacent debt edits on its rebase.
The PollCancel follow-up #11294 also declares this PR first and will retain the remaining Destroy/End debt after rebasing. This PR still has no predecessor; neither #10993 nor #11294 is part of the CI composition below.
Tested
Maintainer-dispatched Build run 40355767067, attempt 1 completed successfully: six jobs succeeded and two were skipped, eight jobs total. Its tested composition is base
518d36eaec0ac37870a17b465bedb5551be91b42with the ordered inputs #11138 atb732c0c75d1869d432c6463583b8a29d521e8f8f, #10913 at294ab651deabaa45146d16341a77f19378807160, #10916 ate75ee1d1e175d6b2d51171385ecab0d460d05236, #10936 at0d14468ccc1b1186b60b1fc85c802ace1594ca23and this PR atef9a48c6ec715bbd917dcb3f64ab7dfd7f1cdb12. Linux and Windows logs verify every fetched input head before the five ordered CI merges, followed by normal root Release builds and CTests. This is composite CI evidence; it does not establish actual PR merges or a new dependency order.Linux job 121687778237, GCC 13.3.0: 2,298 passed, 93 expected skips, zero failed out of 2,391. Windows job 121687778345, WinLibs GCC 15.2.0 r7: 1,681 passed, 815 expected skips, zero failed out of 2,496. Both platforms passed all six RUDP cases:
guest_rudp_status,guest_rudp_context_queries,guest_rudp_pump,guest_rudp_context_lifecycle,guest_rudp_pollandguest_rudp_empty_poll. Both also passedpublic_headers, all 64 header compilation batches andpatched_libraries. Each skip-policy check accepted the stated skips; they remain untested paths, not passes. Actual RUDP source, PRX link/NID patching and the new fixture are present in both product builds; compiler caches were used, so no every-object-fresh build is claimed.The two macOS relinker jobs and relinker-ASAN job succeeded in metadata; their logs were not audited here and do not establish native macOS RUDP product or library-ASAN coverage. The register-context and write-watch jobs were skipped. No compiled binary hashes, console/title execution, standalone-head or newer-main validation is claimed. #10913 was included only in the CI union; this does not establish its real merge or validate our separate HEVC PR #10959. The cancellation and Destroy/End mismatches described above remain unresolved by this regression PR.
Earlier local, contributor Windows and private-integration evidence below retains its original head, base and environment scopes.
Documentation-only follow-up head:
ef9a48c6ec715bbd917dcb3f64ab7dfd7f1cdb12. Only one debt paragraph changed from the tested503a0efb3asource; all runtime, test and build inputs are byte-identical. Conventions and whitespace checks pass again. Runtime tests were not rerun for this documentation edit; the qualified Linux and independent Windows evidence below remains attributed to its exact tested revisions.Exact revised head:
503a0efb3a57ed5997b90357d9b3c78e865ee7e7. Linux x86-64, GCC 16.2.1, Release,BUILD_TESTING=ON, based one05ba6feebd000cfc316c1d1f00e37e030aa3d8b. Built the actual RUDP CMake target and passed all 6/6 focused runtime tests, including the new empty-poll fixture. Public-header audit/compilation, conventions and whitespace checks pass. Linux libc/kernel dependencies were reused only after verifying that their Linux build inputs were unchanged from the prior qualified build; the intervening mapping-header change is Windows-only.A runtime negative control builds the previously published immediate-return implementation and fails the new fixture’s finite-timeout check. The passing run uses main’s production behavior; these are regression results, not a performance claim. The existing nonempty-poll fixture is unchanged.
The previously tested private combined resolution with #10993 preserves the poll/cancellation gaps and all of its setter/getter/unresolved-export changes. The new paragraph only refines the reported observations; it adds no runtime behavior or new combined-tree runtime claim. No AppContent test coverage is claimed.
Author-run Windows/macOS runtime, console execution and a monolithic repository build were not run for this revision; independent Windows validation is attributed below. The previously reported Windows run on the old fast-return head does not validate the new fixture. Existing cancellation mismatches remain debt and are not asserted as corrected by these tests.
An independent exact revised-head Windows report covers
503a0efb3amerged onto maind2b3ee3bcc, Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7, Release. Bothguest_rudp_empty_pollandguest_rudp_pollpassed two repeated runs, and the new empty-poll fixture passed ten repeated runs. The only reported build warning was an existing main signal declaration. No Windows negative control was run. This is reviewer-reported native Windows evidence, separate from the Linux source-control experiment and from hosted product CI.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T11:38:01Z.
Review: APPROVED
The empty-entry fast path follows argument and poll-ID validation while
g_mutexis held, so the check is atomic with poll mutations. It returns before waiting, leaves the event buffer untouched, and does not alter the existing nonempty timeout/destruction path. The new tests cover zero, finite, and infinite timeouts plus transitions back to an empty poll after removal and context termination. The PR reports 5/5 focused Linux runtime tests and an unchanged-main comparison; I did not rerun those tests here. Conventions and whitespace checks pass, and the implementation looks correct within the explicitly documented Vita-derived behavior.Imported from boykopovar/AnyPS5. Originally posted by thepoppfish on 2026-10-25T11:49:24Z.
Review: APPROVED
Reviewed exact head
4f23c6a34a8cdac7d61046cefeea89118050d17d; no blocking findings. This adds native Windows runtime evidence to the existing source review and author's Linux results.Windows 11 build 26200, MSYS2 UCRT64 GCC 16.2.0-6, CMake 4.3.1, Ninja 1.13.2, Release, no LTO:
libSceRudpDLL through its actual library CMake, including actualTime/TimedWait.cpp; ran the complete unmodifiedGuestRudpStatus.cpp,GuestRudpContextQueries.cpp,GuestRudpPump.cpp,GuestRudpContextLifecycle.cppandGuestRudpPoll.cppacross the DLL boundary.Export.cpprestored from base63a863d3b07f2457ee1210f1abba1c11409cdff5, keeping the submitted poll fixture and same timed-wait/support code, the library and test build successfully but the poll test fails in 2.06 s. It reaches the bounded old empty-wait behavior rather than failing to compile/link. No timeout was raised.16ff208dc32cf3927ba1bae492eee363a5ae7ae8. Tree-only merge is clean (tree8537cd8734165f176dc25bfb2a1f716720305b14); no merged-tree test run claimed.The isolated parent harness uses exact production test/unwind helpers and
WindowsTestExit.cpp. Its sole runtime adapter isNotImplemented_nid_no_patchwithGeneral.cpp's runtime_error body, plus disabling Windows crash-report UI for the expected failing control. No poll, context, mutex, timer, wait, cancellation or callback behavior is replaced. Full libc/kernel and NID-patched artifacts were not built or executed.I also checked the early empty-entry return in the pinned Vita implementation. As documented, this is Vita implementation evidence, not console verification. The debt still identifies PS5 semantics and removal of the final entry during an existing wait as unverified. No PS5/title/network-traffic/GPU run, full product/runtime, Linux/macOS run or hosted workflow claim. Local wait durations are fixture results, not a speed claim. Author checkout remains clean and unchanged. AI-assisted review/testing: yes, OpenAI Codex.
Windows native replay
Save these files outside the pinned checkout. Extract its unchanged
add_test_executablefunction from top-levelCMakeLists.txtandconfigure_windows_unwindfromcore/libs/CMakeLists.txtintoProductionHelpers.cmake. Keep the GCC runtime DLL directory on PATH.For the negative control, save
git show 63a863d3b07f2457ee1210f1abba1c11409cdff5:core/libs/prx/libSceRudp/Export.cppoutside the checkout. Configure a separate build with-DRUDP_SOURCE_OVERRIDE=<baseline.cpp>, buildrudp_poll, and runctest -R ^rudp_poll$ --output-on-failure -Vthere. It should fail the submitted regression; the other setup is identical.CMakeLists.txtSupport.cppImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T13:33:24Z.
Review: CHANGES_REQUESTED
I rechecked the overlap report against the current exact heads of this PR and #10993.
git merge-tree --write-tree --name-only refs/remotes/review/pr-10954 refs/remotes/review/pr-10993reports a content conflict indocs/dev/debt/libSceRudp.md; #10993 removessceRudpSetMaxSegmentSizefrom the unresolved-export entry while this PR edits the adjacentsceRudpPollWaitentry. These are separate implementations, but the current heads cannot be combined cleanly.Please coordinate the landing order with #10993's author and record the agreed
Depends onordering, then rebase/resolve the debt-file conflict so both entries are preserved. The implementation review and tests previously assessed for this PR remain unchanged; this request is for the newly confirmed integration conflict.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T13:55:51Z.
Review: CHANGES_REQUESTED
I found a material conflict between this PR’s stated behavior and the firmware 13.42 evidence newly posted on this PR. The current change returns immediately when
poll->second.entries.empty(), based on Vita3K, and its debt note now treats that as the expected behavior. BunnyFl’s report in the issue thread describes running the PS5sceRudpPollWaitimplementation with imported primitives stubbed: an empty poll waits for the remaining timeout, returns zero with the event buffer untouched on timeout, and returns0x80770014when canceled or destroyed while waiting. This directly contradicts the early return that this PR adds.Please reconcile the implementation and regression expectations with that PS5-specific evidence before merging. At minimum, retain the wait behavior unless there is stronger evidence that the observed firmware/build differs from the target contract; update the debt note so the Vita-derived behavior is not presented as PS5-equivalent. The existing fixture results only verify the chosen implementation against its own expectations, not this firmware behavior.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T14:23:02Z.
Review: APPROVED
Reviewed revised head
503a0efb3a. The PR now adds focused empty-poll regressions and a debt update; production and the prior nonempty-poll fixture are unchanged from main. The firmware 13.42 report is clearly labeled as emulated library execution with stubbed imports, not console measurement, and the documentation preserves the unresolved cancel/destroy behavior separately.\n\nChecks I ran: and pass; the new C++ test translation unit passes . I could not run the linked library test locally: CMake configuration stops because this environment lacks the SDL2 submodule and XRandR development support. The hosted Linux product test is skipped; the PR reports 6/6 focused tests on the author's Linux build, which I have not independently reproduced.\n\nThe infinite-wait test uses a short 20 ms observation window after a pre-call start signal, so it is a timing-based check, but it is a reasonable regression guard alongside the finite-timeout cases. The agreed merge order with #10993 is documented in both PRs.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T14:23:38Z.
Review: APPROVED
Reviewed revised head
503a0efb3a. The PR now adds focused empty-poll regressions and a debt update; productionExport.cppand the prior nonempty-poll fixture are unchanged from main. The firmware 13.42 report is clearly labeled as emulated library execution with stubbed imports, not console measurement, and the documentation preserves the unresolved cancel/destroy behavior separately.Checks I ran:
git diff --checkandtools/check_conventions.pypass; the new C++ test translation unit passesg++ -std=c++20 -fsyntax-only. I could not run the linked library test locally: CMake configuration stops because this environment lacks the SDL2 submodule and XRandR development support. The hosted Linux product test is skipped; the PR reports 6/6 focused tests on the author's Linux build, which I have not independently reproduced.The infinite-wait test uses a short 20 ms observation window after a pre-call start signal, so it is a timing-based check, but it is a reasonable regression guard alongside the finite-timeout cases. The agreed merge order with #10993 is documented in both PRs.