fix(libs): TLOU sceRtcParseDateTime ISO 8601 subset parser #516

Merged
Pouare514 merged 2 commits from upstream-pr/516 into main 2026-10-04 23:46:14 +00:00
Pouare514 commented 2026-10-04 14:34:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Pouare514 on 2026-10-04T14:34:48Z.


What

TLOU Part I needs \sceRtcParseDateTime. Implements the ISO 8601 subset \YYYY-MM-DDTHH:MM:SS[.ffffff]\ (T/t/space separator tolerated, optional fractional seconds), reusing the file's validate/toTick helpers and error codes. Split out of the former combined TLOU runtime PR (#302, now Net only).

The accepted format source is recorded in TechnicalDebt (assumed ISO 8601 subset matching the sibling RFC 3339 parser, unverified against hardware).

Tested

  • Windows Release Ninja: \libs\ target builds clean on this branch.

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: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4735126168 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/516). Originally posted by [Pouare514](https://github.com/Pouare514) on 2026-10-04T14:34:48Z. --- ### What TLOU Part I needs \sceRtcParseDateTime\. Implements the ISO 8601 subset \YYYY-MM-DDTHH:MM:SS[.ffffff]\ (T/t/space separator tolerated, optional fractional seconds), reusing the file's validate/toTick helpers and error codes. Split out of the former combined TLOU runtime PR (#302, now Net only). The accepted format source is recorded in TechnicalDebt (assumed ISO 8601 subset matching the sibling RFC 3339 parser, unverified against hardware). ### Tested - Windows Release Ninja: \libs\ target builds clean on this branch. ### 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 - [ ] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-04 14:35:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-04T14:35:09Z.


Progress report (33a870d → e67d50c)

📉 System libraries: 78.82% (-0.02%, +1 declared functions)

🆕 1 declared as stubs
Library Name
libSceRtc sceRtcParseDateTime
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5981115565 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/516#issuecomment-5981115565). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-04T14:35:09Z. --- <!-- progress-report --> ### Progress report (33a870d → e67d50c) 📉 **System libraries**: 78.82% (-0.02%, +1 declared functions) <details> <summary>🆕 1 declared as stubs</summary> | Library | Name | | - | - | | libSceRtc | `sceRtcParseDateTime` | </details>
oneandonlydean commented 2026-10-04 21:19:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T21:19:06Z.


Thanks for splitting these out. The parser reuses the RFC 3339 helpers cleanly and the NID matches, but two parts of it are guesses that the code currently answers silently:

  1. A string with a zone (2024-02-29T12:34:56Z or +01:30), which sceRtcParseRFC3339 accepts, returns SCE_RTC_ERROR_BAD_PARSE here, so a title would see a valid date as unparseable.
  2. A string without a zone is taken as UTC. It could just as well be local time (the file already has localOffsetSeconds).

Since the real accepted formats aren't known, I'd accept the zone suffix through the same path as sceRtcParseRFC3339, and throw (instead of returning BAD_PARSE) for anything outside what you've verified, keeping the range errors from validate. The TechnicalDebt line can then say which choice was made for zoneless strings. Could you also add a few rows to core/libs/tests/GuestRtc.cpp, next to the existing sceRtcParseRFC3339 cases? It already has the tick values you'd need.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5984492940 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/516#issuecomment-5984492940). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T21:19:06Z. --- Thanks for splitting these out. The parser reuses the RFC 3339 helpers cleanly and the NID matches, but two parts of it are guesses that the code currently answers silently: 1. A string with a zone (`2024-02-29T12:34:56Z` or `+01:30`), which `sceRtcParseRFC3339` accepts, returns `SCE_RTC_ERROR_BAD_PARSE` here, so a title would see a valid date as unparseable. 2. A string without a zone is taken as UTC. It could just as well be local time (the file already has `localOffsetSeconds`). Since the real accepted formats aren't known, I'd accept the zone suffix through the same path as `sceRtcParseRFC3339`, and throw (instead of returning `BAD_PARSE`) for anything outside what you've verified, keeping the range errors from `validate`. The TechnicalDebt line can then say which choice was made for zoneless strings. Could you also add a few rows to `core/libs/tests/GuestRtc.cpp`, next to the existing `sceRtcParseRFC3339` cases? It already has the tick values you'd need.
github-actions[bot] commented 2026-10-04 22:40:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-04T22:40:31Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#553 docs/dev/TechnicalDebt.md L26
#579 docs/dev/TechnicalDebt.md L26-27
#580 docs/dev/TechnicalDebt.md L26-27
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5985238031 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/516#issuecomment-5985238031). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-04T22:40:31Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #553 | `docs/dev/TechnicalDebt.md` [L26](https://github.com/boykopovar/AnyPS5/blob/d22014954265c33cefc8ab0fe5864cc15d71fcd0/docs/dev/TechnicalDebt.md#L26) | | | | #579 | `docs/dev/TechnicalDebt.md` [L26-27](https://github.com/boykopovar/AnyPS5/blob/d22014954265c33cefc8ab0fe5864cc15d71fcd0/docs/dev/TechnicalDebt.md#L26-L27) | | | | #580 | `docs/dev/TechnicalDebt.md` [L26-27](https://github.com/boykopovar/AnyPS5/blob/d22014954265c33cefc8ab0fe5864cc15d71fcd0/docs/dev/TechnicalDebt.md#L26-L27) | | |
Pouare514 commented 2026-10-04 23:12:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Pouare514 on 2026-10-04T23:12:11Z.


Done: extracted a shared parseZoneSuffix helper used by both parsers, so zoned DateTime strings go through the same path as sceRtcParseRFC3339 (RFC3339 behavior unchanged). Anything outside the verified shape now throws instead of returning BAD_PARSE; validate() range errors are kept. The TechnicalDebt line documents the zoneless-means-UTC choice. Added DateTime rows to GuestRtc.cpp next to the RFC3339 cases (UTC, space separator, zone suffixes, epoch, invalid-day, nullptr, plus five throw shapes). Notes: the test needed libc on its link line for __gxx_personality_v0 and configure_windows_unwind like the other guest tests; also dropped the stray AudioIn hunk from this branch.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5985471474 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/516#issuecomment-5985471474). Originally posted by [Pouare514](https://github.com/Pouare514) on 2026-10-04T23:12:11Z. --- Done: extracted a shared parseZoneSuffix helper used by both parsers, so zoned DateTime strings go through the same path as sceRtcParseRFC3339 (RFC3339 behavior unchanged). Anything outside the verified shape now throws instead of returning BAD_PARSE; validate() range errors are kept. The TechnicalDebt line documents the zoneless-means-UTC choice. Added DateTime rows to GuestRtc.cpp next to the RFC3339 cases (UTC, space separator, zone suffixes, epoch, invalid-day, nullptr, plus five throw shapes). Notes: the test needed libc on its link line for __gxx_personality_v0 and configure_windows_unwind like the other guest tests; also dropped the stray AudioIn hunk from this branch.
oneandonlydean commented 2026-10-04 23:43:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T23:43:44Z.


Thanks, this is what I had in mind: zoned strings go through the same parseZoneSuffix as sceRtcParseRFC3339 (whose behaviour is unchanged), shapes outside the verified subset throw, the range errors from validate stay, and the zoneless-means-UTC choice is in TechnicalDebt. The new rows check the ticks against the RFC 3339 values and the five throw shapes. guest_rtc passes here on this head merged with current main, and CI is green. Ready to merge from my side.

This, #518 and #553 all insert after the sceVideoOutOpen line in TechnicalDebt.md, so the second and third to land need a one-line rebase.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5985700690 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/516#issuecomment-5985700690). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T23:43:44Z. --- Thanks, this is what I had in mind: zoned strings go through the same `parseZoneSuffix` as `sceRtcParseRFC3339` (whose behaviour is unchanged), shapes outside the verified subset throw, the range errors from `validate` stay, and the zoneless-means-UTC choice is in TechnicalDebt. The new rows check the ticks against the RFC 3339 values and the five throw shapes. `guest_rtc` passes here on this head merged with current main, and CI is green. Ready to merge from my side. This, #518 and #553 all insert after the `sceVideoOutOpen` line in TechnicalDebt.md, so the second and third to land need a one-line rebase.
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!516
No description provided.