Skip to content

docs(debt): name what KytyPS5 does for sceAmprMeasureCommandSizeReadFile - #14471

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
xXPBSXx:fu/q6-ampr-measure-debt
Nov 1, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
xXPBSXx:fu/q6-ampr-measure-debt

Conversation

@xXPBSXx

@xXPBSXx xXPBSXx commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

What

Adds one entry to the libSceAmpr technical debt: sceAmprMeasureCommandSizeReadFile takes no argument and returns the size of the host command record every time, so it never fails, and the commit that added it names no measurement. KytyPS5 (PS5), the only one of the three emulators with libSceAmpr (shadPS4 and fpPS4 only list the names), takes four arguments and returns KERNEL_ERROR_EINVAL when the destination range or the file offset is out of range, and otherwise 0x14, or 0x18 when the offset needs more than 32 bits. The entry says only what KytyPS5 does and what this library does; it does not say which signature is right, and no code or test changes.

Tested

Documentation only. tools/check_conventions.py --base upstream/main passes. Based on main f1a7b02028, and it merges with main e450145140 without a conflict (checked 2026-11-01 at 14:51 UTC). I read sceAmprMeasureCommandSizeReadFile and its range and offset checks in KytyPS5 src/libs/libAmpr.cpp at commit 5e837a9beac82c031868eaad9348d6a48245fb99, searched shadPS4 and fpPS4 for AmprMeasure (shadPS4 has it only in its name table, fpPS4 only in name lists), and read our function in Export.cpp and its call in GuestAmpr.cpp. Not run: a build or a test, because nothing but the debt file changes.

Overlap

Checked on 2026-11-01 against main f1a7b02028ae50adaf6c5aaaef892a51841b25bf (1669 open pull requests, listed at 13:30 UTC; the merge checks ran from 13:30 UTC to 13:43 UTC). I took the changed files of each from git diff --name-only against its merge base. Seven of them change libSceAmpr files or GuestAmpr.cpp: #14212, #13990, #13730, #12581, #10025, #7648 and #7081. Only #14212 changes docs/dev/debt/libSceAmpr.md, and it conflicts with this head but also conflicts with main on its own, so not because of this entry; #10025 and #7081 conflict with main on their own too, and #13990, #13730, #12581 and #7648 merge cleanly with this head. None of the seven has a changed line that names sceAmprMeasureCommandSizeReadFile. None of the 34 pull requests opened since (#14431 to #14469, listed at 14:51 UTC) changes a libSceAmpr file.

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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

AI-assisted (Claude Code).

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the docs label Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 14212 docs/dev/debt/libSceAmpr.md

@oneandonlydean oneandonlydean self-assigned this Nov 1, 2026
@oneandonlydean
oneandonlydean merged commit 6fae420 into boykopovar:main Nov 1, 2026
10 checks passed
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head e30c19a merged onto main f2d874c · tested 2026-11-01 22:57 UTC · 13 min

GPU AMD Radeon RX 6300 (RADV NAVI24), driver Mesa 25.2.8-0ubuntu0.24.04.4, Vulkan 1.4.318
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 833 passed · 4 failed (0 new, 3 also fail on main, 1 unstable on main) · 2 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 839 of 3,168 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (408 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.0 s, ⚠️ public_headers 76.0 s, ⚠️ unwrap_self 40.0 s
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 3 of the last 5 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
agc_driver_native_depth_bda_clear
agc_driver_native_multisample_depth
Validation IDs already present on main (4 IDs in 347 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (347 tests): agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, agc_driver_bindless_images, and 339 more
VUID-vkCmdCopyImage-srcImage-01548 (6 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (6 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkShaderModuleCreateInfo-pCode-08737 (1 test): agc_driver_image_sample_derivatives
Skipped (2)
agc_driver_copied_writer_label_order: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_ngg_vertex_wave_reduction: skipped, s3 describes a 32-lane wave only on 32-lane subgroups, and the device has 64 lanes
Reproduce
git fetch origin e30c19a60255f096da2f110bfe4db19c7903e295 f2d874c1fdccf781c0fa5d86619bb5dd8894b958
git checkout f2d874c1fdccf781c0fa5d86619bb5dd8894b958 && git merge --no-ff e30c19a60255f096da2f110bfe4db19c7903e295
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 12 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 16 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@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 — no blocking findings

Documentation only: one debt line about sceAmprMeasureCommandSizeReadFile. The line says the export takes no argument and returns the size of the host command record every time. The base implementation does exactly that (libSceAmpr/Export.cpp lines 663-665, return sizeof(Apr::ReadFileCommand)). The rest of the line describes another emulator's code, which I did not check.

What I ran

  • Head e30c19a60255f096da2f110bfe4db19c7903e295; base e450145140... (the base moved; the diff is against the PR's own base). 1 file, +1/-0: docs/dev/debt/libSceAmpr.md.
  • Read the debt line and the base implementation of sceAmprMeasureCommandSizeReadFile.
  • Read-only checks from the trusted main checkout (precheck not run: no PR-head code is run here): diff check and conventions passed.
  • Hosted: no CTest relevance for a documentation change.
  • No MarcZX10 review at this head.

Results

Check Result Note
Diff check passed
Conventions and PR template passed conventions check from the main checkout
Mergeability and dependencies passed depends on none; the stack check passed
Export description matches the base code passed takes no argument; returns sizeof(Apr::ReadFileCommand)
Claims about another emulator's code not verified external repository, not checked
Build and runtime tests not run documentation only
Negative controls not run not applicable
Hosted CI passed windows passed; linux and relinkers skipped
Read-only check output

Precheck was not run: no PR-head code is run here. Conventions: passed. Hosted: gh api repos/boykopovar/AnyPS5/commits/e30c19a60255f096da2f110bfe4db19c7903e295/check-runs.

Negative control

Not applicable: documentation only.

Findings

Blocking

None.

Non-blocking

None.

Sources

Not verified

  • The emulator comparison in the debt line (an external repository and commit) was not checked.

To get this to a good state

  • Nothing to change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants