Repository navigation
feat(libSceNKWebKit): implement WTF::BitVector::dump and WTF::Thread::dump - #24901
XFlawless1 wants to merge 1 commit into
Conversation
…:dump Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 3e4f1f3abb:
- Conventions:
tools/check_conventions.pypassed. - Build:
nkwebkit_wtfobjectdumps_testsbuilt cleanly. - CTest (
nkwebkit_wtfobjectdumps):1/1 Test #4893: nkwebkit_wtfobjectdumps .......... Passed 0.01 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/WtfObjectDumps.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass. - Code reading:
- Verified that WTF::BitVector::dump and WTF::Thread::dump in core/libs/prx/libSceNKWebKit/src/WtfObjectDumps.cpp match upstream WebKit dump logic (one begin/printf/end per bit for BitVector, and begin/printf Thread:/printf %p/end for Thread).
- Verified null checks on
selfandout(includingout->vtable) throw std::invalid_argument before dereferencing, in core/libs/prx/libSceNKWebKit/src/WtfObjectDumps.cpp:92-140. - Verified inline vs out-of-line BitVector handling: inline vector uses MaxInlineBits (63 bits) and bit shifts on bitsOrPointer, while out-of-line bits are dereferenced after shifting bitsOrPointer << 1 in accordance with WtfBitVector layout conventions.
- Verified sentinel checks: empty (0) and deleted (1) BitVector sentinels are explicitly checked in OutOfLine() and throw std::invalid_argument, matching documented debt behavior.
- Verified AGENTS.md compliance: export declarations in InventoryExports.hpp and Export.cpp cleanly removed, added to WtfObjectDumpExports.hpp, and debt changes properly tracked in docs/dev/debt/changes/feat-nkwebkit-wtf-bitvector-thread-dumps.md.
- Verified cross-platform ABI handling: sysv va_list branching for Windows vs Linux in ObjectDumpPrintf_nid_no_patch is correctly preserved.
Looks Good To Me
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
Nothing blocks this change; the review covered its implementation and tests, but was not complete enough to justify approval because two changed export files were not available to read.
What I ran
Reviewed head 3e4f1f3abb7255063574abaf21cca8c2e205fe7f using the prepared diff and repo_read.py. No test or build commands were run; test results below are author-reported.
Results
| Check | Result | Note |
|---|---|---|
| Implementation and tests | passed | Reviewed included changed files |
| Export wiring | not run | Two changed files were excluded |
| Tests and build | not run | Results supplied by author only |
| Console behavior | not run | No console comparison reported |
Findings
Blocking
None identified in the code read.
Non-blocking
None.
Not verified
Export.cpp and include/InventoryExports.hpp were excluded because they were too large for the review folder; their full text and the wider export wiring were not inspected. No tests or build were run by this review, and console behavior was not confirmed. The author reports passing Windows 11 / MinGW GCC 15.2 tests and conventions checks, which this review did not reproduce. Read: include/WtfObjectDumpExports.hpp, libSceNKWebKit.hpp, src/WtfObjectDumps.cpp, tests/WtfObjectDumps.cpp, and docs/dev/debt/changes/feat-nkwebkit-wtf-bitvector-thread-dumps.md. Excluded: Export.cpp and include/InventoryExports.hpp.
To get this to a good state
Nothing is required.
Progress report (fb8cc51 → 3e4f1f3)📈 System libraries: 45.06% (+0.01%, +2 implemented functions) ✅ 2 implemented
Changed libraries (implemented exports)
|
|
Independent native Windows BitVector and thread diagnostics check with MSYS2 UCRT64 GCC 16.2 and Ninja. I applied the WebKit change from AI-assisted: yes (OpenAI Codex). |
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
This passed review on 3e4f1f3, but it now conflicts with main in InventoryExports.hpp. Please merge main into the branch and push; it goes back to the merge queue on the new head. |
ligmaSec
left a comment
There was a problem hiding this comment.
Built the branch’s changed sources and ran WtfObjectDumps on Linux against the existing runtime libraries. The test run passed and covered the inline BitVector output and Thread debug stream callbacks.
AI-assisted: yes.
What
Implements two
WTFPrintStreamdumps that were throwing stubs:WTF::BitVector::dump(PrintStream&) constsize():out.print(get(i) ? "1" : "-"), i.e. onebegin,printf("%s", …),endper bitWTF::Thread::dump(PrintStream&) constout.print("Thread:", RawPointer(this)):begin,printf("%s", "Thread:"),printf("%p", this),endBitVectoris the 8-bytebitsOrPointerofWtfBitVector.hpp, read the wayWtfBitVector.cppalready does: inline when the top bit is set (63 bits), otherwiseOutOfLineBitsatbitsOrPointer << 1with its word count roundednumBitsand the words after it.size()is 63 inline andnumBitsout of line, so an out-of-line vector prints every bit of its last word, as upstream does. An empty (0) or deleted (1) hash-tableBitVectorhas no bits to read (upstream would dereference a null pointer); it throwsstd::invalid_argument.Thread::dumponly printsthis, soThreadstays an opaque type.PrintStreamis the guest object ofWtfDumpStreamAbi.hpp, called through itsvprintf,beginandendslots asWtfTimeDump.cppdoes. Nullthisor stream throws.The code is in new files (
src/WtfObjectDumps.cpp,include/WtfObjectDumpExports.hpp).Tested
Windows 11, MinGW GCC 15.2, Release.
nkwebkit_wtfobjectdumpspasses, using a fake guest stream that logs eachvprintf(with its format),beginandend:0x5(1-1then 60-), all 63 bits set, and a mixed pattern, each 63printgroups;Thread::dumpprintsThread:and the object's address as formatted by this project'ssnprintf("%p"), in onebegin/end, and does not touch the object;BitVectorvalues, nullthisand null streams throw without writing anything.1and-; using 64 inline bits.nkwebkit_wtfbitvectorstill passes.main, all 182nkwebkit_*tests pass, as do the 15registration|conventions_pr_template|pr_overlap_exports|conventions_unknown_nidstests.python tools/check_conventions.py --base origin/mainandpython tools/debt_fold.py --checkpass.Not tested on a console.
Overlap (
python tools/pr_overlap.py --namesand--branch feat/nkwebkit-wtf-bitvector-thread-dumps):URL::dump, also mine) delete stubs next to these inExport.cppandInventoryExports.hpp, so whichever merges second gets a textual conflict there; the resolution keeps all deletions.mainand shareExport.cpp,InventoryExports.hpporlibSceNKWebKit.hpp; the--namessearch covers every open PR's changes and finds these exports only in refactor: split large emulator libraries into small-size libraries #24322.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