Skip to content

feat(libScePad): read per-title input profiles beside the shared input file - #14313

Merged
oneandonlydean merged 7 commits into
boykopovar:mainfrom
oneandonlydean:carry-7499
Nov 4, 2026
Merged

oneandonlydean merged 7 commits into
boykopovar:mainfrom
oneandonlydean:carry-7499

Conversation

@oneandonlydean

Copy link
Copy Markdown
Collaborator

What

Carried from #7499 by @AlxcBTW (fork archived). Their commit keeps its authorship; the commits added here merge current main and change the profile examples to a placeholder title ID.

anyps5-input.ini (or the file ANYPS5_INPUT_CONFIG names) applies to every title. Mouse sensitivity, curve and bindings that suit one title do not suit the next, and the only way to switch is to edit the file or set ANYPS5_INPUT_CONFIG for each launch.

Pad::LoadInputMapping(titleId) now reads a second file after the shared one: anyps5-input.<TITLEID>.ini in the same directory as the shared file (beside the executable, or beside the file ANYPS5_INPUT_CONFIG names), where <TITLEID> is the running title's ID from GetAppTitleId_nid_postfix. The profile has the same format and overrides only what it lists: an action it names replaces the bindings from the shared file (and the built-in ones), a setting it names replaces the shared value, everything else stays. A missing profile is not an error; an invalid line in one reports the profile's path and line like the shared file does. A title ID is used only if it has at most 32 characters of letters, digits, _ and - (Pad::InputProfileName), so an ID can never name a path outside the directory.

The parsing loop moved unchanged into one function (loadInputFile) that both files use; each file keeps its own "first line replaces, later lines add" and "setting given twice" state. With no profile, or no title ID, the result is the same as before. docs/user/INPUT_MAPPING.md has a "Per-game profiles" section.

Changes against the original PR:

  • Merged current main. In PadInput.cpp the modal dialog and host volume includes and the HostVolumeConfigureFromEnvironment_nid_no_patch() call from main are kept next to the title ID load; INPUT_MAPPING.md keeps both the per-game profiles section and main's current analog section.
  • The profile examples in INPUT_MAPPING.md and the pad_input_mapping test use the placeholder title ID PPSA00001 instead of a real title's ID.

Tested

  • Not built or run locally for this carry; CI on this branch reports the build and tests.
  • From feat(libScePad): read per-title input profiles beside the shared input file #7499, on its head 636cc9e before the merge:
    • Linux (Ubuntu 24.04, GCC 13, Mesa lavapipe runner), fork CI at 55b64a0 (the PR head 636cc9e plus the CI scaffolding commit; run 39115078106, ctest -R '^(pad_|guest_pad|video_out_mouse|mouse_input|keyboard_input)'): 9 of 9 passed, among them pad_input_mapping. Not run on Windows. An earlier run of the previous head (39113712815) failed to compile (InputBinding unqualified in the moved loop) and was fixed before this one.
    • New checks in pad_input_mapping: profile names (valid IDs, empty, path separator, dot, over the length limit); a profile overrides and adds settings and replaces the bindings of an action it lists; another title ID and no title ID keep the shared file; a partial profile keeps what it does not list; a profile may set a setting the shared file also sets; an invalid profile names its file and line and does not affect other titles.
    • Not tested in a game; the title ID wiring in PadInput (GetAppTitleId_nid_postfix, trimmed at the first NUL) is covered only by compiling.
    • python3 tools/check_conventions.py --base origin/main passes. tools/pr_overlap.py lists no overlap with a comparable pull request and could not compare feat(input): add native SDL input configuration with ImGui #674, feat(agc,videoout): save the displayed frame as a PNG with a screenshot key #4891 and Macos port #7201 (InputMapping.cpp, PadInput.cpp, InputMapping.hpp, docs); feat(input): add native SDL input configuration with ImGui #674 (an input editor) also changes PadInput.cpp and INPUT_MAPPING.md. Based on cdb7ed0.

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
  • Unblocks: none
  • AI-assisted: yes

AlxcBTW and others added 6 commits October 18, 2026 11:22
# Conflicts:
#	core/libs/prx/libSceVideoOut/tests/InputMapping.cpp
# Conflicts:
#	core/libs/prx/libSceVideoOut/tests/InputMapping.cpp
#	docs/user/INPUT_MAPPING.md
# Conflicts:
#	core/libs/prx/libSceVideoOut/src/PadInput.cpp
#	docs/user/INPUT_MAPPING.md
@MarcZX10

MarcZX10 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Re-checked — Windows CI fails in pad tests at 6e6d28c

The hosted Windows job on head 6e6d28c5887571a6174e08a2fa6e1b840eac072b reports six failing pad_* tests with exit code 0xc0000409, and the same test names pass in the Windows run on main 5c9837bfe7, so the cause is not yet established.

What I ran

  • Head 6e6d28c5887571a6174e08a2fa6e1b840eac072b, unchanged since the changes-requested review on this head. No new commit.
  • Read the failed hosted Windows job log: run 41289152477, job 124798085892 ("Build and run changed guest core/libs tests").
  • Read the Windows job log for main 5c9837bfe7: run 41288949548, job 124797879816, for the same test names.
  • No build, configure or compile. No local test run.
