Repository navigation
fix(rtc): parse RFC 2822, RFC 850 and asctime text like the console - #1399
adriadam10 merged 3 commits into
Conversation
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>
Measured on a PS5 (firmware 13.60) through dlopen of libSceRtc.sprx. The weekday is required in any case or length, month names may be full, RFC 2822 and RFC 850 share one lenient grammar with 2-digit years split at 50, and the asctime zone is ignored. Zones come from a name table, a military letter, or +HHMM without a range check. Text the console rejects returns a parse error with the tick untouched, and an invalid calendar date returns 0 with only the offset applied to the tick, as the console does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
About the overlap report: #1253, #1306 and #1314 are not dependencies. Each of them inserts a TechnicalDebt line right after |
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>
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>
|
Replayed the 1174 console inputs from the #1397 tables ( |
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(fix(rtc): match sceRtcParseRFC3339 to the console #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