feat(libSceNKWebKit): implement WebCore::HTTPHeaderMap #15326

Merged
AlexWhitehouse merged 1 commit from upstream-pr/15326 into main 2026-11-07 04:23:58 +00:00
AlexWhitehouse commented 2026-11-03 00:02:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlexWhitehouse on 2026-11-03T00:02:42Z.


What

Implements 11 libSceNKWebKit WebCore::HTTPHeaderMap exports that threw through NotImplemented_nid_no_patch:

Export NID
_ZN7WebCore13HTTPHeaderMapC1Ev / C2Ev qVrMxeDN6Zs / lsMB2OXXR-Q
_ZN7WebCore13HTTPHeaderMap3addERKN3WTF6StringES4_ +7HpqmfJz48
_ZN7WebCore13HTTPHeaderMap3setERKN3WTF6StringES4_ CUlajtWO-L4
_ZN7WebCore13HTTPHeaderMap6appendERKN3WTF6StringES4_ 17lDGYhSTx4
_ZN7WebCore13HTTPHeaderMap6removeENS_14HTTPHeaderNameE +uk5J35y6WQ
_ZN7WebCore13HTTPHeaderMap6removeERKN3WTF6StringE -LVXigKk--w
_ZNK7WebCore13HTTPHeaderMap3getENS_14HTTPHeaderNameE Zkmt7pm3d5M
_ZNK7WebCore13HTTPHeaderMap8containsENS_14HTTPHeaderNameE oKamLgrFO+k
_ZNK7WebCore13HTTPHeaderMap8containsERKN3WTF6StringE 9w0VG82erX8
_ZN7WebCore20httpHeaderNameStringENS_14HTTPHeaderNameE jajO-tAdNek

They are ported from the PS5 WebKit source the library's debt file already pins, neonmodder123/PS5-WebKit-11.x@80f77e94c63e:

  • Map operations: HTTPHeaderMap.cpp lines 40–265.
    • add joins an existing value with ", ", and set replaces it.
    • append always appends: its uniqueness check is a debug-only ASSERT, so duplicates stay and lookup and removal act on the first match.
    • remove drops the first match, and a missing header reads as the null string.
  • Header names: HTTPHeaderNames.in (95 names) and create-http-header-name-table.
    • The enum is numbered by the generator's sort() of the names, and the table here matches that order.
    • Recognition is ASCII case-insensitive (gperf %ignore-case). A non-ASCII name is an uncommon header.
    • httpHeaderNameString returns ASCIILiteral, a trivial one-pointer object returned in rax.
  • Licence notices: src/HttpHeaderMap.cpp starts with HTTPHeaderMap.cpp's notice, and the names table with HTTPHeaderNames.in's, each byte for byte.

Layout (src/HttpHeaderMapAbi.hpp, pinned with static_asserts): HTTPHeaderMap is 32 bytes.

  • CommonHeadersVector is Vector<CommonHeader, 0, CrashOnOverflow, 6>. The 0 is the inline capacity and the 6 the minimum capacity (Forward.h line 98).
  • With no inline storage, each vector is VectorBufferBase's T* m_buffer; unsigned m_capacity; unsigned m_size; (Vector.h lines 395–397), 16 bytes. The common vector sits at offset 0, the uncommon one at 16.
  • Both entry types are 16 bytes, with the value at offset 8.
  • Growth: buffers grow by WTF's rule, max(requested, minimum capacity, capacity + capacity/4 + 1), with WTF's capacity-overflow limit. They're allocated and freed with the library's existing WTF::fastMalloc/fastFree exports, so guest code that destroys or copies a map inline uses the same allocator.
  • What throws: null objects, null accessed storage, overflowing sizes and a name index outside 0–94.

All of this is in new files. WtfString.cpp and WtfStringAbi.hpp are not touched; the shared edits are limited to removing the stubs and adding the new public header.

HTTPHeaderMap::isolatedCopy stays unimplemented: the inventory symbol has no ref qualifier, while the pinned source declares const & and && overloads. The debt entry says so.

