Repository navigation
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed the single-character EUC-JP decoder change at head e04647b. The measured length/error handling for single bytes, half-width forms, zero bytes, short sequences, and JIS X 0212 rows is reflected in the implementation and full-input hash regressions. The branch reports the ten focused CES tests passing three consecutive runs; eligibility, conventions, intake, labels and report checks pass, while product jobs are path-skipped. The implementation and tests also pass C++20 syntax checks in the descendant #10186 tree. I could not run the executable locally because the full project configure is blocked by missing SDL2 development files.
|
@orezraey Please correct the “On top of #8967 and #8972” paragraph in the description to match the implemented scope. |
|
@orezraey Full CI on main plus this PR (run 40021961421, head e04647b) fails |
|
Merged |
|
@orezraey independent confirmation from a second console. I swept To stay out of your way: I'm opening a PR for the lengths of rejected characters in the other encodings and in |
|
@rooklz thanks for the second-console sweep; it matches what this PR measured. Please send the |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Everything in this PR landed with #10185, which contained this branch. I merged |
|
Thanks! After the latest merge from main this PR has no changes left: the conversion work landed with #10185. Closing it as done. |
What
sceCesEucJpToUtf8andsceCesEucJpToUcs2used assumed errors and decoded JIS X 0212. I measured them on a retail PS5 (firmware 13.60) with homebrew probes, from a payload process loadinglibSceCesCs.sprx. I swept every two-byte input and every0x8Fthree-byte input withsceCesEucJpToUcs2. The sources and console logs are in this gist (pces3,pces4,pces5,pces7).What the console does, and what changes here:
0x805C0014with length 1; we accepted 0x0E.0x8Ewith a second byte E0–FE returns0x805C0020; we returned0x805C0014.0x8Fform returns0x805C0020in the rows X 0212 leaves empty (1, 3–5, 8, 12–15, 78–94) and0x805C0014elsewhere, always with length 3. We decoded 6067 X 0212 cells.0x805C0014with the length set to its index. A short sequence returns0x805C0011with the full length.0x805C0004; we returned0x805C0001.0x805C0010; we returned0x805C0011.sceCesEucJpToUcs2output, are cleared first.sceCesEucJpToUtf8sets the UTF-8 length before checking the output, which returns0x805C0030or0x805C0031and leaves the output untouched.With the change, the per-lead hashes of result, length and output match the console's for all 256 leads and all 256
0x8Fsecond bytes. The JIS X 0208 table (including NEC row 13 and the IBM extensions in rows 89–92) was already right.Not changed. The console reads any other profile pointer as a sheet; with the Cp1252 profile it faulted. Here a pointer that is not an EUC-JP profile still returns
0x805C0001. The MBCS string conversions keep decoding JIS X 0212, although the console'ssceCesMbcsStrToUtf8Strrejected8F A2 AFwith0x805C0014; their errors and partial output are a separate change. The debt entry records both. The strict JIS X 0208 profiles thatmainadded later were not measured: with them, both functions keep the earlier path throughdecodeMbcs, so their errors leave the outputs unchanged.On top of #8967 and #8972. The measured byte rules apply only to
sceCesEucJpToUcs2andsceCesEucJpToUtf8, throughdecodeEucJpScalar.sceCesEucJpToUtf16andsceCesEucJpToUtf32from #8967 still decode through the unchangeddecodeMbcs, so this PR does not change them.Tested
main(f26434afa3, with refactor(libs): add full export headers for libs #10706):1f9a014195. The test now takes its declarations fromlibSceCesCs/include/Api.hppinstead of its ownextern "C"block. The 14guest_ces*tests pass three runs in a row on Windows (MinGW) and on Linux (WSL Ubuntu, GCC);public_headersaudit andcheck_conventionspass.Windows 11, MinGW (winlibs).
guest_cespins the FNV hash of result, length and output over all 65536 two-byte inputs and all 655360x8Fthree-byte inputs. It also checks the null, size, output and length cases above. The JIS X 0212 round trip now goes through the string conversions.guest_ces_unicodechecks the single bytes, the half-width katakana and every JIS X 0208 cell with the measured lengths.mainand pass with the change. The fourteenguest_ces*tests pass three runs in a row, on Windows and on Linux (WSL, GCC).tools/check_conventions.pypasses.tools/pr_overlap.pylists:Export.cppandGuestCes.cpp), none of which changes these functions;Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)