fix(rtc): parse ISO text in sceRtcParseDateTime by the RFC 3339 rules #1398

Merged
hugodearaujo merged 2 commits from upstream-pr/1398 into main 2026-10-08 12:56:13 +00:00
hugodearaujo commented 2026-10-08 02:11:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-08T02:11:59Z.


What

Stacked on #1397: this branch also carries that PR's commit, and only the last commit is new here. The PS5 measurements and the probe source are in the comments on #1397.

I measured this on a PS5 (firmware 13.60) with the same dlopen probe as #1397. sceRtcParseDateTime and sceRtcParseRFC3339 give the same return code and output tick for every input that starts with a digit. The one difference is that sceRtcParseDateTime skips leading spaces and tabs first, and nothing else: \n, \r, \v, \f and \xa0 are BAD_PARSE. So the ISO branch now skips spaces and tabs and then calls the RFC 3339 parser.

What changes for sceRtcParseDateTime on main:

Input Console main
2024-02-29T12:34:56.789 (no zone) BAD_PARSE, tick untouched 0, read as UTC
2024-02-29 12:34:56 (space separator) BAD_PARSE 0
2024-02-29 12:34:56Z BAD_PARSE 0
\t 2024-02-29T12:34:56Z 0 throws
2024-02-29T12:34:56Zjunk, ...+99:99 0 (as sceRtcParseRFC3339) throws
2024-02-29, 2024/02/29T12:34:56Z, ...56. BAD_PARSE throws

The TechnicalDebt entry from #516 assumed the space separator and the zone-less form. It now says that this branch follows the measured RFC 3339 rules. The RFC 2822 / asctime part is left as is: the next PR handles it.

Title evidence, stated plainly: the only evidence for this function is #516's statement that The Last of Us Part I needs sceRtcParseDateTime. #516 was merged on that statement alone, with no title ID and no log line. The Propagation: Paradise Hotel dump (PPSA15878) that backs #1397 does not use this function, only sceRtcParseRFC3339. The "title ID and the log line where it stops on main" bar was set for new library functions, and this PR corrects one that is already merged. It may still apply, so I'm flagging it here.

