docs(libSceAudioOut): count the blocking values passed to sceAudioOut2ContextPush #12698
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12698"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-29T02:55:16Z.
What
Adds one sentence to the technical debt entry for
sceAudioOut2ContextAdvanceandsceAudioOut2ContextPush: in the 39 local titles that callsceAudioOut2ContextPush, its 66 direct call sites passblockingas 0 at 19 sites and as 1 at 43 sites; at 4 sites the value is not constant (one is computed from a comparison, one is set differently on two paths that reach the call). So both values occur. Jump stubs to the function (11) are not counted.The entry then reads (the new part is its last sentence):
Changed:
docs/dev/debt/libSceAudioOut.md, one existing entry extended by one sentence. No code change.Method: for each of the 53 local titles the import table of the title's executable was read, and the direct
callinstructions to the imported function were counted in that executable (static counting only, nothing run on a console); the value of theblockingargument was read from the instructions just before each call and checked by a second, independent count. Per-title results and the counting script are attached to this PR. They contain counts, addresses and classifications only, no game code. Calls through the GOT (call [rip+got]) would not be read; every registry call site of the import in these executables is a stubjmp [rip+got], so there are none.Overlap
Three open PRs change
docs/dev/debt/libSceAudioOut.md, none of them this entry: #12425 changes single lines at 36 and 135, #11762 adds three lines after line 11, and #5021 adds two lines after line 28.git merge-treeof this branch against the heads of #12425 and #11762 is clean. #5021 does not merge cleanly intomainon its own either, with or without this change. Measured on the file sets of all 1393 open PRs (git diff --name-onlyfrom the merge base to each PR head, all refs fetched). Duplicates checked through the pull request API over all pull requests: no open or merged PR counts theblockingvalues ofsceAudioOut2ContextPush.Tested
Documentation only.
tools/check_conventions.py --base upstream/mainpasses; based on currentmain3a2b919816. Not built, not run.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)AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-29T04:28:58Z.
Review: COMMENTED
I checked the attached data and script. I ran nothing on title code: I don't have the 53 executables. I only ran the posted
arg_value()on synthetic input with GNU objdump 2.42 (Ubuntu 24.04, x86_64).What I checked (head
ba998c5558, mainb433c40f2f)git merge-tree --write-tree upstream/maincheck_conventions.py --base upstream/main --headgit diff --check0×19 /1×44 /computed×3, every row's site count = its "Direct calls" column. Matches the summary line and the new sentenceAudioOut2Context.cpp0sites reach code paths the entry already describesarg_value()on synthetic windowsI put each byte sequence right before an
E8call in a fake one-segment ELF and called the posted function unchanged. It is wrong on 16 of 31 cases, and the errors go both ways:callmov esi,1; cdq/mul ecxmov esi,1; pop rsi/movsxd rsi,eax/adc esi,0/bswap esi/rol esi,1/popcnt esi,eaxmov esi,1; rep movsb/lodsbmov esi,1; call f; mov rdi,raxmov sil,1/mov si,1mov esi,1; jne +2; xor esi,esi/jmpover the xorb8 00 00 48 b8 | be 01 …)The reasons: the
writelist has nopop/movsxd/adc/rol/bswap/popcnt/string ops/call,mul|div|cdqcounts as a write for any register, the immediate is accepted forsil/si, and the walk ignores branches. Also, nothing checks that the call offset was decoded as an instruction start.I also compiled 13 small C functions that call
push(ctx, blocking)(constants,x != 0, ternaries, a loop withi & 1, a volatile load, a call between the setup and the push, a global first argument) with gcc 13.3 at -O0/-O1/-O2/-O3/-Os. On those 87 call sites the posted script is right every time. So real compiler output rarely hits the cases above, and I don't expect the 19/44/3 split to change. Still, the 0 and 1 counts depend on this walk. A stricter version (below) is right on all 31 synthetic cases and gives the same answer on all 87 compiled sites. It changes three things: it uses an explicit "first operand is the register" test plus implicit writers, it treats a branch landing between the last write and the call as not constant, and it re-decodes from 64…48 bytes back, reportingambiguousif those starts disagree. If you re-run it over the 66 sites, any change would show up ascomputed/ambiguousrows.replacement for arg_value (same signature)
Two smaller points
computed. In the script,unreadablemeans no write in the window, andcomputedmeans some other write. All 3 sites arecomputed. The comment explains why the sentence says "unreadable", but someone re-running the script will see a category the sentence doesn't use. Maybe "or a computed value (3)".CallSiteResolver.cppL67-104 also records a title's owncall [rip+got](FF 15) as a call site. The script treats each recorded address as a stub and only countsE8/E9 rel32that target it, soFF 15sites are skipped silently. The Limits bullet covers function pointers but not this case. A per-title count ofcallSitesentries that are not PLT stubs, or one more phrase in Limits, would close it.Docs-only change, the numbers match the attachment, and neither gap is likely to change them. This is a comment, not a change request.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-29T07:07:42Z.
Review: APPROVED
Reviewed
f205990ead16296bbc0e41a928565b7d56ab0dd3against3a2b91981651569163768854a1fcdc7193b6667b. The direct-call census is clearly separated from the existing SDL/snapshot/queue implementation and the unverified console semantics. The linked Advance/Push implementation resolves and retains those host restrictions. No actionable finding in the documentation change.Validation: inspected the changed wording and relevant pinned source; relative source links and git diff --check pass. Documentation-only validation: no runtime behavior changed. Author-reported title inventories, console/emulator observations and macOS/physical-GPU measurements were not independently reproduced; this review does not certify those measurements.