Repository navigation
feat(libSceJson2): implement allocator-backed values and recovery - #10378
Conversation
|
Native Windows test report for exact PR head Windows 11 Pro build 26300, AMD Ryzen 7 5700X3D, WinLibs GCC 15.2.0 r7 ( 202 registered groups passed three times each: 606 successful executions, zero failures, zero skips. Checked both verbose execution output and JUnit results. This includes Tested the PR head directly, without merging current main ( AI-assisted: yes. Builds and tests were executed locally. |
…at-modes # Conflicts: # core/libs/prx/libSceJson2/Export.cpp
|
Merged current main The description now records the independent native Windows 606-execution report for prior head |
MarcZX10
left a comment
There was a problem hiding this comment.
Re-reviewed — approved
Reviewed exact PR head da1fb929eabd09573783570048a07438fad59f8d against current main edf6804cf52c62eacafc592dd6142cb4efe5bd05.
What I checked
- Re-read the latest source/test delta and the decimal-underflow integration. Since the prior Windows-tested head
34632912cfb6d6861443eb73be13ad6538582575, every PR-touched file is byte-identical at the current head; the intervening update merges current main. - Current merge base is
6a28efaa277ca38291ba263aa2774859858161a0. Current main has changed 358 paths since then, with no overlap with the PR's 51 changed paths. git merge-tree --write-tree upstream/main refs/review/upstream-10378: clean treeb041b021928f387c1cd070aad408e02e8c380828.git diff --check upstream/main...refs/review/upstream-10378: pass.python3 tools/check_conventions.py --base upstream/main: pass.
Results
| Check | Result |
|---|---|
| Current-main merge preview | Clean |
| Diff check and conventions | Pass |
| Linux Json2 tests | I previously ran 203/203 on head 34632912cfb6d6861443eb73be13ad6538582575 under QEMU after bypassing only this host's unsupported-CPU guard; not rerun on this merge head |
| macOS Json2 tests | Author reports 202/202 on exact current head da1fb929 in a production-source fixture |
| Windows Json2 tests | Author reports 606/606 executions on 34632912cfb6d6861443eb73be13ad6538582575; the PR-touched files are unchanged at the current head |
| Hosted Windows job | Passes, but product test execution is skipped by the path filter |
| Full project suite/title/GPU | Not reported as run |
Negative control
The author reports the callback-thread regression times out with the previous implementation and completes with the fix. No full negative-control run was reported for the current merged tree.
Findings
Blocking
None. The Windows-specific String::npos data export, callback ownership changes, and decimal-range behavior were covered by the reported platform tests. The current-head macOS suite exercises the merged integration; source and test files for this PR are unchanged from the extensive Windows run.
Non-blocking
- No Windows runtime suite was rerun after the main merge. The Windows run is on the prior head, but the PR's 51 touched files are identical at the reviewed head; current main has no overlapping path changes.
- The Linux runtime result required QEMU and a temporary host CPU guard bypass because this machine lacks the required CPU features. It is not a native supported-CPU run.
- The 202-test macOS result is author-reported; I did not reproduce it in this environment.
Sources
- PR source at reviewed head
- Current PR discussion and test reports
- Contribution rules at current main
Not verified
I did not rerun the Linux or Windows suites on the merged head, nor the macOS fixture. Platform results are attributed above to my earlier run or the authors' reports.
…61030 # Conflicts: # core/libs/prx/libSceJson2/CMakeLists.txt
|
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.
|
…ured on a PS5 The system libSceJson2.sprx of a retail PS5 (13.60) returns from sce::Json::Array::pop_front on an empty array and the size stays 0 (orezraey on #10378); the host threw std::out_of_range.
What
Implement allocator-backed Json2 values, object trees and iterators, auxiliary callback records, recovery fallbacks, and initialization resources. Preserve allocation ordering, partial failure states, ownership, callback precedence and retry behavior instead of using host-only storage or fabricated success results.
Implement 73 of the 74 inventory exports introduced by #9517. The remaining base allocator deleting destructor deliberately traps and stays explicitly unsupported. Correct member/callback signatures, setter return declarations, special-float settings and SDK-dependent storage behavior. Document remaining unsupported cases in the library debt file.
Expose the four read-only Boolean, signed-integer, unsigned-integer and real fallback objects and the three writable String, Array and Object fallback pointers. The pointers are published after construction, used by getters and initialization admission, and consumed and cleared during cleanup. When a getter reaches its default path, it returns the corresponding exported object's address; successful callback replacements retain their own addresses. These data NIDs also occur in
libSceJson; this branch defines them inlibSceJson2, and independently loaded provider resolution remains separate.Original prerequisites #10212, #10353 and #8530 have merged into main. This branch retains their String/Array assignment and parser-cleanup regressions. There is no remaining landing dependency on those PRs.
Preserved the String overload cases from #10212 and the deep-copy/source-independence/self-assignment regression from #10353. Two String expectations are deliberately corrected: out-of-range
atreturns zero, and a null C-string needle is empty. Existing String boundary regressions cover those contracts. Array assignment keeps the SDK-dependent allocator ordering and partial-failure behavior covered by the allocator tests. The current debt file retains applicable limitations instead of restoring obsolete pending-export declarations.Integrated #8530 in the agreed order. Array parsing continues to admit an owned placeholder through
AppendArraybefore parsing its payload. Its expanded buffer/callback, malformed/nested, long-key and missing-key checks are retained, with expectations reconciled to the implemented ABI and measured partial-parser states. Host-allocation counts from the former list storage are not treated as guest-allocation coverage.Other overlap review: #8658 decimal conversion, #9826 placeholder bodies, #6039 debt documentation and #6044 test organization. Same-name matches in #9470 belong to libSceJson, a different module. These are not prerequisites.
Tested
Current-main refresh: merged
556547da71in3a9241afe5, retaining both the existing test links and the new C++23 requirement. The macOS x86-64 production-source fixture passes 202/202 registeredguest_jsoncases; the public-header audit, conventions and whitespace checks pass. The fixture adapts unrelated libc/kernel boundaries; no full product build or new Linux/Windows run is claimed.Current-main validation (2026-10-28): merged main
6a28efaa27inda1fb929eaand reconciled its decimal-underflow fix with this PR's reference-backedParseDecimal, allocator admission andAssignRealpath. The registered decimal-range tests cover signed underflow to zero, subnormals and overflow settings. Rebuilt macOS x86-64 production-source fixture: 202/202guest_jsonchecks pass. Header audit, conventions, whitespace and privacy checks pass. This is a focused fixture with unrelated libc/kernel boundaries adapted, not a full product build.Current-main validation (2026-10-27): integrated main
9ae2f7d22ain34632912cf. All 202/202 supported Json2 CTest cases pass in the rebuilt macOS x86-64 production-source fixture. The fixture now also compiles the production macOS guest-image lookup required by main; unrelated libc/kernel boundaries remain substituted. Conventions, whitespace and privacy checks pass. The reviewer independently reports both focused Linux ownership/callback-thread cases passing, including a later QEMU TCG run. No complete Linux-suite or Windows runtime pass is claimed; Windowsguest_jsonremains outstanding.Historical integration:
18f7696bd6includes main941ace5f34and merged #8530. The production-source macOS x86-64/Rosetta fixture rebuilt and passed 219/219 registered JSON checks, using production process-metadata lookup. File/mutex and unrelated libc boundaries remain substituted; the unsupported-export adapter uses the production diagnostic format. No full product, Linux/Windows or game run is claimed.Previous public-header integration (
7f0fe1d09b, main2e22b67032): reconciled #10706's public-header migration with the implemented ABI layouts and signatures. All Json2 callers/tests use the canonical declarations; raw parameter/layout fixtures retain explicit ABI casts. Private storage helpers remain outside the exported API through a header-derived linker export list, including the existingString::nposdata symbol.Export.cppfunction bodies are unchanged by this integration. The built module exports exactly the 216 declared API function/data symbols, with no extra private storage helpers.Overlap follow-up: added a bounded guest-allocation sweep for
[1]and malformed[1,parsed into an already owned empty array, through buffer and callback readers. It checks public error propagation, admitted entry ownership, cleanup and retry of the same destination. Existing measured partial-array and nested-parser expectations remain intact. Seven focused parser/allocator/callback checks pass per macOS architecture. This earlier check preceded the combined #8530 validation above. The missing-sentinel refusal remains documented and unsupported.Allocation-failure follow-up on main
c9b2660d56: reproduced the two reported macOS failures with the productionApplicationProcessParameters.cpplookup instead of the earlier null-returning metadata adapter. A missing process-metadata lookup throwsstd::runtime_error; repeatedly constructing that exception can allocate from the host heap while the tests deliberately disable host allocations. Json2 now remembers a failed lookup with an atomic flag and keeps the existing unknown-SDK fallback. Successful metadata queries remain unchanged, preserving SDK-dependent behavior. Main-executable metadata cannot appear later without relinking/restarting the process.Latest review check: the reported PS4 Pro 10.71 measurements corroborate the measured iterator ABI, allocator slots, constructor footprints and Array assignment results. Added the exact
{"a":}case to the existing parser-state regression: parsing returns0x80848101, publicgetType()returns object (7), a later parse succeeds and teardown reclaims the admitted storage. This behavior already worked on this branch; no parser implementation change was needed. These PS4 observations do not establish PS5 console or cross-firmware compatibility.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)Review follow-up: descendant assignment now snapshots aliased payloads before releasing the owning tree; allocation bookkeeping no longer nests the legacy shared recovery mutex under the host state mutex. Public-entry ownership regressions reproduce the old failure. A coordinated legacy mismatch/parser test times out on the old implementation and completes on the fix. Supported Json2 tests pass 202/202 in the rebuilt macOS production-source fixture. Explicitly unsupported throw-pinning tests were removed, while supported rollback, callback exceptions and returning retries remain.
Windows export generation now marks String::npos DATA and retains function exports normally. The real CMake generator produces 216 entries with exactly that one DATA export. This is generation validation, not a Windows runtime rerun. File mocks include the kernel API header and use int descriptors. The vector insertion behind the reported GCC warning was rewritten as equivalent element appends; the independent Linux ASan/LSan report on the prior code found no overflow. No Linux/Windows execution by the author is claimed for this update. Overlapping ancestor/descendant swaps are explicitly unsupported before mutation pending a verified reference contract; partial object-allocation and null-callback-cycle gaps remain documented.
The callback-thread test substitutes the application-heap allocation entry points and kernel mutex primitives; it exercises the real Json2 state locks, mismatch callback and parser. Its five-word SDK fixture supplies only the compatibility SDK query and is not presented as real application-heap metadata. The substitution now also checks that every legacy application-heap allocation is released. The prior implementation still times out with that corrected fixture and the fixed implementation completes. The raw Object descendant setter also has a public-entry regression alongside Array/String/Value assignment.
The Windows CI failure on the previous head reported ambiguous fallback-data references. The seven definitions now use the namespace of their declarations while retaining C linkage. The macOS production-source fixture rebuilds and all 202 registered tests pass; Windows CI passed on head
881f168de66d.Independent platform evidence
Native supported-CPU Windows report validates prior exact head
34632912cf: 202 registered groups, three runs each (606 successes), including theString::npos DATAimport. It closes the previously missing Windows evidence for that head. It predates this main merge; no current-head Windows rerun is claimed. The Linux report on that head also predates this merge and documents an unsupported-CPU guard bypass, so it is not a supported-CPU Linux result.