feat(libSceCesCs): add the ISO-2022-JP profiles, context and string conversions #10428

Merged
rooklz merged 2 commits from upstream-pr/10428 into main 2026-10-30 11:17:29 +00:00
rooklz commented 2026-10-24 00:03:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-24T00:03:17Z.


What

Twenty-one libSceCesCs exports for ISO-2022-JP that still threw now work: the profile initialisers sceCesUcsProfileInitIso2022JpRfc1468, Cp50221 and Cp50222, sceCesIso2022UcsContextInit and InitCopy, and the sixteen string conversions between ISO-2022-JP and UTF-8, UCS-2, UTF-16 and UTF-32 in both directions with their length-only forms (sceCesUtf8StrToIso2022Str, sceCesUtf8StrGetIso2022Len, sceCesIso2022StrToUtf8Str, sceCesIso2022StrGetUtf8Len and the same for the other three encodings).

The behaviour is measured on a PS5. I ran homebrew payloads that load the console's libSceCesCs.sprx and call sceCesUtf32StrToIso2022Str on every BMP scalar and sceCesIso2022StrToUtf32Str on every designation followed by every byte and every 94×94 pair, for each profile, plus 46 multi-character strings per profile through the UTF-8 forms. Earlier heads followed RFC 1468 and Microsoft's descriptions; the console differs from them in several places, and this head matches it on every one of those inputs (result, both lengths and output):

  • RFC 1468 starts in JIS X 0201 Roman, and ESC ( B selects it too (0x5C is ¥, 0x7E overline); it uses the strict JIS X 0208 table of #10718, so U+005C goes out as ESC $ B 21 40 and U+007E is unassigned. Half-width katakana answer 0x805C0024. A string does not have to end in ASCII.
  • CP50221 and CP50222 start in ASCII, read ESC ( J as ASCII, and use CP932's table (NEC row 13 and the IBM rows 89-92 included) with the JIS forms as extra encodings (U+00A5 → 21 6F, U+2014 → 21 3D). CP50221 writes katakana as ESC ( I; CP50222 uses SO/SI, follows SI with ESC ( B, and does not accept ESC ( I.
  • No profile reads JIS X 0212: ESC $ ( D, like any other designation it does not know, is accepted and makes every following character answer 0x805C0015.
  • Errors: U+000E, U+000F and U+0080-U+009F answer 0x805C0024; U+001B answers 0x805C0011 at the end of the input and 0x805C0015 before more; a designation at the very end of the input answers 0x805C0011. U+FEFF writes nothing. On an error both lengths report the progress so far.
  • Lengths: the decoded length stops after the last character, so a trailing designation is not counted; the encoder returns to the initial set at the end only if it left it.

The type database has none of these exports, so the signatures follow the MBCS string family by analogy, which the names mirror one for one. The UTF-16 and UCS-2 forms share the converters and were not measured separately. sceCesIso2022JpUcsProfileSetSbcs keeps throwing; it belongs with the other single-byte-set selectors.

Tested

  • Hosted Linux runner, head 940424456b (verify run on my fork; Ubuntu 24.04, GCC, Release, lavapipe): every guest_ces* test passes; its failures (pr_overlap_encoding) are main's on that runner. macOS (Apple clang 21, x86-64): every guest_ces* source passes against this Export.cpp, and a harness built from it matches the console dump for every input above.
  • guest_ces_iso2022 (new, both link variants): on RFC 1468, あ encodes to ESC $ B 24 22 ESC ( B, Aあ¥B\n to A ESC $ B 24 22 ESC ( J 5C B ESC ( B \n, ‾~ to ESC ( J 7E ESC ( B 7E, each decodes back and the GetLen forms match; ESC $ @ decodes as JIS X 0208; a string ending in JIS X 0208 or in JIS X 0201 Roman is refused (also by the length-only form) while the same text followed by ESC ( B decodes; ESC, SO and SI are unassigned on encode (on all three profiles); an ESC ( I, SO or ESC $ ( D sequence is refused, as are a truncated escape or pair, an unknown escape, a byte above 0x7F, an empty row-9 cell and a bad trail; half-width katakana and a supplementary-plane character are unassigned on encode; the destination size and the null-buffer and null-context errors are checked, and a copied context converts. On 50221, カ gives ESC ( I 36 ESC ( B, カあ gives ESC ( I 36 ESC $ B 24 22 ESC ( B, SO is refused, ESC ( I 60 is unassigned, a string ending in JIS X 0208 decodes, and ESC $ ( D 30 21 decodes to the character the EUC-JP SS3 decoder gives for 8F B0 A1 and encodes back to ESC $ ( D 30 21 ESC ( B, which RFC 1468 refuses. On 50222, カ gives SO 36 SI, カあカA gives SO 36 SI ESC $ B 24 22 ESC ( B SO 36 SI A, and both ESC ( I and SO decode, a string ending shifted out included. (Earlier heads encoded the three reserved controls verbatim and accepted any final state, then a final Roman designation, on RFC 1468; @MarcZX10 flagged each.) UCS-2, UTF-16 and UTF-32 round-trip Aあ in both directions with matching length-only forms.
  • guest_ces, guest_ces_mbc, guest_ces_unicode, guest_ces_japanese, guest_ces_chinese, guest_ces_wide and guest_ces_dbcs still pass.
  • Linux x86-64 container (Ubuntu 24.04, GCC 13.3, Release, this head built from scratch with ccache): guest_ces_iso2022 and guest_ces_iso2022_module pass, and guest_ces, guest_ces_mbc, guest_ces_unicode, guest_ces_japanese, guest_ces_chinese, guest_ces_wide and guest_ces_dbcs pass, each binary run directly with its exit status checked.
  • Hosted runners (verify run on my fork, which fails a job on any ctest failure): the Windows full build (Server 2025, WinLibs GCC 15.2.0, Release) compiles everything and passes all sixteen guest_ces* tests, the two new ones included; the Linux full build (Ubuntu 24.04, GCC, Release, lavapipe) compiles everything and passes every guest_ces* test, its two failures being agc_driver_queued_index_read_order and agc_driver_sgpr_pattern_fill_keys, which main fails on that runner.
  • check_conventions.py passes. pr_overlap.py reports #9175 on the removed PendingExports.cpp lines (it removes eight others nearby), #10056 and #10214 on the debt file, and #9912 as an uncompared sharer of the same files; none implements an ISO-2022 export.

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 under Silent stubs in their library's technical debt file
  • 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: #10718 (which depends on #10722)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4990798075 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10428). Originally posted by [rooklz](https://github.com/rooklz) on 2026-10-24T00:03:17Z. --- ### What Twenty-one libSceCesCs exports for ISO-2022-JP that still threw now work: the profile initialisers `sceCesUcsProfileInitIso2022JpRfc1468`, `Cp50221` and `Cp50222`, `sceCesIso2022UcsContextInit` and `InitCopy`, and the sixteen string conversions between ISO-2022-JP and UTF-8, UCS-2, UTF-16 and UTF-32 in both directions with their length-only forms (`sceCesUtf8StrToIso2022Str`, `sceCesUtf8StrGetIso2022Len`, `sceCesIso2022StrToUtf8Str`, `sceCesIso2022StrGetUtf8Len` and the same for the other three encodings). The behaviour is measured on a PS5. I ran homebrew payloads that load the console's `libSceCesCs.sprx` and call `sceCesUtf32StrToIso2022Str` on every BMP scalar and `sceCesIso2022StrToUtf32Str` on every designation followed by every byte and every 94×94 pair, for each profile, plus 46 multi-character strings per profile through the UTF-8 forms. Earlier heads followed RFC 1468 and Microsoft's descriptions; the console differs from them in several places, and this head matches it on every one of those inputs (result, both lengths and output): - **RFC 1468** starts in JIS X 0201 Roman, and `ESC ( B` selects it too (`0x5C` is ¥, `0x7E` overline); it uses the strict JIS X 0208 table of #10718, so U+005C goes out as `ESC $ B 21 40` and U+007E is unassigned. Half-width katakana answer `0x805C0024`. A string does not have to end in ASCII. - **CP50221 and CP50222** start in ASCII, read `ESC ( J` as ASCII, and use CP932's table (NEC row 13 and the IBM rows 89-92 included) with the JIS forms as extra encodings (U+00A5 → `21 6F`, U+2014 → `21 3D`). CP50221 writes katakana as `ESC ( I`; CP50222 uses SO/SI, follows SI with `ESC ( B`, and does not accept `ESC ( I`. - **No profile reads JIS X 0212**: `ESC $ ( D`, like any other designation it does not know, is accepted and makes every following character answer `0x805C0015`. - **Errors**: U+000E, U+000F and U+0080-U+009F answer `0x805C0024`; U+001B answers `0x805C0011` at the end of the input and `0x805C0015` before more; a designation at the very end of the input answers `0x805C0011`. U+FEFF writes nothing. On an error both lengths report the progress so far. - **Lengths**: the decoded length stops after the last character, so a trailing designation is not counted; the encoder returns to the initial set at the end only if it left it. The type database has none of these exports, so the signatures follow the MBCS string family by analogy, which the names mirror one for one. The UTF-16 and UCS-2 forms share the converters and were not measured separately. `sceCesIso2022JpUcsProfileSetSbcs` keeps throwing; it belongs with the other single-byte-set selectors. ### Tested - Hosted Linux runner, head `940424456b` ([verify run on my fork](https://github.com/rooklz/AnyPS5/actions/runs/40134138226); Ubuntu 24.04, GCC, Release, lavapipe): every `guest_ces*` test passes; its failures (pr_overlap_encoding) are `main`'s on that runner. macOS (Apple clang 21, x86-64): every `guest_ces*` source passes against this `Export.cpp`, and a harness built from it matches the console dump for every input above. - `guest_ces_iso2022` (new, both link variants): on RFC 1468, `あ` encodes to `ESC $ B 24 22 ESC ( B`, `Aあ¥B\n` to `A ESC $ B 24 22 ESC ( J 5C B ESC ( B \n`, `‾~` to `ESC ( J 7E ESC ( B 7E`, each decodes back and the `GetLen` forms match; `ESC $ @` decodes as JIS X 0208; a string ending in JIS X 0208 or in JIS X 0201 Roman is refused (also by the length-only form) while the same text followed by `ESC ( B` decodes; ESC, SO and SI are unassigned on encode (on all three profiles); an `ESC ( I`, SO or `ESC $ ( D` sequence is refused, as are a truncated escape or pair, an unknown escape, a byte above `0x7F`, an empty row-9 cell and a bad trail; half-width katakana and a supplementary-plane character are unassigned on encode; the destination size and the null-buffer and null-context errors are checked, and a copied context converts. On 50221, `カ` gives `ESC ( I 36 ESC ( B`, `カあ` gives `ESC ( I 36 ESC $ B 24 22 ESC ( B`, SO is refused, `ESC ( I 60` is unassigned, a string ending in JIS X 0208 decodes, and `ESC $ ( D 30 21` decodes to the character the EUC-JP SS3 decoder gives for `8F B0 A1` and encodes back to `ESC $ ( D 30 21 ESC ( B`, which RFC 1468 refuses. On 50222, `カ` gives `SO 36 SI`, `カあカA` gives `SO 36 SI ESC $ B 24 22 ESC ( B SO 36 SI A`, and both `ESC ( I` and SO decode, a string ending shifted out included. (Earlier heads encoded the three reserved controls verbatim and accepted any final state, then a final Roman designation, on RFC 1468; @MarcZX10 flagged each.) UCS-2, UTF-16 and UTF-32 round-trip `Aあ` in both directions with matching length-only forms. - `guest_ces`, `guest_ces_mbc`, `guest_ces_unicode`, `guest_ces_japanese`, `guest_ces_chinese`, `guest_ces_wide` and `guest_ces_dbcs` still pass. - Linux x86-64 container (Ubuntu 24.04, GCC 13.3, Release, this head built from scratch with ccache): `guest_ces_iso2022` and `guest_ces_iso2022_module` pass, and `guest_ces`, `guest_ces_mbc`, `guest_ces_unicode`, `guest_ces_japanese`, `guest_ces_chinese`, `guest_ces_wide` and `guest_ces_dbcs` pass, each binary run directly with its exit status checked. - Hosted runners ([verify run on my fork](https://github.com/rooklz/AnyPS5/actions/runs/40044996265), which fails a job on any ctest failure): the Windows full build (Server 2025, WinLibs GCC 15.2.0, Release) compiles everything and passes all sixteen `guest_ces*` tests, the two new ones included; the Linux full build (Ubuntu 24.04, GCC, Release, lavapipe) compiles everything and passes every `guest_ces*` test, its two failures being `agc_driver_queued_index_read_order` and `agc_driver_sgpr_pattern_fill_keys`, which `main` fails on that runner. - `check_conventions.py` passes. `pr_overlap.py` reports #9175 on the removed `PendingExports.cpp` lines (it removes eight others nearby), #10056 and #10214 on the debt file, and #9912 as an uncompared sharer of the same files; none implements an ISO-2022 export. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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 - [x] Depends on: #10718 (which depends on #10722) <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
MarcZX10 commented 2026-10-24 00:17:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T00:17:55Z.

Review: CHANGES_REQUESTED


I found a round-trip correctness blocker in the ASCII/control branch. It emits every scalar below 0x80 verbatim, including U+001B, U+000E and U+000F. Those bytes are reserved by the codec: ESC begins a designation, while SO/SI change the CP50222 shift state; RFC 1468 explicitly excludes ESC, SO and SI from single-byte characters (https://www.rfc-editor.org/rfc/rfc1468, formal syntax). Consequently the encoder reports success for values its decoder treats as escape/shift syntax or rejects. For example, encoding U+000E on RFC 1468 emits 0E, which the same profile's decoder rejects; on CP50222 it changes state without producing U+000E. Please return UNASSIGNED_CODE for these unrepresentable control scalars and add round-trip/error tests for all three across profiles.

There is a second RFC-profile mismatch: fromIso2022 returns success regardless of the final designation state, and the tests explicitly accept a JIS X 0208 string ending without a return to ASCII. RFC 1468 requires text to end in ASCII. Please enforce that for the RFC 1468 profile (or provide a separate documented permissive mode if that is intended) and cover the non-ASCII-terminal case.

The changed Export.cpp and GuestCesIso2022.cpp pass C++20 syntax checks; diff-check and conventions pass. The current hosted run passes conventions, eligibility, intake, labels and report; product jobs are skipped for these paths. The PR description reports Linux and Windows focused builds/tests, but those reported runs do not cover the cases above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5635770342 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10428#pullrequestreview-5635770342). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T00:17:55Z. **Review:** CHANGES_REQUESTED --- I found a round-trip correctness blocker in the ASCII/control branch. It emits every scalar below 0x80 verbatim, including U+001B, U+000E and U+000F. Those bytes are reserved by the codec: ESC begins a designation, while SO/SI change the CP50222 shift state; RFC 1468 explicitly excludes ESC, SO and SI from single-byte characters (https://www.rfc-editor.org/rfc/rfc1468, formal syntax). Consequently the encoder reports success for values its decoder treats as escape/shift syntax or rejects. For example, encoding U+000E on RFC 1468 emits 0E, which the same profile's decoder rejects; on CP50222 it changes state without producing U+000E. Please return UNASSIGNED_CODE for these unrepresentable control scalars and add round-trip/error tests for all three across profiles. There is a second RFC-profile mismatch: fromIso2022 returns success regardless of the final designation state, and the tests explicitly accept a JIS X 0208 string ending without a return to ASCII. RFC 1468 requires text to end in ASCII. Please enforce that for the RFC 1468 profile (or provide a separate documented permissive mode if that is intended) and cover the non-ASCII-terminal case. The changed Export.cpp and GuestCesIso2022.cpp pass C++20 syntax checks; diff-check and conventions pass. The current hosted run passes conventions, eligibility, intake, labels and report; product jobs are skipped for these paths. The PR description reports Linux and Windows focused builds/tests, but those reported runs do not cover the cases above.
MarcZX10 commented 2026-10-24 00:23:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T00:23:31Z.

Review: CHANGES_REQUESTED


Thanks for addressing both findings from my first review. The reserved-control encoder cases and a final JIS X 0208 state are now rejected and have regression coverage.

I found one remaining RFC 1468 mismatch in the updated decoder. fromIso2022 accepts a final Iso2022Set::Roman state for the RFC 1468 profile (state.set != Ascii && state.set != Roman is the rejection condition), and CheckRfc1468 explicitly expects ESC ( J at end of input to decode successfully. RFC 1468 says “the text must end in ASCII” (section 2) and its formal syntax annotates the final sequence “must end in ASCII” (https://www.rfc-editor.org/rfc/rfc1468, lines 131–137 and 153–155). The same RFC distinguishes ASCII (ESC ( B) from the Roman set (ESC ( J) and says Roman replaces backslash and tilde (lines 99–122). Please require the final ASCII designation for the RFC 1468 profile and change the Roman-terminal test to expect CES_ERROR_INVALID_ENCODE, or document authoritative console-specific behavior if this profile intentionally diverges from RFC 1468.

I ran the current-main conventions check and git diff --check; both pass. I attempted a focused local CMake configuration, but it stops before generating targets because SDL2 development package configuration is unavailable. I therefore did not claim a local product test run. The PR author reports container tests; the targeted test case above currently asserts the behavior in question rather than catching it.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5635794134 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10428#pullrequestreview-5635794134). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T00:23:31Z. **Review:** CHANGES_REQUESTED --- Thanks for addressing both findings from my first review. The reserved-control encoder cases and a final JIS X 0208 state are now rejected and have regression coverage. I found one remaining RFC 1468 mismatch in the updated decoder. `fromIso2022` accepts a final `Iso2022Set::Roman` state for the RFC 1468 profile (`state.set != Ascii && state.set != Roman` is the rejection condition), and `CheckRfc1468` explicitly expects `ESC ( J` at end of input to decode successfully. RFC 1468 says “the text must end in ASCII” (section 2) and its formal syntax annotates the final sequence “must end in ASCII” (https://www.rfc-editor.org/rfc/rfc1468, lines 131–137 and 153–155). The same RFC distinguishes ASCII (`ESC ( B`) from the Roman set (`ESC ( J`) and says Roman replaces backslash and tilde (lines 99–122). Please require the final ASCII designation for the RFC 1468 profile and change the Roman-terminal test to expect `CES_ERROR_INVALID_ENCODE`, or document authoritative console-specific behavior if this profile intentionally diverges from RFC 1468. I ran the current-main conventions check and `git diff --check`; both pass. I attempted a focused local CMake configuration, but it stops before generating targets because SDL2 development package configuration is unavailable. I therefore did not claim a local product test run. The PR author reports container tests; the targeted test case above currently asserts the behavior in question rather than catching it.
MarcZX10 commented 2026-10-24 00:33:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T00:33:27Z.

Review: APPROVED


Reviewed the current head 9080ba49ff50bdc2b47c12ca24e3be73bd4accd6 and the complete ISO-2022 conversion diff. The RFC 1468 end-state handling now requires ASCII, reserved ESC/SO/SI are rejected as character data, and the focused tests cover the designation, malformed-input, and length-only cases. The author reports Linux and Windows test runs on this head; I also ran the local syntax-only compile, git diff --check, and current-main conventions check successfully. Hosted conventions, eligibility, labels, and report pass; product build jobs are skipped by workflow policy. The shared debt/build files are sequencing conflicts only; I found no overlapping ISO-2022 implementation.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5635841258 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10428#pullrequestreview-5635841258). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T00:33:27Z. **Review:** APPROVED --- Reviewed the current head `9080ba49ff50bdc2b47c12ca24e3be73bd4accd6` and the complete ISO-2022 conversion diff. The RFC 1468 end-state handling now requires ASCII, reserved ESC/SO/SI are rejected as character data, and the focused tests cover the designation, malformed-input, and length-only cases. The author reports Linux and Windows test runs on this head; I also ran the local syntax-only compile, `git diff --check`, and current-main conventions check successfully. Hosted conventions, eligibility, labels, and report pass; product build jobs are skipped by workflow policy. The shared debt/build files are sequencing conflicts only; I found no overlapping ISO-2022 implementation.
MarcZX10 commented 2026-10-29 08:22:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T08:22:03Z.

Review: APPROVED


Re-reviewed exact head 2b4bbf8036bed5254ad370187344695878a6b923 against current main 4c7d275bef89d309313d16bc2bc05d37a1b50be2.

The ISO-2022 implementation, tests and public-header usage are unchanged from the measured feature head 9e7f470109; the subsequent changes are the #10430 merge/rebase, debt-count adjustment and restored SPIR-V submodule pointers. Both declared dependencies, #10718 and #10722, are merged. The Tested section reports the fresh relinker-only build and 391/391 tests on the current head; the Linux guest/header suites were reported on the unchanged feature source/test revision.

Checks run:

  • Current-main merge preview: clean (51eb9b0dd7a3c16c6b2f1716c0db00e57e12fe6d).
  • Current-main diff check: passed.
  • python3 tools/check_conventions.py --base upstream/main --head refs/review/upstream-10428: passed.
  • No PR paths changed on main since this branch's base.

I did not rerun the guest suites locally. No blocking finding remains.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5694702992 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10428#pullrequestreview-5694702992). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T08:22:03Z. **Review:** APPROVED --- Re-reviewed exact head `2b4bbf8036bed5254ad370187344695878a6b923` against current `main` `4c7d275bef89d309313d16bc2bc05d37a1b50be2`. The ISO-2022 implementation, tests and public-header usage are unchanged from the measured feature head `9e7f470109`; the subsequent changes are the #10430 merge/rebase, debt-count adjustment and restored SPIR-V submodule pointers. Both declared dependencies, #10718 and #10722, are merged. The `Tested` section reports the fresh relinker-only build and 391/391 tests on the current head; the Linux guest/header suites were reported on the unchanged feature source/test revision. Checks run: - Current-main merge preview: clean (`51eb9b0dd7a3c16c6b2f1716c0db00e57e12fe6d`). - Current-main diff check: passed. - `python3 tools/check_conventions.py --base upstream/main --head refs/review/upstream-10428`: passed. - No PR paths changed on `main` since this branch's base. I did not rerun the guest suites locally. No blocking finding remains.
MarcZX10 commented 2026-10-29 10:28:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T10:28:09Z.

Review: CHANGES_REQUESTED


Follow-up — changes requested

A new review note identified one observable behavior that the current debt entry does not cover. In the exact head 2b4bbf8036bed5254ad370187344695878a6b923, sceCesIso2022UcsContextInit rejects a null context but stores a null profile and returns success; the analogous MBCS initializer rejects both null pointers. The PR's console measurements cover the ISO-2022 conversion forms, not this initializer result.

Please either add a direct console measurement and make the implementation match it, or state in the ISO-2022-JP debt entry that the null-profile initializer result is unmeasured. This is a narrow behavior/evidence gap; the rest of the implementation and current-head checks remain as reviewed. I did not rerun tests because no source change is requested unless measurement shows the current behavior is wrong.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5696219845 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10428#pullrequestreview-5696219845). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T10:28:09Z. **Review:** CHANGES_REQUESTED --- # Follow-up — changes requested A new review note identified one observable behavior that the current debt entry does not cover. In the exact head `2b4bbf8036bed5254ad370187344695878a6b923`, `sceCesIso2022UcsContextInit` rejects a null context but stores a null profile and returns success; the analogous MBCS initializer rejects both null pointers. The PR's console measurements cover the ISO-2022 conversion forms, not this initializer result. Please either add a direct console measurement and make the implementation match it, or state in the ISO-2022-JP debt entry that the null-profile initializer result is unmeasured. This is a narrow behavior/evidence gap; the rest of the implementation and current-head checks remain as reviewed. I did not rerun tests because no source change is requested unless measurement shows the current behavior is wrong.
MarcZX10 commented 2026-10-29 17:30:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T17:30:15Z.

Review: DISMISSED


Reviewed — changes requested

The new firmware-module result confirms that the current initializer returns success for a null profile instead of the measured invalid-parameter result.

What I ran

Head 2b4bbf8036bed5254ad370187344695878a6b923; base bb04a4f1ea0175e9e4f149f0359a764d62ff3296. git merge-tree produced a clean preview tree (c29b90d4ede24fc7c4585b389fe913a3358648f0); no merge was attempted. Environment: Debian Linux x86_64, Python 3.11.2.

git merge-tree --write-tree upstream/main HEAD
python3 tools/check_conventions.py --base upstream/main --head HEAD
git diff --check upstream/main...HEAD

Results

Check Result
Current-main merge preview Clean
Conventions Pass
git diff --check Pass, no output
Hosted Windows Pass
Hosted conventions, eligibility, labels, report Pass
Hosted Linux and specialized jobs Skipped
Local compile or GuestCesIso2022 execution Not run
Local check output
c29b90d4ede24fc7c4585b389fe913a3358648f0
All conventions checks passed.

Negative control

Assertion Change to code under test Did a new test fail?
A non-null context with a null profile returns 0x805C0001 and zeroes its first 256 bytes No mutation run; the current test suite has no null-profile initializer assertion Not exercised

Findings

Blocking

  • sceCesIso2022UcsContextInit checks only context, copies profile into the first pointer-sized bytes, and returns success. With a null profile it therefore returns 0, whereas the new firmware-module measurement reports 0x805C0001 and zeroes bytes +0x00 through +0xFF for a non-null context. Please implement that observed behavior and add a regression that checks both the return value and all 256 cleared bytes. Ensure the test context buffer is at least 256 bytes. The null-context case should continue returning 0x805C0001 without touching memory.

Non-blocking

None found in the reviewed follow-up scope.

Sources

Not verified

  • I did not run a local build or the GuestCesIso2022 test executable.
  • The firmware measurement is the author’s report of a native PC run of the firmware module, not my independent reproduction or a physical-console run.

To get this to a good state

Make the initializer and test match the reported return value and 256-byte clearing behavior. I will rerun these same commands and the focused test on the new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5702170013 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10428#pullrequestreview-5702170013). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T17:30:15Z. **Review:** DISMISSED --- # Reviewed — changes requested The new firmware-module result confirms that the current initializer returns success for a null profile instead of the measured invalid-parameter result. ## What I ran Head `2b4bbf8036bed5254ad370187344695878a6b923`; base `bb04a4f1ea0175e9e4f149f0359a764d62ff3296`. `git merge-tree` produced a clean preview tree (`c29b90d4ede24fc7c4585b389fe913a3358648f0`); no merge was attempted. Environment: Debian Linux x86_64, Python 3.11.2. ```sh git merge-tree --write-tree upstream/main HEAD python3 tools/check_conventions.py --base upstream/main --head HEAD git diff --check upstream/main...HEAD ``` ## Results | Check | Result | |---|---| | Current-main merge preview | Clean | | Conventions | Pass | | `git diff --check` | Pass, no output | | Hosted Windows | Pass | | Hosted conventions, eligibility, labels, report | Pass | | Hosted Linux and specialized jobs | Skipped | | Local compile or GuestCesIso2022 execution | Not run | <details><summary>Local check output</summary> ```text c29b90d4ede24fc7c4585b389fe913a3358648f0 All conventions checks passed. ``` </details> ## Negative control | Assertion | Change to code under test | Did a new test fail? | |---|---|---| | A non-null context with a null profile returns `0x805C0001` and zeroes its first 256 bytes | No mutation run; the current test suite has no null-profile initializer assertion | Not exercised | ## Findings ### Blocking - `sceCesIso2022UcsContextInit` checks only `context`, copies `profile` into the first pointer-sized bytes, and returns success. With a null profile it therefore returns `0`, whereas the new firmware-module measurement reports `0x805C0001` and zeroes bytes `+0x00` through `+0xFF` for a non-null context. Please implement that observed behavior and add a regression that checks both the return value and all 256 cleared bytes. Ensure the test context buffer is at least 256 bytes. The null-context case should continue returning `0x805C0001` without touching memory. ### Non-blocking None found in the reviewed follow-up scope. ## Sources - [Current initializer implementation](https://github.com/boykopovar/AnyPS5/blob/2b4bbf8036bed5254ad370187344695878a6b923/core/libs/prx/libSceCesCs/Export.cpp#L2736-L2740) - [Current initializer tests](https://github.com/boykopovar/AnyPS5/blob/2b4bbf8036bed5254ad370187344695878a6b923/core/libs/tests/GuestCesIso2022.cpp#L257-L268) - [Author-reported firmware 13.42 measurement](https://github.com/boykopovar/AnyPS5/pull/10428#issuecomment-6502506441) ## Not verified - I did not run a local build or the GuestCesIso2022 test executable. - The firmware measurement is the author’s report of a native PC run of the firmware module, not my independent reproduction or a physical-console run. ## To get this to a good state Make the initializer and test match the reported return value and 256-byte clearing behavior. I will rerun these same commands and the focused test on the new head.
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!10428
No description provided.