feat(libSceNKWebKit): implement JSC::ConfigFile construction, names and parse #25548

Open
pinewhite wants to merge 3 commits from upstream-pr/25548 into main
pinewhite commented 2026-11-22 08:30:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by pinewhite on 2026-11-22T08:30:23Z.


What

Implements five JSC::ConfigFile exports in libSceNKWebKit, following the pinned ConfigFile.cpp and ConfigFile.h at 80f77e94:

  • _ZN3JSC10ConfigFileC1EPKc, _ZN3JSC10ConfigFileC2EPKc — the object is two 1025-byte name arrays (PATH_MAX 1024); the file name is truncated to 1024 bytes and the config directory is cleared. A null name leaves both empty, as the source does.
  • _ZN3JSC10ConfigFile14setProcessNameEPKc, _ZN3JSC10ConfigFile20setParentProcessNameEPKc — strncpy semantics into the 128-byte static buffers, including zero padding a shorter name over a longer one.
  • _ZN3JSC10ConfigFile5parseEv — canonicalizes a relative name against getcwd, then reads the file with the source's line buffer, # comment stripping, blank-line skipping and isUnicodeCompatibleASCIIWhitespace set, and parses jscOptions { }, logFile = "..." and the processName, parentProcessName and build predicates with their && chains, nested-statement nesting and =~ /pattern/i form. A skipped block still scans its body to the closing brace but contributes no options, as upstream.

Two upstream seams are not implemented yet, so parse throws std::logic_error instead of applying them: a non-empty jscOptions payload (JSC::Options::setOptions is a stub) and a logFile path (WTF::setDataFile(const char*) is a stub). =~ matches with std::regex's POSIX extended grammar rather than regexec, because HAVE(REGEX_H) on the console is unverified. Null objects, null names and name arrays without a terminating byte at index 1024 throw std::invalid_argument where the source faults. _ZN3JSC17processConfigFileEPKcS1_S1_ stays a stub.

New files: src/JscConfigFile.cpp, src/ConfigFileAbi.hpp (2050-byte layout with static_asserts), include/ConfigFileExports.hpp, tests/JscConfigFile.cpp. The five stubs and their InventoryExports.hpp declarations are removed. Debt entry added through docs/dev/debt/changes/feat-nkwebkit-jsc-config-file.md.

python3 tools/progress.py --module libSceNKWebKit: 3915/11252 → 3920/11252 (the same five names move from todo to done, and no name moves into todo; --root on a pristine tree gives the same 3915 baseline).

Tested

Not tested on a console; no title uses these exports yet.

Hand-built host proof on ARM64 (Linux, GCC 13, g++ -std=c++20 -O1 -ffunction-sections -fdata-sections -Icore/libs -c, linked with -Wl,--gc-sections):

  • Pre-change: the same test binary linked against the pristine Export.cpp bodies of these five exports aborts on the first call — NotImplemented: _ZN3JSC10ConfigFileC1EPKc, exit 134.
  • Post-change: ./proof-post prints libSceNKWebKit ConfigFile tests passed, exit 0.

tests/JscConfigFile.cpp (registered as nkwebkit_jscconfigfile) calls the real exports and covers both constructors, 1200-byte name truncation, null and empty names, null objects, an object with unterminated name arrays, a missing file and an empty name (both logged through WTF::dataLogF and returning), processName/parentProcessName/build predicates matching, skipped, chained and followed by a trailing comment, two sequential blocks, =~ matching, case-insensitive and mismatched, an invalid regex (parse error, no throw), jscOptions and logFile throwing when they apply, skipped when their block does not match, malformed statements (unknown statement, bare block, unterminated block, unknown predicate, logFile without quotes, option without = or value), reuse of both name buffers, and relative-name canonicalization against a temporary getcwd.

Shims used only for the hand build, none of them the code under test: fopen/fgets/fclose/getcwd/chdir _nid_postfix over host stdio, CopyGuestString/GuestCopyIn/GuestCopyOut over host memory, the path-alias table, WTF::dataLogF over vfprintf, and ApplicationHeapRegister. A full CMake/CTest run was not made on this host (no Ninja, two cores, submodules not initialised); python3 tools/check_conventions.py --base origin/main passes on the commit.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

tools/pr_overlap.py --branch feat/nkwebkit-jsc-config-file lists three refactors that split libraries (#24322, #24910, #24917) and #23860 (trap bodies), which delete neighbouring lines of Export.cpp and InventoryExports.hpp around these stubs; none of them implements or removes these five exports.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5437267232 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/25548). Originally posted by [pinewhite](https://github.com/pinewhite) on 2026-11-22T08:30:23Z. --- ### What Implements five `JSC::ConfigFile` exports in `libSceNKWebKit`, following the pinned [ConfigFile.cpp](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/JavaScriptCore/runtime/ConfigFile.cpp) and [ConfigFile.h](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/JavaScriptCore/runtime/ConfigFile.h) at `80f77e94`: - `_ZN3JSC10ConfigFileC1EPKc`, `_ZN3JSC10ConfigFileC2EPKc` — the object is two 1025-byte name arrays (`PATH_MAX` 1024); the file name is truncated to 1024 bytes and the config directory is cleared. A null name leaves both empty, as the source does. - `_ZN3JSC10ConfigFile14setProcessNameEPKc`, `_ZN3JSC10ConfigFile20setParentProcessNameEPKc` — `strncpy` semantics into the 128-byte static buffers, including zero padding a shorter name over a longer one. - `_ZN3JSC10ConfigFile5parseEv` — canonicalizes a relative name against `getcwd`, then reads the file with the source's line buffer, `#` comment stripping, blank-line skipping and `isUnicodeCompatibleASCIIWhitespace` set, and parses `jscOptions { }`, `logFile = "..."` and the `processName`, `parentProcessName` and `build` predicates with their `&&` chains, nested-statement nesting and `=~` `/pattern/i` form. A skipped block still scans its body to the closing brace but contributes no options, as upstream. Two upstream seams are not implemented yet, so `parse` throws `std::logic_error` instead of applying them: a non-empty `jscOptions` payload (`JSC::Options::setOptions` is a stub) and a `logFile` path (`WTF::setDataFile(const char*)` is a stub). `=~` matches with `std::regex`'s POSIX extended grammar rather than `regexec`, because `HAVE(REGEX_H)` on the console is unverified. Null objects, null names and name arrays without a terminating byte at index 1024 throw `std::invalid_argument` where the source faults. `_ZN3JSC17processConfigFileEPKcS1_S1_` stays a stub. New files: `src/JscConfigFile.cpp`, `src/ConfigFileAbi.hpp` (2050-byte layout with `static_assert`s), `include/ConfigFileExports.hpp`, `tests/JscConfigFile.cpp`. The five stubs and their `InventoryExports.hpp` declarations are removed. Debt entry added through `docs/dev/debt/changes/feat-nkwebkit-jsc-config-file.md`. `python3 tools/progress.py --module libSceNKWebKit`: **3915/11252 → 3920/11252** (the same five names move from `todo` to `done`, and no name moves into `todo`; `--root` on a pristine tree gives the same 3915 baseline). ### Tested Not tested on a console; no title uses these exports yet. Hand-built host proof on ARM64 (Linux, GCC 13, `g++ -std=c++20 -O1 -ffunction-sections -fdata-sections -Icore/libs -c`, linked with `-Wl,--gc-sections`): - Pre-change: the same test binary linked against the pristine `Export.cpp` bodies of these five exports aborts on the first call — `NotImplemented: _ZN3JSC10ConfigFileC1EPKc`, exit 134. - Post-change: `./proof-post` prints `libSceNKWebKit ConfigFile tests passed`, exit 0. `tests/JscConfigFile.cpp` (registered as `nkwebkit_jscconfigfile`) calls the real exports and covers both constructors, 1200-byte name truncation, null and empty names, null objects, an object with unterminated name arrays, a missing file and an empty name (both logged through `WTF::dataLogF` and returning), `processName`/`parentProcessName`/`build` predicates matching, skipped, chained and followed by a trailing comment, two sequential blocks, `=~` matching, case-insensitive and mismatched, an invalid regex (parse error, no throw), `jscOptions` and `logFile` throwing when they apply, skipped when their block does not match, malformed statements (unknown statement, bare block, unterminated block, unknown predicate, `logFile` without quotes, option without `=` or value), reuse of both name buffers, and relative-name canonicalization against a temporary `getcwd`. Shims used only for the hand build, none of them the code under test: `fopen`/`fgets`/`fclose`/`getcwd`/`chdir` `_nid_postfix` over host stdio, `CopyGuestString`/`GuestCopyIn`/`GuestCopyOut` over host memory, the path-alias table, `WTF::dataLogF` over `vfprintf`, and `ApplicationHeapRegister`. A full CMake/CTest run was not made on this host (no Ninja, two cores, submodules not initialised); `python3 tools/check_conventions.py --base origin/main` passes on the commit. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical debt file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes `tools/pr_overlap.py --branch feat/nkwebkit-jsc-config-file` lists three refactors that split libraries (#24322, #24910, #24917) and #23860 (trap bodies), which delete neighbouring lines of `Export.cpp` and `InventoryExports.hpp` around these stubs; none of them implements or removes these five exports.
PrivacyOnion commented 2026-11-22 08:33:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-22T08:33:27Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against d878bfe5e8:

  • Conventions: tools/check_conventions.py passed.
  • Build: nkwebkit_jscconfigfile_tests built cleanly.
  • CTest (nkwebkit_jscconfigfile):
    1/1 Test #4889: nkwebkit_jscconfigfile ...........Subprocess aborted***Exception:   0.21 sec
    0% tests passed, 1 tests failed out of 1
    
    The following tests FAILED:
    

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6011255910 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/25548#pullrequestreview-6011255910). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-22T08:33:27Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `d878bfe5e8`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `nkwebkit_jscconfigfile_tests` built cleanly. - **CTest** (`nkwebkit_jscconfigfile`): ``` 1/1 Test #4889: nkwebkit_jscconfigfile ...........Subprocess aborted***Exception: 0.21 sec 0% tests passed, 1 tests failed out of 1 ``` ``` The following tests FAILED: ``` Requesting changes for the points above.
MarcZX10 commented 2026-11-22 08:34:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T08:34:03Z.

Review: COMMENTED


Reviewed — comments

The parser skips validation of later conditions when an earlier predicate in an && chain fails, so malformed config input can be accepted as a skipped block.

What I ran

Reviewed head d878bfe5e8a1da7e9d7b2bc9d95641a8961e0c6b. Read the prepared diff and repository sources through repo_read.py; no tests or other commands were run.

Results

Check Result Note
Source review passed Parser and tests inspected
Automated checks not run No local command execution
Console behavior not run No console verification

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceNKWebKit/src/JscConfigFile.cpp:325: If ParsePredicate returns false, the loop neither errors nor checks for &&; it proceeds to expect {. After an earlier chain member fails, a later malformed condition such as nonsense is therefore not validated and can be skipped if followed by a block. Validate every predicate and return Result::Error when parsing fails; add a regression test with a failed first condition and malformed trailing condition.

Not verified

  • No tests were run. The description reports a hand-built host proof and a conventions check, but these were not run for this review; no full CMake/CTest run or console test was performed.
  • Export.cpp and InventoryExports.hpp were excluded from the prepared full-file bundle; their relevant hunks were read from the prepared diff. Other excluded paths listed in files.json were not reviewed.
  • The full console ABI and runtime behavior remain unverified, as recorded in the change description.

To get this to a good state

Nothing is required. Optional: validate every predicate in an && chain and add coverage for a malformed condition after a failing predicate.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6011259471 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/25548#pullrequestreview-6011259471). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T08:34:03Z. **Review:** COMMENTED --- # Reviewed — comments The parser skips validation of later conditions when an earlier predicate in an `&&` chain fails, so malformed config input can be accepted as a skipped block. ## What I ran Reviewed head `d878bfe5e8a1da7e9d7b2bc9d95641a8961e0c6b`. Read the prepared diff and repository sources through `repo_read.py`; no tests or other commands were run. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Parser and tests inspected | | Automated checks | not run | No local command execution | | Console behavior | not run | No console verification | ## Findings ### Blocking None. ### Non-blocking - `core/libs/prx/libSceNKWebKit/src/JscConfigFile.cpp:325`: If `ParsePredicate` returns false, the loop neither errors nor checks for `&&`; it proceeds to expect `{`. After an earlier chain member fails, a later malformed condition such as `nonsense` is therefore not validated and can be skipped if followed by a block. Validate every predicate and return `Result::Error` when parsing fails; add a regression test with a failed first condition and malformed trailing condition. ## Not verified - No tests were run. The description reports a hand-built host proof and a conventions check, but these were not run for this review; no full CMake/CTest run or console test was performed. - `Export.cpp` and `InventoryExports.hpp` were excluded from the prepared full-file bundle; their relevant hunks were read from the prepared diff. Other excluded paths listed in `files.json` were not reviewed. - The full console ABI and runtime behavior remain unverified, as recorded in the change description. ## To get this to a good state Nothing is required. Optional: validate every predicate in an `&&` chain and add coverage for a malformed condition after a failing predicate.
PrivacyOnion commented 2026-11-22 14:12:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-22T14:12:37Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against a2e45c2255:

  • Conventions: tools/check_conventions.py passed.
  • Build: nkwebkit_jscconfigfile_tests built cleanly.
  • CTest (nkwebkit_jscconfigfile):
    1/1 Test #4896: nkwebkit_jscconfigfile ...........   Passed    0.02 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libSceNKWebKit/Export.cpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp, core/libs/prx/libSceNKWebKit/src/JscConfigFile.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified JscConfigFile.cpp implementation against WebKit upstream ConfigFile.cpp/h logic and PS5 ABI expectations
    • Audited CanonicalizePaths path concatenation buffer size and bounds checks in JscConfigFile.cpp
    • Audited Scanner and Parser token consumption, comment stripping, regex assign/search handling, and nesting logic
    • Audited GuestCopyIn/GuestCopyOut and guest string bounds checking in Construct and Parse
    • Verified test coverage in JscConfigFile.cpp including canonical path resolution with path aliasing

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6012652664 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/25548#pullrequestreview-6012652664). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-22T14:12:37Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `a2e45c2255`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `nkwebkit_jscconfigfile_tests` built cleanly. - **CTest** (`nkwebkit_jscconfigfile`): ``` 1/1 Test #4896: nkwebkit_jscconfigfile ........... Passed 0.02 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libSceNKWebKit/Export.cpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp`, `core/libs/prx/libSceNKWebKit/src/JscConfigFile.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified JscConfigFile.cpp implementation against WebKit upstream ConfigFile.cpp/h logic and PS5 ABI expectations - Audited CanonicalizePaths path concatenation buffer size and bounds checks in JscConfigFile.cpp - Audited Scanner and Parser token consumption, comment stripping, regex assign/search handling, and nesting logic - Audited GuestCopyIn/GuestCopyOut and guest string bounds checking in Construct and Parse - Verified test coverage in JscConfigFile.cpp including canonical path resolution with path aliasing Looks Good To Me
MarcZX10 commented 2026-11-22 14:30:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T14:30:04Z.

Review: COMMENTED


Reviewed — comments

The parser and ABI implementation have concrete edge cases that need clarification before I can recommend a formal merge decision.

What I ran

Reviewed head a2e45c2255082ce9ffd5a024bfaf6407348f267f. I read the prepared description, commit list, diff, manifest and review-folder README; targeted source at the pinned head was read with repo_read.py. No build or test command was run. The author reports a hand-built host proof and a passing conventions check; these were not run during this review.

Results

Check Result Note
Source review passed Changed parser, ABI and tests inspected
Build and tests not run Author reports a host proof; not independently checked
Console behavior not run No console verification reported

Findings

Blocking

None verified.

Non-blocking

  • JscConfigFile.cpp:325 — If parsing a predicate fails (for example, processName = "x"), ParseConditionalBlock does not return an error. It falls through to consume {, so malformed predicates can be accepted as a block with a false match. Return an error when ParsePredicate fails, and add a malformed-operator case to the tests.
  • JscConfigFile.cpp:143 — Regex parsing treats the first slash as the delimiter and does not account for escaped slashes. Patterns such as /foo\\/bar/ therefore do not follow normal regex-delimiter semantics. Consider parsing escaped delimiters and test one such pattern.
  • JscConfigFile.cpp:351 — The relative-path length check accounts for the working directory and optional separator, but not the filename length. strncat then silently truncates the path to the fixed buffer while the code reports success. Check the total required length before appending and add a near-limit path test.

Not verified

The changed lines in Export.cpp and InventoryExports.hpp only remove the five old declarations/stubs in the prepared diff; their full files were not read. No upstream source checkout, CMake build, CTest run, or console behavior was independently verified. The host proof and conventions result in the description are author-reported.

Files read: ConfigFileExports.hpp, libSceNKWebKit.hpp, ConfigFileAbi.hpp, JscConfigFile.cpp, tests/JscConfigFile.cpp, and the debt note, along with the prepared review documents. The full text of Export.cpp and InventoryExports.hpp was excluded from the review bundle; their changed hunks were inspected in diff.patch.

To get this to a good state

Nothing is required. Optional points: reject malformed predicates, define escaped slash handling in regex literals, and reject overlong canonical paths rather than silently truncating them.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6012764764 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/25548#pullrequestreview-6012764764). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T14:30:04Z. **Review:** COMMENTED --- # Reviewed — comments The parser and ABI implementation have concrete edge cases that need clarification before I can recommend a formal merge decision. ## What I ran Reviewed head `a2e45c2255082ce9ffd5a024bfaf6407348f267f`. I read the prepared description, commit list, diff, manifest and review-folder README; targeted source at the pinned head was read with `repo_read.py`. No build or test command was run. The author reports a hand-built host proof and a passing conventions check; these were not run during this review. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Changed parser, ABI and tests inspected | | Build and tests | not run | Author reports a host proof; not independently checked | | Console behavior | not run | No console verification reported | ## Findings ### Blocking None verified. ### Non-blocking - `JscConfigFile.cpp:325` — If parsing a predicate fails (for example, `processName = "x"`), `ParseConditionalBlock` does not return an error. It falls through to consume `{`, so malformed predicates can be accepted as a block with a false match. Return an error when `ParsePredicate` fails, and add a malformed-operator case to the tests. - `JscConfigFile.cpp:143` — Regex parsing treats the first slash as the delimiter and does not account for escaped slashes. Patterns such as `/foo\\/bar/` therefore do not follow normal regex-delimiter semantics. Consider parsing escaped delimiters and test one such pattern. - `JscConfigFile.cpp:351` — The relative-path length check accounts for the working directory and optional separator, but not the filename length. `strncat` then silently truncates the path to the fixed buffer while the code reports success. Check the total required length before appending and add a near-limit path test. ## Not verified The changed lines in `Export.cpp` and `InventoryExports.hpp` only remove the five old declarations/stubs in the prepared diff; their full files were not read. No upstream source checkout, CMake build, CTest run, or console behavior was independently verified. The host proof and conventions result in the description are author-reported. Files read: `ConfigFileExports.hpp`, `libSceNKWebKit.hpp`, `ConfigFileAbi.hpp`, `JscConfigFile.cpp`, `tests/JscConfigFile.cpp`, and the debt note, along with the prepared review documents. The full text of `Export.cpp` and `InventoryExports.hpp` was excluded from the review bundle; their changed hunks were inspected in `diff.patch`. ## To get this to a good state Nothing is required. Optional points: reject malformed predicates, define escaped slash handling in regex literals, and reject overlong canonical paths rather than silently truncating them.
throny commented 2026-11-22 16:23:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by throny on 2026-11-22T16:23:42Z.

Review: COMMENTED


Review: ⚠️ faithful port of JSC::ConfigFile, but an invalid =~ pattern aborts the process on Windows

Basis: code read against neonmodder123/PS5-WebKit-11.x@80f77e94c6 ConfigFile.cpp/.h · head a2e45c2255

Checked

  • Layout: two 1025-byte path arrays (2050 bytes, static_asserted), constructor truncation, and the 128-byte name setters all match upstream. Paths go through getcwd_nid_postfix/fopen_nid_postfix, never raw host paths.
  • The grammar matches upstream line for line: comments, jscOptions/logFile, the processName/parentProcessName/build predicates, && chains and nesting. A malformed operator is a parse error in both, so I don't think the "skipped block" divergence raised earlier is real.

Findings

  1. JscConfigFile.cpp:324-332: std::regex throws regex_error from libstdc++-6.dll on Windows, and the prx has no unwind data for that frame, so the catch is never reached. A config with a bad =~ pattern (the test's processName =~ /(/) aborts instead of returning a parse error the way upstream's regcomp failure does. JJenkx reproduced this 3/3 on Windows. A non-throwing matcher is needed: either validate the pattern up front or use an error-code API.
  2. JscConfigFile.cpp:413-416: parse throws for any logFile or non-empty jscOptions, so only empty or fully skipped configs succeed. That is honest, and the debt fragment records it, as it does the unverified HAVE(REGEX_H) on the console. I'm noting it only so a maintainer is aware that the export is counted as implemented.

Suggested action: fix 1, then merge

AI-assisted review (Claude Code) · head a2e45c2255 · base main 23b8772462

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6013248903 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/25548#pullrequestreview-6013248903). Originally posted by [throny](https://github.com/throny) on 2026-11-22T16:23:42Z. **Review:** COMMENTED --- ### Review: ⚠️ faithful port of `JSC::ConfigFile`, but an invalid `=~` pattern aborts the process on Windows **Basis:** code read against `neonmodder123/PS5-WebKit-11.x@80f77e94c6` `ConfigFile.cpp`/`.h` · head `a2e45c2255` **Checked** - Layout: two 1025-byte path arrays (2050 bytes, `static_assert`ed), constructor truncation, and the 128-byte name setters all match upstream. Paths go through `getcwd_nid_postfix`/`fopen_nid_postfix`, never raw host paths. - The grammar matches upstream line for line: comments, `jscOptions`/`logFile`, the `processName`/`parentProcessName`/`build` predicates, `&&` chains and nesting. A malformed operator is a parse error in both, so I don't think the "skipped block" divergence raised earlier is real. **Findings** 1. `JscConfigFile.cpp:324-332`: `std::regex` throws `regex_error` from `libstdc++-6.dll` on Windows, and the prx has no unwind data for that frame, so the `catch` is never reached. A config with a bad `=~` pattern (the test's `processName =~ /(/`) aborts instead of returning a parse error the way upstream's `regcomp` failure does. JJenkx reproduced this 3/3 on Windows. A non-throwing matcher is needed: either validate the pattern up front or use an error-code API. 2. `JscConfigFile.cpp:413-416`: `parse` throws for any `logFile` or non-empty `jscOptions`, so only empty or fully skipped configs succeed. That is honest, and the debt fragment records it, as it does the unverified `HAVE(REGEX_H)` on the console. I'm noting it only so a maintainer is aware that the export is counted as implemented. **Suggested action:** fix 1, then merge <sub>AI-assisted review (Claude Code) · head `a2e45c2255` · base `main` `23b8772462`</sub>
throny commented 2026-11-23 07:00:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by throny on 2026-11-23T07:00:42Z.

Review: APPROVED


Review: ✅ re-review: the Windows abort is the libc exception-delivery bug fixed by #25935, not this PR

Basis: commit read, plus JJenkx's Windows run with #25935 (3/3) · head 6cc898863b

Checked

  • My earlier finding was that the =~ invalid-pattern path aborted on Windows because the regex_error thrown inside libstdc++-6.dll never reached the catch in JscConfigFile.cpp:300. JJenkx traced that to libc's exception delivery, which #25935 fixes, and with it nkwebkit_jscconfigfile passes 3/3 on Windows. The catch here is therefore correct code, and the remedy belongs in libc, not in a different matcher.
  • The new commit 6cc898863b only switches the test fixture to the guest working directory. The ConfigFile source is unchanged, and so is my reading of its layout and grammar against 80f77e94c6.

Findings
none (the earlier note that parse throws for logFile/jscOptions stands, and is recorded in the debt fragment)

Suggested action: merge after #25935 (the Windows test needs it)

AI-assisted review (Claude Code) · head 6cc898863b · base main 23b8772462

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6017620784 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/25548#pullrequestreview-6017620784). Originally posted by [throny](https://github.com/throny) on 2026-11-23T07:00:42Z. **Review:** APPROVED --- ### Review: ✅ re-review: the Windows abort is the libc exception-delivery bug fixed by #25935, not this PR **Basis:** commit read, plus JJenkx's Windows run with #25935 (3/3) · head `6cc898863b` **Checked** - My earlier finding was that the `=~` invalid-pattern path aborted on Windows because the `regex_error` thrown inside `libstdc++-6.dll` never reached the `catch` in `JscConfigFile.cpp:300`. JJenkx traced that to libc's exception delivery, which #25935 fixes, and with it `nkwebkit_jscconfigfile` passes 3/3 on Windows. The `catch` here is therefore correct code, and the remedy belongs in libc, not in a different matcher. - The new commit `6cc898863b` only switches the test fixture to the guest working directory. The `ConfigFile` source is unchanged, and so is my reading of its layout and grammar against `80f77e94c6`. **Findings** none (the earlier note that `parse` throws for `logFile`/`jscOptions` stands, and is recorded in the debt fragment) **Suggested action:** merge after #25935 (the Windows test needs it) <sub>AI-assisted review (Claude Code) · head `6cc898863b` · base `main` `23b8772462`</sub>
MarcZX10 commented 2026-11-23 07:28:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T07:28:15Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

Changes are required before merge: fix the conditional parser so each predicate in an && chain is parsed and evaluated, including when an earlier predicate does not match.

What I ran

  • Read prepared description.md, commits.md, manifest.json, and diff.patch; inspected the changed parser, tests, CMake registration, and nearby export context through the pinned reader.
  • Head reviewed: 6cc898863bca5a7fc6cf5f9ca55a89deef9318a0.
  • No commands or tests were run in this review.

Results

Check Result Note
Source review failed One verified parser defect
Tests not run Host proof and convention check are author-reported
Console behavior not run No console validation reported

Findings

Blocking

  • core/libs/prx/libSceNKWebKit/src/JscConfigFile.cpp:430: A predicate whose syntax parses but whose value does not match sets subNesting to NestedFailedCriteria, then breaks out of the && loop because TryConsume("&&") fails when the scanner is still positioned at the comparison value. For example, processName == "delta" && build == "Release" { ... } leaves the scanner at "delta" and reports a parse error instead of skipping the block. Consume the full predicate value and continue evaluating the chain even after a mismatch; mark the whole block skipped if any predicate fails.

Non-blocking

  • None.

Not verified

  • Full text and changed context for core/libs/prx/libSceNKWebKit/Export.cpp and core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp were excluded from the prepared review folder as too large. The available reader returned the export context around the removed stubs, but the complete files were not reviewed.
  • No full CMake/CTest run or console test was performed; reported host proof and convention-check results were not independently verified.

To get this to a good state

  • Correct conditional-chain parsing and add a regression case with a false first predicate followed by && and a valid block body, then rerun the targeted test.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:6017843402 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/25548#pullrequestreview-6017843402). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-23T07:28:15Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested Changes are required before merge: fix the conditional parser so each predicate in an `&&` chain is parsed and evaluated, including when an earlier predicate does not match. ## What I ran - Read prepared `description.md`, `commits.md`, `manifest.json`, and `diff.patch`; inspected the changed parser, tests, CMake registration, and nearby export context through the pinned reader. - Head reviewed: `6cc898863bca5a7fc6cf5f9ca55a89deef9318a0`. - No commands or tests were run in this review. ## Results | Check | Result | Note | |---|---|---| | Source review | failed | One verified parser defect | | Tests | not run | Host proof and convention check are author-reported | | Console behavior | not run | No console validation reported | ## Findings ### Blocking - `core/libs/prx/libSceNKWebKit/src/JscConfigFile.cpp:430`: A predicate whose syntax parses but whose value does not match sets `subNesting` to `NestedFailedCriteria`, then breaks out of the `&&` loop because `TryConsume("&&")` fails when the scanner is still positioned at the comparison value. For example, `processName == "delta" && build == "Release" { ... }` leaves the scanner at `"delta"` and reports a parse error instead of skipping the block. Consume the full predicate value and continue evaluating the chain even after a mismatch; mark the whole block skipped if any predicate fails. ### Non-blocking - None. ## Not verified - Full text and changed context for `core/libs/prx/libSceNKWebKit/Export.cpp` and `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp` were excluded from the prepared review folder as too large. The available reader returned the export context around the removed stubs, but the complete files were not reviewed. - No full CMake/CTest run or console test was performed; reported host proof and convention-check results were not independently verified. ## To get this to a good state - Correct conditional-chain parsing and add a regression case with a false first predicate followed by `&&` and a valid block body, then rerun the targeted test.
MarcZX10 commented 2026-11-23 09:34:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T09:34:08Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the points below are optional.

What I ran

Reviewed head 62af34c7a1de24fc365eb8390cd3f7bd2f634498 against the prepared diff and inspected targeted source context with repo_read.py. No build or test command was run. The PR description reports a hand-built ARM64 Linux host proof and a passing conventions check; those runs were not independently verified.

Results

Check Result Note
Diff and targeted source review passed Parser, ABI declarations, tests, and build registration inspected
Build and tests not run Full CMake/CTest was not run
Console behavior not run PR description says no console test was performed

Findings

Blocking

None.

Non-blocking

  • TryConsumeString and TryConsumeRegExPattern search only the current 1024-byte scanner buffer for a closing delimiter, so a quoted value or regex spanning a fgets boundary is treated as malformed. Consider preserving scanner state across buffers or explicitly rejecting overlong tokens. (core/libs/prx/libSceNKWebKit/src/JscConfigFile.cpp:234, core/libs/prx/libSceNKWebKit/src/JscConfigFile.cpp:245)

Not verified

  • No local build, CTest, conventions check, or console test was run. Host proof and conventions results are author-reported.
  • Read: core/libs/prx/libSceNKWebKit/include/ConfigFileExports.hpp, core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp, core/libs/prx/libSceNKWebKit/src/ConfigFileAbi.hpp, core/libs/prx/libSceNKWebKit/src/JscConfigFile.cpp, core/libs/prx/libSceNKWebKit/tests/JscConfigFile.cpp, and docs/dev/debt/changes/feat-nkwebkit-jsc-config-file.md; relevant changed hunks in Export.cpp and InventoryExports.hpp; targeted context in CMakeLists.txt and core/libs/prx/libc/src/General.cpp.
  • Excluded from full-file review by bundle rule: core/libs/prx/libSceNKWebKit/Export.cpp and core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp (both too large). The diff hunks for their removed stubs and declarations were inspected. files.json was not available in the prepared review folder; the manifest identifies these exclusions.

To get this to a good state

Nothing is required. Optional: handle quoted strings and regex patterns that cross scanner-buffer boundaries.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6019264166 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/25548#pullrequestreview-6019264166). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-23T09:34:08Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the points below are optional. ## What I ran Reviewed head `62af34c7a1de24fc365eb8390cd3f7bd2f634498` against the prepared diff and inspected targeted source context with `repo_read.py`. No build or test command was run. The PR description reports a hand-built ARM64 Linux host proof and a passing conventions check; those runs were not independently verified. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | Parser, ABI declarations, tests, and build registration inspected | | Build and tests | not run | Full CMake/CTest was not run | | Console behavior | not run | PR description says no console test was performed | ## Findings ### Blocking None. ### Non-blocking - `TryConsumeString` and `TryConsumeRegExPattern` search only the current 1024-byte scanner buffer for a closing delimiter, so a quoted value or regex spanning a `fgets` boundary is treated as malformed. Consider preserving scanner state across buffers or explicitly rejecting overlong tokens. (`core/libs/prx/libSceNKWebKit/src/JscConfigFile.cpp:234`, `core/libs/prx/libSceNKWebKit/src/JscConfigFile.cpp:245`) ## Not verified - No local build, CTest, conventions check, or console test was run. Host proof and conventions results are author-reported. - Read: `core/libs/prx/libSceNKWebKit/include/ConfigFileExports.hpp`, `core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp`, `core/libs/prx/libSceNKWebKit/src/ConfigFileAbi.hpp`, `core/libs/prx/libSceNKWebKit/src/JscConfigFile.cpp`, `core/libs/prx/libSceNKWebKit/tests/JscConfigFile.cpp`, and `docs/dev/debt/changes/feat-nkwebkit-jsc-config-file.md`; relevant changed hunks in `Export.cpp` and `InventoryExports.hpp`; targeted context in `CMakeLists.txt` and `core/libs/prx/libc/src/General.cpp`. - Excluded from full-file review by bundle rule: `core/libs/prx/libSceNKWebKit/Export.cpp` and `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp` (both too large). The diff hunks for their removed stubs and declarations were inspected. `files.json` was not available in the prepared review folder; the manifest identifies these exclusions. ## To get this to a good state Nothing is required. Optional: handle quoted strings and regex patterns that cross scanner-buffer boundaries.
ligmaSec commented 2026-12-03 12:42:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T12:42:52Z.

Review: COMMENTED


Compiled and ran the exact JscConfigFile fixture on Linux with the branch’s changed sources and existing WebKit libraries. The configuration-file parsing and directory-restoration checks passed.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6170026352 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/25548#pullrequestreview-6170026352). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T12:42:52Z. **Review:** COMMENTED --- Compiled and ran the exact `JscConfigFile` fixture on Linux with the branch’s changed sources and existing WebKit libraries. The configuration-file parsing and directory-restoration checks passed. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/25548:upstream-pr/25548'
git switch 'upstream-pr/25548'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/25548'
git switch 'upstream-pr/25548'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/25548'
git switch 'upstream-pr/25548'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/25548'
git switch 'main'
git merge --squash 'upstream-pr/25548'
git switch 'main'
git merge --ff-only 'upstream-pr/25548'
git switch 'main'
git merge 'upstream-pr/25548'
git push origin 'main'
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!25548
No description provided.