Skip to content

feat(libSceAjmi): implement sceAjmiBatchErrorDump - #26311

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
shripad-jyothinath:feat/ajmi-batch-error-dump
Nov 23, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
shripad-jyothinath:feat/ajmi-batch-error-dump

Conversation

@shripad-jyothinath

Copy link
Copy Markdown
Contributor

What

Implement sceAjmiBatchErrorDump in libSceAjmi, forwarding calls to native sceAjmBatchErrorDump. Updates the declaration in core/libs/prx/libSceAjmi/include/InventoryExports.hpp and implementation in Export.cpp, removes the placeholder table row in docs/dev/debt/libSceAjmi.md via debt fragment docs/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 with errno verification in GuestAjmiLifecycleAliases.cpp.

Tested

Ubuntu 24.04 LTS (x86_64, Linux 7.4.0-rc1, GCC 13.3, Ninja).

  • Built targets: guest_ajmi_lifecycle_aliases_tests, libSceAjmi.
  • CTest suites: all 6 guest_ajmi_lifecycle tests passed cleanly (contexts, instances, batches across unpatched and patched NID variants).
  • Automated checks: python3 tools/check_conventions.py passed cleanly; python3 tools/debt_fold.py --check passed cleanly; python3 tools/pr_overlap.py --names sceAjmiBatchErrorDump confirmed no competing PRs implement this export.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 23, 2026
@shripad-jyothinath
shripad-jyothinath force-pushed the feat/ajmi-batch-error-dump branch from aa26d1a to 6d636bd Compare November 23, 2026 17:32

@PrivacyOnion PrivacyOnion 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.

Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 6d636bd857:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_ajmi_lifecycle_aliases_tests built 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.hpp reverted to main, 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

@github-actions github-actions Bot added docs prx and removed needs rebase Conflicts with main, rebase needed labels Nov 23, 2026
@github-actions

Copy link
Copy Markdown

Progress report (6555c14 → 6d636bd)

📈 System libraries: 45.98% (+0.0025%, +1 implemented function)

✅ 1 implemented
Library Name
libSceAjmi sceAjmiBatchErrorDump

Changed libraries (implemented exports)

Library Before After Change
libSceAjmi 19/26 (73.08%) 20/26 (76.92%) +3.85%

@nexus1692

Copy link
Copy Markdown
Contributor

Independent Windows validation of guest_ajmi_lifecycle_*

Validated the head of this PR on a native Windows 11 machine, because the PR's Tested block covers Ubuntu 24.04 only.

Hardware and toolchain

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 sceAjmiBatchErrorDump and the native sceAjmBatchErrorDump produce the same result on Windows, for both the unpatched and the NID-imported module, including the cleared-output case, the null-AjmBatchError case, the unmapped 0x10 pointers (result 0 for info, InvalidParameter for error) and errno staying 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-0x10 fault 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.

@oneandonlydean
oneandonlydean merged commit 7b91392 into boykopovar:main Nov 23, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants