Skip to content

docs(libkernel): name what the emulators do for the size and flags of sceKernelVirtualQuery - #13995

Merged
adriadam10 merged 2 commits into
boykopovar:mainfrom
xXPBSXx:docs/libkernel-virtualquery-size
Nov 5, 2026
Merged

adriadam10 merged 2 commits into
boykopovar:mainfrom
xXPBSXx:docs/libkernel-virtualquery-size

Conversation

@xXPBSXx

@xXPBSXx xXPBSXx commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds one entry to the libkernel technical debt: sceKernelVirtualQuery accepts an info_size larger than the 72-byte record, writes only the record and reads only bit 0 of flags, and this was not measured on a console. KytyPS5 fails an info_size other than the record size and flags other than 0 and 1 with EINVAL, fpPS4 returns EFAULT from _sys_virtual_query for an info_size other than the record size, and shadPS4 checks neither. The entry does not say which behaviour is right and no code or test changes.

Tested

Documentation only. tools/check_conventions.py --base upstream/main passes. Based on main 73f4f7e06e; the follow-up head b857d94cbe merges with main 474030e584 without a conflict (checked 2026-10-31 17:13 UTC). I read our sceKernelVirtualQuery in Export.cpp and the three emulators at the commits named in the entry (KytyPS5 5e837a9beac82c031868eaad9348d6a48245fb99, shadPS4 0614ce324be092791b758d79f93d9f1ca5b10a81, fpPS4 04cefd43e6fddd1ab033e7980cd356d14c964905). Not run: a build or a test, because nothing but the debt file changes.

Overlap

Checked on 2026-10-31 against main 73f4f7e06e4f210a8c6570e335fd654dc0a86134 (1589 open pull requests, listed at 11:58 UTC; the merge checks ran from 13:50 UTC to 13:59 UTC). I took the changed files of each from git diff --name-only against its merge base (one ref, #13454, could not be fetched; the GitHub file list shows it does not change docs/dev/debt/libkernel.md). 101 of them change that file. git merge-tree of this head with each of the 101 and with #13866: 42 conflict, and every one of the 42 also conflicts with main on its own, so none conflicts because of this entry. I placed the line three entries after the sceKernelVirtualQuery entry because directly after or before it, it conflicted with #11625 and #13896, which each change a nearby line. Checked once more on 2026-10-31 at 14:37 UTC against main 73f4f7e06e: of the 71 pull requests opened since 11:55 UTC, three change that file (#13950, #13953, #13964) and none of them conflicts with this entry.

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

AI-assisted (Claude Code).

🤖 Generated with Claude Code

… sceKernelVirtualQuery

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

The new debt entry clearly separates AnyPS5's current behavior from emulator references and labels console semantics as unmeasured.

What I ran

Reviewed head f5a60e25c16a4e5872ca5dd8045f4800a036c43d against base 73f4f7e06e4f210a8c6570e335fd654dc0a86134; no build or merge-preview was run. The change only adds one documentation line.

git diff --check 73f4f7e06e4f210a8c6570e335fd654dc0a86134...f5a60e25c16a4e5872ca5dd8045f4800a036c43d
python3 tools/check_conventions.py --base 73f4f7e06e4f210a8c6570e335fd654dc0a86134 --head f5a60e25c16a4e5872ca5dd8045f4800a036c43d

Results

Check Result
Diff check Passed.
Conventions and PR template Passed.
Hosted eligibility, intake, and labels Passed.
Build/tests Not applicable to the documentation-only change; not run.
Unedited diff-check output
Unedited conventions output
All conventions checks passed.

Sources

Not verified

No console behavior was measured; the PR explicitly marks it as unknown. No build or tests were run because the PR changes documentation only.

@github-actions github-actions Bot added the docs label Oct 31, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — evidence clarification requested

The host behavior and KytyPS5 comparison are supported, but the precise fpPS4 EFAULT claim is not established by the pinned source cited in the entry, so I am withholding approval pending clarification.

What I ran

Reviewed head f5a60e25c16a4e5872ca5dd8045f4800a036c43d against base 73f4f7e06e4f210a8c6570e335fd654dc0a86134. The individual merge preview against current main 474030e58424fefdb65e5df9f3820810fbb4553c was clean. Environment: Linux x86_64, Python 3.11.2, Git 2.39.5; no compiler was used.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13995
git diff --check 73f4f7e06e4f210a8c6570e335fd654dc0a86134...f5a60e25c16a4e5872ca5dd8045f4800a036c43d
python3 tools/pr_stack_check.py 13995 --repo boykopovar/AnyPS5

I inspected the changed debt entry, the current sceKernelVirtualQuery implementation, and the KytyPS5, shadPS4, and fpPS4 code at the commits named in the PR.

Results

Check Result
Diff whitespace Passed
Repository conventions and PR template Passed
Individual merge preview against current main Clean
Hosted conventions, eligibility, intake, labels Passed
Hosted build/test jobs Skipped by CI for this documentation-only change
Test-quality helper Could not execute because it was absent from the isolated PR snapshot; not applicable to this change
Unedited check output

Diff check exited 0 with no output.

Conventions:

All conventions checks passed.

Merge preview:

- PR #13995: **clean** against current base; head `f5a60e25c16a4e5872ca5dd8045f4800a036c43d`; changed paths: none reported

No declared PR dependencies were found in the target PR chain.

The test-quality helper could not be found in the isolated snapshot:

/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13995-f5a60e25c16a/head-f5a60e25c16a-24490ba4/tools/pr_test_quality.py': [Errno 2] No such file or directory

Hosted checks: conventions, eligibility, intake, and labels passed; Linux, Windows, relinker, relinker-asan, register-context, and write-watch were skipped.

Findings

Blocking

None established.

Non-blocking

The pinned fpPS4 implementation delegates to _sys_virtual_query and maps the result with px2sce; the cited file does not show that an info_size mismatch returns EFAULT. Please link the source that establishes that result or narrow the sentence to say the exact mismatch behavior is not verified.

I also could not reproduce the “39 of the 53 local titles” count from tracked files in this checkout.

Sources

Not verified

No build, test, or console run was applicable or performed. The local-title count was not independently reproduced, and the exact fpPS4 size-mismatch result remains unverified from the cited code.

To get this to a good state

Clarify the fpPS4 EFAULT source or revise that claim; I will reassess the updated head before approving.

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 4630 docs/dev/debt/libkernel.md
PR 5021 docs/dev/debt/libkernel.md
PR 6740 docs/dev/debt/libkernel.md
PR 6936 docs/dev/debt/libkernel.md
PR 7088 docs/dev/debt/libkernel.md
PR 7105 docs/dev/debt/libkernel.md
PR 7121 docs/dev/debt/libkernel.md
PR 7135 docs/dev/debt/libkernel.md
PR 7149 docs/dev/debt/libkernel.md
PR 7192 docs/dev/debt/libkernel.md
PR 7447 docs/dev/debt/libkernel.md
PR 7464 docs/dev/debt/libkernel.md
PR 7804 docs/dev/debt/libkernel.md
PR 9156 docs/dev/debt/libkernel.md
PR 9199 docs/dev/debt/libkernel.md
PR 9293 docs/dev/debt/libkernel.md
PR 9297 docs/dev/debt/libkernel.md
PR 9302 docs/dev/debt/libkernel.md
PR 9389 docs/dev/debt/libkernel.md
PR 9557 docs/dev/debt/libkernel.md
PR 9566 docs/dev/debt/libkernel.md
PR 9843 docs/dev/debt/libkernel.md
PR 9938 docs/dev/debt/libkernel.md
PR 10025 docs/dev/debt/libkernel.md
PR 10319 docs/dev/debt/libkernel.md
PR 10442 docs/dev/debt/libkernel.md
PR 11896 docs/dev/debt/libkernel.md
PR 11939 docs/dev/debt/libkernel.md
PR 12104 docs/dev/debt/libkernel.md
PR 12560 docs/dev/debt/libkernel.md
PR 12682 docs/dev/debt/libkernel.md
PR 12688 docs/dev/debt/libkernel.md
PR 12700 docs/dev/debt/libkernel.md
PR 12965 docs/dev/debt/libkernel.md
PR 12970 docs/dev/debt/libkernel.md
PR 13560 docs/dev/debt/libkernel.md
PR 14103 docs/dev/debt/libkernel.md
PR 14128 docs/dev/debt/libkernel.md
PR 14212 docs/dev/debt/libkernel.md
PR 14264 docs/dev/debt/libkernel.md
PR 14310 docs/dev/debt/libkernel.md
PR 14832 docs/dev/debt/libkernel.md
PR 14854 docs/dev/debt/libkernel.md
PR 14886 docs/dev/debt/libkernel.md
PR 14894 docs/dev/debt/libkernel.md

…ize and drop the title count

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@xXPBSXx

xXPBSXx commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for checking both points.

fpPS4: the EFAULT comes from _sys_virtual_query itself, which ps4_sceKernelVirtualQuery calls. It sets Result:=EFAULT and leaves early for a nil info and for an infoSize that differs from the record size (L1059-L1062). The wrapper at L1528-L1541 returns px2sce(Result), and px2sce subtracts 0x7ffe0000 (sys/sys_kernel.pas), which makes 14 the console code 0x8002000e. The entry now links those lines and says so.

Title count: the 39 came from the import tables of a set of 53 local titles that is not in the repository, so a reader cannot check it. I removed that sentence from the entry and from the description rather than keep a number nobody else can reproduce.

AI-assisted (Claude Code).

@adriadam10 adriadam10 self-assigned this Nov 5, 2026
@adriadam10
adriadam10 merged commit 0540ef0 into boykopovar:main Nov 5, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants