fix(pad): timestamp fresh controller samples when read #6337
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6337"
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 JJenkx on 2026-10-15T12:14:00Z.
What
Fresh
scePadReadStatesamples and the empty-queue fallback ofscePadReadreuse the timestamp of the last input change. Holding a button or stick therefore returns a frozen timestamp across later reads. Stamp these newly generated samples with the current process time; queued samples retain their capture timestamps and order.Two production lines change. The regression checks advancing timestamps with unchanged buttons/sticks in both paths and verifies that draining the queued sample retains its earlier capture time. Existing latched presses, trigger values and latch reset are preserved. The refresh retains merged #8138 touchpad resolution changes and its controller regressions, including both
<cstdio>and<cstring>in the fixture and both functional debt entries. This does not implement hardware sampling cadence or idle sample batching; those limits remain in the library debt file.Based on main
2dc85609fc1f70965ca88829560a73ad3c363493, head8e30de03174899b4aa104cdf52c44bf12bdb9b98, with two linear topic commits and no merge commits. Current main has per-controller slots: the two fresh-sample calls now usenowinBuildData(slot, slot.state, now, now, injected, port). Resolution preserves all current-main slot discovery, initialization, latched input and queued/scripted-overlay timestamp handling. The existing regression and main's added controller cases are retained. No new Windows run is claimed.Open overlap review (2026-10-22): #7881 rewrites both paths for per-port state. Either merge order must keep current-time timestamps for fresh samples and capture-time timestamps for queued entries. Author coordination. The #7881 author reports a local combination passing all 15 pad/user-service tests, including
CheckHeldSampleTimes; I have not independently repeated that combined run. #9878 adds disconnected special-port handling and does not change either timestamp site inPadState.cpp. ItsCheckSpecialPorttest and this PR'sCheckHeldSampleTimesare inserted at the same position inGuestPad.cpp; a three-way fixture merge at headsbdd7a52cand7678df54conflicts there. Resolve by retaining both function definitions and both calls; neither replaces the other. This is a static overlap review, not a combined build/runtime result. Neither PR is a code dependency. #9770, which included the sameReadStatecorrection, was closed without merging as an accidental fork sync; its implementation is not a dependency.Tested
Current Linux x86-64 Release validation on
8e30de03174899b4aa104cdf52c44bf12bdb9b98: fresh build oflibScePad,guest_pad_testsandguest_pad_vibration_mode_tests; both focused groups pass. With only the two production timestamp edits reverted,guest_padfails with the expected stale-held-input diagnostic while vibration-mode checks pass. Restoring the exact clean head and rebuilding gives 2/2 passes on three consecutive runs. Conventions against current main and origin/main and whitespace checks pass. Logs, patch and negative-control receipt (SHA-2568218028ba0e3951182f4a5a475fd714fb0708558e7c70576fdaf186773720009). No new Windows, title, GPU or FPS result is claimed.Historical Windows 11, GCC 15.2 (UCRT), Release evidence on previous head
bbd9164413ae23a90bac2ad2eb90d26cb8d3f693/ main938812df1403f9616dba71744216725891ca4979:guest_pad_testsandguest_pad_vibration_mode_testsin a fresh build directory;ctest -R '^guest_pad(_vibration_mode)?$'three times: 2/2 pass each run, 0 not run, no skips.core/libs/prx/libScePad/src/PadState.cpprestored from main, built in a separate fresh directory:guest_padfails withscePadReadState returned a stale timestamp for held input(abort).python tools/check_conventions.py --base 938812df14 --head HEAD: passed.Earlier Linux results on base
a6646f8464, kept for history:Linux x86-64, GCC 16.2.1, Ryzen 9 7950X, previous head
bdd7a52c1b:guest_pad_tests.SDL_VIDEODRIVER=dummy ctest --test-dir build -R '^guest_pad$' -V --timeout 60 --repeat until-fail:3: all three runs pass, no skips. The fixture covers held-input timestamps, captured queue timestamps and the existing touchpad/latch regressions.PadState.cppwith the base revision, rebuilt, and reran the fixture. It failed atscePadReadState returned a stale timestamp for held input. Restoring the candidate source, rebuilding and rerunning passed. Source is clean and still at the tested head.python3 tools/check_conventions.py --base a6646f8464140180351e4c08694dccdd55b2814dandgit diff --check: passed during the linear rebase review.Earlier revisions had broader controller/library checks and independent negative controls for both production lines; those are historical evidence, not tests of this refreshed head. No native game, Windows runtime, full runtime suite, GPU or performance result is claimed for this head.
Pinned validation logs and negative control, SHA-256
264ef40273a4e022f4409e01b6c8c9e02106e6c3896c924b43fedb988ce25686.The touch-ID ordering agreement in the review remains applicable if #6485 is reopened or resubmitted: merge its prerequisite and touch-ID change first, then retain both captured touch IDs and
nowfor fresh samples. That closed PR is not a current code dependency; queued samples retain their captured IDs and times.Supplemental qualification (2026-11-01)
Merged main
93dbd0f82aeainto the branch, preserving the original history. New head:ee1696711b51fce4473a501c3524a53c29cb7d70.Resolved
PadState.cppby keeping main's withdrawn-port decision andWithdrawnData(slot.timestamp)path; only fresh non-withdrawnBuildDatacalls usenowfor the sample timestamp. Queued samples retain their capture timestamps. Main's injected-title-input handling and the combined fixture, includingCheckSpecialPortandCheckHeldSampleTimes, remain.Linux Release exact-head
guest_padandguest_pad_vibration_modepass three times each. A production-only negative replacingPadState.cppwith current main failsguest_padwith “scePadReadState returned a stale timestamp for held input”. Restoring the candidate rebuilds and both focused groups pass. Conventions and whitespace checks pass; submodule pins match main. No new Windows or title execution is claimed; previous Windows/title reports remain historical.Evidence: frozen source and qualification receipts (SHA-256
e40b9e4b51b918651e5061b7ca78903741cf1886e27a6def8ec6565b8fb7acd2, downloaded bytes and internal manifest verified).AI-assisted: yes.
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 Ondra97 on 2026-10-15T17:13:50Z.
I opened #6485 for a separate touch-contact identity bug. The changes meet at the two fresh-sample
BuildDatacalls.I propose #6485 first, after its shared Windows build prerequisite #6452, then rebasing this timestamp change while retaining both
nowfor fresh sample timestamps and the capturedtouchIds. Queued samples keep their capture timestamp and IDs.I manually composed this PR at
279fee87a077f413daa950deb73c2940232f0a3bwith the contact-ID sources from68c8a853on main92e50418. Those two Pad source blobs are unchanged in the published #6485 head. On Ubuntu24.04.5/GCC13.3, all four input tests passed; the timestamp regression failed when its two-line timestamp correction was omitted. Restoring the standalone contact-ID sources passed four tests again. This is Linux CPU composition evidence, not a combined Windows, GPU or game result.Would this integration order work for you?
AI-assisted: yes (Codex).
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-15T22:05:08Z.
I agree with the proposed order if the touch-ID change is reopened or resubmitted: #6452, then the touch-contact fix, then #6337 rebased to preserve both the captured touch IDs and
nowfor fresh-sample timestamps. Queued samples must retain their captured IDs and times. I see #6485 is currently closed without merging, so I will not treat its code as present on main. The latest #6337 validation remains independent of that change.Your four-test Linux composition result is useful evidence; I have not independently repeated that touch-ID combination or claimed a combined Windows result.
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-16T13:22:48Z.
Temporarily closing to stay within the 20-open-PR author cap while submitting a verified Cocoon startup fix. This timestamp work is preserved at 279fee87a077f413daa950deb73c2940232f0a3b on JJenkx/AnyPS5 branch fix/pad-read-timestamps-upstream; it is not withdrawn on technical grounds. The ordering notes already in the description remain applicable when a slot is available.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T13:31:27Z.
Review: CHANGES_REQUESTED
Reviewed exact PR head
bdd7a52c1b3b3bb237f15c3a019bd03a8f7b7a64. The two production edits consistently timestamp only newly generatedscePadReadState/empty-queuescePadReadsamples withnow; queued samples retain their captured timestamp. The test covers both fresh-read paths and queued timestamp preservation. The author reports three passing Windowsguest_padandguest_pad_vibration_moderuns plus Linux negative-control testing on older bases; I have not independently run the guest executable here. Exact-headgit diff --checkpasses. The local conventions checker currently fails the PR-template rule becauseBased on current main; no other open PR implements the same functionsis unchecked.The branch is no longer based on current
main:tools/check_main_sync.pyreports 2 commits ahead and 848 behindupstream/main(938812df1403f9616dba71744216725891ca4979). A current-main merge preview conflicts incore/libs/tests/GuestPad.cpp; main has since merged #9878 and #9664. A pairwise preview with current #7881 also conflicts incore/libs/prx/libScePad/src/PadState.cpp. The existing coordination comment from #7881's author says either order is acceptable, but the linked 15-test combination predates the current heads. Please rebase/resolve against current main when practical, preserve both #9878'sCheckSpecialPortand this PR'sCheckHeldSampleTimesin the fixture, preserve the timestamp behavior if #7881 lands first, refresh the checklist, and rerun the focused pad tests on the resulting exact tree. This review is about current integration and validation; it does not ask that the PR be closed.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T07:12:29Z.
Review: APPROVED
Re-checked — new head, looks good
I reviewed head
92f795b3420f7e82088af97decba5796167e566d; its only commit since the previously tested8e30de03174899b4aa104cdf52c44bf12bdb9b98changes the two regression failure messages, while the timestamp implementation and assertions are unchanged. The author-reported focused Linux tests and negative control are for8e30de0, not this exact head; the the latest reported merge preview against currentmain(f7f03daf52f11191174b1be089a56e268390a707) and conventions check are clean, and I did not independently build or run CTest. No blocking issue is visible in this diagnostic-only update.