Skip to content

feat(libSceAjmi): implement sceAjmiInstanceCodecType - #24067

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
jsthope:feat/ajmi-instance-codec-type
Nov 23, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
jsthope:feat/ajmi-instance-codec-type

Conversation

@jsthope

@jsthope jsthope commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

What

Implement sceAjmiInstanceCodecType in libSceAjmi by forwarding the 32-bit instance ID to the existing sceAjmInstanceCodecType implementation in libSceAjm.native. Remove the export from the list of unimplemented AJMI functions.

Tested

All 28 AJM and AJMI guest tests passed on Linux x86-64 (Release). The instance tests call the export by name and by NID (Uqtj4RSP-JQ). They check the codec boundary at 0x3fff and 0x4000, the full 32-bit value 0xffffffff, and an instance created with codec type 24.

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

@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 4eb9922155:

  • 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 #3512: guest_ajmi_lifecycle_contexts_unpatched ....   Passed    0.01 sec
    2/6 Test #3513: guest_ajmi_lifecycle_instances_unpatched ...   Passed    0.01 sec
    3/6 Test #3514: guest_ajmi_lifecycle_batches_unpatched .....   Passed    0.01 sec
    4/6 Test #3515: guest_ajmi_lifecycle_contexts_nid ..........   Passed    0.01 sec
    5/6 Test #3516: guest_ajmi_lifecycle_instances_nid .........   Passed    0.01 sec
    6/6 Test #3517: guest_ajmi_lifecycle_batches_nid ...........   Passed    0.01 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:
    • Export signature in InventoryExports.hpp and Export.cpp correctly matches std::uint32_t APS5_VABI sceAjmiInstanceCodecType(std::uint32_t instanceId), forwarding cleanly to sceAjmInstanceCodecType(instanceId) in libSceAjm.native.
    • Technical debt tracking properly registers a removal fragment at docs/dev/debt/changes/feat-ajmi-instance-codec-type.md to remove sceAjmiInstanceCodecType from libSceAjmi debt.
    • Memory, pointer, and concurrency safety: sceAjmiInstanceCodecType takes a 32-bit scalar value by value and delegates to sceAjmInstanceCodecType, involving no raw pointer dereferences or local allocations.
    • AGENTS.md conventions: no comments added to code, conventional commit title, valid debt fragment syntax, and clean convention checks.
    • Test coverage in GuestAjmiLifecycleAliases.cpp exercises boundary conditions (0, 0x3fff, 0x4000, 0xffffffff) as well as an active allocated codec instance both via unpatched symbol name and NID 'Uqtj4RSP-JQ'.

Looks Good To Me

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

Reviewed — looks good

Nothing blocks this change; the inspected implementation forwards the 32-bit instance ID to the existing codec-type decoder and adds boundary and created-instance checks.

What I ran

Reviewed head 4eb99221557144e8dd0e69f27fd02671db13e203 using repo_read.py to inspect the prepared diff and source context. No build or test commands were run.

Results

Check Result Note
Diff and changed source review passed Four changed files inspected
Build and tests not run Test results in the PR description are author-reported

Findings

Blocking

None.

Non-blocking

None.

Not verified

The reported 28 AJM and AJMI guest tests were not run independently. No files were excluded according to the prepared manifest; all four files marked reviewed were read. The separate files.json document was unavailable through the reader, so exclusions outside the manifest were not verified.

To get this to a good state

Nothing is required.

@ycbuzi

ycbuzi commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Tested 4eb9922155 merged into main, with the whole ctest suite on each machine below. Nothing fails that does not also fail on main on the same machine.

  • Windows Server 2022 (GitHub-hosted runner), full build, WinLibs GCC 15.2.0: 99% tests passed, 2 tests failed out of 6448; 99% tests passed, 3 tests failed out of 6448. 3 of the failing tests fail on main too. run
  • Windows Server 2025 (GitHub-hosted runner), full build, WinLibs GCC 15.2.0: 100% tests passed, 0 tests failed out of 6448; 100% tests passed, 0 tests failed out of 6448. run

AI-assisted: yes (Claude Code); the runs are automated, this summary was written from their reports.

This was referenced Nov 21, 2026
@kiwe147

kiwe147 commented Nov 21, 2026

Copy link
Copy Markdown

Tested head 4eb9922155, applied with git apply on main fd4aeed483 together with the other 29 PRs of one batch (#24576, #24603, #14196, #14527, #17718, #18671, #22753, #22792, #23503, #24245, #24480, #24553, #24714, #21236, #21765, #21987, #22030, #22107, #22397, #22571, #23158, #23816, #18401, #19101, #19398, #19657, #21563, #24584, #24628). All applied without conflicts and the whole tree built.

Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. GPUs: NVIDIA GeForce RTX 3080 (driver 621.24) and the AMD Radeon iGPU of the CPU (gfx1036, driver 32.0.21036.18). No validation layer. iGPU run: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ANYPS5_GPU="AMD Radeon", agc_/video tests only.

tests RTX 3080 iGPU
guest_ajmi_lifecycle_batches_nid, guest_ajmi_lifecycle_batches_unpatched, guest_ajmi_lifecycle_contexts_nid and 3 more (6 tests, matched by name to the test file this PR changes) all pass outside the iGPU subset

Whole batch: the full ctest -j 12 (6523 tests) on the RTX 3080 has 7 failing tests; the 4 that also fail on main fd4aeed483 are agc_driver_stencil_plane_memory, agc_driver_msaa_dcc_unwatch, agc_storage_write_back_host_retile, and pr_overlap_names, which needs a newer Python than my 3.10. Intermittent in this run (pass when rerun alone, or known flaky): agc_driver_store_over_untracked, agc_driver_store_over_untracked, agc_storage_write_back_host_retile. Traced to other PRs of the batch, each by reverting it and testing again: #19101 (guest_video_out_window_margins_bounds); none is in this PR's area. Failing tests I could not trace to a single PR (reverting the likely candidates did not clear them): agc_driver_image_gather_lod. The 2125 agc_/video tests on the iGPU have 5 failing: agc_driver_image_gather_lod, agc_driver_stencil_plane_memory, agc_driver_store_over_untracked, agc_storage_write_back_host_retile, guest_video_out_window_margins_bounds (agc_driver_stencil_plane_memory also fails on main).

This is one combined tree, not a run of this PR alone.

AI-assisted: yes (Claude Code)

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.

6 participants