Repository navigation
fix(libSceXml): skip ignorable white space by default as firmware 13.40 does - #24665
Conversation
…40 does The module's engine starts with setSkipIgnorableWhiteSpace on, so a new or re-initialized DocumentBuilder drops white space that is a node's only text. This library started with every option off and kept it as text nodes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the focused code review found no verified defect.
What I ran
Reviewed head db7a57829394cb5b435ea1ea30dcfac18521b2a1. Read description.md, commits.md, manifest.json, diff.patch, both changed files, and the relevant ParseOptions definition and TextRun logic. No commands or tests were run.
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | Default options set whitespace skipping |
| Tests | not run | Author reports eight focused tests pass |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The PR description reports native tests and firmware comparison, but these were not independently run or verified. Title behavior was not tested, as the author notes. files.json was not available; the manifest lists two changed files, both included and read. No files were excluded in the manifest.
To get this to a good state
Nothing is required.
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against db7a578293:
- Conventions:
tools/check_conventions.pypassed. - Build:
guest_xml_document_builder_testsbuilt cleanly. - CTest (
guest_xml_document_builder):1/1 Test #5528: guest_xml_document_builder ....... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 - Negative control: with
core/libs/prx/libSceXml/src/DocumentBuilder.cppreverted tomainand the new tests kept, the suite fails:Restoring the change makes it pass again.1/1 Test #5528: guest_xml_document_builder .......Subprocess aborted***Exception: 0.38 sec 0% tests passed, 1 tests failed out of 1 - Code reading:
- Verified struct BuilderState default initialization in DocumentBuilder.cpp line 32: ParseOptions options{false, true, false} sets skipWhiteSpace=true, matching firmware 13.40 offset 0x80 behaviour.
- Verified BuilderParse options propagation: state->documentOptions takes state->options when not inProgress, preserving skipWhiteSpace across new documents parsed with the same builder.
- Verified BuilderSetOption(BuilderOption::SkipIgnorableWhiteSpace, value) toggles state->options.skipWhiteSpace cleanly without side-effects or leaks.
- Verified memory lifecycle in DocumentBuilder.cpp and GuestXmlDocumentBuilder.cpp: XmlHandle cleanup, Document destruction, and terminate/initialize cycles correctly release allocated resources and restore options.
- Verified test coverage in GuestXmlDocumentBuilder.cpp: TestSkipIgnorableWhiteSpaceDefault thoroughly tests default skipping, explicitly disabling skipping, option persistence across multiple documents, and default reset upon builder terminate/re-initialize.
Looks Good To Me
|
Tested
AI-assisted: yes (Claude Code); the runs are automated, this summary was written from their reports. |
|
Tested head Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release,
Whole batch: the full This is one combined tree, not a run of this PR alone. AI-assisted: yes (Claude Code) |
What
A new or re-initialized
sce::Xml::Dom::DocumentBuildernow skips ignorable white space, aslibSceXml.sprxof firmware 13.40 does. This library started with every option off, so pretty-printed XML grew white-space text nodes the console never produces:<r>\n <a> </a>\n <b>x </b>\n</r>gaverfive children here ("\n ",awith a" "child,"\n ",b,"\n") and two on the console (awithout children,b). A title that walksgetFirstChild/getSiblingexpecting elements reads text nodes instead.The module's engine initialization (
0x10d50, reached from the builder'sinitialize) stores 1 at engine offset0x80, the bytesetSkipIgnorableWhiteSpacewrites (0x110b0), and 0 at0x81(setResolveEntity,0x110c0) and0x82(setSkipIgnorableText,0x110d0). Run natively (see Tested): the default matchessetSkipIgnorableWhiteSpace(true), the setting holds across documents of one builder, andterminatefollowed byinitializerestores the default.Sax::Parseralready starts with skipping on.Tested
Windows 11 26300, WinLibs GCC 15.2.0 (UCRT, posix), Ninja, Release.
ctest --test-dir build -R "^(guest_xml_|xml_dom_)": all 8 libSceXml tests pass;guest_xml_document_buildergainsTestSkipIgnorableWhiteSpaceDefault, whose expected trees are the firmware's.tools/check_conventions.py --base origin/mainandtools/pr_overlap.py --branchpass. Not tested with a title.The firmware results come from 13.40
libSceXml.sprx(sha256810de3883c4d988a5b2fd6306dfb0a5fee02b987682922540cd11a8c242c88d6) mapped into a Windows process by a small loader that applies its relocations, binds its 32 imports to host functions and calls its exports throughsysv_abi; not measured on a console. Found while testingDocument::serializeagainst the same module.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)🤖 Generated with Claude Code