fix(tests): drop the guest_freebsd_clocks check that the host zone is UTC #12660

Closed
JJenkx wants to merge 1 commit from upstream-pr/12660 into main
JJenkx commented 2026-10-29 00:47:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-29T00:47:09Z.


What

guest_freebsd_clocks fails on any machine whose time zone isn't UTC. This PR removes the check responsible.

KernelTimezoneIsUtc (added by #11546) runs first in main(), before the test sets TZ. It requires sceKernelGettimezone to report {0, 0}. Since #10499, that call reports the host zone's standard offset and daylight saving amount, as frankea measured on a PS5 set to US Eastern (-300, 60). So on a host in another zone, the check sees the host zone and aborts. CI and the machines #11546 was tested on run in UTC, so it passed there.

The check adds no coverage. Both of its assertions are already in TimezoneReportsTheStandardOffsetAndDaylightAmount, which sets TZ first:

  • a null pointer returns 0x8002000E;
  • UTC0 reports {0, 0}.

So this PR deletes KernelTimezoneIsUtc and its call. No library code changes.

Tested

Windows 11 set to Eastern Standard Time, WinLibs GCC 15.2.0 UCRT r7, Release, main 3a2b919816.

TZ main this PR (--repeat until-fail:3)
unset (host zone: Eastern) fails, also in a full ctest -j32 run passes 3/3
EST5EDT fails passes 3/3
UTC0 passes passes 3/3
IST-5:30 fails passes 3/3
CET-1CEST not run passes 3/3

On main, a temporary line-number print in Require locates the abort at the zone check in KernelTimezoneIsUtc.

Conventions pass. tools/pr_overlap.py: three open PRs share the file (#9658 and #12418 among them), and all merge cleanly with this branch.

Not tested: Linux and macOS. The check does the same thing there whenever the host zone isn't UTC.

Agreed landing order — 2026-10-29

Agreed: #12660 lands first, then #12418. babyhuey’s confirmation records #12418’s dependency. This PR has no dependency on #12418. Its non-UTC clock assertions need this timezone correction; #12418’s separate guest-copy fast-path prerequisite remains its author’s responsibility. This records the landing order without adding a new runtime claim.

AI-assisted: yes (Codex).

Alternative-fix overlap — 2026-10-29

The refreshed overlap review identifies #12747 (222a178f7f) as an alternative fix for the same host-timezone assertion, rather than a prerequisite: it initializes UTC inside KernelTimezoneIsUtc, while this PR removes the redundant assertion and its call. #12809 is closed as a duplicate of #12747. These should not all land.

Please choose one of #12660 and #12747 before merging; I favor the deletion here because the remaining clock/offset checks already cover the contract. I am keeping this useful reviewed PR open pending that choice. The separately agreed order with babyhuey remains #12660 first, then #12418 if this alternative is selected. No dependency on #12747 is claimed. The earlier clean merge previews do not establish that these alternatives should be combined.

AI-assisted: yes (Codex).

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
  • 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 (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5060100302 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12660). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-29T00:47:09Z. --- ### What `guest_freebsd_clocks` fails on any machine whose time zone isn't UTC. This PR removes the check responsible. `KernelTimezoneIsUtc` (added by #11546) runs first in `main()`, before the test sets `TZ`. It requires `sceKernelGettimezone` to report `{0, 0}`. Since #10499, that call reports the host zone's standard offset and daylight saving amount, as frankea measured on a PS5 set to US Eastern (`-300`, `60`). So on a host in another zone, the check sees the host zone and aborts. CI and the machines #11546 was tested on run in UTC, so it passed there. The check adds no coverage. Both of its assertions are already in `TimezoneReportsTheStandardOffsetAndDaylightAmount`, which sets `TZ` first: - a null pointer returns `0x8002000E`; - `UTC0` reports `{0, 0}`. So this PR deletes `KernelTimezoneIsUtc` and its call. No library code changes. ### Tested Windows 11 set to Eastern Standard Time, WinLibs GCC 15.2.0 UCRT r7, Release, `main` `3a2b919816`. | `TZ` | `main` | this PR (`--repeat until-fail:3`) | |---|---|---| | unset (host zone: Eastern) | fails, also in a full `ctest -j32` run | passes 3/3 | | `EST5EDT` | fails | passes 3/3 | | `UTC0` | passes | passes 3/3 | | `IST-5:30` | fails | passes 3/3 | | `CET-1CEST` | not run | passes 3/3 | On `main`, a temporary line-number print in `Require` locates the abort at the zone check in `KernelTimezoneIsUtc`. Conventions pass. `tools/pr_overlap.py`: three open PRs share the file (#9658 and #12418 among them), and all merge cleanly with this branch. **Not tested:** Linux and macOS. The check does the same thing there whenever the host zone isn't UTC. <!-- codex-maintenance-20261029-repeat-order-12660 --> **Agreed landing order — 2026-10-29** Agreed: #12660 lands first, then #12418. [babyhuey’s confirmation](https://github.com/boykopovar/AnyPS5/pull/12660#issuecomment-6497759326) records #12418’s dependency. This PR has no dependency on #12418. Its non-UTC clock assertions need this timezone correction; #12418’s separate guest-copy fast-path prerequisite remains its author’s responsibility. This records the landing order without adding a new runtime claim. AI-assisted: yes (Codex). <!-- codex-maintenance-20261029-repeat-alternatives-12660 --> **Alternative-fix overlap — 2026-10-29** The refreshed overlap review identifies #12747 (`222a178f7f`) as an **alternative fix for the same host-timezone assertion**, rather than a prerequisite: it initializes UTC inside `KernelTimezoneIsUtc`, while this PR removes the redundant assertion and its call. #12809 is closed as a duplicate of #12747. These should not all land. Please choose one of #12660 and #12747 before merging; I favor the deletion here because the remaining clock/offset checks already cover the contract. I am keeping this useful reviewed PR open pending that choice. The separately agreed order with babyhuey remains #12660 first, then #12418 **if this alternative is selected**. No dependency on #12747 is claimed. The earlier clean merge previews do not establish that these alternatives should be combined. AI-assisted: yes (Codex). ### Checklist - [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) - [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 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes (Claude Code)
rooklz commented 2026-10-29 01:38:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-29T01:38:34Z.

Review: APPROVED


Host-side review for the platforms the body lists as Not tested (Linux, macOS). I made no console measurements.

Harness. I extracted HostZone/HostZoneAt/HostDaylightAmount/sceKernelGettimezone verbatim from core/libs/prx/libkernel/Time/Time.cpp @ 3a2b919816 (lines 763-803 and 844-849). GuestCopyOut_nid_no_patch is shimmed as a memcpy. On top of that I ran main's KernelTimezoneIsUtc body unchanged. TZ is set from outside the process, the way the zone is set before main() reaches any SetTimeZone.

TZ macOS 26 arm64, Apple clang (host /etc/localtime = Europe/London) Ubuntu 24.04 x86_64, GCC, glibc 2.39 (container /etc/localtime = Etc/UTC)
unset {0,60} → abort {0,0} pass
UTC0 / Etc/UTC {0,0} pass {0,0} pass
Europe/London {0,60} → abort {0,60} → abort
EST5EDT / America/New_York {-300,60} → abort {-300,60} → abort
IST-5:30 / Asia/Kolkata {330,0} → abort {330,0} → abort
Africa/Accra, Atlantic/Reykjavik {0,0} pass n/a

This confirms the body's analysis on Linux and macOS too. The deleted check passes only when the host zone has offset 0 and no daylight saving at all. A UK host fails it all year round, because sceKernelGettimezone reports the zone's daylight amount (60), not whether daylight saving is in effect now. So a "GMT" machine is not safe. CI passes only because the runners and containers are Etc/UTC.

Coverage. Nothing is lost:

  • The null → 0x8002000E assertion is repeated at L309.
  • {0,0} under UTC0 is the first RequireTimezone row (L304), and that row now runs with TZ set explicitly.
  • No other check before TimezoneReportsTheStandardOffsetAndDaylightAmount reads the host zone. The gettimeofday zone check at L342 reads guestTimezone, not the host.
  • The EST5EDT/CET-1CEST rows compare the daylight amount, not the current DST state, so they don't depend on the date.

Head ab03f37893 is base 3a2b919816 minus exactly these 7 lines. LGTM.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5691848518 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12660#pullrequestreview-5691848518). Originally posted by [rooklz](https://github.com/rooklz) on 2026-10-29T01:38:34Z. **Review:** APPROVED --- Host-side review for the platforms the body lists as **Not tested** (Linux, macOS). I made no console measurements. **Harness.** I extracted `HostZone`/`HostZoneAt`/`HostDaylightAmount`/`sceKernelGettimezone` verbatim from `core/libs/prx/libkernel/Time/Time.cpp` @ `3a2b919816` (lines 763-803 and 844-849). `GuestCopyOut_nid_no_patch` is shimmed as a memcpy. On top of that I ran main's `KernelTimezoneIsUtc` body unchanged. `TZ` is set from outside the process, the way the zone is set before `main()` reaches any `SetTimeZone`. | `TZ` | macOS 26 arm64, Apple clang (host `/etc/localtime` = Europe/London) | Ubuntu 24.04 x86_64, GCC, glibc 2.39 (container `/etc/localtime` = Etc/UTC) | |---|---|---| | unset | `{0,60}` → **abort** | `{0,0}` pass | | `UTC0` / `Etc/UTC` | `{0,0}` pass | `{0,0}` pass | | `Europe/London` | `{0,60}` → **abort** | `{0,60}` → **abort** | | `EST5EDT` / `America/New_York` | `{-300,60}` → **abort** | `{-300,60}` → **abort** | | `IST-5:30` / `Asia/Kolkata` | `{330,0}` → **abort** | `{330,0}` → **abort** | | `Africa/Accra`, `Atlantic/Reykjavik` | `{0,0}` pass | n/a | This confirms the body's analysis on Linux and macOS too. The deleted check passes only when the host zone has offset 0 **and** no daylight saving at all. A UK host fails it all year round, because `sceKernelGettimezone` reports the zone's daylight *amount* (60), not whether daylight saving is in effect now. So a "GMT" machine is not safe. CI passes only because the runners and containers are Etc/UTC. **Coverage.** Nothing is lost: - The null → `0x8002000E` assertion is repeated at L309. - `{0,0}` under `UTC0` is the first `RequireTimezone` row (L304), and that row now runs with `TZ` set explicitly. - No other check before `TimezoneReportsTheStandardOffsetAndDaylightAmount` reads the host zone. The `gettimeofday` zone check at L342 reads `guestTimezone`, not the host. - The `EST5EDT`/`CET-1CEST` rows compare the daylight amount, not the current DST state, so they don't depend on the date. Head `ab03f37893` is base `3a2b919816` minus exactly these 7 lines. LGTM.

Pull request closed

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!12660
No description provided.