Skip to content

test(libkernel): run guest_timed_wait_cpu alone on Windows - #13710

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
dantdmdarealguy:agent/cifails4
Oct 31, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
dantdmdarealguy:agent/cifails4

Conversation

@dantdmdarealguy

Copy link
Copy Markdown
Contributor

What

guest_timed_wait_cpu aborts on the Windows CI runner. The latest case is job 124274871982, a push build of main 37277ea (#13366, unrelated) at 2026-10-30 19:35Z. The test aborts right after scePthreadCondTimedwait(500 us): calling-thread CPU 0.0% (limit <= 40%), before the line for that wait's latency bounds.

Cause. The test from #11725 times 1000 sceKernelUsleep(100), 500 sceKernelUsleep(500) and 500 scePthreadCondTimedwait(500 us) calls on Windows. It requires each set's 99th percentile under 3 ms and its longest wait under 10 ms. CI runs ctest with --parallel 4 on a 4-vCPU runner, and the tests ctest starts beside it (guest_usb_storage, guest_nanosleep_long_request and the guest_raise_* tests, as in that job) keep the CPUs busy. A woken waiter then waits a scheduler quantum or more before it runs again. A copy of the test that prints the samples before checking them shows this in the failing runs:

  • scePthreadCondTimedwait(500 us): 99th percentile 2.60 ms, longest wait 13.25 ms. This run stops at the same line as the CI job.
  • sceKernelUsleep(500 us): 99th percentile 3.57 ms, longest wait 23.3 ms.

It isn't CPU-bound load that causes this. With 16 busy loops on the same 4 CPUs the test passed 10 of 10 times, because a thread whose wait completes is boosted past them. With the test alone, the 99th percentiles overshoot by 0.5 to 1 ms.

Change. guest_timed_wait_cpu runs with RUN_SERIAL on Windows, so ctest doesn't run other tests beside it. This is the third option in the comment on #11725 asking for the test to be made robust on CI. #4356 did the same for guest_pthread_start and audio_out2_timing. The bounds are unchanged; #13338 kept the Windows ones deliberately. The test takes 1.2 to 1.4 s, so running it alone costs CI about a second. Processes outside ctest can still load the runner.

Measurements. Each pass runs the 92 libkernel timing and thread tests around it with ctest pinned to the given logical CPUs (every test inherits the mask):

ctest -R '^guest_(nanosleep|usleep|sleep_wake|cond_timedwait|pthread|getitimer|cpu_time|thread_cpu|freebsd_clocks|timed_wait_cpu|mutex|sem|usb_storage|precise|raise)' --parallel 4
CPUs main this change
2, main arm then change arm 54/100 1/100
2, alternating main and the change pass by pass 42/100 0/100
4, main arm then change arm 2/100 1/100

Two more measurements:

  • Test alone on 4 pinned CPUs (no other test): 0/100.
  • Other failures: the only other test that failed in any of these passes was guest_sleep_wake, once, in the 2-CPU change arm.

The two failures with the change happened while the test ran alone. Other builds were using about 80% of this machine's CPU at the time.

CI. Windows: guest_timed_wait_cpu failed in 1 of 54 test jobs since #11725 merged. Linux: it failed in 7 of 19 jobs between #11725 and #13338, and in 0 of 41 since #13338 loosened the Linux bounds.

Tested

Windows 11 Pro, Intel Core i9-14900K, 128 GB RAM, NVIDIA GeForce RTX 5080 (driver 32.0.16.1742), WinLibs GCC 15.2.0, Release, BUILD_TESTING=ON, main 7fcab08.

  • cmake --build build and cmake --build build --target libs: both succeed.
  • ctest --show-only=json-v1 -R '^guest_timed_wait_cpu$' lists RUN_SERIAL: true beside the existing ENVIRONMENT_MODIFICATION and the 30 s TIMEOUT.
  • ctest -R "^guest_timed_wait_cpu$|patched_libraries": 2/2 passed. patched_libraries: 389 patched libraries loaded, 0 failed.
  • The pinned runs in the table above, on the same machine and build.
  • python tools/check_conventions.py --base origin/main: passed.
  • python tools/check_test_registration.py build: 1617 test executable(s), 0 built and not run as recorded, none new.

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, some AI assistance was used

guest_timed_wait_cpu aborts on the Windows CI runner after printing the
scePthreadCondTimedwait(500 us) CPU line (job 124274871982, main
37277ea). The test requires the 99th percentile of each set of waits
under 3 ms and the longest under 10 ms. ctest runs it with --parallel 4
beside tests such as guest_usb_storage, guest_nanosleep_long_request and
the guest_raise tests. Their threads keep the runner's CPUs busy, so a
woken waiter can wait more than a scheduler quantum before it runs: a
failing run measured a 13.25 ms condition wait and a 23.3 ms usleep.

The test now runs with RUN_SERIAL on Windows, as guest_pthread_start and
audio_out2_timing do. The bounds are unchanged.
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 4563 core/libs/prx/libkernel/CMakeLists.txt
PR 5021 core/libs/prx/libkernel/CMakeLists.txt
PR 6936 core/libs/prx/libkernel/CMakeLists.txt
PR 7192 core/libs/prx/libkernel/CMakeLists.txt
PR 8477 core/libs/prx/libkernel/CMakeLists.txt
PR 9156 core/libs/prx/libkernel/CMakeLists.txt
PR 9293 core/libs/prx/libkernel/CMakeLists.txt
PR 9297 core/libs/prx/libkernel/CMakeLists.txt
PR 9302 core/libs/prx/libkernel/CMakeLists.txt
PR 9326 core/libs/prx/libkernel/CMakeLists.txt
PR 9383 core/libs/prx/libkernel/CMakeLists.txt
PR 9389 core/libs/prx/libkernel/CMakeLists.txt
PR 9557 core/libs/prx/libkernel/CMakeLists.txt
PR 9566 core/libs/prx/libkernel/CMakeLists.txt
PR 9938 core/libs/prx/libkernel/CMakeLists.txt
PR 10645 core/libs/prx/libkernel/CMakeLists.txt
PR 11002 core/libs/prx/libkernel/CMakeLists.txt
PR 11939 core/libs/prx/libkernel/CMakeLists.txt
PR 12544 core/libs/prx/libkernel/CMakeLists.txt
PR 12688 core/libs/prx/libkernel/CMakeLists.txt
PR 12700 core/libs/prx/libkernel/CMakeLists.txt
PR 12965 core/libs/prx/libkernel/CMakeLists.txt

@MarcZX10 MarcZX10 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.

Re-checked — test execution not verified

The CMake change appears valid, but the exact-head Windows workflow did not run guest_timed_wait_cpu; it reported that no guest core/libs test sources changed.

What I ran

Reviewed head a0e3da6c493749db7a5ad4e96371dec59979a315 against PR base 539c3425f886a9fed61f8e33448e09f21504be91. Current main is e2df06e661f94d6e63b8f6622c8c58507b0245c1; the exact-head merge preview was clean. Environment: Debian 12 x86-64, Python 3.11.2, GCC 12.2.0. No local build or test was run.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13710
python3 tools/check_test_registration.py --scripts
python3 tools/pr_test_quality.py --root /marc/AnyPS5 --json core/libs/prx/libkernel/CMakeLists.txt
python3 tools/pr_stack_check.py 13710 --repo boykopovar/AnyPS5
gh pr checks 13710 --repo boykopovar/AnyPS5
gh run view 41156230070 --repo boykopovar/AnyPS5 --job 124404529783 --log | grep -F 'No guest core/libs test sources changed'

Results

Check Result
Diff and conventions Passed. The one-line change adds RUN_SERIAL TRUE only for this test on Windows.
Test registration Passed; the existing guest_timed_wait_cpu test remains registered.
Test-quality heuristic No findings from the workspace copy. The isolated precheck checkout lacked this workspace-only helper.
Current-main merge preview Clean against e2df06e661f94d6e63b8f6622c8c58507b0245c1.
Hosted Windows job Job passed, but its changed-guest-test step said no guest core/libs test sources changed, so the log does not verify this test on the reviewed head.
Other hosted jobs Conventions, intake, labels, library-portability, report and eligibility passed. Linux and specialized jobs were skipped.
Selected unedited output from checks
All conventions checks passed.
179 test script(s), each run by an add_test or a workflow
{
  "findings": [],
  "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."
  ]
}
windows	pass	38m36s	https://github.com/boykopovar/AnyPS5/actions/runs/41156230070/job/124404529783
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41156230070/job/124404530833
windows	Build and run changed guest core/libs tests	2026-10-31T02:20:55.4114386Z No guest core/libs test sources changed
windows	Build and run changed guest core/libs tests	2026-10-31T02:20:55.4114980Z No guest core/libs test sources changed; the libs build still ran
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13710-a0e3da6c4937/head-a0e3da6c4937-b075150c/tools/pr_test_quality.py': [Errno 2] No such file or directory

