Commit Graph
54 Commits
Author SHA1 Message Date
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
Dean da53518e5f Merge pull request #10212 from noamroger/claude/project-thread-a44tqk
feat(libSceJson2): implement sce::Json::String at, find and rfind
2026-10-24 15:23:36 +13:00
ntamas94andClaude Opus 5.5 d44c823834 feat(libSceJson2): implement sce::Json::Array::operator=
Copy the source array into this and return this, as the console does
(measured on a PS4 Pro, firmware 10.71). Knowledge is Power: Decades
imports it; the inventory stub threw NotImplemented.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 20:53:04 +02:00
Claude 1aab236614 feat(libSceJson2): implement sce::Json::String at, find and rfind
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GDe3GT5MyAARmdWTiGsiNU
2026-10-23 13:52:35 +00:00
JJenkxandClaude Opus 5.5 e4d512bbbd feat(libSceJson2): implement sce::Json::Array::pop_front
Graven (PPSA09614) imports sce::Json::Array::pop_front()
(pPs3qZTZQvQ) from one call site of its executable, and no built
library exported it, so tools/import_audit.py lists it as absent and
the loader stops before the title starts.

pop_front removes the first element and destroys it, like clear does
for every element. On an empty array it throws std::out_of_range, as
front and back do here; the console's result there is unverified and
listed in the debt file.

guest_json pops both elements of a two-element copy, checks the
remaining element and the empty array, and expects the throw on a
third pop.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 21:32:45 -04:00
SimoneandClaude Opus 5.5 a07d5a5074 test(json2): follow main's parser in the numeric locale test
main now keeps object keys sorted and stops at the end of the first
value, so the nested document lists its keys in order and "1,5" parses
as the integer 1 instead of failing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 11:44:03 +02:00
SimoneandClaude Opus 5.5 e7ea986aa7 test(json2): build a decimal-comma locale for the numeric locale test
Linux runners have no decimal-comma locale, so guest_json_numeric_locale
skipped there. Build xx_COMMA from a charmap and an LC_NUMERIC source
shipped with the test as a CTest fixture, point the test at it with
LOCPATH and try it first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 10:03:09 +02:00
Simone ebd1a14e30 Merge main into codex/json-numeric-locale
# Conflicts:
#	core/libs/prx/libSceJson2/Export.cpp
#	docs/dev/debt/libSceJson2.md
2026-10-22 10:02:59 +02:00
boykopovar b19f2227df fix(json): restore object iterator ownership and bounds 2026-10-21 21:47:56 +03:00
boykopovar ce03b9c68a fix(json): restore array iterator lifetime and end handling 2026-10-21 21:47:55 +03:00
boykopovar 0e1ddf3bdf fix(json): preserve value storage when swapping contents 2026-10-21 21:47:53 +03:00
boykopovar 843185a354 fix(json): restore integer token types and bit interpretation 2026-10-21 21:47:48 +03:00
boykopovar 03e47f84fb fix(json): restore incremental parser callback semantics 2026-10-21 21:47:38 +03:00
boykopovar f487c3699c fix(json): replace duplicate members while parsing 2026-10-21 21:47:37 +03:00
boykopovar 17a1c4d291 fix(json): restore bytewise string comparison 2026-10-21 21:47:37 +03:00
boykopovar 47f6af24a4 fix(json): restore the parser error code 2026-10-21 21:47:36 +03:00
boykopovar a1818c1ed0 fix(json): preserve system object key ordering 2026-10-21 21:47:28 +03:00
boykopovar 3812ecbc08 fix(json): recover scalar boolean conversion semantics 2026-10-21 21:47:10 +03:00
boykopovar fc3db15402 fix(json): preserve existing values on duplicate insertion 2026-10-21 21:45:10 +03:00
boykopovar 6d2aebd469 fix(json): restore the default special float format 2026-10-21 21:45:09 +03:00
boykopovar 9f39eb44da fix(json): correct the object erase return contract
the system export leaves the return register unspecified on missing keys and tail-calls node removal on a match. declare void and check object contents instead of a fabricated removal count. guest_json passes on windows.
2026-10-21 21:44:52 +03:00
Dean Galvin 0b51b5b482 Merge main into pr-7215
# Conflicts:
#	core/libs/tests/GuestJson.cpp
2026-10-20 18:57:38 +13:00
simonbronk 2b991e8751 fix(json2): keep numeric conversion independent of host locale
Prevent decimal-comma LC_NUMERIC from emitting invalid JSON and silently truncating decimal-point input. Keep 17-digit output, signed underflow and overflow rejection without changing the process locale.