gh run view 41289152477 --repo boykopovar/AnyPS5 --job 124798085892 --log
gh run view 41288949548 --repo boykopovar/AnyPS5 --job 124797879816 --log

Results

Run Result
PR 6e6d28c5, Windows, changed guest core/libs tests 99% tests passed, 6 tests failed out of 2581
main 5c9837bfe7, Windows 100% tests passed, 0 tests failed out of 3264; the six test names are listed as Passed
PR run, unedited failure lines
2206/2581 Test #2671: pad_identify_invalid .....................................................***Failed    0.03 sec
	2667 - pad_sdl (Exit code 0xc0000409)
	2668 - pad_identify_connect (Exit code 0xc0000409)
	2669 - pad_identify_off (Exit code 0xc0000409)
	2670 - pad_identify_rumble (Exit code 0xc0000409)
	2690 - pad_port0 (Exit code 0xc0000409)
99% tests passed, 6 tests failed out of 2581
main run, selected lines from the log (leader dots shortened)
2640/3264 Test #2511: guest_pad  ...    Passed    5.22 sec
2655/3264 Test #2668: pad_identify_connect  ...    Passed    3.06 sec
2657/3264 Test #2667: pad_sdl  ...    Passed    5.46 sec
2658/3264 Test #2671: pad_identify_invalid  ...    Passed    0.04 sec
2677/3264 Test #2669: pad_identify_off  ...    Passed    3.05 sec
2682/3264 Test #2670: pad_identify_rumble  ...    Passed    3.06 sec
2785/3264 Test #2690: pad_port0  ...    Passed    3.85 sec
100% tests passed, 0 tests failed out of 3264

Findings

Blocking: none that I can substantiate from the logs alone.

Non-blocking, needed to read the Windows result as clean:

  • This PR changes libScePad sources, and the six failing tests are pad tests. The 0xc0000409 exit on all six points to a crash rather than an assertion. The PR run covers only the changed-tests set (2581 tests), so the comparison above is between two different test sets that share these names.
  • Please check whether the failure reproduces on a rerun of the Windows job for this head. If it does, the cause needs to be found before the Windows result can be called clean. If it does not, a note in the PR saying so is enough.

Sources

Not verified

  • The crash was not reproduced; no build was run here.
  • Whether the failure is caused by this PR, by the runner, or by the test environment was not established.
  • Hosted Linux and the specialized jobs for this head were not part of this check.

@MarcZX10

MarcZX10 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Re-checked — Windows pad failures traced to metadata lookup

The changed default constructor now calls a metadata accessor that throws when neither param.json nor param.sfo exists, which accounts for the six failing Windows pad tests.

PadInput::PadInput() calls appTitleId() before constructing the input mapping; appTitleId() calls GetAppTitleId_nid_postfix(), whose ensureTitleLoaded() path parses those files and throws when neither exists. The Windows log shows param.json or param.sfo not found in pad_sdl, pad_identify_connect, pad_identify_off, pad_identify_rumble, and pad_port0. pad_identify_invalid also fails: its test expects the invalid ANYPS5_PAD_IDENTIFY error, but construction now throws for missing metadata before reaching that validation. pad_input_mapping passes because it does not exercise PadInput construction.

Please preserve default pad initialization when app metadata is unavailable while applying a title profile when an ID is available, and add coverage for constructing PadInput without either metadata file. Then rerun the affected Windows pad tests. The existing changes-requested review remains in place.

Sources: constructor and title lookup, metadata load failure, invalid-mode test, Windows CI log.

@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 — changes requested

The change is credited to its original author, but the same implementation remains open in #7499, leaving two active PRs for one feature.

What I ran

Reviewed head 6e6d28c5887571a6174e08a2fa6e1b840eac072b against the PR base 5c9837bfe7c5533f2c77c968dd8193157a8c342a; the current main tip is 1f2c1da1fbc2e455b921616cdacb5a714d7fe7ba. The exact head merges cleanly onto current main. Environment: Linux x86_64, Python 3.11.2, Git 2.39.5; no compiler was used.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14313
git diff --check 5c9837bfe7c5533f2c77c968dd8193157a8c342a...6e6d28c5887571a6174e08a2fa6e1b840eac072b
python3 tools/check_conventions.py --base 5c9837bfe7c5533f2c77c968dd8193157a8c342a --head 6e6d28c5887571a6174e08a2fa6e1b840eac072b --title 'feat(libScePad): read per-title input profiles beside the shared input file' --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14313-6e6d28c58875/pr-body.md
python3 tools/pr_stack_check.py 14313 --repo boykopovar/AnyPS5
gh pr checks 14313 --repo boykopovar/AnyPS5
gh api repos/boykopovar/AnyPS5/pulls/7499/commits?per_page=100