Debt (docs/dev/debt/libSceNKWebKit.md):

  • a new entry records that the layout follows the pinned headers and is unverified against the console module;
  • the ten table rows are removed, and the known-name count goes from 114 to 113 (merges since this PR opened took it from 127 to 114); it is recounted as the throwing Api.hpp declarations outside the table, which reproduces every earlier value of that line;
  • the inventory count is recounted from the table rather than subtracted: on main (cdefa2cf7c) the table lists 6508 rows, of which 6501 still throw (#14387 and #14981 implemented seven without removing their rows), and the prose says 6501; this PR removes 10 throwing rows, so it now says 6491.

Related open PRs: #15214 and #15228 (simnJS) reserve 128 bytes for HTTPHeaderMap in their ResourceRequestBase and ResourceResponseBase layouts, reading the 6 above as inline slots. The derivation is in a comment on #15214. This PR doesn't touch their files, but the two layouts disagree.

Tested

  • nkwebkit_httpheadermap (core/libs/prx/libSceNKWebKit/tests/HttpHeaderMap.cpp, registered by the existing tests/*.cpp glob) covers:
    • every export, and all 95 enum/name pairs both ways;
    • 8-bit and UTF-16 names, ASCII case equivalence, and unknown and non-ASCII names;
    • null versus empty values, set versus add, duplicate append and first-match removal;
    • removal by enum and by string;
    • growth across several reallocations (minimum capacity 6 for common headers);
    • string reference counts, and canary bytes around a 32-byte map object.
  • Linux (Ubuntu 26.04, GCC 15):
    • on unchanged main with only the test added, it fails with _ZN7WebCore13HTTPHeaderMapC1Ev not implemented, and separate probes confirm all 11 exports throw;
    • with this PR (a8b0884e26), all 11 NKWebKit tests pass, including guest_nkwebkit_dates and guest_nkwebkit_numbers.
    • after rebasing onto main (cdefa2cf7c), at 9b7b551bd7 all 33 NKWebKit tests pass, including those added on main since this PR was opened.
  • Windows 11 (MinGW GCC 15.2.0):
    • on main (5cb015caaa) with only the test added, it fails with the same not implemented message, and a probe run reports 11/11 threw;
    • with this PR (a8b0884e26; the final commit only moves the debt entry), all 11 NKWebKit tests pass;
    • the disassembly shows get takes the hidden return pointer in RDI with self in RSI, and httpHeaderNameString returns its pointer in RAX;
    • no compiler warnings in the new files.
  • Mutation checks:
    • swapping the two vectors fails known header classification;
    • joining with "," fails header value mismatch;
    • case-sensitive name matching fails ASCII case equivalence.
  • python3 tools/check_conventions.py --base origin/main: all conventions checks passed. The public-header audit passes, and the new header compiles on its own.
  • python3 tools/pr_overlap.py: no other PR implements these exports. The search hit on #15214 is its use of the type, described above.
    • The inventory count line is shared with about 30 open libSceNKWebKit PRs, as every implementation in this library edits it. Whichever merges second rebases that line.
    • The known-name count line is shared with #15215.
    • #13486 is listed for the same exports only because its stale branch carries the old stubs.

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
  • 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

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5129429160 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15326). Originally posted by [AlexWhitehouse](https://github.com/AlexWhitehouse) on 2026-11-03T00:02:42Z. --- ### What Implements 11 libSceNKWebKit `WebCore::HTTPHeaderMap` exports that threw through `NotImplemented_nid_no_patch`: | Export | NID | |---|---| | `_ZN7WebCore13HTTPHeaderMapC1Ev` / `C2Ev` | `qVrMxeDN6Zs` / `lsMB2OXXR-Q` | | `_ZN7WebCore13HTTPHeaderMap3addERKN3WTF6StringES4_` | `+7HpqmfJz48` | | `_ZN7WebCore13HTTPHeaderMap3setERKN3WTF6StringES4_` | `CUlajtWO-L4` | | `_ZN7WebCore13HTTPHeaderMap6appendERKN3WTF6StringES4_` | `17lDGYhSTx4` | | `_ZN7WebCore13HTTPHeaderMap6removeENS_14HTTPHeaderNameE` | `+uk5J35y6WQ` | | `_ZN7WebCore13HTTPHeaderMap6removeERKN3WTF6StringE` | `-LVXigKk--w` | | `_ZNK7WebCore13HTTPHeaderMap3getENS_14HTTPHeaderNameE` | `Zkmt7pm3d5M` | | `_ZNK7WebCore13HTTPHeaderMap8containsENS_14HTTPHeaderNameE` | `oKamLgrFO+k` | | `_ZNK7WebCore13HTTPHeaderMap8containsERKN3WTF6StringE` | `9w0VG82erX8` | | `_ZN7WebCore20httpHeaderNameStringENS_14HTTPHeaderNameE` | `jajO-tAdNek` | They are ported from the PS5 WebKit source the library's debt file already pins, [`neonmodder123/PS5-WebKit-11.x@80f77e94c63e`](https://github.com/neonmodder123/PS5-WebKit-11.x/tree/80f77e94c63ee7202eec3d4b5b1a021dd89011ba): - **Map operations:** [`HTTPHeaderMap.cpp`](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/network/HTTPHeaderMap.cpp) lines 40–265. - `add` joins an existing value with `", "`, and `set` replaces it. - `append` always appends: its uniqueness check is a debug-only `ASSERT`, so duplicates stay and lookup and removal act on the first match. - `remove` drops the first match, and a missing header reads as the null string. - **Header names:** [`HTTPHeaderNames.in`](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/network/HTTPHeaderNames.in) (95 names) and [`create-http-header-name-table`](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/network/create-http-header-name-table). - The enum is numbered by the generator's `sort()` of the names, and the table here matches that order. - Recognition is ASCII case-insensitive (gperf `%ignore-case`). A non-ASCII name is an uncommon header. - `httpHeaderNameString` returns `ASCIILiteral`, a trivial one-pointer object returned in `rax`. - **Licence notices:** `src/HttpHeaderMap.cpp` starts with `HTTPHeaderMap.cpp`'s notice, and the names table with `HTTPHeaderNames.in`'s, each byte for byte. **Layout** (`src/HttpHeaderMapAbi.hpp`, pinned with `static_assert`s): `HTTPHeaderMap` is 32 bytes. - `CommonHeadersVector` is `Vector<CommonHeader, 0, CrashOnOverflow, 6>`. The 0 is the inline capacity and the 6 the minimum capacity ([`Forward.h`](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/Forward.h#L98) line 98). - With no inline storage, each vector is `VectorBufferBase`'s `T* m_buffer; unsigned m_capacity; unsigned m_size;` ([`Vector.h`](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/Vector.h#L395-L397) lines 395–397), 16 bytes. The common vector sits at offset 0, the uncommon one at 16. - Both entry types are 16 bytes, with the value at offset 8. - **Growth:** buffers grow by WTF's rule, max(requested, minimum capacity, capacity + capacity/4 + 1), with WTF's capacity-overflow limit. They're allocated and freed with the library's existing `WTF::fastMalloc`/`fastFree` exports, so guest code that destroys or copies a map inline uses the same allocator. - **What throws:** null objects, null accessed storage, overflowing sizes and a name index outside 0–94. All of this is in new files. `WtfString.cpp` and `WtfStringAbi.hpp` are not touched; the shared edits are limited to removing the stubs and adding the new public header. `HTTPHeaderMap::isolatedCopy` stays unimplemented: the inventory symbol has no ref qualifier, while the pinned source declares `const &` and `&&` overloads. The debt entry says so. **Debt** (`docs/dev/debt/libSceNKWebKit.md`): - a new entry records that the layout follows the pinned headers and is unverified against the console module; - the ten table rows are removed, and the known-name count goes from 114 to 113 (merges since this PR opened took it from 127 to 114); it is recounted as the throwing `Api.hpp` declarations outside the table, which reproduces every earlier value of that line; - the inventory count is recounted from the table rather than subtracted: on `main` (cdefa2cf7c) the table lists 6508 rows, of which 6501 still throw (#14387 and #14981 implemented seven without removing their rows), and the prose says 6501; this PR removes 10 throwing rows, so it now says 6491. **Related open PRs:** #15214 and #15228 (simnJS) reserve 128 bytes for `HTTPHeaderMap` in their `ResourceRequestBase` and `ResourceResponseBase` layouts, reading the 6 above as inline slots. The derivation is in a comment on #15214. This PR doesn't touch their files, but the two layouts disagree. ### Tested - **`nkwebkit_httpheadermap`** (`core/libs/prx/libSceNKWebKit/tests/HttpHeaderMap.cpp`, registered by the existing `tests/*.cpp` glob) covers: - every export, and all 95 enum/name pairs both ways; - 8-bit and UTF-16 names, ASCII case equivalence, and unknown and non-ASCII names; - null versus empty values, `set` versus `add`, duplicate `append` and first-match removal; - removal by enum and by string; - growth across several reallocations (minimum capacity 6 for common headers); - string reference counts, and canary bytes around a 32-byte map object. - **Linux (Ubuntu 26.04, GCC 15):** - on unchanged `main` with only the test added, it fails with `_ZN7WebCore13HTTPHeaderMapC1Ev not implemented`, and separate probes confirm all 11 exports throw; - with this PR (a8b0884e26), all 11 NKWebKit tests pass, including `guest_nkwebkit_dates` and `guest_nkwebkit_numbers`. - after rebasing onto `main` (cdefa2cf7c), at 9b7b551bd7 all 33 NKWebKit tests pass, including those added on `main` since this PR was opened. - **Windows 11 (MinGW GCC 15.2.0):** - on `main` (5cb015caaa) with only the test added, it fails with the same `not implemented` message, and a probe run reports `11/11 threw`; - with this PR (a8b0884e26; the final commit only moves the debt entry), all 11 NKWebKit tests pass; - the disassembly shows `get` takes the hidden return pointer in RDI with `self` in RSI, and `httpHeaderNameString` returns its pointer in RAX; - no compiler warnings in the new files. - **Mutation checks:** - swapping the two vectors fails `known header classification`; - joining with `","` fails `header value mismatch`; - case-sensitive name matching fails `ASCII case equivalence`. - `python3 tools/check_conventions.py --base origin/main`: all conventions checks passed. The public-header audit passes, and the new header compiles on its own. - **`python3 tools/pr_overlap.py`:** no other PR implements these exports. The search hit on #15214 is its use of the type, described above. - **The inventory count line** is shared with about 30 open libSceNKWebKit PRs, as every implementation in this library edits it. Whichever merges second rebases that line. - **The known-name count line** is shared with #15215. - **#13486** is listed for the same exports only because its stale branch carries the old stubs. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/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 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-11-03 00:16:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T00:16:36Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The uncommon-header comparison distinguishes null and empty names, while the pinned WebKit implementation treats both zero-length names as equal.

What I ran

Reviewed all 10 changed files at head b6ffdb9ebca345a34e741a19a4b019a65369ebda against base 5cb015caaaaf83f8ee431414ee6a457b5b307d49; the exact head merges cleanly into current main. Environment: Debian 12, Linux x86_64, Python 3.11.2, GCC 12.2.0. No build or C++ tests were run.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15326 --output-dir /tmp/anyps5-pr-precheck/15326-session-20261103-followup
git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...b6ffdb9ebca345a34e741a19a4b019a65369ebda
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head b6ffdb9ebca345a34e741a19a4b019a65369ebda --json > /tmp/anyps5-pr-precheck/15326-session-20261103-followup/manual-abi.json
python3 - <<'PY'
import json
p='/tmp/anyps5-pr-precheck/15326-session-20261103-followup/manual-abi.json'
d=json.load(open(p))
print(json.dumps({'status':d['status'],'symbols':len(d['symbols']),'findings':d['findings'],'limitations':d['limitations']},indent=2))
PY
python3 /tmp/anyps5-15326-quality.DmjnAZ/tools/pr_test_quality.py --root /tmp/anyps5-15326-quality.DmjnAZ --json core/libs/prx/libSceNKWebKit/tests/HttpHeaderMap.cpp
git show b6ffdb9ebca345a34e741a19a4b019a65369ebda:core/libs/prx/libSceNKWebKit/CMakeLists.txt | sed -n '49,62p'
python3 - <<'PY'
import re, subprocess
sha='b6ffdb9ebca345a34e741a19a4b019a65369ebda'
text=subprocess.check_output(['git','-C','/marc/AnyPS5','show',f'{sha}:core/libs/prx/libSceNKWebKit/src/HttpHeaderNames.hpp'],text=True)
array=text.split('constexpr std::array<const char*, 95> headerNames {',1)[1].split('};',1)[0]
actual=re.findall(r'"([^"]+)"',array)
lines=open('/tmp/webkit-HTTPHeaderNames.in').read().splitlines()
upstream=sorted(x.strip() for x in lines if x.strip() and not x.strip().startswith('//') and not x.lstrip().startswith('*'))
print(f'upstream_sorted_names={len(upstream)} pr_names={len(actual)} equal={actual==upstream}')
PY

Results

Check Result Note
Diff and conventions passed Exact-head diff and conventions checks passed.
Export audit passed 10,103 symbols scanned; no lexical findings.
Header-name table passed All 95 names match the pinned source's sorted list.
Test registration passed The CMake tests/*.cpp glob registers this test.
Null/empty semantics failed Code and test differ from the pinned WebKit comparison behavior.
Hosted checks not run Six required checks were queued at the final status query.
Build, CTest, negative control not run No build was performed.
Raw check output
| Check | Status | Command / reason |
|---|---|---|
| build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` |
| diff_check | passed | `git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...b6ffdb9ebca345a34e741a19a4b019a65369ebda` |
| conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head b6ffdb9ebca345a34e741a19a4b019a65369ebda --title feat(libSceNKWebKit): implement WebCore::HTTPHeaderMap --body /tmp/anyps5-pr-precheck/15326-session-20261103-followup/pr-body.md` |
| changed_export_abi_audit | failed | `/usr/bin/python3 tools/pr_abi_audit.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head b6ffdb9ebca345a34e741a19a4b019a65369ebda --json` |
| python_syntax | not_applicable | `No changed Python implementation files.` |
| related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` |
| python_test_registration | not_applicable | `No changed test_*.py files.` |
| live_dependency_and_mergeability_check | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 15326 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/15326-session-20261103-followup/stack` |
| build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` |
| test_quality_heuristics | failed | `/usr/bin/python3 /tmp/anyps5-pr-precheck/15326-session-20261103-followup/head-b6ffdb9ebca3-e2bd9a2b/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/15326-session-20261103-followup/head-b6ffdb9ebca3-e2bd9a2b --json core/libs/prx/libSceNKWebKit/Export.cpp core/libs/prx/libSceNKWebKit/include/Api.hpp core/libs/prx/libSceNKWebKit/include/HttpHeaderMapExports.hpp core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp core/libs/prx/libSceNKWebKit/src/HttpHeaderMap.cpp core/libs/prx/libSceNKWebKit/src/HttpHeaderMapAbi.hpp core/libs/prx/libSceNKWebKit/src/HttpHeaderNames.hpp core/libs/prx/libSceNKWebKit/tests/HttpHeaderMap.cpp docs/dev/debt/libSceNKWebKit.md` |
| negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` |
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/15326-session-20261103-followup/head-b6ffdb9ebca3-e2bd9a2b/tools/pr_abi_audit.py': [Errno 2] No such file or directory
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/15326-session-20261103-followup/head-b6ffdb9ebca3-e2bd9a2b/tools/pr_test_quality.py': [Errno 2] No such file or directory
{
  "status": "passed",
  "symbols": 10103,
  "findings": [],
  "limitations": [
    "This lexical audit does not parse C++ fully, prove calling-convention or binary ABI correctness, verify runtime version tables, or replace compilation.",
    "An absent source declaration or explicit alias can be intentional for assembly exports, conditional platform code, or generated interfaces; inspect findings before treating them as defects."
  ]
}
{
  "findings": [
    {
      "path": "core/libs/prx/libSceNKWebKit/tests/HttpHeaderMap.cpp",
      "line": 1,
      "kind": "possible-unregistered-cpp-test",
      "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
    }
  ],
  "negative_control_candidates": [],
  "limits": [
    "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
    "A test that passes against base is not by itself proof that the PR test is inadequate.",
    "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
  ]
}
    file(GLOB nkWebKitTests CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp)
    foreach(testSource ${nkWebKitTests})
        get_filename_component(testName ${testSource} NAME_WE)
        string(TOLOWER ${testName} testName)
        add_test_executable(nkwebkit_${testName}_tests ${testSource})
        target_include_directories(nkwebkit_${testName}_tests PRIVATE ${LIBS_INCLUDE_DIR})
        target_link_libraries(nkwebkit_${testName}_tests PRIVATE libSceNKWebKit libSceJsc libc)
        configure_windows_unwind(nkwebkit_${testName}_tests)
        add_test(NAME nkwebkit_${testName} COMMAND nkwebkit_${testName}_tests)
upstream_sorted_names=95 pr_names=95 equal=True
All conventions checks passed.

Negative control

Assertion Change to code under test Did the new test fail?
Null and empty uncommon names compare as WebKit does. None; the C++ test requires a built exact-head binary. Not run.

Findings

Blocking

  • Equal returns false when exactly one key has a null StringImpl, even when both keys have length zero. The pinned WebKit equalIgnoringASCIICaseCommon compares lengths and then characters; for two empty views, the zero-iteration character comparison returns true. setUncommonHeader uses that comparison, so setting a null name and then an empty name updates the same first entry in WebKit, while this implementation creates two entries. The new test asserts that the keys coexist. Please match the source comparison and change the test to cover null/empty lookup, update, and removal consistently.

    bool Equal(const String& a, const String& b) {
        const auto length = Length(a);
        if (length != Length(b)) return false;
        for (unsigned i = 0; i < length; ++i)
            if (Fold(Character(a, i)) != Fold(Character(b, i))) return false;
        return true;
    }
    

Non-blocking

None.

Sources

Not verified

No build, CTest, runtime behavior, Linux/Windows comparison, console layout, allocation-failure test, or negative control was run. The six hosted checks were still queued at the final status query. The precheck's ABI and test-quality steps could not find their optional scripts in its isolated snapshot; both were run manually against the exact PR commits, and the test-quality warning was checked against the exact-head CMake glob.

To get this to a good state

Make the null-versus-empty comparison and regression test match the pinned WebKit behavior. On the new head, I will rerun the no-build precheck, ABI audit, test-quality inspection, and hosted-check review; C++ runtime tests still need an exact-head build.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5745289165 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15326#pullrequestreview-5745289165). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-03T00:16:36Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The uncommon-header comparison distinguishes null and empty names, while the pinned WebKit implementation treats both zero-length names as equal. ## What I ran Reviewed all 10 changed files at head `b6ffdb9ebca345a34e741a19a4b019a65369ebda` against base `5cb015caaaaf83f8ee431414ee6a457b5b307d49`; the exact head merges cleanly into current `main`. Environment: Debian 12, Linux x86_64, Python 3.11.2, GCC 12.2.0. No build or C++ tests were run. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15326 --output-dir /tmp/anyps5-pr-precheck/15326-session-20261103-followup git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...b6ffdb9ebca345a34e741a19a4b019a65369ebda python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head b6ffdb9ebca345a34e741a19a4b019a65369ebda --json > /tmp/anyps5-pr-precheck/15326-session-20261103-followup/manual-abi.json python3 - <<'PY' import json p='/tmp/anyps5-pr-precheck/15326-session-20261103-followup/manual-abi.json' d=json.load(open(p)) print(json.dumps({'status':d['status'],'symbols':len(d['symbols']),'findings':d['findings'],'limitations':d['limitations']},indent=2)) PY python3 /tmp/anyps5-15326-quality.DmjnAZ/tools/pr_test_quality.py --root /tmp/anyps5-15326-quality.DmjnAZ --json core/libs/prx/libSceNKWebKit/tests/HttpHeaderMap.cpp git show b6ffdb9ebca345a34e741a19a4b019a65369ebda:core/libs/prx/libSceNKWebKit/CMakeLists.txt | sed -n '49,62p' python3 - <<'PY' import re, subprocess sha='b6ffdb9ebca345a34e741a19a4b019a65369ebda' text=subprocess.check_output(['git','-C','/marc/AnyPS5','show',f'{sha}:core/libs/prx/libSceNKWebKit/src/HttpHeaderNames.hpp'],text=True) array=text.split('constexpr std::array<const char*, 95> headerNames {',1)[1].split('};',1)[0] actual=re.findall(r'"([^"]+)"',array) lines=open('/tmp/webkit-HTTPHeaderNames.in').read().splitlines() upstream=sorted(x.strip() for x in lines if x.strip() and not x.strip().startswith('//') and not x.lstrip().startswith('*')) print(f'upstream_sorted_names={len(upstream)} pr_names={len(actual)} equal={actual==upstream}') PY ``` ## Results | Check | Result | Note | |---|---|---| | Diff and conventions | passed | Exact-head diff and conventions checks passed. | | Export audit | passed | 10,103 symbols scanned; no lexical findings. | | Header-name table | passed | All 95 names match the pinned source's sorted list. | | Test registration | passed | The CMake `tests/*.cpp` glob registers this test. | | Null/empty semantics | failed | Code and test differ from the pinned WebKit comparison behavior. | | Hosted checks | not run | Six required checks were queued at the final status query. | | Build, CTest, negative control | not run | No build was performed. | <details> <summary>Raw check output</summary> ```text | Check | Status | Command / reason | |---|---|---| | build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` | | diff_check | passed | `git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...b6ffdb9ebca345a34e741a19a4b019a65369ebda` | | conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head b6ffdb9ebca345a34e741a19a4b019a65369ebda --title feat(libSceNKWebKit): implement WebCore::HTTPHeaderMap --body /tmp/anyps5-pr-precheck/15326-session-20261103-followup/pr-body.md` | | changed_export_abi_audit | failed | `/usr/bin/python3 tools/pr_abi_audit.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head b6ffdb9ebca345a34e741a19a4b019a65369ebda --json` | | python_syntax | not_applicable | `No changed Python implementation files.` | | related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` | | python_test_registration | not_applicable | `No changed test_*.py files.` | | live_dependency_and_mergeability_check | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 15326 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/15326-session-20261103-followup/stack` | | build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` | | test_quality_heuristics | failed | `/usr/bin/python3 /tmp/anyps5-pr-precheck/15326-session-20261103-followup/head-b6ffdb9ebca3-e2bd9a2b/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/15326-session-20261103-followup/head-b6ffdb9ebca3-e2bd9a2b --json core/libs/prx/libSceNKWebKit/Export.cpp core/libs/prx/libSceNKWebKit/include/Api.hpp core/libs/prx/libSceNKWebKit/include/HttpHeaderMapExports.hpp core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp core/libs/prx/libSceNKWebKit/src/HttpHeaderMap.cpp core/libs/prx/libSceNKWebKit/src/HttpHeaderMapAbi.hpp core/libs/prx/libSceNKWebKit/src/HttpHeaderNames.hpp core/libs/prx/libSceNKWebKit/tests/HttpHeaderMap.cpp docs/dev/debt/libSceNKWebKit.md` | | negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` | ``` ```text /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/15326-session-20261103-followup/head-b6ffdb9ebca3-e2bd9a2b/tools/pr_abi_audit.py': [Errno 2] No such file or directory /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/15326-session-20261103-followup/head-b6ffdb9ebca3-e2bd9a2b/tools/pr_test_quality.py': [Errno 2] No such file or directory ``` ```text { "status": "passed", "symbols": 10103, "findings": [], "limitations": [ "This lexical audit does not parse C++ fully, prove calling-convention or binary ABI correctness, verify runtime version tables, or replace compilation.", "An absent source declaration or explicit alias can be intentional for assembly exports, conditional platform code, or generated interfaces; inspect findings before treating them as defects." ] } ``` ```json { "findings": [ { "path": "core/libs/prx/libSceNKWebKit/tests/HttpHeaderMap.cpp", "line": 1, "kind": "possible-unregistered-cpp-test", "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage." } ], "negative_control_candidates": [], "limits": [ "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.", "A test that passes against base is not by itself proof that the PR test is inadequate.", "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error." ] } ``` ```text file(GLOB nkWebKitTests CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp) foreach(testSource ${nkWebKitTests}) get_filename_component(testName ${testSource} NAME_WE) string(TOLOWER ${testName} testName) add_test_executable(nkwebkit_${testName}_tests ${testSource}) target_include_directories(nkwebkit_${testName}_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(nkwebkit_${testName}_tests PRIVATE libSceNKWebKit libSceJsc libc) configure_windows_unwind(nkwebkit_${testName}_tests) add_test(NAME nkwebkit_${testName} COMMAND nkwebkit_${testName}_tests) ``` ```text upstream_sorted_names=95 pr_names=95 equal=True ``` ```text All conventions checks passed. ``` </details> ## Negative control | Assertion | Change to code under test | Did the new test fail? | |---|---|---| | Null and empty uncommon names compare as WebKit does. | None; the C++ test requires a built exact-head binary. | Not run. | ## Findings ### Blocking - `Equal` returns false when exactly one key has a null `StringImpl`, even when both keys have length zero. The pinned WebKit `equalIgnoringASCIICaseCommon` compares lengths and then characters; for two empty views, the zero-iteration character comparison returns true. `setUncommonHeader` uses that comparison, so setting a null name and then an empty name updates the same first entry in WebKit, while this implementation creates two entries. The new test asserts that the keys coexist. Please match the source comparison and change the test to cover null/empty lookup, update, and removal consistently. ```suggestion bool Equal(const String& a, const String& b) { const auto length = Length(a); if (length != Length(b)) return false; for (unsigned i = 0; i < length; ++i) if (Fold(Character(a, i)) != Fold(Character(b, i))) return false; return true; } ``` ### Non-blocking None. ## Sources - [PR comparison implementation](https://github.com/boykopovar/AnyPS5/blob/b6ffdb9ebca345a34e741a19a4b019a65369ebda/core/libs/prx/libSceNKWebKit/src/HttpHeaderMap.cpp#L73-L80) - [PR test asserting null and empty names coexist](https://github.com/boykopovar/AnyPS5/blob/b6ffdb9ebca345a34e741a19a4b019a65369ebda/core/libs/prx/libSceNKWebKit/tests/HttpHeaderMap.cpp#L435-L443) - [Pinned WebKit StringView conversion and null handling](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/text/StringView.h#L423-L446) - [Pinned WebKit case-insensitive comparison](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/text/StringCommon.h#L367-L384) - [Pinned WebKit uncommon-header update uses that comparison](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/network/HTTPHeaderMap.cpp#L116-L130) ## Not verified No build, CTest, runtime behavior, Linux/Windows comparison, console layout, allocation-failure test, or negative control was run. The six hosted checks were still queued at the final status query. The precheck's ABI and test-quality steps could not find their optional scripts in its isolated snapshot; both were run manually against the exact PR commits, and the test-quality warning was checked against the exact-head CMake glob. ## To get this to a good state Make the null-versus-empty comparison and regression test match the pinned WebKit behavior. On the new head, I will rerun the no-build precheck, ABI audit, test-quality inspection, and hosted-check review; C++ runtime tests still need an exact-head build.
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!15326
No description provided.