feat(tools): preview controller pulses without queuing #12879

Merged
StoneDC merged 1 commit from upstream-pr/12879 into main 2026-11-11 05:18:02 +00:00
StoneDC commented 2026-10-29 13:26:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by StoneDC on 2026-10-29T13:26:25Z.


What

Adds read-only preview_pad_input.py for a single pulse, including button chords, hold duration, sticks and touch. It prints a command accepted by the existing reader and never queues it or creates a command file. Existing pad_input.py is unchanged.

Implementation basis: Uses the current button_mask()/next_sequence() helpers and the existing pulse command grammar and value ranges. Real files test a sequence ahead of the clock, boundary-valued controls, reader acceptance, preservation, missing output, invalid fields and sequence exhaustion. This differs from #11816, which previews timeline events.

Known limits: The sequence is a read-time proposal and is not reserved against another writer. Preview does not verify that a missing parent directory could later be written or that a game consumed the command. Sequence recovery follows current next_sequence(); this does not include the separate timeline-body validation from #11885.

Existing implementation/schema: tools/pad_input.py

Exact topic head f90410dcc7b6f9c8dff65c7b25515ca92dfcb6c3 is one independent commit on main 5454cd2e455994d992aca39335ce60507eeda1eb. The repository overlap checker against 5454cd2e455994d992aca39335ce60507eeda1eb reported no confirmed overlap. It could not complete shared-file comparisons for older PRs already conflicting with main: #674, #1835, #3786, #5021, #9508, #9539. Scoped file diffs were reviewed separately. 5 file changes projected onto main and then combined with this topic without a new conflict; 1 peer file changes already conflict with main and are not claimed automatically mergeable. They do not provide this feature or test matrix. The new test has its own source and registration, with no required landing order. If shared registration code changes before landing, this branch needs refreshed merge and affected test checks. Depends on: none. The 20 independent topics also merged together into tested integration 81a0f73e5972352ba2b50ce53077921c51112273 on the same main.

Tested

Tested topic head: f90410dcc7b6f9c8dff65c7b25515ca92dfcb6c3. Final combined integration: 81a0f73e5972352ba2b50ce53077921c51112273, main 5454cd2e455994d992aca39335ce60507eeda1eb. Ubuntu/WSL GCC 15.2, CMake 4.2.3, Python 3.14.4; Windows MinGW GCC 15.2, CMake 4.3.1, Python 3.14.3.

python tools/tests/test_pad_preview.py: 2 tests passed on each platform, no skips. The focused registered CTest tools_pad_preview passed on both platforms. A mutation in the actual tool code was rejected by this fixture.

