Repository navigation
fix(libkernel): saturate overflowing high-resolution timers - #2064
Closed
STUPIDCONTEM wants to merge 1 commit into
Closed
STUPIDCONTEM wants to merge 1 commit into
STUPIDCONTEM wants to merge 1 commit into
Conversation
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Evidence review (2026-10-09)
Game/title evidence has not been established. Validation below is host regression/build evidence only; it does not establish title compatibility. Older checked items and test results describe their stated revisions, not current merge readiness.
Game/title ID: none verified. No PS5 title execution is claimed.
What
Very large
sceKernelAddHRTimerEventdurations can wrap during seconds-to-nanoseconds conversion and fire immediately. Check the conversion before multiplying or adding, saturating at the existing maximum deadline instead.Tested
Windows 10 Pro 19045, WinLibs GCC 15.2.0 UCRT posix SEH r7, Release, BUILD_TESTING=ON. Independent branch from
f145139676a48306681d3a4d5fabf83938759daf.Extended the event-queue regression with multiplication and addition overflow boundaries, immediate and finite polling, a normal timer in the same queue, and cancellation. The extended test fails on the unchanged implementation and passes three repeated runs with this change. Default and
libsbuilds passed; all 488 CTest tests passed (28.81 seconds); committed-head conventions and test-registration checks passed.This preserves the existing deadline saturation policy; hardware behavior for centuries-long requests was not measured. No PS5 title was run. The original independent validation above was Windows-only. Checked open PRs for this timer conversion defect before submission.
Additional current-main integration verification: this fix is included in the 19 still-open proposals at
8f0190c793c6dfa2b7a3a3f33f3d2cbe2509937c, based on upstreamd70b89989473ba1f6ae13e44e079e67f1f8a44b0. Declined proposals are excluded. Default and explicit libs builds passed on Windows; 513 tests passed and one was skipped (514 registered, 52.66 seconds). The affected event-queue test passed ten repetitions as part of a five-test interaction run.Linux verification run 37928070910 at
338ec787cd5b78e7c4fa62d850af5c68c9395568has the same production/test tree plus a fork-only workflow. With SPIRV-Tools and lavapipe enabled, default and guest-library builds passed; 496 distinct tests passed three repetitions each, 27 were skipped, and none failed (523 registered, 321.81 seconds). Two pre-existing graphics tests exceeded the 30-second target on their first run. This is combined integration evidence, not an independent exact-head build of this PR. The workflow's separate trusted conventions job passed for all 19 pinned PR heads and their live titles/descriptions. The current description also passes the same checker locally; the upstream rerun after refreshing the description remains behind GitHub's approval gate.Checklist
main; no other open PR implements the same change (historical base; current readiness not asserted)