fix(json2): implement InitParameter2 base constructor #3670

Merged
SibteProf merged 2 commits from upstream-pr/3670 into main 2026-10-11 22:12:05 +00:00
SibteProf commented 2026-10-11 15:07:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SibteProf on 2026-10-11T15:07:26Z.


What

The sce::Json::InitParameter2 base-object constructor currently throws on every call. Give it the constructor signature (void, with an object pointer) and forward to the existing complete-object constructor so it initializes the allocator, user data and file buffer size.

Carry the implementation and regression from lucfx18's closed PR #2823, preserving its original Git author. Extend the regression to check typed default values and untouched bytes before and after the object, followed by setters and initializer use. The existing inferred object layout and unverified console initialization bytes are recorded in TechnicalDebt.

The progress scanner reports 2,904/3,383 (85.84%), up from 2,903/3,383 (85.81%): one existing pending function becomes implemented, with no new definitions.

Related work: #3575 adds a different setter and extends the object layout. This PR keeps its constructor regression in a separate test function and its technical-debt note in a separate entry, so the two merge cleanly; the combined guest_json test passes. No dependency is needed. #3737 was opened after this PR and includes the same C2 constructor in a broader initialization change; that implementation overlaps and needs a maintainer choice.

Tested

Windows 11 Pro, build 26200; WinLibs MinGW-w64 GCC 15.2.0, x86_64-ucrt-posix-seh, release 15.2.0posix-14.0.0-ucrt-r7; Ninja Release, BUILD_TESTING=ON.

  • guest_json passes. The same updated test fails against unchanged main at the unimplemented C2 constructor; restoring the implementation makes it pass.
  • CTest selection guest_json|progress_report|progress_encoding|conventions_function_bodies|test_registration: 5/5 pass.
  • tools/check_conventions.py --base origin/main, tools/check_test_registration.py build and git diff --check pass.
  • Full cmake --build build --parallel 6 and cmake --build build --target libs --parallel 6 pass. After the full build, patched_libraries and guest_json pass (2/2).
  • After separating the regression, guest_json passes on this branch alone and on its clean merge with #3575. The revised regression still fails against the unchanged main constructor and passes with the implementation restored.
  • Linux, console behavior and titles were not tested. The complete CTest suite was not run.