AI-assisted: yes (OpenAI Codex). Windows WinLibs GCC15.2 Release: original shared Json2 fails the final locale regression; fixed guest_json and guest_json_numeric_locale pass (2/2, no skips). Final conventions pass. Only relevant runtime/test targets built; full build/full suite and game/console/Linux/macOS behavior unverified. No performance or coverage increase claimed.
2026-10-20 00:07:10 +02:00
Swetabh Singh d6f89b5ca5 feat(libSceJson2): implement Value, Object, Array, and String methods 2026-10-19 18:02:40 +02:00
Dean 017f2151ca Merge pull request #6126 from fdfawef324/claude/json2-value-handlers
feat(libSceJson2): implement Value::setTypeMismatchHandler and store the element access failure and special float handlers
2026-10-19 14:21:53 +13:00
pushkarreddyy 813fdda24d fix(json2): return parse error on null text or zero size 2026-10-18 09:50:39 +05:30
fdfawef324andClaude Opus 5.5 7e4b1b7c3d feat(libSceJson2): implement Value::setTypeMismatchHandler and store the element access failure and special float handlers
Value::setTypeMismatchHandler, setElementAccessFailureHandler and
setSpecialFloatHandler were stubs that threw NotImplemented. PPSA07411
calls all three while it sets up its documents.

The title calls them as members of Value: on its root Value before
parsing into it, with the handler and its context, and treats an int
result of 0 as success. They now store the handler and context on that
Value and on the values it holds, and return 0. A Value keeps its
handlers when its content changes (set, clear, operator=,
Parser::parse), and Parser::parse gives the values it creates the
handlers of the Value it parses into, since the title reads the errors
its handlers record after accessing parsed members. A copy does not
carry them.

A typed getter on a non-null value of another type calls the type
mismatch handler with the requested type, the value, null and the
context, and returns its result when it has the requested type, else
the getter's default.

