Repository navigation
feat(libSceAjmi): implement sceAjmiBatchErrorDump - #26311
oneandonlydean merged 1 commit into
Conversation
aa26d1a to
6d636bd
Compare
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 6d636bd857:
- Conventions:
tools/check_conventions.pypassed. - Build:
guest_ajmi_lifecycle_aliases_testsbuilt cleanly. - CTest (
guest_ajmi_lifecycle_contexts_unpatched,guest_ajmi_lifecycle_instances_unpatched,guest_ajmi_lifecycle_batches_unpatched,guest_ajmi_lifecycle_contexts_nid,guest_ajmi_lifecycle_instances_nid,guest_ajmi_lifecycle_batches_nid):1/6 Test #3664: guest_ajmi_lifecycle_instances_unpatched ... Passed 0.03 sec 2/6 Test #3666: guest_ajmi_lifecycle_contexts_nid .......... Passed 0.03 sec 3/6 Test #3663: guest_ajmi_lifecycle_contexts_unpatched .... Passed 0.03 sec 4/6 Test #3667: guest_ajmi_lifecycle_instances_nid ......... Passed 0.03 sec 5/6 Test #3665: guest_ajmi_lifecycle_batches_unpatched ..... Passed 0.03 sec 6/6 Test #3668: guest_ajmi_lifecycle_batches_nid ........... Passed 0.02 sec 100% tests passed, 0 tests failed out of 6 - Negative control: with
core/libs/prx/libSceAjmi/Export.cpp,core/libs/prx/libSceAjmi/include/InventoryExports.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass. - Code reading:
- Verified sceAjmiBatchErrorDump signature matches sceAjmBatchErrorDump and forwards directly without parameter manipulation in core/libs/prx/libSceAjmi/Export.cpp
- Verified InventoryExports.hpp declares sceAjmiBatchErrorDump(const AjmBatchInfo*, AjmBatchError*) matching native definition
- Checked technical debt fragment docs/dev/debt/changes/feat-ajmi-batch-error-dump.md correctly removes sceAjmiBatchErrorDump from libSceAjmi debt
- Verified test coverage in GuestAjmiLifecycleAliases.cpp exercises both alias and native variants under patched NID and unpatched name, validating null error, valid error dump, and invalid parameter rejection
- Confirmed compliance with AGENTS.md rules regarding no code comments, conventional commits, debt fragment, and absence of stubs
Looks Good To Me
Independent Windows validation of
|
| OS | Windows 11 (x86-64) |
| Compiler | WinLibs GCC 16.2.0 (MinGW-w64 x86_64-ucrt-posix-seh, built by Brecht Sanders, r3) |
| CMake / Ninja | 4.4.4 / 1.13.2, CMAKE_BUILD_TYPE=Release |
| GPU | NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell), driver 621.24 |
| Environment | ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, APS5_NO_PIPELINE_JOURNAL=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation |
| Head | 6d636bd857becb45f9cae052e16cf0cfd80e626e |
| Base | 6555c1425a (merge base with main) |
No Vulkan instance is created by these tests, so the GPU row only describes the machine; nothing below exercises the RTX 5070 Ti paths.
Build
The PR adds no new test target (the new case goes into the existing GuestAjmiLifecycleAliases.cpp), so the existing configured tree only needed the target rebuilt:
ninja -C build guest_ajmi_lifecycle_aliases_tests
Exit 0, with the usual MinGW .rsrc merge failure: multiple non-default manifests link warning. cmake -S . -B build was still re-run first to keep the tree consistent with head (exit 0).
Results
ctest --test-dir build -R '^guest_ajmi_lifecycle_' --output-on-failure, 3 consecutive runs:
| Test | run 1 | run 2 | run 3 |
|---|---|---|---|
guest_ajmi_lifecycle_contexts_unpatched |
Passed, 0.04 s | Passed, 0.02 s | Passed, 0.02 s |
guest_ajmi_lifecycle_instances_unpatched |
Passed, 0.02 s | Passed, 0.02 s | Passed, 0.02 s |
guest_ajmi_lifecycle_batches_unpatched |
Passed, 0.02 s | Passed, 0.02 s | Passed, 0.02 s |
guest_ajmi_lifecycle_contexts_nid |
Passed, 0.03 s | Passed, 0.02 s | Passed, 0.02 s |
guest_ajmi_lifecycle_instances_nid |
Passed, 0.02 s | Passed, 0.02 s | Passed, 0.02 s |
guest_ajmi_lifecycle_batches_nid |
Passed, 0.02 s | Passed, 0.02 s | Passed, 0.02 s |
| negative control | — | — | batches_unpatched and batches_nid Failed, exit 0xc0000409 |
6/6 on head, 3/3 runs, both the unpatched and the NID-exported module.
Negative control
Restoring Export.cpp to 6555c1425a does not compile, exactly as expected for a stub that the PR gives a real signature: conflicting declaration of C function 'int sceAjmiBatchErrorDump()'. The base declaration had no parameters, so the new test cannot be built against it.
Keeping the PR's signature and adding NotImplemented_nid_no_patch(__func__); as the first statement of sceAjmiBatchErrorDump (its behaviour at base) rebuilds cleanly and fails precisely the two tests that exercise the new case:
guest_ajmi_lifecycle_batches_unpatched ... Exit code 0xc0000409 what(): sceAjmiBatchErrorDump not implemented
guest_ajmi_lifecycle_batches_nid ....... Exit code 0xc0000409 what(): sceAjmiBatchErrorDump not implemented
67% tests passed, 2 tests failed out of 6
contexts and instances keep passing, which confirms the new assertions are bound to sceAjmiBatchErrorDump and not to unrelated lifecycle state.
What this does and does not establish
Establishes, on native Windows 11 with GCC 16.2.0/UCRT in Release:
- the alias
sceAjmiBatchErrorDumpand the nativesceAjmBatchErrorDumpproduce the same result on Windows, for both the unpatched and the NID-imported module, including the cleared-output case, the null-AjmBatchErrorcase, the unmapped0x10pointers (result 0 forinfo,InvalidParameterforerror) anderrnostaying at 71; - the suite is deterministic here (3/3 runs, ~0.02 s) and the new case is not vacuous (it fails only when the export is stubbed).
Does not establish:
- no console behaviour: this shows alias/native agreement and the guards, not that the PS5 returns these values;
sceAjmBatchErrorDump's own semantics remain the existing implementation's; - no GPU path: no Vulkan instance is created;
- no non-
0x10fault shapes: only the unmapped pointer the test uses; read-only or partially-mapped guest ranges are not covered; - only one alias shape: the test proves this one alias forwards, not that the inventory aliases around it do;
- no title or homebrew run, and no Windows version other than this one.
Workspace cleaned up: temporary branch deleted, main left at origin/main (110d1fcd39), no local changes.
What
Implement
sceAjmiBatchErrorDumpinlibSceAjmi, forwarding calls to nativesceAjmBatchErrorDump. Updates the declaration incore/libs/prx/libSceAjmi/include/InventoryExports.hppand implementation inExport.cpp, removes the placeholder table row indocs/dev/debt/libSceAjmi.mdvia debt fragmentdocs/dev/debt/changes/feat-ajmi-batch-error-dump.md, and adds test coverage for unpatched and patched NIDs (RbLGSlJB6dc,WfAiBW8Wcek), null error handling, and faulting pointer parameter rejection witherrnoverification inGuestAjmiLifecycleAliases.cpp.Tested
Ubuntu 24.04 LTS (x86_64, Linux 7.4.0-rc1, GCC 13.3, Ninja).
guest_ajmi_lifecycle_aliases_tests,libSceAjmi.guest_ajmi_lifecycletests passed cleanly (contexts, instances, batches across unpatched and patched NID variants).python3 tools/check_conventions.pypassed cleanly;python3 tools/debt_fold.py --checkpassed cleanly;python3 tools/pr_overlap.py --names sceAjmiBatchErrorDumpconfirmed no competing PRs implement this export.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)