Skip to content

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

Merged
adriadam10 merged 2 commits into
boykopovar:mainfrom
hugodearaujo:fix/rtc-parse-datetime-iso-hardware
Oct 8, 2026
Merged

adriadam10 merged 2 commits into
boykopovar:mainfrom
hugodearaujo:fix/rtc-parse-datetime-iso-hardware

Conversation

@hugodearaujo

Copy link
Copy Markdown
Contributor

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: fix(rtc): match sceRtcParseRFC3339 to the console #1397
  • AI-assisted: yes

🤖 Generated with Claude Code

hugodearaujo and others added 2 commits October 7, 2026 19:04
Measured on a PS5 (firmware 13.60) through dlopen of libSceRtc.sprx:
an empty fraction is accepted, any digits past the sixth are dropped,
text after the zone is ignored, the offset is applied without a range
check, and a 60th second returns 0 with the tick only shifted by the
offset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a PS5 (firmware 13.60) every input that starts with a digit gets the
same result and tick from sceRtcParseDateTime as from
sceRtcParseRFC3339, except that leading spaces and tabs are skipped
first. A string without a zone, or with a space instead of T, is a
parse error rather than UTC.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hugodearaujo

Copy link
Copy Markdown
Contributor Author

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.

popcoder565 added a commit to popcoder565/AnyPS5 that referenced this pull request Oct 8, 2026
boykopovar#1398 and boykopovar#1399 both rewrite the sceRtcParseDateTime entry that the s_sethalt entry followed. It now follows the libSceAudio3d entries, which no open pull request edits, so either can merge first without a conflict.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adriadam10 pushed a commit to popcoder565/AnyPS5 that referenced this pull request Oct 8, 2026
boykopovar#1398 and boykopovar#1399 both rewrite the sceRtcParseDateTime entry that the s_sethalt entry followed. It now follows the libSceAudio3d entries, which no open pull request edits, so either can merge first without a conflict.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adriadam10

Copy link
Copy Markdown
Collaborator

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.

@adriadam10
adriadam10 merged commit 09a17e9 into boykopovar:main Oct 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants