feat(libSceAmpr): add From*OnCompletion measure helpers #12061

Merged
akkadbakkad89 merged 1 commit from upstream-pr/12061 into main 2026-10-29 23:28:15 +00:00
akkadbakkad89 commented 2026-10-27 18:16:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-27T18:16:06Z.


What

Cross-checked KytyPS5 (src/libs/, ~1,554 registered exports) against this tree's export table by resolving every NID against the full aerolib database. Almost every apparent gap was already covered under a different naming form, module grouping, or mangled C++ spelling. This PR takes the residue that is portable 1:1 — no Kyty code is copied; the convention already lives here and only needed three more exports.

libSceAmpr — three missing measure helpers. sceAmprMeasureCommandSizeWriteAddressFromTimeCounterOnCompletion, sceAmprMeasureCommandSizeWriteAddressFromCounterOnCompletion and sceAmprMeasureCommandSizeWriteAddressFromCounterPairOnCompletion are real firmware exports (aerolib) whose CommandBufferWrite* siblings already exist. They mirror the _04_00 measure convention exactly: ValidWriteAddress argument checks and sizeof(Apr::WriteAddressFromCounterCommand) = 0x18 on success, MeasureInvalid on failure — 0x18 because AppendCommand stamps header.bytes = sizeof(command) and the kernel APR executor _reads that exact struct for these opcodes. (Kyty's flat 0x20 is a padded slot size; its WriteCounterOnCompletion appends a 0x20 no-op, not a record.)

GuestAmpr.cpp gains focused assertions for all three: valid arguments return the record size, nullptr returns MeasureInvalid, and the pair helper rejects an odd counter.

Tested

Windows 11 (MinGW build, i7-10700): ctest -R guest_ampr — guest_ampr_markers, guest_ampr_threads, guest_ampr_cpp_error all pass (3/3). Conventions check clean.

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; supersedes the three stub declarations in #11936 — order coordinated on its thread (this PR lands first; #11936 rebases to drop the overlapping stubs)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5038936936 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12061). Originally posted by [akkadbakkad89](https://github.com/akkadbakkad89) on 2026-10-27T18:16:06Z. --- ### What Cross-checked KytyPS5 (`src/libs/`, ~1,554 registered exports) against this tree's export table by resolving every NID against the full aerolib database. Almost every apparent gap was already covered under a different naming form, module grouping, or mangled C++ spelling. This PR takes the residue that is portable 1:1 — no Kyty code is copied; the convention already lives here and only needed three more exports. **libSceAmpr — three missing measure helpers.** `sceAmprMeasureCommandSizeWriteAddressFromTimeCounterOnCompletion`, `sceAmprMeasureCommandSizeWriteAddressFromCounterOnCompletion` and `sceAmprMeasureCommandSizeWriteAddressFromCounterPairOnCompletion` are real firmware exports (aerolib) whose `CommandBufferWrite*` siblings already exist. They mirror the `_04_00` measure convention exactly: `ValidWriteAddress` argument checks and `sizeof(Apr::WriteAddressFromCounterCommand)` = 0x18 on success, `MeasureInvalid` on failure — 0x18 because `AppendCommand` stamps `header.bytes = sizeof(command)` and the kernel APR executor `_read`s that exact struct for these opcodes. (Kyty's flat 0x20 is a padded slot size; its `WriteCounterOnCompletion` appends a 0x20 no-op, not a record.) `GuestAmpr.cpp` gains focused assertions for all three: valid arguments return the record size, nullptr returns `MeasureInvalid`, and the pair helper rejects an odd counter. ### Tested Windows 11 (MinGW build, i7-10700): `ctest -R guest_ampr` — `guest_ampr_markers`, `guest_ampr_threads`, `guest_ampr_cpp_error` all pass (3/3). Conventions check clean. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none; supersedes the three stub declarations in #11936 — order coordinated on its thread (this PR lands first; #11936 rebases to drop the overlapping stubs) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-27 18:25:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T18:25:58Z.

Review: CHANGES_REQUESTED


I built the exact PR head on Linux (Release) and ran guest_ampr_tests and guest_json_tests under qemu-x86_64 -cpu Haswell; both exited 0. python3 tools/check_conventions.py --base refs/remotes/upstream/main also passes. Native execution is blocked on this host because its Xeon lacks the AVX2/BMI/LZCNT features the test runner requires.

I found a concrete mismatch in the three new AMPR measurement helpers. The PR description says each returns 0x20, matching the Kyty reference, but all three implementations return sizeof(Apr::WriteAddressFromCounterCommand). In this tree that structure is 24 bytes (CommandHeader 8 + address 8 + two 32-bit counters), and I called each built export directly: valid inputs returned 0x18, not 0x20. The cited reference at pinned Kyty commit 0685bffb2f060bf470aa8528a405ebbe17130076 returns the constant 0x20 for all three functions: github.com/KytyPS5/KytyPS5@0685bffb2f/src/libs/libAmpr.cpp (L1652-L1670)

Please resolve the size discrepancy before merge: either implement and test the reported 0x20 result, or provide target-specific evidence that the unversioned helpers should return 0x18 and correct the PR's claim that the behavior matches Kyty. Please add focused assertions for these three new exports; the current AMPR tests cover the _04_00 siblings but not these symbols. I have not approved this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5672296617 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12061#pullrequestreview-5672296617). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T18:25:58Z. **Review:** CHANGES_REQUESTED --- I built the exact PR head on Linux (Release) and ran `guest_ampr_tests` and `guest_json_tests` under `qemu-x86_64 -cpu Haswell`; both exited 0. `python3 tools/check_conventions.py --base refs/remotes/upstream/main` also passes. Native execution is blocked on this host because its Xeon lacks the AVX2/BMI/LZCNT features the test runner requires. I found a concrete mismatch in the three new AMPR measurement helpers. The PR description says each returns `0x20`, matching the Kyty reference, but all three implementations return `sizeof(Apr::WriteAddressFromCounterCommand)`. In this tree that structure is 24 bytes (`CommandHeader` 8 + address 8 + two 32-bit counters), and I called each built export directly: valid inputs returned `0x18`, not `0x20`. The cited reference at pinned Kyty commit `0685bffb2f060bf470aa8528a405ebbe17130076` returns the constant `0x20` for all three functions: https://github.com/KytyPS5/KytyPS5/blob/0685bffb2f060bf470aa8528a405ebbe17130076/src/libs/libAmpr.cpp#L1652-L1670 Please resolve the size discrepancy before merge: either implement and test the reported `0x20` result, or provide target-specific evidence that the unversioned helpers should return `0x18` and correct the PR's claim that the behavior matches Kyty. Please add focused assertions for these three new exports; the current AMPR tests cover the `_04_00` siblings but not these symbols. I have not approved this head.
MarcZX10 commented 2026-10-27 18:51:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T18:51:50Z.

Review: APPROVED


Follow-up review of exact head 6d7182b3f66b55e5935f58a010a41a421694462f; this resolves my prior measurement-helper concern. The body now distinguishes Kyty’s padded 0x20 slot from this tree’s 24-byte command record: the writer stores sizeof(command) in the record header, the APR executor reads the same WriteAddressFromCounterCommand layout, and the existing _04_00 measurement siblings return that layout size. The new assertions cover all three helpers plus null and odd-pair rejection. Console behavior is still unmeasured, so I am relying on this explicit in-tree contract rather than claiming a PS5 measurement.\n\nI built guest_ampr_tests and guest_json_tests from this exact head and ran both under qemu-x86_64 -cpu Haswell; both exited 0. Exact-head conventions and git diff --check pass. Hosted Windows is still pending; native execution here cannot run on the host Xeon because of its missing AVX2/BMI/LZCNT features.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5672622290 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12061#pullrequestreview-5672622290). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T18:51:50Z. **Review:** APPROVED --- Follow-up review of exact head `6d7182b3f66b55e5935f58a010a41a421694462f`; this resolves my prior measurement-helper concern. The body now distinguishes Kyty’s padded 0x20 slot from this tree’s 24-byte command record: the writer stores `sizeof(command)` in the record header, the APR executor reads the same `WriteAddressFromCounterCommand` layout, and the existing `_04_00` measurement siblings return that layout size. The new assertions cover all three helpers plus null and odd-pair rejection. Console behavior is still unmeasured, so I am relying on this explicit in-tree contract rather than claiming a PS5 measurement.\n\nI built `guest_ampr_tests` and `guest_json_tests` from this exact head and ran both under `qemu-x86_64 -cpu Haswell`; both exited 0. Exact-head conventions and `git diff --check` pass. Hosted Windows is still pending; native execution here cannot run on the host Xeon because of its missing AVX2/BMI/LZCNT features.
MarcZX10 commented 2026-10-27 19:00:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T19:00:53Z.

Review: CHANGES_REQUESTED


The Ampr portion has a coherent in-tree basis: the record is 0x18 bytes, the matching _04_00 helpers return that size, and the reported focused tests cover valid and invalid inputs. The Json2 portion cannot stay in this PR, though. Open #10378 already replaces the same C2/D2 stubs with C1/D1 forwarders and removes the corresponding debt entries. I fetched both exact heads and confirmed the pairwise merge conflicts in Export.cpp, InventoryExports.cpp, and docs/dev/debt/libSceJson2.md; this also combines two unrelated topics. Please drop the Json2 changes and keep the Ampr helpers as the single topic, then rerun the required checks. I am changing my review because this overlap was identified after my earlier approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5672730794 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12061#pullrequestreview-5672730794). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T19:00:53Z. **Review:** CHANGES_REQUESTED --- The Ampr portion has a coherent in-tree basis: the record is 0x18 bytes, the matching `_04_00` helpers return that size, and the reported focused tests cover valid and invalid inputs. The Json2 portion cannot stay in this PR, though. Open #10378 already replaces the same C2/D2 stubs with C1/D1 forwarders and removes the corresponding debt entries. I fetched both exact heads and confirmed the pairwise merge conflicts in `Export.cpp`, `InventoryExports.cpp`, and `docs/dev/debt/libSceJson2.md`; this also combines two unrelated topics. Please drop the Json2 changes and keep the Ampr helpers as the single topic, then rerun the required checks. I am changing my review because this overlap was identified after my earlier approval.
MarcZX10 commented 2026-10-27 20:45:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T20:45:47Z.

Review: CHANGES_REQUESTED


The AMPR implementation itself now has a clear in-tree contract and focused assertions, and the earlier unrelated Json2 overlap has been removed. One integration issue remains: open #11936 declares the same three exports as throwing placeholders. The exact branches merge textually, but combining them leaves duplicate/conflicting declarations and two definitions for each export; accepting both as-is is not safe. Please coordinate with #11936's author and record which PR supersedes the other, or an explicit landing order/rebase that results in exactly one declaration and one implementation. The current checklist still says Depends on: none and the overlap comment's 'either rebases to a no-op' needs a concrete resolution before merge.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5674079571 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12061#pullrequestreview-5674079571). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T20:45:47Z. **Review:** CHANGES_REQUESTED --- The AMPR implementation itself now has a clear in-tree contract and focused assertions, and the earlier unrelated Json2 overlap has been removed. One integration issue remains: open #11936 declares the same three exports as throwing placeholders. The exact branches merge textually, but combining them leaves duplicate/conflicting declarations and two definitions for each export; accepting both as-is is not safe. Please coordinate with #11936's author and record which PR supersedes the other, or an explicit landing order/rebase that results in exactly one declaration and one implementation. The current checklist still says Depends on: none and the overlap comment's 'either rebases to a no-op' needs a concrete resolution before merge.
MarcZX10 commented 2026-10-29 04:39:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T04:39:26Z.

Review: APPROVED


Reviewed — looks good

The exact-head AMPR implementation follows the existing 0x18-byte command-record contract, its focused tests pass under QEMU, and the former overlap with #11936 is resolved because that PR is closed.

What I ran

PR head 0f21aac195687ffe257906ec021926d789d19f20; current base main b433c40f2f46aa2e59e19806010a839ac8572d64. The merge preview is clean (tree 8893520a96689b4efe3766efd994b38b3bde31e4). Linux x86_64, GCC 12.2.0, Release; native CPU is Intel Xeon E5-1620 v2. QEMU user-mode emulation used the Haswell CPU model for execution.

cmake --build build-review --target guest_ampr_tests guest_ampr_threads_tests guest_ampr_cpp_error_tests --parallel 4
ctest --test-dir build-review -R '^guest_ampr_markers$' -V
qemu-x86_64 -cpu Haswell -L / build-review/tests/guest_ampr_tests
qemu-x86_64 -cpu Haswell,-pcid,-x2apic,-tsc-deadline,-hle,-invpcid,-rtm -L / build-review/tests/guest_ampr_threads_tests
qemu-x86_64 -cpu Haswell -L / build-review/tests/guest_ampr_cpp_error_tests
git diff --check refs/remotes/upstream/main...refs/review/pr-12061
python3 tools/check_conventions.py --base refs/remotes/upstream/main --head refs/review/pr-12061 --title 'feat(libSceAmpr): add From*OnCompletion measure helpers' --body /tmp/pr-12061-body.md
git merge-tree --write-tree refs/remotes/upstream/main refs/review/pr-12061
python3 tools/pr_overlap.py --base main --branch refs/review/pr-12061 --repo boykopovar/AnyPS5 --jobs 8

Results

Check Result
Focused build Pass; guest_ampr_tests, guest_ampr_threads_tests, and guest_ampr_cpp_error_tests built
Native CTest Could not execute on this host: the project CPU guard requires LZCNT, BMI1/2, MOVBE, AVX2, and FMA, which this Xeon lacks
Focused tests under QEMU All three executables returned exit code 0; the AMPR marker tests exercise the new valid/null/odd-counter cases
Diff and conventions Pass; conventions report All conventions checks passed.
Merge preview Clean against current main
Overlap The full scan found an uncomparable shared Export.cpp in #7081; manual diff shows only three CRT forwarding renames, unrelated to these exports. Search found no other open PR for the three new AMPR exports. #11936 is closed.
Hosted checks on exact head Windows, conventions, labels, eligibility, and report pass; Linux and specialized jobs are skipped
Raw command output

cmake --build completed with:

[105/197] Building CXX object core/libs/prx/libSceAmpr/CMakeFiles/libSceAmpr.dir/Export.cpp.o
[108/197] Building CXX object core/libs/prx/libSceAmpr/CMakeFiles/guest_ampr_tests.dir/__/__/tests/GuestAmpr.cpp.o
[196/197] Linking CXX shared library core/libs/libs/unpatched/libSceAmpr.prx
[197/197] Linking CXX executable tests/guest_ampr_tests

Native CTest output:

Internal ctest changing into directory: /dev/shm/AnyPS5-review-12149-local/build-review
UpdateCTestConfiguration  from :/dev/shm/AnyPS5-review-12149-local/build-review/DartConfiguration.tcl
UpdateCTestConfiguration  from :/dev/shm/AnyPS5-review-12149-local/build-review/DartConfiguration.tcl
Test project /dev/shm/AnyPS5-review-12149-local/build-review
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 1612
    Start 1612: guest_ampr_markers

1612: Test command: /dev/shm/AnyPS5-review-12149-local/build-review/tests/guest_ampr_tests
1612: Working Directory: /dev/shm/AnyPS5-review-12149-local/build-review/core/libs/prx/libSceAmpr
1612: Test timeout computed to be: 10000000
1612: [src/HostCpu.cpp:193 operator()] host CPU Intel(R) Xeon(R) CPU E5-1620 v2 @ 3.70GHz: has SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, CMPXCHG16B, LAHF/SAHF, AVX, F16C, AES, PCLMULQDQ, RDRAND, XSAVEOPT, OS AVX state (XCR0); lacks LZCNT, BMI1, BMI2, MOVBE, AVX2, FMA, RDSEED, ADX, SHA, CLFLUSHOPT, CLWB, RDPID, XSAVEC, SSE4A, PREFETCHW, CLZERO
1612: [libc] unhandled exception 'St13runtime_error' thrown from 0x7fb2c629861d
1612: terminate called after throwing an instance of 'std::runtime_error'
1612:   what():  The host CPU (Intel(R) Xeon(R) CPU E5-1620 v2 @ 3.70GHz) lacks LZCNT, BMI1, BMI2, MOVBE, AVX2, FMA. The PS5's Zen 2 CPU has these extensions and titles run their instructions natively, so this CPU cannot run them.
Errors while running CTest
Output from these tests are in: /dev/shm/AnyPS5-review-12149-local/build-review/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
1/1 Test #1612: guest_ampr_markers ...............Subprocess aborted***Exception:   0.02 sec

0 tests passed, 1 tests failed out of 1

Total Test time (real) =   0.23 sec

The following tests FAILED:
	1612 - guest_ampr_markers (Subprocess aborted)

The three QEMU executions returned exit code 0. The guest_ampr_cpp_error_tests output ended with:

guest _Throw_Cpp_error system_error, generic category and range: PASS

Convention output:

All conventions checks passed.

git diff --check produced no output and returned 0. The merge command printed:

8893520a96689b4efe3766efd994b38b3bde31e4

GitHub check runs are all attached to exact head 0f21aac195687ffe257906ec021926d789d19f20:

conventions  success
labels       success
windows      success
eligibility  success
report       success
linux        skipped
register-context skipped
relinker     skipped
relinker-asan skipped
write-watch  skipped

The overlap scan reported only:

| [PR 7081](https://www.github.com/boykopovar/AnyPS5/pull/7081) | `core/libs/prx/libSceAmpr/Export.cpp` |

Negative control

Assertion Change made to code under test Did the test fail?
New measurement sizes and invalid-argument cases No mutation applied Not exercised

Findings

Blocking

None found in the reviewed diff.

Non-blocking

The PR explicitly does not claim console measurement. The 0x18 return size is supported by this tree's command header/record layout and matching _04_00 measurement helpers; the current tests establish the in-tree contract, not PS5 behavior.

Sources

Not verified

Native execution on a supported CPU and the Windows run in the PR description were not independently reproduced. Linux hosted product CI is skipped. Console behavior remains unmeasured as stated by the author.

To get this to a good state

No change is needed for this review. If the head changes, I will rerun the same build, focused tests, convention, diff, merge-preview, and overlap checks against the new SHA.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5692929234 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12061#pullrequestreview-5692929234). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T04:39:26Z. **Review:** APPROVED --- # Reviewed — looks good The exact-head AMPR implementation follows the existing 0x18-byte command-record contract, its focused tests pass under QEMU, and the former overlap with #11936 is resolved because that PR is closed. ## What I ran PR head `0f21aac195687ffe257906ec021926d789d19f20`; current base `main` `b433c40f2f46aa2e59e19806010a839ac8572d64`. The merge preview is clean (tree `8893520a96689b4efe3766efd994b38b3bde31e4`). Linux x86_64, GCC 12.2.0, Release; native CPU is Intel Xeon E5-1620 v2. QEMU user-mode emulation used the Haswell CPU model for execution. ```sh cmake --build build-review --target guest_ampr_tests guest_ampr_threads_tests guest_ampr_cpp_error_tests --parallel 4 ctest --test-dir build-review -R '^guest_ampr_markers$' -V qemu-x86_64 -cpu Haswell -L / build-review/tests/guest_ampr_tests qemu-x86_64 -cpu Haswell,-pcid,-x2apic,-tsc-deadline,-hle,-invpcid,-rtm -L / build-review/tests/guest_ampr_threads_tests qemu-x86_64 -cpu Haswell -L / build-review/tests/guest_ampr_cpp_error_tests git diff --check refs/remotes/upstream/main...refs/review/pr-12061 python3 tools/check_conventions.py --base refs/remotes/upstream/main --head refs/review/pr-12061 --title 'feat(libSceAmpr): add From*OnCompletion measure helpers' --body /tmp/pr-12061-body.md git merge-tree --write-tree refs/remotes/upstream/main refs/review/pr-12061 python3 tools/pr_overlap.py --base main --branch refs/review/pr-12061 --repo boykopovar/AnyPS5 --jobs 8 ``` ## Results | Check | Result | |---|---| | Focused build | Pass; `guest_ampr_tests`, `guest_ampr_threads_tests`, and `guest_ampr_cpp_error_tests` built | | Native CTest | Could not execute on this host: the project CPU guard requires LZCNT, BMI1/2, MOVBE, AVX2, and FMA, which this Xeon lacks | | Focused tests under QEMU | All three executables returned exit code 0; the AMPR marker tests exercise the new valid/null/odd-counter cases | | Diff and conventions | Pass; conventions report `All conventions checks passed.` | | Merge preview | Clean against current `main` | | Overlap | The full scan found an uncomparable shared `Export.cpp` in #7081; manual diff shows only three CRT forwarding renames, unrelated to these exports. Search found no other open PR for the three new AMPR exports. #11936 is closed. | | Hosted checks on exact head | Windows, conventions, labels, eligibility, and report pass; Linux and specialized jobs are skipped | <details> <summary>Raw command output</summary> `cmake --build` completed with: ```text [105/197] Building CXX object core/libs/prx/libSceAmpr/CMakeFiles/libSceAmpr.dir/Export.cpp.o [108/197] Building CXX object core/libs/prx/libSceAmpr/CMakeFiles/guest_ampr_tests.dir/__/__/tests/GuestAmpr.cpp.o [196/197] Linking CXX shared library core/libs/libs/unpatched/libSceAmpr.prx [197/197] Linking CXX executable tests/guest_ampr_tests ``` Native CTest output: ```text Internal ctest changing into directory: /dev/shm/AnyPS5-review-12149-local/build-review UpdateCTestConfiguration from :/dev/shm/AnyPS5-review-12149-local/build-review/DartConfiguration.tcl UpdateCTestConfiguration from :/dev/shm/AnyPS5-review-12149-local/build-review/DartConfiguration.tcl Test project /dev/shm/AnyPS5-review-12149-local/build-review Constructing a list of tests Done constructing a list of tests Updating test list for fixtures Added 0 tests to meet fixture requirements Checking test dependency graph... Checking test dependency graph end test 1612 Start 1612: guest_ampr_markers 1612: Test command: /dev/shm/AnyPS5-review-12149-local/build-review/tests/guest_ampr_tests 1612: Working Directory: /dev/shm/AnyPS5-review-12149-local/build-review/core/libs/prx/libSceAmpr 1612: Test timeout computed to be: 10000000 1612: [src/HostCpu.cpp:193 operator()] host CPU Intel(R) Xeon(R) CPU E5-1620 v2 @ 3.70GHz: has SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, CMPXCHG16B, LAHF/SAHF, AVX, F16C, AES, PCLMULQDQ, RDRAND, XSAVEOPT, OS AVX state (XCR0); lacks LZCNT, BMI1, BMI2, MOVBE, AVX2, FMA, RDSEED, ADX, SHA, CLFLUSHOPT, CLWB, RDPID, XSAVEC, SSE4A, PREFETCHW, CLZERO 1612: [libc] unhandled exception 'St13runtime_error' thrown from 0x7fb2c629861d 1612: terminate called after throwing an instance of 'std::runtime_error' 1612: what(): The host CPU (Intel(R) Xeon(R) CPU E5-1620 v2 @ 3.70GHz) lacks LZCNT, BMI1, BMI2, MOVBE, AVX2, FMA. The PS5's Zen 2 CPU has these extensions and titles run their instructions natively, so this CPU cannot run them. Errors while running CTest Output from these tests are in: /dev/shm/AnyPS5-review-12149-local/build-review/Testing/Temporary/LastTest.log Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely. 1/1 Test #1612: guest_ampr_markers ...............Subprocess aborted***Exception: 0.02 sec 0 tests passed, 1 tests failed out of 1 Total Test time (real) = 0.23 sec The following tests FAILED: 1612 - guest_ampr_markers (Subprocess aborted) ``` The three QEMU executions returned exit code `0`. The `guest_ampr_cpp_error_tests` output ended with: ```text guest _Throw_Cpp_error system_error, generic category and range: PASS ``` Convention output: ```text All conventions checks passed. ``` `git diff --check` produced no output and returned 0. The merge command printed: ```text 8893520a96689b4efe3766efd994b38b3bde31e4 ``` GitHub check runs are all attached to exact head `0f21aac195687ffe257906ec021926d789d19f20`: ```text conventions success labels success windows success eligibility success report success linux skipped register-context skipped relinker skipped relinker-asan skipped write-watch skipped ``` The overlap scan reported only: ```text | [PR 7081](https://www.github.com/boykopovar/AnyPS5/pull/7081) | `core/libs/prx/libSceAmpr/Export.cpp` | ``` </details> ## Negative control | Assertion | Change made to code under test | Did the test fail? | |---|---|---| | New measurement sizes and invalid-argument cases | No mutation applied | Not exercised | ## Findings ### Blocking None found in the reviewed diff. ### Non-blocking The PR explicitly does not claim console measurement. The 0x18 return size is supported by this tree's command header/record layout and matching `_04_00` measurement helpers; the current tests establish the in-tree contract, not PS5 behavior. ## Sources - [PR head: AMPR implementation](https://github.com/boykopovar/AnyPS5/blob/0f21aac195687ffe257906ec021926d789d19f20/core/libs/prx/libSceAmpr/Export.cpp) - [PR head: public API declarations](https://github.com/boykopovar/AnyPS5/blob/0f21aac195687ffe257906ec021926d789d19f20/core/libs/prx/libSceAmpr/include/Api.hpp) - [PR head: focused AMPR tests](https://github.com/boykopovar/AnyPS5/blob/0f21aac195687ffe257906ec021926d789d19f20/core/libs/tests/GuestAmpr.cpp) - [PR head: APR command record definitions](https://github.com/boykopovar/AnyPS5/blob/0f21aac195687ffe257906ec021926d789d19f20/core/libs/prx/libkernel/Apr/include/AprCommandBuffer.hpp) - [Reviewed base commit](https://github.com/boykopovar/AnyPS5/tree/b433c40f2f46aa2e59e19806010a839ac8572d64) - [Closed overlapping stub PR #11936](https://github.com/boykopovar/AnyPS5/pull/11936) ## Not verified Native execution on a supported CPU and the Windows run in the PR description were not independently reproduced. Linux hosted product CI is skipped. Console behavior remains unmeasured as stated by the author. ## To get this to a good state No change is needed for this review. If the head changes, I will rerun the same build, focused tests, convention, diff, merge-preview, and overlap checks against the new SHA.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!12061
No description provided.