Repository navigation
test(libScePad): wait for the read intervals the latch checks rely on - #12115
oneandonlydean merged 2 commits into
Conversation
The latch lasts one and a half times the interval between the previous two scePadReadState calls, kept between 100 ms and 500 ms. The latch checks assumed two consecutive reads land within a few microseconds and that a read follows a tap within the latch, so a stall of about 100 ms on a loaded runner made them fail: guest_pad aborted in CheckLatchedPressLifetime in two Windows CI runs on main. Repeat the two short reads until both finished within 50 ms, hold the newer press while it is read, and repeat the slow-read and per-port cases until the tap was read within 250 ms of the second slow read.
|
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.
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact head 94df21e84d94f8d847d74107d27a731d1ca6f356. The change keeps the library untouched and makes each timing assumption explicit in the test: it establishes a short read interval before expiry checks and retries the slow-read cases until the post-tap read is within the computed latch window. The newer-press case reads while the newer button is still down. The reported stall-injection and mutation runs give useful evidence that it avoids the CI scheduling flake without masking the existing latch regressions.
Independent checks: GuestPad.cpp syntax-only compilation passed with the project GCC 12/C++20 flags, git diff --check passed, and merge preview against current main is clean. Hosted Windows CI passed. I did not independently run the Windows stress tests on this Linux host.
|
@dantdmdarealguy thanks, the interval analysis matches |
THEMANnt
left a comment
There was a problem hiding this comment.
Reviewed 94df21e84d94f8d847d74107d27a731d1ca6f356 against f5fefb982c53672bda23767304f97aac2eec5207. The Pad latch checks establish the intended fast/slow read intervals before asserting latch behavior, and keep a currently held replacement button down until its state is read. The retry windows are timing preconditions; the focused CTest has an external timeout. A successful local run is not proof of scheduler behavior under every load. No actionable finding in this scoped test review.
Windows/GCC 15.3 Release: configured and built the registered target from pinned sources; focused CTest: 1 passed, 0 skipped. Checked that the fixture assertions remain active in Release. Production source is unchanged from the author base; baseline was source-compared, not rebuilt/rerun here. Matching cached dependency source pins and the existing matching FFmpeg package are used. No game, physical-console or GPU validation is claimed.
The newer-press case in CheckLatchedPressLifetime held the circle press while it was read, so the check passed for any held button and no longer showed that a released tap stays latched at the default 100 ms latch. Release the circle tap before the read again. Each attempt makes two reads within 50 ms, so the latch is 100 ms, taps cross, waits 150 ms, taps circle and reads it. Repeat up to 50 times until the reads were close and the read finished within 50 ms of the circle press, and abort with a message if no attempt did.
|
@oneandonlydean Thanks, fixed in 90e7ebe: the circle tap is released before the read again. Each attempt makes a read pair within 50 ms (so the latch is 100 ms), taps cross, waits 150 ms, taps circle and reads it. The block repeats until the pair was close and the read came within 50 ms of the press, at most 50 times, and aborts with a message otherwise. With a |
✅ AMD GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validation IDs already present on main (4 IDs in 441 tests)Skipped (7)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
Tested This flake also breaks other PRs' CI. The same Without stalls: One 110 ms sleep at each read gap that a latch check depends on, on both sides, run 3 times each.
Every attempt stalled (the retry bound is never met):
AI-assisted: yes (Claude Code) |
What
guest_padaborts now and then on Windows CI onmain. It failed in 2 Windows jobs out of 1771build.ymlruns onmainfrom 2026-10-26 00:00Z to 2026-10-27 20:30Z: 121861376042 (7e89ba1 + #10319) and 122201223723 (62b3ba2 + #11388). The test exits with0xc0000409and prints nothing, becauseRequirecallsstd::abort(). Both stacks symbolize toCheckLatchedPressLifetime:guest_pad_tests.exe+0x8f2eis the return fromcall abortinCheckLatchedPressLifetime(int).cold, and+0xa9e9followscall CheckLatchedPressLifetimeinmain.+0x86afand+0xaa08map to the same two places.Since #9919, the latch lasts one and a half times the interval between the previous two
scePadReadStatecalls, kept between 100 ms and 500 ms. The latch checks assumed two things about scheduling:A stall of about 100 ms between those reads breaks the first assumption. That happens on a CI runner running
ctest --parallel 4, and it makes(data.buttons & cross) == 0fail atGuestPad.cpp:283or:293. A stall between a tap and its read breaks the second assumption (:294,:309,:329). Before #9919 the latch was a fixed 100 ms, and only:294depended on timing.The test now waits for the conditions it relies on:
ReadTwiceWithinrepeats twoscePadReadStatecalls until both finish within 50 ms. This makes the latch exactly 100 ms before the "expired" checks.released circle tap was not read within 50 ms of a close read pair in 50 attemptsif no attempt did.The library is unchanged.
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.
guest_padpassed 100/100 runs on its own (ctest -R "^guest_pad$" --repeat until-fail:100, 395.8 s, about 4.0 s per run, the same asmain), and 100/100 with 8 instances running at a time.Requirereporting its line, and ran 100 copies, 10 at a time. Themaincolumn ismain's test againstmain'slibScePad; line numbers are inmain'sGuestPad.cpp:mainCheckLatchedPressLifetime(the CI window):398Require, inside the three latch checks:39835,:4089,:40923,:42411,:4296,:4446):39847,:40811,:40920,:4248,:4293,:4446)PadState.cppand ran builds where a failedRequireprints its line and continues, so that every failing check shows:PadState.cppmain's testWithout a mutation all three pass 5/5. The first two mutations also make the earlier
CheckTapBetweenReadsfail, so the unmodified test binary aborts there first. The rows show the newer-press check on its own.ctest -R "^guest_pad|patched_libraries"passes 3/3. The full build and thelibstarget both succeed with no warnings inGuestPad.cpp.check_test_registration.pyandcheck_conventions.py --base origin/mainpass.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)guest_pad)