cmake --build <full-linux-build> --parallel 8: full Linux default product build passed, including a final build at the integration above. Windows used the full configuration and built the affected libc/test targets and relinker with --parallel 8; a complete default Windows build is not claimed. ctest --test-dir <build> -R "^(tools_sanitizer_json|tools_annotation_symbols_json|tools_compile_plan|tools_catalog_json|tools_nid_offline|tools_audit_strict_partial|tools_intervals_complete|tools_pad_preview|tools_release_notes_check|tools_progress_diff_json|guest_memmove_snapshot|guest_memcpy_protected|guest_memcmp_protected|guest_span_protected|guest_substring_protected|guest_tokenizer_protected|guest_strncpy_protected|guest_strncat_protected|guest_wmemmove_snapshot|guest_wide_length_protected)$" -j 8 -V --output-on-failure: 20/20 passed on each platform, zero skips. Conventions, whitespace, script registration and the public-header audit passed. No PS5/title execution or GPU validation protocol was run; macOS and hosted full-build CI are not reported as passed.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5068854762 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12879). Originally posted by [StoneDC](https://github.com/StoneDC) on 2026-10-29T13:26:25Z. --- ### What Adds read-only `preview_pad_input.py` for a single pulse, including button chords, hold duration, sticks and touch. It prints a command accepted by the existing reader and never queues it or creates a command file. Existing pad_input.py is unchanged. Implementation basis: Uses the current button_mask()/next_sequence() helpers and the existing pulse command grammar and value ranges. Real files test a sequence ahead of the clock, boundary-valued controls, reader acceptance, preservation, missing output, invalid fields and sequence exhaustion. This differs from #11816, which previews timeline events. Known limits: The sequence is a read-time proposal and is not reserved against another writer. Preview does not verify that a missing parent directory could later be written or that a game consumed the command. Sequence recovery follows current next_sequence(); this does not include the separate timeline-body validation from #11885. Existing implementation/schema: [tools/pad_input.py](https://github.com/boykopovar/AnyPS5/blob/5454cd2e455994d992aca39335ce60507eeda1eb/tools/pad_input.py) Exact topic head `f90410dcc7b6f9c8dff65c7b25515ca92dfcb6c3` is one independent commit on main `5454cd2e455994d992aca39335ce60507eeda1eb`. The repository overlap checker against `5454cd2e455994d992aca39335ce60507eeda1eb` reported no confirmed overlap. It could not complete shared-file comparisons for older PRs already conflicting with main: #674, #1835, #3786, #5021, #9508, #9539. Scoped file diffs were reviewed separately. 5 file changes projected onto main and then combined with this topic without a new conflict; 1 peer file changes already conflict with main and are not claimed automatically mergeable. They do not provide this feature or test matrix. The new test has its own source and registration, with no required landing order. If shared registration code changes before landing, this branch needs refreshed merge and affected test checks. Depends on: none. The 20 independent topics also merged together into tested integration `81a0f73e5972352ba2b50ce53077921c51112273` on the same main. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Tested topic head: `f90410dcc7b6f9c8dff65c7b25515ca92dfcb6c3`. Final combined integration: `81a0f73e5972352ba2b50ce53077921c51112273`, main `5454cd2e455994d992aca39335ce60507eeda1eb`. Ubuntu/WSL GCC 15.2, CMake 4.2.3, Python 3.14.4; Windows MinGW GCC 15.2, CMake 4.3.1, Python 3.14.3. `python tools/tests/test_pad_preview.py`: 2 tests passed on each platform, no skips. The focused registered CTest `tools_pad_preview` passed on both platforms. A mutation in the actual tool code was rejected by this fixture. `cmake --build <full-linux-build> --parallel 8`: full Linux default product build passed, including a final build at the integration above. Windows used the full configuration and built the affected libc/test targets and relinker with `--parallel 8`; a complete default Windows build is not claimed. `ctest --test-dir <build> -R "^(tools_sanitizer_json|tools_annotation_symbols_json|tools_compile_plan|tools_catalog_json|tools_nid_offline|tools_audit_strict_partial|tools_intervals_complete|tools_pad_preview|tools_release_notes_check|tools_progress_diff_json|guest_memmove_snapshot|guest_memcpy_protected|guest_memcmp_protected|guest_span_protected|guest_substring_protected|guest_tokenizer_protected|guest_strncpy_protected|guest_strncat_protected|guest_wmemmove_snapshot|guest_wide_length_protected)$" -j 8 -V --output-on-failure`: 20/20 passed on each platform, zero skips. Conventions, whitespace, script registration and the public-header audit passed. No PS5/title execution or GPU validation protocol was run; macOS and hosted full-build CI are not reported as passed. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes
BunnyFl commented 2026-11-02 01:50:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-02T01:50:04Z.

Review: APPROVED


Windows 11, Python 3.14.7. Head f90410dcc7 merged into upstream/main 93dbd0f82a:

  • tools/tests/test_pad_preview.py: 2 tests OK.
  • Without the new tool, test_preview_matches_the_existing_command_reader_without_writes fails, as expected.
  • check_test_registration.py --scripts passes, and this merges cleanly together with #12767 and #12874.

pad_input.py on main has no preview mode, and preview_pad_timeline.py previews timelines only, so this doesn't duplicate an existing path. Reusing button_mask() and next_sequence() keeps the preview in step with what pad_input.py would queue.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5731331116 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12879#pullrequestreview-5731331116). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-02T01:50:04Z. **Review:** APPROVED --- Windows 11, Python 3.14.7. Head f90410dcc7 merged into upstream/main 93dbd0f82a: - `tools/tests/test_pad_preview.py`: 2 tests OK. - Without the new tool, `test_preview_matches_the_existing_command_reader_without_writes` fails, as expected. - `check_test_registration.py --scripts` passes, and this merges cleanly together with #12767 and #12874. `pad_input.py` on main has no preview mode, and `preview_pad_timeline.py` previews timelines only, so this doesn't duplicate an existing path. Reusing `button_mask()` and `next_sequence()` keeps the preview in step with what `pad_input.py` would queue.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!12879
No description provided.