fix(libSceSystemService): preserve host local time with non-hour DST #28891

Open
RuiRDA wants to merge 1 commit from upstream-pr/28891 into main
RuiRDA commented 2026-12-04 13:35:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by RuiRDA on 2026-12-04T13:35:48Z.


What

Project the host’s current local offset onto the console’s offset-plus-summer-time representation so adding the console summer-time hour still yields the correct wall clock for zones such as Lord Howe. The debt entry records the console behavior still to verify.

Tested

Linux, GCC 14. The standalone SystemServiceDateTimeLocale fixture passed, including the Lord Howe standard-time and half-hour daylight-saving cases. The full guest test was not run here.

git diff --check and the conventions checker passed. I searched for duplicate and related open PRs. A complete pr_overlap.py scan requires an authenticated GitHub CLI.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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

Summary by CodeRabbit

  • Bug Fixes

    • Improved time-zone reporting when daylight saving time is active, including for regions with half-hour time-zone offsets.
    • Time-zone and summer-time values are now handled more consistently across supported host environments.
  • Documentation

    • Clarified how time-zone offsets and summer-time adjustments affect local-time calculations, including limitations for regions with non-hour seasonal changes.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5647481160 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28891). Originally posted by [RuiRDA](https://github.com/RuiRDA) on 2026-12-04T13:35:48Z. --- ### What Project the host’s current local offset onto the console’s offset-plus-summer-time representation so adding the console summer-time hour still yields the correct wall clock for zones such as Lord Howe. The debt entry records the console behavior still to verify. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Linux, GCC 14. The standalone SystemServiceDateTimeLocale fixture passed, including the Lord Howe standard-time and half-hour daylight-saving cases. The full guest test was not run here. `git diff --check` and the conventions checker passed. I searched for duplicate and related open PRs. A complete `pr_overlap.py` scan requires an authenticated GitHub CLI. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Improved time-zone reporting when daylight saving time is active, including for regions with half-hour time-zone offsets. * Time-zone and summer-time values are now handled more consistently across supported host environments. * **Documentation** * Clarified how time-zone offsets and summer-time adjustments affect local-time calculations, including limitations for regions with non-hour seasonal changes. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Plyxen commented 2026-12-04 13:51:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-04T13:51:10Z.

Review: APPROVED


Verified on Windows 11 (GCC 15.2, Release) on main 484b0368d3. Applied together with #28892, #28890, #28817 and #27995, which touch separate files.

  • system_service_date_time_locale and guest_system_service_time_zone passed in 3 of 3 runs.
  • With the sources reverted and the tests kept, the fixture no longer compiles, because the tests call the new ToConsoleTimeZone. So there is no separate negative run.
  • Worked through Lord Howe in summer (UTC+11:00, a 30-minute shift). Main's Windows branch reported 630 minutes plus summer, which a guest that adds the console's 60 minutes reads as UTC+11:30. With this change it reports 600 plus summer, which gives the right wall clock. For zones with a 60-minute shift the result matches main's _get_dstbias path, and on Linux main already subtracted 60.

Not run: Linux and macOS, and the console's own value for a 30-minute zone, which the debt entry records as unverified.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6190141713 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28891#pullrequestreview-6190141713). Originally posted by [Plyxen](https://github.com/Plyxen) on 2026-12-04T13:51:10Z. **Review:** APPROVED --- Verified on Windows 11 (GCC 15.2, Release) on main 484b0368d3. Applied together with #28892, #28890, #28817 and #27995, which touch separate files. - `system_service_date_time_locale` and `guest_system_service_time_zone` passed in 3 of 3 runs. - With the sources reverted and the tests kept, the fixture no longer compiles, because the tests call the new `ToConsoleTimeZone`. So there is no separate negative run. - Worked through Lord Howe in summer (UTC+11:00, a 30-minute shift). Main's Windows branch reported 630 minutes plus summer, which a guest that adds the console's 60 minutes reads as UTC+11:30. With this change it reports 600 plus summer, which gives the right wall clock. For zones with a 60-minute shift the result matches main's `_get_dstbias` path, and on Linux main already subtracted 60. Not run: Linux and macOS, and the console's own value for a 30-minute zone, which the debt entry records as unverified. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-12-04 13:53:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T13:53:31Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

Reviewed head 5fbe3f882c33ab58a8e07af928f054dac5461175 by source inspection. No merged-preview check or executable checks were run; no build or test was run. The author reports the standalone fixture passed, but I did not run it.

env -u ANYPS5_READ_LOG python3 repo_read.py search 'HostTimeZone' core/libs/prx/libSceSystemService/Export.cpp
env -u ANYPS5_READ_LOG python3 repo_read.py cat core/libs/prx/libSceSystemService/Export.cpp 55 95
env -u ANYPS5_READ_LOG python3 repo_read.py cat core/libs/prx/libSceSystemService/Export.cpp 570 610
env -u ANYPS5_READ_LOG python3 repo_read.py cat core/libs/prx/libSceSystemService/DateTimeLocale.hpp 1 54
env -u ANYPS5_READ_LOG python3 repo_read.py cat core/libs/tests/GuestSystemServiceTimeZone.cpp 1 57
env -u ANYPS5_READ_LOG python3 repo_read.py cat core/libs/tests/SystemServiceDateTimeLocale.cpp 438 513
env -u ANYPS5_READ_LOG python3 repo_read.py cat docs/dev/debt/changes/fix-systemservice-timezone-dst-projection.md 1 5
env -u ANYPS5_READ_LOG python3 repo_read.py ls core/libs/tests

Results

Check Result Note
Changed-code inspection passed Reviewed relevant changed code and callers
Runtime tests and checks not run Author reports fixture and static checks passed
Console behavior not run Non-hour DST behavior remains unverified

Negative control

Not run; no executable test was run.

Findings

Blocking

None.

Non-blocking

  • Console behavior for zones with non-hour seasonal changes remains unverified, as the debt note states. The host-side arithmetic and fixture cover the intended projection, but do not confirm how the console interprets these values. Optional: verify the parameter behavior on-console when feasible. Implementation · Debt note

Sources

The five changed files listed in the manifest were reviewed: DateTimeLocale.hpp (lines 1–54), Export.cpp (lines 1–95 and 570–610), GuestSystemServiceTimeZone.cpp (all 57 lines), SystemServiceDateTimeLocale.cpp (lines 438–513), and the debt note (all 5 lines). No files were excluded. Other portions of the larger source and test files were not read.

Not verified

The full guest test, other operating systems, and physical-console behavior were not verified. The code outside the ranges listed above was not read.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6190175900 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28891#pullrequestreview-6190175900). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-12-04T13:53:31Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran Reviewed head `5fbe3f882c33ab58a8e07af928f054dac5461175` by source inspection. No merged-preview check or executable checks were run; no build or test was run. The author reports the standalone fixture passed, but I did not run it. ```text env -u ANYPS5_READ_LOG python3 repo_read.py search 'HostTimeZone' core/libs/prx/libSceSystemService/Export.cpp env -u ANYPS5_READ_LOG python3 repo_read.py cat core/libs/prx/libSceSystemService/Export.cpp 55 95 env -u ANYPS5_READ_LOG python3 repo_read.py cat core/libs/prx/libSceSystemService/Export.cpp 570 610 env -u ANYPS5_READ_LOG python3 repo_read.py cat core/libs/prx/libSceSystemService/DateTimeLocale.hpp 1 54 env -u ANYPS5_READ_LOG python3 repo_read.py cat core/libs/tests/GuestSystemServiceTimeZone.cpp 1 57 env -u ANYPS5_READ_LOG python3 repo_read.py cat core/libs/tests/SystemServiceDateTimeLocale.cpp 438 513 env -u ANYPS5_READ_LOG python3 repo_read.py cat docs/dev/debt/changes/fix-systemservice-timezone-dst-projection.md 1 5 env -u ANYPS5_READ_LOG python3 repo_read.py ls core/libs/tests ``` ## Results | Check | Result | Note | |---|---|---| | Changed-code inspection | passed | Reviewed relevant changed code and callers | | Runtime tests and checks | not run | Author reports fixture and static checks passed | | Console behavior | not run | Non-hour DST behavior remains unverified | ## Negative control Not run; no executable test was run. ## Findings ### Blocking None. ### Non-blocking - Console behavior for zones with non-hour seasonal changes remains unverified, as the debt note states. The host-side arithmetic and fixture cover the intended projection, but do not confirm how the console interprets these values. Optional: verify the parameter behavior on-console when feasible. [Implementation](https://github.com/boykopovar/AnyPS5/blob/5fbe3f882c33ab58a8e07af928f054dac5461175/core/libs/prx/libSceSystemService/DateTimeLocale.hpp#L39-L45) · [Debt note](https://github.com/boykopovar/AnyPS5/blob/5fbe3f882c33ab58a8e07af928f054dac5461175/docs/dev/debt/changes/fix-systemservice-timezone-dst-projection.md#L5) ## Sources The five changed files listed in the manifest were reviewed: `DateTimeLocale.hpp` (lines 1–54), `Export.cpp` (lines 1–95 and 570–610), `GuestSystemServiceTimeZone.cpp` (all 57 lines), `SystemServiceDateTimeLocale.cpp` (lines 438–513), and the debt note (all 5 lines). No files were excluded. Other portions of the larger source and test files were not read. ## Not verified The full guest test, other operating systems, and physical-console behavior were not verified. The code outside the ranges listed above was not read. ## To get this to a good state Nothing is required.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/28891:upstream-pr/28891'
git switch 'upstream-pr/28891'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/28891'
git switch 'upstream-pr/28891'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/28891'
git switch 'upstream-pr/28891'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/28891'
git switch 'main'
git merge --squash 'upstream-pr/28891'
git switch 'main'
git merge --ff-only 'upstream-pr/28891'
git switch 'main'
git merge 'upstream-pr/28891'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!28891
No description provided.