feat(libSceJson2): implement InitParameter2 constructors #3737

Merged
MarcZX10 merged 3 commits from upstream-pr/3737 into main 2026-10-12 07:01:35 +00:00
MarcZX10 commented 2026-10-11 16:12:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T16:12:34Z.


What

Implements the InitParameter2 C1/C2 constructors, InitParameterRtti constructor, InitParameterRtti2::setAllocatorRtti, and setSpecialFloatFormatType. Adds guest coverage for the object layout, constructors and setters, and records what remains inferred in TechnicalDebt.

This carries the ready #3348 implementation onto current main, preserving David's author metadata. The setter also appears in #3575; this PR includes that behavior with the complete InitParameter2 layout plus the three other imported exports. For issue #3348's broader scope, this is the more complete PR. The open JSON2 PRs #3570 and #3571 touch adjacent code/tests but implement different exports.

Tested

Local Linux Release build of guest_json_tests; guest_json passed (1/1). tools/check_conventions.py --base upstream/main and git diff upstream/main --check pass.

Independent Linux verification reports guest_json and full suite (520/520) passed. The original Windows Release report records guest_json 3/3 and full suite 507/507, with the #3329 test fix applied locally. Verification details are in issue #3348.

Checklist

  • Based on current main; related open PR #3575 implements only the setter, which is included here alongside the other imports
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw
  • No notes or investigation files added
  • Generic behavior
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4820448530 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3737). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-11T16:12:34Z. --- ### What Implements the `InitParameter2` C1/C2 constructors, `InitParameterRtti` constructor, `InitParameterRtti2::setAllocatorRtti`, and `setSpecialFloatFormatType`. Adds guest coverage for the object layout, constructors and setters, and records what remains inferred in TechnicalDebt. This carries the ready #3348 implementation onto current `main`, preserving David's author metadata. The setter also appears in #3575; this PR includes that behavior with the complete `InitParameter2` layout plus the three other imported exports. For issue #3348's broader scope, this is the more complete PR. The open JSON2 PRs #3570 and #3571 touch adjacent code/tests but implement different exports. ### Tested Local Linux Release build of `guest_json_tests`; `guest_json` passed (1/1). `tools/check_conventions.py --base upstream/main` and `git diff upstream/main --check` pass. Independent Linux verification reports `guest_json` and full suite (520/520) passed. The original Windows Release report records `guest_json` 3/3 and full suite 507/507, with the #3329 test fix applied locally. Verification details are in issue #3348. ### Checklist - [x] Based on current `main`; related open PR #3575 implements only the setter, which is included here alongside the other imports - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw - [x] No notes or investigation files added - [x] Generic behavior - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-11 16:12:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T16:12:57Z.


Progress report (fabbeb3 → 8c00fe8)

📈 System libraries: 86.19% (+0.06%, +3 implemented functions)

✅ 3 implemented
Library Name
libSceJson2 _ZN3sce4Json14InitParameter225setSpecialFloatFormatTypeENS0_22SpecialFloatFormatTypeE
libSceJson2 _ZN3sce4Json17InitParameterRttiC1EPNS0_14AllocParamRttiEPvm
libSceJson2 _ZN3sce4Json18InitParameterRtti216setAllocatorRttiEPNS0_14AllocParamRttiEPv
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111006992 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3737#issuecomment-6111006992). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-11T16:12:57Z. --- <!-- progress-report --> ### Progress report (fabbeb3 → 8c00fe8) 📈 **System libraries**: 86.19% (+0.06%, +3 implemented functions) <details> <summary>✅ 3 implemented</summary> | Library | Name | | - | - | | libSceJson2 | `_ZN3sce4Json14InitParameter225setSpecialFloatFormatTypeENS0_22SpecialFloatFormatTypeE` | | libSceJson2 | `_ZN3sce4Json17InitParameterRttiC1EPNS0_14AllocParamRttiEPvm` | | libSceJson2 | `_ZN3sce4Json18InitParameterRtti216setAllocatorRttiEPNS0_14AllocParamRttiEPv` | </details>
adriadam10 commented 2026-10-11 21:57:29 +00:00 (Migrated from github.com)

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


Checked the layout against KytyPS5 libJson2.cpp (JsonInitParameter2: 40 bytes, special float format type at 0x18), built and ran the Json tests (scoped ctest 20/20 green), and confirmed the new test fails to link without the change.