The element access failure and special float handlers are stored but
not called: the error code the console passes to the first and the
FunctionType it passes to the second are unknown. A failed element
access on a value carrying the first throws instead of reaching the
null-access callback. Serializing a non-finite real already threw; with
the second set it throws naming the unknown FunctionType. The technical
debt entry records what is inferred.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 01:39:31 +02:00
mrfelek 495b4f50df feat(libSceJson2): implement sce::Json::String find, rfind, substr, append, clear, reserve and npos 2026-10-15 10:32:57 +13:00
Adrià bb7e47a889 Merge pull request #5634 from klosixgaming-arch/feat/json2-pair-iterator
feat(libSceJson2): implement Object::Pair, Array::iterator copies and notifyError
2026-10-14 16:04:09 +02:00
Andre KurthandClaude Sonnet 5.5 38be35d5a3 feat(libSceJson2): implement Value::setNullAccessCallBack
Value::setNullAccessCallBack(callback, context) sets the callback that
Value uses for a missing member or a type mismatch. It was a stub that
aborted the title. It now sets the same global callback and context as
Initializer::setGlobalNullAccessCallBack; a null callback clears it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-14 13:43:57 +02:00
klosixgaming-archandClaude Opus 5.5 c976fd0572 feat(libSceJson2): implement Object::Pair, Array::iterator copies and notifyError
PPSA30601 imports these without a known signature. The mangled names
give them: Pair's constructor deep-copies its key and value into the
layout Object iteration already returns and its destructor frees both,
Array::iterator gets its default constructor, copy assignment and
post-increment (returning the copy through a result pointer, as begin
does), and MemAllocator::notifyError is the base class's empty virtual.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dh1MhYBFyzxRceoAxrepZ6
2026-10-13 21:15:56 -05:00
Dean 9231a08b00 Merge pull request #3737 from MarcZX100/codex/json2-init-parameter2-3348
feat(libSceJson2): implement InitParameter2 constructors
2026-10-12 20:01:34 +13:00
Dean a2c4176f7e Merge pull request #3631 from arreina/pr/json-test-leak
test(json2): destroy the value before constructing over it
2026-10-12 17:34:01 +13:00
Dean 6253883dee Merge pull request #3881 from gravelas/fix/libscejson2-object-find
feat(libSceJson2): implement Object::find, Object::iterator::operator-> and String::compare
2026-10-12 15:42:47 +13:00
MarcZX100 d004d11fa3 fix(libSceJson2): use signed special-float enum type 2026-10-11 22:19:14 +00:00
David 1d5f5eb6c8 feat(libSceJson2): implement the InitParameter2 constructors and setSpecialFloatFormatType
Resident Evil 4 (PPSA07411, #2776) and PRAGMATA (PPSA02530, #3043) stop
on the absent export with

  what():  _ZN3sce4Json14InitParameter225setSpecialFloatFormatTypeENS0_22SpecialFloatFormatTypeE not implemented

Deathloop, Minecraft Legends and Cyberpunk import the base-object
constructor InitParameter2::InitParameter2(), InitParameterRtti2::
setAllocatorRtti and InitParameterRtti::InitParameterRtti(AllocParamRtti*,
void*, unsigned long), which were NotImplemented stubs.

InitParameter2 is the 40-byte object of SharpEmu and KytyPS5: the
allocator, its user data, the file buffer size and the 32-bit special
float format type at 0x18. Both constructors zero it, setAllocatorRtti
writes the allocation parameters and user data where setAllocator writes
the allocator, and setSpecialFloatFormatType stores the type.
InitParameterRtti's constructor writes its three arguments to the first
24 bytes. The NID WVZBP4IyM+E recomputes from the mangled name and is in
the aerolib database. The enum's values are unknown, so no value is
rejected; the inferred layouts are recorded in TechnicalDebt.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
(cherry picked from commit 258f2910808e5ef1636973aaefbdf51615873dcb)
2026-10-11 22:19:14 +00:00
SibteProf eaa9ce97ca test(json2): isolate base constructor regression from float format changes 2026-10-11 23:51:46 +02:00
Codex 3d8db7b5a8 fix(json2): implement InitParameter2 base constructor
Carry the implementation and regression from lucfx18's PR #2823, retaining
the original Git author. Extend the regression with a leading guard and
typed default-field checks, and record the unverified console layout.

Source: https://github.com/boykopovar/AnyPS5/pull/2823
2026-10-11 23:51:34 +02:00
Adrià ac1c340392 Merge pull request #3571 from EdouardSence/feat/json-parser-stream-parse
feat(libSceJson2): add sce::Json::Parser::parse with a read callback
2026-10-11 23:34:48 +02:00
Tyler WesterbergandClaude Opus 5.5 565e8e9c4a feat(libSceJson2): implement Object::find, Object::iterator::operator-> and String::compare
Goat Simulator 3 (PPSA04159) imports sce::Json::Object::find(String const&)
const (ehN1Biw3tw8), Object::iterator::operator->() const (EnesV4gXDtE) and
String::compare(char const*) const (Yfw63FVJgtU); without them the Windows
entry stub stops before the game starts with "unresolved ELF import
ehN1Biw3tw8".

find returns an iterator to the first pair whose key equals the argument,
or end(), using the same key match as Object::operator[]. operator->
returns the pair like operator*. compare orders the string against a C
string as std::string::compare does; a null argument throws.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 14:11:39 -04:00
Alberto RuizandClaude Sonnet 5.5 029430690f test(json2): destroy the value before constructing over it
ValueClear constructs a Value, then calls the Value(const Object&)
constructor on the same object. The constructor allocates a new node and
overwrites the pointer, so the first node (56 bytes) is never freed.
LeakSanitizer reports it; destroy the value first.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R5WJS4ZdQynAJesCZKH5hb
2026-10-11 16:21:15 +02:00
EdouardSenceandClaude Opus 5.5 95a92f35e1 feat(libSceJson2): add sce::Json::Parser::parse with a read callback
PPSA04540 (Rise of the Ronin) imports it. The characters the callback
returns are parsed as by the (text, size) overload.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 15:28:58 +02:00
EdouardSenceandClaude Opus 5.5 3faaa4b8f0 feat(libSceJson2): add the sce::Json::Array copy constructor, clear, front and iterator::operator->
PPSA04540 (Rise of the Ronin) imports all four.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-11 15:28:30 +02:00
Nahuel GenchiandClaude Opus 5.5 b9d7ff46d2 feat(libSceJson2): implement sce::Json::Object::empty
Sonic Origins (PPSA05324) imports sce::Json::Object::empty() const
(i2l3IYvQ9UE) and fails to load without it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 01:33:58 -03:00
Adrià 3e32797cca Merge pull request #1204 from CyanBook/feat/json2-value-clear
feat(libSceJson2): implement sce::Json::Value::clear
2026-10-08 11:17:57 +02:00
Lorenzo Delmonte cbc5b4cd5d feat(libSceJson2): implement sce::Json::Value::clear 2026-10-07 19:19:53 +02:00
eliasbruno124-dev 77becef75c fix(json2): support null-access callback spelling 2026-10-07 16:18:01 +02:00
Dean cfe926c0b0 Merge pull request #488 from arreina/pr/json-non-finite
fix(json2): throw on numbers that overflow a double
2026-10-07 10:06:47 +13:00
Alberto RuizandClaude Opus 5.5 bdeeb17326 fix(json2): throw on numbers that overflow a double
Whether the console's parser rejects 1e309 or stores an infinite real
is unknown, and RFC 8259 allows both. Following the exact-or-throw rule,
sce::Json::Parser::parse now throws with the number text and a note that
the behaviour is unverified, instead of returning JsonErrorParse. The
partially built tree is freed before the exception leaves the parser.
The case is listed under unknown function info in TechnicalDebt.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R5WJS4ZdQynAJesCZKH5hb
2026-10-06 18:37:38 +02:00
Alberto RuizandClaude Opus 5.5 be6c0cf3ec fix(json2): reject numbers that overflow to infinity
The parser stored strtod's result for 1e309 and similar numbers, so a
document with such a value parsed as an infinite real. Serializing it
then threw "cannot serialize a non-finite number", which escaped the
guest call and terminated the process. sce::Json::Parser::parse now
returns JsonErrorParse for a number that is not finite after conversion.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R5WJS4ZdQynAJesCZKH5hb
2026-10-06 18:37:26 +02:00