loader: wrap elapsed time in Timer::GetTime #679

Manually merged
github merged 1 commit from gh-pr/679/head into gh-pr/679/base 2026-11-26 09:29:15 +00:00
Owner

@⁠c0sxm0s on GitHub · 2026-09-17 16:29 UTC · original
c0sxm0s:loader-timer-day-wrap → main · +11 −25 · 5 files · 1 commits · merged 2026-09-24 18:02 UTC

Common::Time is a time-of-day capped at TIME_MS_IN_DAY, so after 24h of emulator uptime the timestamp printed by PRINT_NAME-based log lines became invalid (empty string), and after ~24.8 days the 32-bit cast overflowed negative. Wrap the elapsed milliseconds modulo a day.

**@⁠c0sxm0s** on GitHub · 2026-09-17 16:29 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/679) `c0sxm0s:loader-timer-day-wrap` → `main` · +11 −25 · 5 files · 1 commits · merged 2026-09-24 18:02 UTC Common::Time is a time-of-day capped at TIME_MS_IN_DAY, so after 24h of emulator uptime the timestamp printed by PRINT_NAME-based log lines became invalid (empty string), and after ~24.8 days the 32-bit cast overflowed negative. Wrap the elapsed milliseconds modulo a day.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:29:14 +00:00
github manually merged commit eabc04385a into gh-pr/679/base 2026-11-26 09:29:15 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-17 16:34 UTC · original

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: a775973c-26e8-44f8-911e-a85421c00484

📥 Commits

Reviewing files that changed from the base of the PR and between c66d977c1d and 1e7eb31819d237eebfafec0710b5689431c65d9d.

📒 Files selected for processing (1)
  • src/loader/timer.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

GetTime now converts elapsed milliseconds to uint64_t and applies Common::TIME_MS_IN_DAY modulo before constructing Common::Time. This preserves time-of-day formatting after 24 hours and avoids 32-bit overflow effects.

Suggested reviewers: nmzik

Priority: ⬇️ Low

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 1e7eb

The timer now preserves valid time-of-day timestamps beyond 24 hours without introducing a concrete current-head risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: wrapping elapsed time in Timer::GetTime.
Description check ✅ Passed The description directly explains the timestamp defect, the overflow condition, and the modulo-day fix.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-09-17 16:34 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/679#issuecomment-5717886257) <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/679#gh-light-mode-only"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg" alt="Review Change Stack" width="202" height="32"></a><a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/679#gh-dark-mode-only"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg" alt="Review Change Stack" width="202" height="32"></a> <!-- review_stack_entry_end --> <!-- recent_review_start --> No actionable comments were generated in the recent review. 🎉 <details> <summary>ℹ️ Recent review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Path: .coderabbit.yaml **Review profile**: CHILL **Plan**: Advanced **Run ID**: `a775973c-26e8-44f8-911e-a85421c00484` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between c66d977c1d8f0e9cbeec71c2dbc57eb3e0000d45 and 1e7eb31819d237eebfafec0710b5689431c65d9d. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `src/loader/timer.cpp` </details> **Included review availability:** Your plan provides up to 10 included reviews per hour; 8 remain after this review. </details> --- <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## Walkthrough `GetTime` now converts elapsed milliseconds to `uint64_t` and applies `Common::TIME_MS_IN_DAY` modulo before constructing `Common::Time`. This preserves time-of-day formatting after 24 hours and avoids 32-bit overflow effects. **Suggested reviewers:** `nmzik` </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ⬇️ Low <!-- change_assessment_commit:"1e7eb31819d237eebfafec0710b5689431c65d9d" --> **Change:** Bug fix · **Severity of issue fixed:** Low <!-- change_assessment_end --> <!-- final_review_risk_start --> **Merge Risk:** _⚪ Minimal_ · up to `1e7eb` <!-- final_review_risk_coverage:{"sourceCommitId":"1e7eb31819d237eebfafec0710b5689431c65d9d","coveredCommitId":"1e7eb31819d237eebfafec0710b5689431c65d9d","kind":"reviewed"} --> The timer now preserves valid time-of-day timestamps beyond 24 hours without introducing a concrete current-head risk. <!-- final_review_risk_end --> <!-- pre_merge_checks_walkthrough_start --> <details> <summary>🚥 Pre-merge checks | ✅ 4 | ❌ 1</summary> ### ❌ Failed checks (1 warning) | Check name | Status | Explanation | Resolution | | :----------------: | :--------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ⚠️ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary>✅ Passed checks (4 passed)</summary> | Check name | Status | Explanation | | :------------------------: | :------- | :------------------------------------------------------------------------------------------------------ | | Title check | ✅ Passed | The title clearly summarizes the main change: wrapping elapsed time in Timer::GetTime. | | Description check | ✅ Passed | The description directly explains the timestamp defect, the overflow condition, and the modulo-day fix. | | Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | </details> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- tips_start --> --- <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
This discussion has been locked. Commenting is limited to contributors.
No description provided.