Findings

Blocking

None found in the CMake diff.

Non-blocking

The PR describes a Windows ctest --show-only check and focused test run, but it does not identify the tested PR head. The hosted Windows job for head a0e3da6c493749db7a5ad4e96371dec59979a315 did not run the changed guest test. I am leaving this as a comment rather than requesting code changes because the scheduling property itself matches the existing CMake pattern.

Sources

Not verified

I did not run CTest locally or independently verify that RUN_SERIAL appears in the test properties for the exact reviewed head. The PR author reports such a check and focused Windows run, but the reported base is 7fcab08f71 rather than the reviewed-head SHA.

To get this to a good state

Please provide the exact commit SHA used for the reported Windows ctest --show-only and focused test run, or rerun those checks on a0e3da6c493749db7a5ad4e96371dec59979a315. I will recheck the same evidence before approving.

@adriadam10 adriadam10 self-assigned this Oct 31, 2026
@adriadam10
adriadam10 merged commit 05ff285 into boykopovar:main Oct 31, 2026
12 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the diff against the description: RUN_SERIAL TRUE is added only under if(WIN32) for guest_timed_wait_cpu, next to the existing ENVIRONMENT_MODIFICATION and 30 s timeout, the same pattern as #4356; the latency bounds are untouched, and #13750 only touches the test source, so there is no overlap; merged.

adriadam10 added a commit that referenced this pull request Oct 31, 2026
…wait latency

Run 41245658018 (b9bf246). linux: agc_shader_disk_cache_large_file skips
when the runner has under 3 GiB free and check_skips.py did not list that
reason. windows: guest_timed_wait_cpu aborted on a runner scheduling hiccup
(latency bound exceeded, #13710 made it serial but it is still timing-based).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants