Skip to content

Fix cache expiration timestamps outside UTC - #1007

Open
cupkk wants to merge 1 commit into
Physical-Intelligence:mainfrom
cupkk:fix/utc-cache-expiration
Open

Fix cache expiration timestamps outside UTC#1007
cupkk wants to merge 1 commit into
Physical-Intelligence:mainfrom
cupkk:fix/utc-cache-expiration

Conversation

@cupkk

@cupkk cupkk commented Jul 29, 2026

Copy link
Copy Markdown

PR Draft

Title: Fix cache expiration timestamps outside UTC

_get_mtime() creates an aware UTC datetime but passes its timetuple() to time.mktime(), which interprets the tuple in the host's local timezone. This shifts the configured cache expiration boundary on machines that do not run in UTC. For example, under America/Los_Angeles, the February 17, 2025 boundary is eight hours late.

Use datetime.timestamp() so the aware datetime is converted as UTC, and add a regression test that temporarily switches the process timezone before checking the timestamp. The test restores the original timezone in a finally block.

Local verification:

  • reproduced the pre-fix 28,800-second offset under America/Los_Angeles
  • ran the fixed function under the same timezone
  • compiled the changed files and ran git diff --check
  • verified the patch applies to a clean base snapshot

The full test suite and pre-commit hooks were not run because this minimal environment intentionally did not install the project's JAX/CUDA development stack. The change and test were prepared with AI assistance and manually inspected.

Copilot AI review requested due to automatic review settings July 29, 2026 00:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@jimmyt857
jimmyt857 removed their request for review July 30, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants