Repository navigation
fix(tools): pass every replay argument explicitly - #21326
oneandonlydean merged 2 commits into
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The replay now supplies deterministic zero values for stack arguments omitted from recordings, and the affected known-result rows reflect the resulting packet differences.
What I ran
Reviewed head 8bfec74aac5e0299081d3136c3d96c86ef2a574e. I read review/description.md, review/commits.md, review/manifest.json, review/diff.patch, and the full changed files tools/library-oracle/replay.cpp and tools/library-oracle/known.tsv. No tests or build commands were run.
Results
| Check | Result | Note |
|---|---|---|
| Diff and changed files | passed | Both changed files were read. |
| Tests and build | not run | No independent test run. |
| Description claims | not verified | Reported commands and measurements were not rerun. |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author-reported replay summaries, test results, conventions checks, and overlap analysis were not independently verified. No other files were changed or excluded according to the manifest.
To get this to a good state
Nothing is required.
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
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.
|
The replay called each export through an eight-argument function pointer, so an export with more parameters read the rest from the caller stack and the same tree produced different packets depending on the process environment: sceAgcDcbCopyData saw 0x78, 0xc9 and 1 in its write-confirm slot across three invocations of one binary, which flipped twelve known entries between throw and diff. Declare sixteen parameters and pass zeros for the ten the recording does not supply. The twelve CopyData and DmaData cases now encode deterministically, and their known.tsv rows record the packet difference in the fields the recording never carries. Measured on e04bd77 with freshly built modules: 151 known / 0 new / 0 now matching in two consecutive runs, against 145 known / 6 new before the change.
8bfec74 to
6a4949f
Compare
|
Rebased onto Re-measured on the new head (modules rebuilt from |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
The replay now passes sixteen arguments, which removes the stack garbage the eight-argument call read; one note in known.tsv misstates the argument count of sceAgcDcbDmaData.
What I ran
- Head:
6a4949f22a8e300f3c78aabe0fa203fe6470a175, basemain. No merged-preview check. - No build and no test run in this review. The reader was used for read-only lookups:
python3 repo_read.py search sceAgcDcbCopyData
python3 repo_read.py search sceAgcDmaData
python3 repo_read.py search "DcbDmaData("
python3 repo_read.py search test_library_oracle
Results
| Check | Result | Note |
|---|---|---|
| Replay call and type agree (16 and 16) | passed | Read in replay.cpp |
sceAgcDcbCopyData has nine arguments |
passed | Matches the note |
sceAgcDcbDmaData has ten arguments |
failed | It has twelve |
| Oracle test script is wired to CTest | passed | CMakeLists.txt |
| Build and the replay runs | not run | Author-reported only |
Findings
Blocking
None.
Non-blocking
tools/library-oracle/known.tsv:65: theDcbDmaDatarows say "the recording passes six of the export's ten arguments".sceAgcDcbDmaDatatakes twelve parameters, so the gap is six, not four. The note should read "twelve". The same wording is on lines 66 and 67.
The code change itself is sound. The type and the call both carry sixteen uint64_t slots, the ten extra slots are zeros, and the export reads only the slots it declares. Calling through a pointer with more parameters than the target declares is the existing pattern in this file.
Sources
- Export declaration:
sceAgcDcbCopyDatadeclaration:
Not verified
- The build,
library_oracle_replay, and the byte-identical runs and control numbers in the description. These are the author's reports; I did not run them. - The
Acbrows (known.tsv:7-9and13-15): the argument counts in their notes were not checked againstsceAgcAcbCopyDataandsceAgcAcbDmaData. - The stack-slot measurement (
0x78,0xc9,1) and the console behaviour it describes. Not measured here. test_library_oracle.py(23 tests) andcheck_conventions.py. Author-reported; not run.- Whether the sixteen-slot call is ABI-safe on every
APS5_VABItarget. I read only the Linux-side code path. - Files read:
replay.cppfrom the diff and head lines 270-309;known.tsvonly from the diff hunks. The rest of both files at head was not read.
To get this to a good state
Nothing is required.
Optional: change "ten" to "twelve" on known.tsv lines 65-67 (see Non-blocking 1).
|
Applied the non-blocking note in The three Data-only commit, so no behaviour moved: |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this; the points below are optional.
What I ran
- Head SHA 58bd96d, base main. No merged-preview check was run.
- Read the changed hunks of both files in the diff, plus the replay call site at head (tools/library-oracle/replay.cpp, lines 280 to 300).
- Read through the repository reader only. No build and no test run: this review does not compile or execute anything.
- Excluded by rule: none (files.json lists no exclusions).
Commands
repo_read.py search "APS5_VABI" tools/library-oracle
repo_read.py cat tools/library-oracle/replay.cpp 280 300
repo_read.py search "sceAgcDcbDmaData|sceAgcDcbCopyData|sceAgcAcbDmaData"
Results
| Check | Result | Note |
|---|---|---|
| Diff of both changed files | passed | Every changed line in known.tsv and replay.cpp was read |
| Call site at head | passed | Six register arguments and ten zeros, sixteen in total |
| Argument counts in known.tsv rows | not run | The export declarations are not in the repository at head |
| Build and replay run | not run | Not part of this review |
| tools/library-oracle/test_library_oracle.py | not run | Author-reported: 23 tests, OK |
| tools/check_conventions.py | not run | Author-reported: passed |
Findings
Blocking: none.
Non-blocking: none.
Sources
- replay.cpp line 295 at head: the call passes the six register values and ten zeros to the sixteen-parameter pointer.
- replay.cpp line 25 at head: the
Functiontype declares sixteenstd::uint64_tparameters, matching the call.
Not verified
- The argument counts written into the known.tsv rows (nine for CopyData, ten for AcbDmaData, twelve for DcbDmaData). The author cites DcbFlow/include/Memory.hpp and Acb/include/Memory.hpp. Those declarations are not in the repository at head, so the search returned no matches. Not checked.
- The author's measurements: 117 known findings with 0 new, the two-run byte-identical summary, the three-run control with the old replay.cpp, the overlap probe against other open PRs, and the rebase against main. None of these was run here.
- Whether any export takes more than sixteen arguments. The new pointer would not pass those.
- known.tsv was read through the diff hunks, not as its full text at head.
To get this to a good state
Nothing is required.
What
The replay called every export through an eight-argument function pointer:
An export that takes more parameters reads the rest from the caller's stack, so the same tree produced different packets depending on the process environment. Measured before the change:
sceAgcDcbCopyDatacarried0x78,0xc9and1in its write-confirm slot across three invocations of one binary, which flipped twelve known entries betweenthrowanddifffrom run to run (theagcbuild_{Acb,Dcb}{CopyData,DmaData}_{a,b,c}rows).Declare sixteen parameters and pass zeros for the ten the recording does not supply. The twelve cases now encode deterministically, and their
known.tsvrows record the packet difference in the fields the recording never carries (the console's item size and write confirm forCopyData, its source address and byte count forDmaData), instead of claiming athrowthat no longer happens.tools/library-oracle/known.tsvis the only other file the change touches, and only in those twelve rows. The threeDcbDmaDatarows also state the number of parameterssceAgcDcbDmaDatadeclares: twelve (DcbFlow/include/Memory.hpp), where the row text said ten; theAcbDmaDatarows keep ten, which is whatAcb/include/Memory.hppdeclares there.Tested
Linux (Ubuntu, i5-8500T, GCC, Ninja, Release), tree
c50f19c4b8(rebased onto currentmain),library_oracle_replayandlibSceAgcfreshly built from that tree.With this change, two consecutive runs of the same binary, byte-identical summary:
Re-measured on
mainbb95654123(same two targets rebuilt from that tree): with the fix andmain's twelvethrowrows the run reports105 known findings, 12 newin two consecutive runs even with the sixteen-argument pointer, and with this PR's twelve rows117 known findings, 0 new, 0 now matching. A sweep of the other families on the same tree (libc,kernel,kernelx,posix,nethttp,rtc,userservice) reports7 known findings, 0 new, 0 now matching, so no other row went stale under the newmain.Control on the same tree and the same target, only
replay.cppreverted tomain's version, three consecutive runs:and the case that flips names its cause in the report itself:
DcbDmaData_cthrowsreserved bits are set (value 0xd0, allowed 0x1), then0x60, then0x20— the stack garbage the eight-argument pointer reads. The intermediate state (fix without the row changes) reports105 known / 12 new: the twelve cases no longer throw, so athrowrow no longer covers them. That is why the two files change together.The rebase onto
c50f19c4b8happened aftermaindeleted theAcbAcquireMem,AcbEventWrite,AcbJump,WaitRegMemandSET_PREDICATIONrows through #19339, #19320, #19338, #19290 and others;diff origin/main tools/library-oracle/known.tsvshows exactly the twelve row changes and both files have 126 lines, so no deleted row came back and none was lost.python3 tools/library-oracle/test_library_oracle.py: 23 tests, OK.python3 tools/check_conventions.py --base origin/main: all conventions checks passed.python3 tools/pr_overlap.py --branch contrib/oracle-replay-explicit-arguments --jobs 8on head58bd96dedfprobes 1614 PRs and reports13 share files or exports with the branch; the table names #19309 (known.tsvL4-9) and #19355 (L65-74) and four comparisons fail closed (#19194, #19196, #19708, #20294).git merge-tree --write-treeanswersCONFLICTfor every one of them, and the changed identifiers in each rival'sknown.tsvdiff are disjoint from this change: #19309 deletesCondExec/SetCxRegistersIndirect/SetShRegistersIndirect/SetUcRegistersIndirect, #19355 rewritesDrawIndexIndirect/DrawIndirect, #19194 deletesSetIndexBuffer/SetIndexIndirectArgs/SetIndexSize, #19196 rewritesCbMemSemaphore_c, #19708 deletes theDispatchIndirectrows, #20294 rewritesSetFlip/WaitUntilSafeForRendering. This change editsAcbCopyData(L7-9),AcbDmaData(L13-15),DcbCopyData(L59-61) andDcbDmaData(L65-67), so the overlap is only the three-line context window and a merge with any of them needs its neighbouring lines resolved by hand. Depends on: none.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)