Repository navigation
feat(tools): inspect SELF header metadata without conversion - #13302
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The exact-head SELF inspector is read-only, reuses the existing parser, reports the documented metadata limits, and its focused tests pass.
What I ran
- Reviewed head
ab1efd11f8ecb739a43cb3965ee8e96a8efdcf1cagainst currentmain42d009f5f37c8f388b01fbfe38d2e704c792c46f. - Merge preview was clean: tree
c6c18c213719d66d080333cd8c5b8d24f5626933. - Environment: Debian Linux, Python 3.11.2. The test ran in an isolated detached worktree at the PR head. I did not build or configure AnyPS5.
- Commands:
git merge-tree --write-tree 42d009f5f37c8f388b01fbfe38d2e704c792c46f ab1efd11f8ecb739a43cb3965ee8e96a8efdcf1c
python3 -m unittest tools.tests.test_inspect_self
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13302Results
| Check | Result |
|---|---|
| Merge preview | Pass; clean tree c6c18c213719d66d080333cd8c5b8d24f5626933. |
| Focused Python tests | Pass; 2 tests. |
| Precheck | Syntax, unit tests, Python test registration, conventions, diff check, and live mergeability passed. Its test-quality heuristic could not run because tools/pr_test_quality.py is absent from the isolated PR snapshot. |
| Hosted checks | Labels, conventions, eligibility, and intake were queued at the last snapshot; I did not treat them as passed. |
Unedited test output
..
----------------------------------------------------------------------
Ran 2 tests in 0.231s
OK
Findings
Blocking
None found in the reviewed head.
Non-blocking
The PR’s reported CTest registration was statically checked by the precheck, but I did not configure CMake or run CTest. The author-reported integration build and mutation control were not independently reproduced.
Sources
Not verified
I did not configure or build the CMake project, run CTest, or independently reproduce the reported mutation control.
|
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.
|
|
Checked that the imported helpers exist in |
What
Adds inspect_self.py to report SELF record metadata and original inner ELF program headers as JSON without unwrapping or writing an output ELF.
Implementation basis: Uses unwrap_self's existing record/ELF parsers, minimum header area and recognized magic values. A constructed ELF64/SELF fixture fixes offsets and sizes independently, includes an intentionally stale original ELF offset, and verifies read-only behavior and clean malformed-input errors.
Known limits: Metadata inspection is not conversion validation, segment placement, decryption, entropy checking or an execution check. Original ELF offsets can be stale inside SELF. JSON consumers must preserve integer precision for ELF64 addresses and offsets. The parser's existing scope and limits remain.
Source/schema: tools/inspect_self.py tools/unwrap_self.py
Exact topic head
ab1efd11f8ecb739a43cb3965ee8e96a8efdcf1cis one independent commit on main51c31ea17e9f66cb36fe9655ec31c81610bfcfc9. The current-main repository overlap checker against51c31ea17e9f66cb36fe9655ec31c81610bfcfc9reported no confirmed overlap. It could not finish comparisons for these older PRs already conflicting with main: #674, #1835, #3786, #5021, #7642, #9539, #10897, #12862. Their shared-file diffs were reviewed separately. 7 scoped file changes projected onto main and then combined with this topic without a new conflict; 1 peer file changes already conflict with main and are not claimed automatically mergeable. They do not provide this command or test matrix. Registration uses a separate target/name and there is no landing-order dependency. Changes to shared registration before landing need a refreshed merge/test check. Depends on: none. The twenty current topic heads are also merged into tested integrationcedab5157a32822332671c90812c6780d05157e8.Tested
Topic head:
ab1efd11f8ecb739a43cb3965ee8e96a8efdcf1c. Combined integration:cedab5157a32822332671c90812c6780d05157e8, based on main51c31ea17e9f66cb36fe9655ec31c81610bfcfc9. Ubuntu/WSL GCC 15.2, CMake 4.2.3, Python 3.14.4; Windows MinGW GCC 15.2, CMake 4.3.1, Python 3.14.3.python tools/tests/test_inspect_self.py: 2 tests passed on each platform, no skips. A mutation in the actual new tool was rejected by the fixture.Registered CTest
tools_self_inspectpassed on Linux and Windows as part of the filtered twenty-topic run:ctest --test-dir <build> -R <20-topic-pattern> -j 8 -V --output-on-failure, 20/20 passed on each platform, zero skips.cmake --build <linux-full-build> --parallel 8: complete default Linux product build passed. Windows used the full configuration and built the sixteen affected libc test targets plus relinker with--parallel 8; a complete default Windows build is not claimed. Conventions, whitespace, script registration and the public-header declaration/umbrella audit passed. No PS5, title or GPU validation run is claimed. macOS, WASM execution and hosted full-build CI are not reported as passed.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)