Checklist

  • Based on current main; no overlapping implementation existed when this PR was opened. Later #3737 implements the same C2 constructor.
  • One topic per PR; follow-ups go in a new PR
  • No comments in code added
  • Unimplemented paths throw; no silent stubs added
  • No notes, investigation files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes; original patch and local adaptation
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4820022483 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3670). Originally posted by [SibteProf](https://github.com/SibteProf) on 2026-10-11T15:07:26Z. --- ### What The `sce::Json::InitParameter2` base-object constructor currently throws on every call. Give it the constructor signature (`void`, with an object pointer) and forward to the existing complete-object constructor so it initializes the allocator, user data and file buffer size. Carry the implementation and regression from [lucfx18's closed PR #2823](https://github.com/boykopovar/AnyPS5/pull/2823), preserving its original Git author. Extend the regression to check typed default values and untouched bytes before and after the object, followed by setters and initializer use. The existing inferred object layout and unverified console initialization bytes are recorded in TechnicalDebt. The progress scanner reports 2,904/3,383 (85.84%), up from 2,903/3,383 (85.81%): one existing pending function becomes implemented, with no new definitions. Related work: #3575 adds a different setter and extends the object layout. This PR keeps its constructor regression in a separate test function and its technical-debt note in a separate entry, so the two merge cleanly; the combined `guest_json` test passes. No dependency is needed. #3737 was opened after this PR and includes the same C2 constructor in a broader initialization change; that implementation overlaps and needs a maintainer choice. ### Tested Windows 11 Pro, build 26200; WinLibs MinGW-w64 GCC 15.2.0, `x86_64-ucrt-posix-seh`, release `15.2.0posix-14.0.0-ucrt-r7`; Ninja Release, `BUILD_TESTING=ON`. - `guest_json` passes. The same updated test fails against unchanged `main` at the unimplemented C2 constructor; restoring the implementation makes it pass. - CTest selection `guest_json|progress_report|progress_encoding|conventions_function_bodies|test_registration`: 5/5 pass. - `tools/check_conventions.py --base origin/main`, `tools/check_test_registration.py build` and `git diff --check` pass. - Full `cmake --build build --parallel 6` and `cmake --build build --target libs --parallel 6` pass. After the full build, `patched_libraries` and `guest_json` pass (2/2). - After separating the regression, `guest_json` passes on this branch alone and on its clean merge with #3575. The revised regression still fails against the unchanged main constructor and passes with the implementation restored. - Linux, console behavior and titles were not tested. The complete CTest suite was not run. ### Checklist - [x] Based on current `main`; no overlapping implementation existed when this PR was opened. Later #3737 implements the same C2 constructor. - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code added - [x] Unimplemented paths throw; no silent stubs added - [x] No notes, investigation files or images added to the repository - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes; original patch and local adaptation
github-actions[bot] commented 2026-10-11 15:09:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T15:09:35Z.


Progress report (32f6414 → eaa9ce9)

📈 System libraries: 85.87% (+0.03%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceJson2 _ZN3sce4Json14InitParameter2C2Ev
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6110424258 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3670#issuecomment-6110424258). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-11T15:09:35Z. --- <!-- progress-report --> ### Progress report (32f6414 → eaa9ce9) 📈 **System libraries**: 85.87% (+0.03%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceJson2 | `_ZN3sce4Json14InitParameter2C2Ev` | </details>
github-actions[bot] commented 2026-10-11 15:28:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T15:28:50Z.


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
#3737 core/libs/prx/libSceJson2/Export.cpp L841-850
core/libs/tests/GuestJson.cpp L386, L461
_ZN3sce4Json14InitParameter2C2Ev
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6110600830 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3670#issuecomment-6110600830). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-11T15:28:50Z. --- <!-- 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 | |---|---|---|---| | #3737 | `core/libs/prx/libSceJson2/Export.cpp` [L841-850](https://github.com/boykopovar/AnyPS5/blob/31bf997b5342b88ebd4fa8f5629b0ee7400fe176/core/libs/prx/libSceJson2/Export.cpp#L841-L850)<br>`core/libs/tests/GuestJson.cpp` [L386](https://github.com/boykopovar/AnyPS5/blob/31bf997b5342b88ebd4fa8f5629b0ee7400fe176/core/libs/tests/GuestJson.cpp#L386), [L461](https://github.com/boykopovar/AnyPS5/blob/31bf997b5342b88ebd4fa8f5629b0ee7400fe176/core/libs/tests/GuestJson.cpp#L461) | `_ZN3sce4Json14InitParameter2C2Ev` | |
adriadam10 commented 2026-10-11 21:54:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:54:58Z.


Rebased onto current main (only conflict: the TechnicalDebt line next to sceAgcCreatePrimState; moved it elsewhere in the section). Scoped build and ctest green after the rebase (76 tests, guest_json included); the code is unchanged. The C2 forward to C1 is exact for a class without virtual bases; merging once CI is green.

@MarcZX100 #3737 includes the same InitParameter2C2Ev change, so it will need a rebase over this one (drop the C2 part).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114227358 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3670#issuecomment-6114227358). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T21:54:58Z. --- Rebased onto current `main` (only conflict: the TechnicalDebt line next to `sceAgcCreatePrimState`; moved it elsewhere in the section). Scoped build and ctest green after the rebase (76 tests, `guest_json` included); the code is unchanged. The C2 forward to C1 is exact for a class without virtual bases; merging once CI is green. @MarcZX100 #3737 includes the same `InitParameter2C2Ev` change, so it will need a rebase over this one (drop the C2 part).
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!3670
No description provided.