Repository navigation
feat(libSceCesCs): report the JIS X 0213 level of a cell as the console does - #10751
Conversation
|
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.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact head 27ef055 and its incremental 62-line change over declared prerequisite #10426. The level calculation distinguishes the JIS X 0208 ranges from the remaining plane-1 cells and plane 2; assignment status includes the 25 multi-code-point cells, and invalid plane/row/cell handling writes level zero when the output pointer is available. The exhaustive 0..3 by 0..255 by 0..255 hash and targeted cases match the reported PS5 sweep. I verified the JIS X 0213 source table permits use/modification/distribution, checked conventions and diff whitespace, and syntax-compiled the exact PR Export.cpp and GuestCesJis2004.cpp successfully. The current hosted product jobs are skipped; I did not run the exhaustive runtime sweep locally. Merge remains dependent on #10426.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed the new sceCesJisGetLevel implementation and its exhaustive test against the prerequisite EUC-JIS-2004/Shift_JIS-2004 profile work in #10426. The bounds checks happen before table indexing, invalid coordinates zero the output when present, and valid coordinates return the level independently of whether the cell is assigned. The level classification and assignment test cover plane 2, JIS X 0208 rows, the remaining plane-1 rows, and the 25 two-code-point cells.
I independently compiled this head's Export.cpp and GuestCesJis2004.cpp with GCC 12/C++20, linked the focused test directly, and ran it successfully (exit 0). That exercises the full 4 × 256 × 256 coordinate sweep and expected hash/count, along with the profile round trips. git diff --check upstream/main...head is clean.
I could not run the full CMake target in this checkout because the other third-party git submodules are not initialized; the hosted product-build jobs are also path-skipped. The PR records the author's Linux and Windows test runs and the PS5 sweep used for the expected results. I did not independently reproduce the console measurement. With that limitation recorded, I found no blocking issue in this change.
27ef055 to
4d46c1f
Compare
MarcZX10
left a comment
There was a problem hiding this comment.
Requesting a fix for the assigned two-code-point JIS X 0213 cells described in the inline comment. The current tests explicitly expect valid standard mappings to fail in both directions.
| std::uint32_t produced = 0; | ||
| Require(Decode(context, "\x8F\xB0\xA1", 3, out, sizeof(out), used, produced) == 0 && produced == 3 && std::memcmp(out, "\xE4\xB8\x82", 3) == 0); | ||
| } | ||
| RequireDecodeFails(context, "\xA4\xF7", 2, unassignedCode); |
There was a problem hiding this comment.
The new profile tests currently assert that EUC-JIS-2004 A4 F7 and the corresponding Unicode sequence U+304B U+309A are unassigned. The JIS X 0213 mapping table lists A4F7 as U+304B+309A (https://www.x0213.org/codetable/euc-jis-2004-std.txt, entry 0xA4F7); the corresponding Shift_JIS-2004 cell is also a two-code-point mapping. I independently confirmed Python's euc_jis_2004 codec decodes A4F7 to that pair and encodes the pair back to A4F7.
As written, decodeJis2004 looks up one scalar in PLANE1, and encodeJis2004 searches only single-scalar reverse entries, so these assigned cells cannot round-trip. Please represent the multi-scalar mappings in the string conversion paths and add decode/encode round-trip coverage for EUC and Shift_JIS. If the console intentionally rejects them despite the standard profile mapping, please document the measured console result and scope the behavior explicitly; the current test alone treats a known mapping as unassigned without evidence.
4d46c1f to
cbc227c
Compare
|
@MarcZX10 thanks, that needed evidence. Measured on a PS5 (the console's
So the console's profiles don't implement the standard's two-code-point mappings in either direction, and the PR's "unassigned" is the console's behaviour, not an omission. I've made that explicit:
|
|
@rooklz At cbc227c, remove the local export declarations, including sceCesJisGetLevel at line 20, and include the canonical libSceCesCs public header. The exact-head audit fails. Take the #10426 header correction first and restack. Preserve the newly measured two-code-point-cell rejection and assignment-level distinction. Please run ctest -R public_headers, including the applicable public_headers_compile_* tests, after the header changes; rerun the affected guest tests. |
cbc227c to
599ed10
Compare
|
@oneandonlydean done at |
599ed10 to
00510ea
Compare
00510ea to
fb64448
Compare
fb64448 to
7fae6a5
Compare
|
Rebased onto current `main` (head `7fae6a5547`); the only conflicts were debt-file churn, resolved with the existing merge tool, all `guest_ces*` tests still pass. On the combining cells: measured on a real PS5 (fw 13.40) with a homebrew payload calling `libSceCesCs.sprx` directly — `sceCesMbcToUtf32`/`sceCesMbcsStrToUtf32Str` on EUC-JIS-2004 `A4F7`, `A5F7`, `A6F8`, `ABC4` and the Shift_JIS-2004 equivalents all return `0x805C0020` (unassigned), and `sceCesUtf32StrToMbcsStr` on U+304B+U+309A returns the same for both profiles. This isn't a blanket failure of multi-scalar combining: U+00E6+U+0300 on the same EUC context round-trips correctly (`consumed=2 produced=4`, encodes back to `A9DCABDC`). So the console itself rejects these four specific cells for decode/encode despite the written standard mapping them, while accepting other two-code-point cells — the existing test's expectations match the console exactly, and no code change is needed here. This is consistent with (not a contradiction of) this PR's own `sceCesJisGetLevel` measurement, which counts these same 25 two-code-point cells as assigned for level-reporting purposes — `sceCesJisGetLevel` is a table/level lookup, a different code path from the actual decode/encode functions, and the two were measured independently on the same console. Probe source and raw output, for the record: ```c Full output: `A4F7`/`A5F7`/`A6F8`/`ABC4` (EUC) and `82F5`/`8397`/`8663` (Shift_JIS) all unassigned on decode; `304B+309A` unassigned on encode for both profiles; `00E6+0300` and `304B+0041` (plain kana, no combining) both succeed. Happy to attach the full run if useful. |
|
@MarcZX10 your change request allowed one resolution for the two-code-point cells: documenting the measured console result if the console intentionally rejects the standard mapping. That measurement is on record since 2026-10-26: on a PS5 (fw 13.40), EUC-JIS-2004 |
|
Windows result for head Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release,
AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
117c232 to
0647217
Compare
|
I rebased onto current At the new head: AI-assisted: yes (Claude Code). |
MarcZX10
left a comment
There was a problem hiding this comment.
Re-checked — approved
The console measurements you supplied resolve my earlier concern about the assigned two-code-point JIS X 0213 cells. The evidence distinguishes these specific EUC-JIS-2004/Shift_JIS-2004 mappings from other valid two-code-point sequences that do round-trip, so the measured rejection is consistent with the implementation and pinned expectations. The PR description now records those console results; the current head contains no behavior change that would invalidate the prior implementation review.
I also confirmed prerequisite #10426 is merged, this PR records it as a dependency, and the current branch is mergeable. The author reports Windows tests on a merge with current main and the prior exhaustive sweep plus macOS test results; hosted Windows and policy checks pass, while Linux hosted CI is skipped. I did not rerun the exhaustive sweep locally.
0647217 to
04112df
Compare
|
Rebased onto current Re-verified at this head in a Linux x86-64 container (Ubuntu 24.04, GCC 13.3, Release): |
MarcZX10
left a comment
There was a problem hiding this comment.
Re-checked — new head, looks good
The sceCesJisGetLevel implementation and its exhaustive test are unchanged from the previously approved head; the rebase only reconciles the pending-export count in the debt entry.
What I ran
Reviewed head 04112df6ff52bd2e12cc6eb14806daa1d87f1dc9 against base 1bc97b9527eaf6b56681cd3465bca67b75329161; the local merge preview against current main was clean and dependency #10426 is already in the base. Environment: Debian Linux x86_64, Python 3.11.2. I compared the exact implementation and test blocks with the previously approved head 0647217ecf16797ad496d6c3fe8e3a01e61cd636 and ran the no-build precheck.
python3 /marc/AnyPS5/tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10751
gh api repos/boykopovar/AnyPS5/contents/core/libs/prx/libSceCesCs/Export.cpp?ref=04112df6ff52bd2e12cc6eb14806daa1d87f1dc9
gh api repos/boykopovar/AnyPS5/contents/core/libs/tests/GuestCesJis2004.cpp?ref=04112df6ff52bd2e12cc6eb14806daa1d87f1dc9Results
| Check | Result |
|---|---|
| Diff check | Passed. |
| Repository conventions | Passed. |
| Dependency and merge preview | Passed; #10426 is satisfied by base and the preview is clean. |
| Change since approved head | The implementation and complete test file are unchanged; only rebase context and the debt-file pending-export count differ. |
| Hosted eligibility, library-portability, and report | Passed on this head. |
| Hosted Linux and specialized product jobs | Skipped. |
| Author-reported tests | The author reports guest_ces_jis2004 and guest_ces_jis2004_module passed 2/2 on this head. |
| Precheck ABI/test-quality helpers | Not executable from the extracted PR checkout because these workspace-only helper scripts are absent there; their status is not evidence of a PR defect. |
Unedited output — conventions
All conventions checks passed.
Unedited output — merge preview
# PR stack check — fresh
Target: https://github.com/boykopovar/AnyPS5/pull/10751
Target branch tip: `1bc97b9527eaf6b56681cd3465bca67b75329161`
All heads unchanged: **True**
Dependency order: #10751
## Individual merge previews
- PR #10751: **clean** against current base; head `04112df6ff52bd2e12cc6eb14806daa1d87f1dc9`; changed paths: none reported
## Dependency relationships
- #10426 → #10751: **satisfied_by_base**; overlapping changed paths: none
## Limits
Merge previews apply each exact PR head independently to the current base. A dependency head that is absent from its dependent is reported separately from merge conflicts; file overlap is only a signal and does not prove a conflict. This tool does not build, resolve conflicts, publish comments, or update branches.
Findings
Blocking
None.
Non-blocking
None.
Sources
- Implementation at the rechecked head
- Export validation and result handling at the rechecked head
- Exhaustive test and targeted boundary assertions at the rechecked head
Not verified
- I did not compile or run the C++ tests on this rebase. The implementation and test contents are identical to the previously approved head, and the author reports both focused tests passed on this head.
- Hosted Windows was still queued; hosted Linux and specialized product jobs were skipped. I did not repeat the PS5 measurement.
04112df to
492a0e3
Compare
|
Rebased onto current |
|
@rooklz a small one from the rebase: in |
492a0e3 to
5954984
Compare
|
@oneandonlydean done at |
docs/dev/debt/libSceCesCs.md: keep this branch's new sceCesJisGetLevel bullet, take main's edit of the single-byte profiles bullet, and recount PendingExports.cpp: 17 pending (main implemented 8 profile exports, this branch sceCesJisGetLevel).
|
Retested head Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release,
AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
✅ AMD GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validation IDs already present on main (4 IDs in 380 tests)Skipped (3)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
What
sceCesJisGetLevelthrew. It now reports the JIS X 0213 level of a plane, row and cell, as a PS5 does:int sceCesJisGetLevel(uint8_t plane, uint8_t row, uint8_t cell, uint32_t* level). The signature comes from the console module's disassembly (libSceCesCs.sprx, NIDhQeUMTVgPHU).I measured it on a PS5 with a homebrew payload that loads the console's
libSceCesCs.sprxand calls it for every plane 0-3, row 0-255 and cell 0-255. On the console:0x805C0020with its level; the 25 cells that need two code points count as assigned;0x805C0015and stores level 0;0x805C0001.The function uses the JIS X 0213 tables of #10426. A native build of it matches the console for all 262144 inputs.
Tested
guest_ces_jis2004sweeps every plane, row and cell, hashing result and level, and checks the hash of the console's sweep (0xD41EFACB, 11233 assigned cells), plus spot cases for each level, empty cells, the out-of-range answer and a null pointer. The otherguest_ces*tests pass.guest_ces*sources pass against thisExport.cpp.27ef055d64(verify run on my fork; Ubuntu 24.04, GCC, Release, lavapipe): everyguest_ces*test passes; its one failure,agc_driver_sgpr_pattern_fill_keys, ismain's on that runner.check_conventions.pypasses.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)