fix(rtc): parse RFC 2822, RFC 850 and asctime text like the console #1399
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1399"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-08T02:12:09Z.
What
Stacked on #1398, which is itself stacked on #1397: this branch also carries their commits, and only the last commit is new here.
In #816 the open question was which shapes the console's
sceRtcParseDateTimeaccepts, so returningSCE_RTC_ERROR_BAD_PARSEfor anything else was left for hardware evidence. This PR is that evidence. I measured 1174 inputs on a PS5 (firmware 13.60) by calling the reallibSceRtc.sprxexport throughdlopenfrom a homebrew payload, with the tick preset to0xdeadbeefcafebabe. The table and the probe source are in the comments on #1397. With this branch, a host harness gets the same return code and tick as the console for all 1174. 400 of them were random mutations of valid strings that I measured only after the implementation was frozen, and all 400 matched with no changes.Grammar measured after leading spaces and tabs (a digit there goes to the RFC 3339 path from #1398):
,must follow it directly (Thu ,andThu,,are BAD_PARSE), then any number of spaces and tabs. A digit next means RFC 2822/850; a letter means asctime.' 'or'-', a month (full name or three letters, any case, nothing else:Sept,Jun.,Januare BAD_PARSE),' 'or'-'again, and a year of exactly 2 or 4 digits (00–49 → 20xx, 50–99 → 19xx). Then one space andH:M[:S]with 1–2 digit fields; an hour above 25 is BAD_PARSE.12:34 ESTis 12:34 UTC).+/-followed by four digits is applied asHHMMwith no range check (+9999,-12345→ 99:99, 12:34). Anything shorter (+01:30,+1,+) gives offset 0.ESTERN= EST,PST8PDT= PST). Before that check, the console takes the zone as UT whenever the first character is an upper-caseUor the second is an upper-caseT(ET,xT,Ux→ 0, whileutis the military letter u, −7h).HST= H = +7h,MSK= M).D,DorDD, one space, thenH:M:S(all three required), one space, and exactly four year digits. Anything after that, including a zone, is ignored.30 Feb,25:00,12:99, year 0) returns 0 without writing the tick, but the offset is still subtracted from the old tick, exactly like the 60th second insceRtcParseRFC3339(#1397). Both go throughstoreParsedTick.The zone table holds the 47 names that the console mapped to their own offset among the 284 distinct zone tokens I measured. Its values are the console's, even where they differ from the real zones:
NSTis −2:30,FWTis +2. The TechnicalDebt entry now records only what is still unknown: a name that I did not measure could be in the console's table, and it would get its first letter's offset here instead.The part of the reviewer's notes on #816 that the console contradicts: it does apply
+9999, and it accepts29 Feb 2024 ...only with a weekday.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, onlysceRtcParseRFC3339. 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
sceRtcParseDateTimeandsceRtcParseRFC3339. Every string the test uses was also run on the console.libs, full CTest 408/408.libs, CTest 0 failed of 404 (GPU execution tests skipped, the VM has no GPU).guest_rtcfail. They cover the weekday and month name forms, the comma and whitespace rules, the separators, the year digit count and the 2-digit pivot, the hour limit, the zone and seconds rules, the UT check, the military formula, table entries, and the asctime day and year rules.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T02:12:31Z.
Progress report (
df16c4c→a156104)📈 System libraries: 86.18% (+0.04%, +1 implemented functions)
✅ 1 implemented
sceRtcParseDateTimeImported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-08T02:47:55Z.
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 thesceRtcParseDateTimeentry, 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.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T13:05:38Z.
Replayed the 1174 console inputs from the #1397 tables (
sceRtcParseDateTimecolumns) against the parser code from this branch: same return code and tick for all of them.guest_rtcfails with theExport.cppchange reverted, full ctest 455/455 green, CI green (linux, windows, conventions). TechnicalDebt entry is in "Unknown function info" and states what is still unmeasured; merging.