feat(libSceJson2): implement Array::iterator assignment, postfix increment and Object::Pair #4476

Closed
ahmedmakroum wants to merge 2 commits from upstream-pr/4476 into main
ahmedmakroum commented 2026-10-12 13:01:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ahmedmakroum on 2026-10-12T13:01:16Z.


What

Implements five libSceJson2 exports that were NotImplemented stubs:

  • Array::iterator::iterator() (placement new on guest memory)
  • Array::iterator::operator=(const iterator&)
  • Array::iterator::operator++(int) (returns the old position through the hidden result pointer, like Array::begin())
  • Object::Pair::Pair(const String&, const Value&) (deep copies key and value with the existing Construct and CopyInto helpers, sets the reserved field to 0)
  • Object::Pair::~Pair() (destroys key and value)

The other Json2 stubs are left as they are: Object::insert has no return type in its mangled name, and the handler setters and operator bool have unknown behaviour.

Tested

Linux (WSL2), no title. Added IteratorAssignmentAndPair to the guest_json test: default construction followed by assignment, postfix increment returning the old position and advancing the iterator, Pair deep copy (changing and destroying the source String and Value leaves the pair unchanged), and the Pair destructor. ctest -R '^guest_json$' passes and python3 tools/check_conventions.py passes.

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 in TechnicalDebt
  • 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: none
  • Unblocks: none
  • AI-assisted: yes, written with Claude Code and reviewed by me
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4829785175 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4476). Originally posted by [ahmedmakroum](https://github.com/ahmedmakroum) on 2026-10-12T13:01:16Z. --- ### What Implements five libSceJson2 exports that were NotImplemented stubs: - `Array::iterator::iterator()` (placement new on guest memory) - `Array::iterator::operator=(const iterator&)` - `Array::iterator::operator++(int)` (returns the old position through the hidden result pointer, like `Array::begin()`) - `Object::Pair::Pair(const String&, const Value&)` (deep copies key and value with the existing Construct and CopyInto helpers, sets the reserved field to 0) - `Object::Pair::~Pair()` (destroys key and value) The other Json2 stubs are left as they are: `Object::insert` has no return type in its mangled name, and the handler setters and `operator bool` have unknown behaviour. ### Tested Linux (WSL2), no title. Added `IteratorAssignmentAndPair` to the guest_json test: default construction followed by assignment, postfix increment returning the old position and advancing the iterator, Pair deep copy (changing and destroying the source String and Value leaves the pair unchanged), and the Pair destructor. `ctest -R '^guest_json$'` passes and `python3 tools/check_conventions.py` passes. ### Checklist - [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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [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: none - [x] Unblocks: none - [x] AI-assisted: yes, written with Claude Code and reviewed by me
ahmedmakroum commented 2026-10-12 13:27:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ahmedmakroum on 2026-10-12T13:27:35Z.


The overlap bot links #4447. That PR adds parameter checks to these five stubs but keeps them NotImplemented; this PR implements them. They change the same lines, so I’d suggest this one goes first and #4447 drops its changes to these five Json2 exports. I’ve left a note there too.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6125237781 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4476#issuecomment-6125237781). Originally posted by [ahmedmakroum](https://github.com/ahmedmakroum) on 2026-10-12T13:27:35Z. --- The overlap bot links #4447. That PR adds parameter checks to these five stubs but keeps them NotImplemented; this PR implements them. They change the same lines, so I’d suggest this one goes first and #4447 drops its changes to these five Json2 exports. I’ve left a note there too.
oneandonlydean commented 2026-10-13 00:20:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T00:20:38Z.


Does PPSA30601 stop at one of these five on main? With the log line this can go in; without one I'll close it until a title gets there. The PPSA30601 line in docs/dev/debt/libSceJson2.md also still lists all six Json2 members as unimplemented.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6135179848 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4476#issuecomment-6135179848). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T00:20:38Z. --- Does PPSA30601 stop at one of these five on main? With the log line this can go in; without one I'll close it until a title gets there. The PPSA30601 line in `docs/dev/debt/libSceJson2.md` also still lists all six Json2 members as unimplemented.
screamm commented 2026-10-13 09:20:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-13T09:20:18Z.


Windows build check (Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON, full build including libs): head 93ad413d merges cleanly onto main 5f426f94; guest_json 3/3; suite 683/686 plus one skip, the failures being patched_libraries (broken on main by #4877, fix #5025) and a load timeout of guest_none_relocations that passes 3/3 alone; conventions and git diff --check pass; no warnings in the changed files. No title evidence from me: Resonance is commercial. One stale line: docs/dev/debt/libSceJson2.md still says six Pair/Object/iterator members are unimplemented, while after this PR only Object::insert is left.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6142389300 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4476#issuecomment-6142389300). Originally posted by [screamm](https://github.com/screamm) on 2026-10-13T09:20:18Z. --- Windows build check (Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, `BUILD_TESTING=ON`, full build including `libs`): head `93ad413d` merges cleanly onto `main` `5f426f94`; `guest_json` 3/3; suite 683/686 plus one skip, the failures being `patched_libraries` (broken on `main` by #4877, fix #5025) and a load timeout of `guest_none_relocations` that passes 3/3 alone; conventions and `git diff --check` pass; no warnings in the changed files. No title evidence from me: Resonance is commercial. One stale line: `docs/dev/debt/libSceJson2.md` still says six `Pair`/`Object`/`iterator` members are unimplemented, while after this PR only `Object::insert` is left.
github-actions[bot] commented 2026-10-13 09:51:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T09:51:56Z.


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.

Pull request Conflicting files (lines on main) Same exports Same new files
#5004 docs/dev/debt/libSceJson2.md L11-12
#5438 core/libs/tests/GuestJson.cpp L612
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6142925002 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4476#issuecomment-6142925002). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T09:51:56Z. --- <!-- pr-overlap --> 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**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #5004 | `docs/dev/debt/libSceJson2.md` [L11-12](https://github.com/boykopovar/AnyPS5/blob/c7601b797119da8e81191dd7d31bdfffd77d9f3b/docs/dev/debt/libSceJson2.md#L11-L12) | | | | #5438 | `core/libs/tests/GuestJson.cpp` [L612](https://github.com/boykopovar/AnyPS5/blob/c7601b797119da8e81191dd7d31bdfffd77d9f3b/core/libs/tests/GuestJson.cpp#L612) | | |
ahmedmakroum commented 2026-10-13 10:03:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ahmedmakroum on 2026-10-13T10:03:50Z.


Thanks for the Windows check.

No log line from me: I don’t have PPSA30601, so I can’t show it stopping at one of these five. I implemented them from the debt entry, which only says the title fails to load without them. @xXPBSXx brought PPSA30601 up in #3814; if a run of yours reaches libSceJson2, a log line would settle it.

I’ve pushed the debt fix: docs/dev/debt/libSceJson2.md now lists only Object::insert as left. If there’s no log, closing this until a title gets there is fine with me.

@oneandonlydean @screamm

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6143126144 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4476#issuecomment-6143126144). Originally posted by [ahmedmakroum](https://github.com/ahmedmakroum) on 2026-10-13T10:03:50Z. --- Thanks for the Windows check. No log line from me: I don’t have PPSA30601, so I can’t show it stopping at one of these five. I implemented them from the debt entry, which only says the title fails to load without them. @xXPBSXx brought PPSA30601 up in #3814; if a run of yours reaches libSceJson2, a log line would settle it. I’ve pushed the debt fix: docs/dev/debt/libSceJson2.md now lists only Object::insert as left. If there’s no log, closing this until a title gets there is fine with me. @oneandonlydean @screamm
ahmedmakroum commented 2026-10-13 10:12:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ahmedmakroum on 2026-10-13T10:12:03Z.


The new overlap with #5004 is only neighbouring lines in docs/dev/debt/libSceJson2.md, no shared exports; whichever merges second can rebase it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6143264442 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4476#issuecomment-6143264442). Originally posted by [ahmedmakroum](https://github.com/ahmedmakroum) on 2026-10-13T10:12:03Z. --- The new overlap with #5004 is only neighbouring lines in docs/dev/debt/libSceJson2.md, no shared exports; whichever merges second can rebase it.
oneandonlydean commented 2026-10-13 22:05:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T22:05:40Z.


Thanks for the work on this. Closing for now: no title reaches these five on main yet, as agreed above. You are welcome to reopen it with the title ID and the log line if PPSA30601 or another title stops at one of them.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6156177519 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4476#issuecomment-6156177519). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T22:05:40Z. --- Thanks for the work on this. Closing for now: no title reaches these five on main yet, as agreed above. You are welcome to reopen it with the title ID and the log line if PPSA30601 or another title stops at one of them.

Pull request closed

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!4476
No description provided.