The precheck's isolated checkout could not find the workspace-only ABI and test-quality helper scripts. The C++ input-mapping test was not run locally; hosted CI has an input-mapper result for this head.

Results

Check Result
Patch whitespace Passed.
Conventions and PR template Passed.
Current-main merge preview Clean against 1f2c1da1fbc2e455b921616cdacb5a714d7fe7ba.
Hosted input-mapper check Passed on this head.
Hosted Windows build Pending at the last refresh.
Linux and specialized hosted jobs Skipped.
Precheck helper coverage Its ABI and test-quality helper invocations were unavailable in the detached checkout; this is an environment limitation, not a reported project failure.
Selected raw output

Conventions:

All conventions checks passed.

Findings

Blocking

PR #7499 remains open at head 83021ee52aabb010fb1d2e6dbca8db60a0ddd96f, carries the same five changed paths, and is labeled needs rebase. Its fork is archived, which explains the carry-forward, and the original implementation commit 636cc9e585a42f6d23be667e751f4ae2e653c8a4 is preserved in this PR's history. The repository asks contributors to check for existing work before opening a PR. Please coordinate with #7499's author or the maintainers so one PR is explicitly treated as the successor and only one remains active for this feature.

Non-blocking

The commit history preserves AlxcBTW's original implementation authorship, as the PR description says. This request concerns the two simultaneously open PRs, not that credit.

Sources

Not verified

I did not configure or build locally, run the C++ input-mapping test locally, or test the profile lookup in a game. The Windows hosted job was pending; Linux and specialized jobs were skipped. The author-reported tests from #7499's earlier head are not independent verification of this head.

To get this to a good state

Coordinate which PR will carry the feature, mark the other as superseded, and update this PR's description or discussion with that relationship. I will rerun the no-build checks and recheck hosted CI on the resulting head.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 9154 core/libs/prx/libSceVideoOut/src/PadInput.cpp L5-6

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 7499 core/libs/prx/libScePad/include/InputMapping.hpp
core/libs/prx/libSceVideoOut/src/InputMapping.cpp
core/libs/prx/libSceVideoOut/src/PadInput.cpp
core/libs/prx/libSceVideoOut/tests/InputMapping.cpp
docs/user/INPUT_MAPPING.md
PR 10112 core/libs/prx/libSceVideoOut/src/PadInput.cpp
PR 11860 core/libs/prx/libSceVideoOut/tests/InputMapping.cpp
PR 14098 core/libs/prx/libSceVideoOut/tests/InputMapping.cpp

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 6e6d28c merged onto main e6f5730 · tested 2026-11-01 18:16 UTC · 23 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 870 passed · 3 failed (0 new, 1 also fail on main, 2 unstable on main) · 0 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 873 of 3,148 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 (426 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s
Intermittent validation messages (1, seen once in the parallel run, not reproduced when the test was re-run alone 2 times; not counted against this PR)
agc_driver_depth_clear_hle: VUID-vkCmdCopyBuffer-commonparent (6x)
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_depth_clear_hle: failed in 2 of the last 10 main runs
agc_driver_pipeline_journal: failed in 1 of the last 10 main runs
Failing on main too (1, not counted against this PR)
agc_driver_image_table
Validation IDs already present on main (5 IDs in 367 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (367 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 359 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_prepared_exports
VUID-VkShaderModuleCreateInfo-pCode-08737 (1 test): agc_driver_image_sample_derivatives
Reproduce
git fetch origin 6e6d28c5887571a6174e08a2fa6e1b840eac072b e6f57307fa7f47165d7fc1bee945abdb2f6816e7
git checkout e6f57307fa7f47165d7fc1bee945abdb2f6816e7 && git merge --no-ff 6e6d28c5887571a6174e08a2fa6e1b840eac072b
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 32 --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 4 --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 NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

…s mounted

PadInput() asked for the title ID while constructing, and
GetAppTitleId_nid_postfix throws when there is no param.json or
param.sfo, so pad tests and tools that mount no title failed. Return no
title ID when neither file exists and let any other metadata error
propagate.
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 9528d7d merged onto main f2d874c · tested 2026-11-02 00:39 UTC · 25 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 879 passed · 2 failed (0 new, 2 also fail on main) · 0 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 881 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 (429 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 114.9 s
Failing on main too (2, not counted against this PR)
agc_driver_dcc_keys_first_write
agc_driver_image_table
Validation IDs already present on main (5 IDs in 368 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (368 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 360 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_prepared_exports
VUID-VkShaderModuleCreateInfo-pCode-08737 (1 test): agc_driver_image_sample_derivatives
Reproduce
git fetch origin 9528d7dc9e2f79ef612e16c7d1a3c7c56f4e4447 f2d874c1fdccf781c0fa5d86619bb5dd8894b958
git checkout f2d874c1fdccf781c0fa5d86619bb5dd8894b958 && git merge --no-ff 9528d7dc9e2f79ef612e16c7d1a3c7c56f4e4447
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 32 --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 4 --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 NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@oneandonlydean
oneandonlydean merged commit 08f19f9 into boykopovar:main Nov 4, 2026
12 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