Added one commit on your branch: the TechnicalDebt.md line moved to where the old InitParameter2 line was instead of the end of the file, to avoid append conflicts with other PRs.

Merging once CI is green. #3575 adds only the setter that this PR already includes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114249067 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3737#issuecomment-6114249067). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T21:57:29Z. --- Checked the layout against KytyPS5 `libJson2.cpp` (`JsonInitParameter2`: 40 bytes, special float format type at 0x18), built and ran the Json tests (scoped ctest 20/20 green), and confirmed the new test fails to link without the change. Added one commit on your branch: the `TechnicalDebt.md` line moved to where the old `InitParameter2` line was instead of the end of the file, to avoid append conflicts with other PRs. Merging once CI is green. #3575 adds only the setter that this PR already includes.
adriadam10 commented 2026-10-11 22:06:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T22:06:37Z.


Rebased onto current main (conflicts in libSceJson2/Export.cpp next to the new Value::* stubs and in TechnicalDebt.md); guest_json passes after the rebase. The TechnicalDebt.md line stays where the old InitParameter2 line was.

Merging once CI is green. #3670 adds only the C2 constructor that this PR already includes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114368026 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3737#issuecomment-6114368026). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T22:06:37Z. --- Rebased onto current `main` (conflicts in `libSceJson2/Export.cpp` next to the new `Value::*` stubs and in `TechnicalDebt.md`); `guest_json` passes after the rebase. The `TechnicalDebt.md` line stays where the old `InitParameter2` line was. Merging once CI is green. #3670 adds only the C2 constructor that this PR already includes.
MarcZX10 commented 2026-10-11 22:21:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T22:21:37Z.


Rebased onto current main after eligibility reported a merge conflict from newer Json2 changes. The rebase preserves the merged base-constructor implementation and its regression coverage alongside this PR’s additional InitParameter2 fields, RTTI setter/constructor, and special-float setter. David remains the author of the carried implementation commit. Linux GCC 12.2 Release build succeeded; guest_json passed (1/1). The conventions checker and git diff --check pass. Fresh GitHub checks are pending.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114540143 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3737#issuecomment-6114540143). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-11T22:21:37Z. --- Rebased onto current main after eligibility reported a merge conflict from newer Json2 changes. The rebase preserves the merged base-constructor implementation and its regression coverage alongside this PR’s additional InitParameter2 fields, RTTI setter/constructor, and special-float setter. David remains the author of the carried implementation commit. Linux GCC 12.2 Release build succeeded; guest_json passed (1/1). The conventions checker and git diff --check pass. Fresh GitHub checks are pending.
xXPBSXx commented 2026-10-11 22:50:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T22:50:12Z.


Test from Resident Evil 4 (PPSA07411), Windows, MinGW GCC 15.2.0: the import audit on main plus this PR no longer lists sce::Json::InitParameter2::setSpecialFloatFormatType, which the title imports; without it the loader stops. I merged this PR together with #3537, #3791, #3517, #3604, #3707 and my export PRs (#3773, #4044, #3799, #3814, #3819); with that stack RE4 gets through the loader and runs 120 s. Not tested: this PR alone.

Overlap: #3575 adds setSpecialFloatFormatType as well and conflicts with this PR (git merge of both onto main: conflict in libSceJson2/Export.cpp and TechnicalDebt.md), so only one of the two can go in. Also, merging this PR after my stub PRs #3773 and #3814 conflicts textually at the end of libSceJson2/Export.cpp (both append there); that is on my side to rebase once this one lands.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114781562 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3737#issuecomment-6114781562). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-11T22:50:12Z. --- Test from Resident Evil 4 (PPSA07411), Windows, MinGW GCC 15.2.0: the import audit on `main` plus this PR no longer lists `sce::Json::InitParameter2::setSpecialFloatFormatType`, which the title imports; without it the loader stops. I merged this PR together with #3537, #3791, #3517, #3604, #3707 and my export PRs (#3773, #4044, #3799, #3814, #3819); with that stack RE4 gets through the loader and runs 120 s. Not tested: this PR alone. Overlap: #3575 adds `setSpecialFloatFormatType` as well and conflicts with this PR (`git merge` of both onto `main`: conflict in `libSceJson2/Export.cpp` and `TechnicalDebt.md`), so only one of the two can go in. Also, merging this PR after my stub PRs #3773 and #3814 conflicts textually at the end of `libSceJson2/Export.cpp` (both append there); that is on my side to rebase once this one lands. AI-assisted (Claude Code).
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!3737
No description provided.