Tested

  • PS5 firmware 13.60: all 196 measured sceRtcParseDateTime inputs that start with a digit after leading spaces and tabs give the same return code and tick on this branch as on the console. Non-ISO text still throws here, as on main.
  • Linux: build, libs, full CTest 408/408.
  • Windows Server 2025 VM, WinLibs GCC 15.2, CI configure flags: build, libs, CTest 0 failed of 404 (GPU execution tests skipped, the VM has no GPU).
  • Mutation check: 4 mutations (no whitespace skip, spaces only, passing the unskipped string, turning parse errors into success) each make guest_rtc fail.

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 in TechnicalDebt
  • 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: #1397
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4780849123 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1398). Originally posted by [hugodearaujo](https://github.com/hugodearaujo) on 2026-10-08T02:11:59Z. --- ### What Stacked on #1397: this branch also carries that PR's commit, and only the last commit is new here. The PS5 measurements and the probe source are in the comments on #1397. I measured this on a PS5 (firmware 13.60) with the same `dlopen` probe as #1397. `sceRtcParseDateTime` and `sceRtcParseRFC3339` give the same return code and output tick for every input that starts with a digit. The one difference is that `sceRtcParseDateTime` skips leading spaces and tabs first, and nothing else: `\n`, `\r`, `\v`, `\f` and `\xa0` are BAD_PARSE. So the ISO branch now skips spaces and tabs and then calls the RFC 3339 parser. What changes for `sceRtcParseDateTime` on `main`: | Input | Console | `main` | |---|---|---| | `2024-02-29T12:34:56.789` (no zone) | BAD_PARSE, tick untouched | 0, read as UTC | | `2024-02-29 12:34:56` (space separator) | BAD_PARSE | 0 | | `2024-02-29 12:34:56Z` | BAD_PARSE | 0 | | ` \t 2024-02-29T12:34:56Z` | 0 | throws | | `2024-02-29T12:34:56Zjunk`, `...+99:99` | 0 (as `sceRtcParseRFC3339`) | throws | | `2024-02-29`, `2024/02/29T12:34:56Z`, `...56.` | BAD_PARSE | throws | The TechnicalDebt entry from #516 assumed the space separator and the zone-less form. It now says that this branch follows the measured RFC 3339 rules. The RFC 2822 / asctime part is left as is: the next PR handles it. **Title evidence, stated plainly:** the only evidence for this function is #516's statement that The Last of Us Part I needs `sceRtcParseDateTime`. #516 was merged on that statement alone, with no title ID and no log line. The Propagation: Paradise Hotel dump (PPSA15878) that backs #1397 does not use this function, only `sceRtcParseRFC3339`. The "title ID and the log line where it stops on main" bar was set for new library functions, and this PR corrects one that is already merged. It may still apply, so I'm flagging it here. ### Tested - PS5 firmware 13.60: all 196 measured `sceRtcParseDateTime` inputs that start with a digit after leading spaces and tabs give the same return code and tick on this branch as on the console. Non-ISO text still throws here, as on `main`. - Linux: build, `libs`, full CTest 408/408. - Windows Server 2025 VM, WinLibs GCC 15.2, CI configure flags: build, `libs`, CTest 0 failed of 404 (GPU execution tests skipped, the VM has no GPU). - Mutation check: 4 mutations (no whitespace skip, spaces only, passing the unskipped string, turning parse errors into success) each make `guest_rtc` fail. ### 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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [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: #1397 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
hugodearaujo commented 2026-10-08 02:47:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-08T02:47:54Z.


About the overlap report: #1253, #1306 and #1314 are not dependencies. Each of them inserts a TechnicalDebt line right after s_setkill, which is directly above the sceRtcParseDateTime entry, and this PR has to rewrite that entry (it still says that ISO text without a zone is read as UTC). Git treats the two edits as a conflict only because the lines are adjacent. Code and tests do not overlap. Whichever lands first, I'll rebase the other side. The three shader PRs also overlap with each other at the same spot.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6051141854 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1398#issuecomment-6051141854). Originally posted by [hugodearaujo](https://github.com/hugodearaujo) on 2026-10-08T02:47:54Z. --- About the overlap report: #1253, #1306 and #1314 are not dependencies. Each of them inserts a TechnicalDebt line right after `s_setkill`, which is directly above the `sceRtcParseDateTime` entry, and this PR has to rewrite that entry (it still says that ISO text without a zone is read as UTC). Git treats the two edits as a conflict only because the lines are adjacent. Code and tests do not overlap. Whichever lands first, I'll rebase the other side. The three shader PRs also overlap with each other at the same spot.
adriadam10 commented 2026-10-08 12:56:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T12:56:10Z.


Checked the new sceRtcParseDateTime cases in GuestRtc.cpp against the PS5 measurements posted on #1397 (leading space/tab, zone-less and space-separated BAD_PARSE with the tick untouched, Zjunk, +99:99, 12:34:56.789+99:99, 12:34:60-01:00); they match. guest_rtc fails with the Export.cpp change reverted, full ctest 452/452 green, CI green. Merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6060352388 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1398#issuecomment-6060352388). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-08T12:56:10Z. --- Checked the new `sceRtcParseDateTime` cases in `GuestRtc.cpp` against the PS5 measurements posted on #1397 (leading space/tab, zone-less and space-separated BAD_PARSE with the tick untouched, `Zjunk`, `+99:99`, `12:34:56.789+99:99`, `12:34:60-01:00`); they match. `guest_rtc` fails with the `Export.cpp` change reverted, full ctest 452/452 green, CI green. Merging.
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!1398
No description provided.