feat(tools): preview controller timelines without queuing #11816

Merged
StoneDC merged 1 commit from upstream-pr/11816 into main 2026-10-29 11:58:01 +00:00
StoneDC commented 2026-10-27 08:41:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by StoneDC on 2026-10-27T08:41:51Z.


What

Add tools/preview_pad_timeline.py to inspect compiled controller events without queuing commands. Reuse compile_timeline with a private placeholder sequence, then expose only event timing/buttons, count and duration as text or JSON. Text deliberately has no APS5_PAD_TIMELINE queue header; JSON identifies itself as a preview and omits sequence fields.

Rebased onto upstream main 3fea2a937ba9fbab2f06c51691fe0c5763659aa3 in 1f563f246edd666b636b658b36ba204277fe150d to address the review's branch-currency request. Main is an ancestor of this head. The feature implementation and its regression-test file are byte-identical to the previously reviewed versions; no functionality was added during this update.

Tested

Exact tested head: 1f563f246edd666b636b658b36ba204277fe150d. Base: upstream main 3fea2a937ba9fbab2f06c51691fe0c5763659aa3.

Windows: Python 3.14.3, MinGW GCC 15.2.0, CMake/CTest 4.3.1, Ninja. WSL Ubuntu: Python 3.14.4, GCC 15.2.0, CMake/CTest 4.2.3, Ninja.

Configured with -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_RELINKER_ONLY=ON; ran ctest --test-dir <build> -R '^(pad_timeline|preview_pad_timeline)$' --parallel 4 -V --output-junit <report>.

  • windows: 2/2 CTest groups, 22 unittest cases, zero failures, 1 inner skips; slowest group 2.58 s.
  • linux: 2/2 CTest groups, 22 unittest cases, zero failures, 0 inner skips; slowest group 0.38 s.

The four preview tests and 18 existing timeline tests exercise actual text/JSON CLI output, repeat/gap timing, invalid inputs, and unchanged command-file bytes/mtime and directory contents. Preview timing is checked against the real compiler with a different placeholder sequence. Windows skips one existing symlink test because creation privilege is unavailable; Linux executes it. That skip is not counted as an executed pass. No command is queued and no controller/game is exercised.

Native relinker-only builds and relinker --help pass on both platforms. Current-main conventions, whitespace, test-script registration audit (203 scripts), XML skip-policy checks and Python 3.9 grammar parsing pass. Grammar parsing is not execution on an older Python runtime. Every related CTest group is below 30 seconds.

The original feature and test blobs were compared with the previous PR head and are unchanged. The shared production helpers (performance_compare.py for CSV, pad_input.py/pad_timeline.py for preview) are also unchanged between the original base and this main revision. Current-main CMake registration and the relevant suites were exercised again on this exact head. No prerequisite or ordering dependency is introduced.

Earlier ten-PR combinations and related selected-file projections remain historical evidence at their recorded commits; they were not rerun or relabeled as final-head integration here. The original publication overlap scan was for the previous head; this update preserves the existing feature and registration patch while refreshing main.

New hosted CI is triggered for this head. Not run locally: native macOS, an actual older Python runtime, full system-library/product builds, browser/WASM, game/PS5 or GPU execution. Skipped or pending hosted jobs are not claimed as passes.

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 (host tools only)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5031013462 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11816). Originally posted by [StoneDC](https://github.com/StoneDC) on 2026-10-27T08:41:51Z. --- ### What Add tools/preview_pad_timeline.py to inspect compiled controller events without queuing commands. Reuse compile_timeline with a private placeholder sequence, then expose only event timing/buttons, count and duration as text or JSON. Text deliberately has no APS5_PAD_TIMELINE queue header; JSON identifies itself as a preview and omits sequence fields. Rebased onto upstream main `3fea2a937ba9fbab2f06c51691fe0c5763659aa3` in `1f563f246edd666b636b658b36ba204277fe150d` to address the review's branch-currency request. Main is an ancestor of this head. The feature implementation and its regression-test file are byte-identical to the previously reviewed versions; no functionality was added during this update. ### Tested Exact tested head: `1f563f246edd666b636b658b36ba204277fe150d`. Base: upstream main `3fea2a937ba9fbab2f06c51691fe0c5763659aa3`. Windows: Python 3.14.3, MinGW GCC 15.2.0, CMake/CTest 4.3.1, Ninja. WSL Ubuntu: Python 3.14.4, GCC 15.2.0, CMake/CTest 4.2.3, Ninja. Configured with `-G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_RELINKER_ONLY=ON`; ran `ctest --test-dir <build> -R '^(pad_timeline|preview_pad_timeline)$' --parallel 4 -V --output-junit <report>`. - windows: 2/2 CTest groups, 22 unittest cases, zero failures, 1 inner skips; slowest group 2.58 s. - linux: 2/2 CTest groups, 22 unittest cases, zero failures, 0 inner skips; slowest group 0.38 s. The four preview tests and 18 existing timeline tests exercise actual text/JSON CLI output, repeat/gap timing, invalid inputs, and unchanged command-file bytes/mtime and directory contents. Preview timing is checked against the real compiler with a different placeholder sequence. Windows skips one existing symlink test because creation privilege is unavailable; Linux executes it. That skip is not counted as an executed pass. No command is queued and no controller/game is exercised. Native relinker-only builds and `relinker --help` pass on both platforms. Current-main conventions, whitespace, test-script registration audit (203 scripts), XML skip-policy checks and Python 3.9 grammar parsing pass. Grammar parsing is not execution on an older Python runtime. Every related CTest group is below 30 seconds. The original feature and test blobs were compared with the previous PR head and are unchanged. The shared production helpers (`performance_compare.py` for CSV, `pad_input.py`/`pad_timeline.py` for preview) are also unchanged between the original base and this main revision. Current-main CMake registration and the relevant suites were exercised again on this exact head. No prerequisite or ordering dependency is introduced. Earlier ten-PR combinations and related selected-file projections remain historical evidence at their recorded commits; they were not rerun or relabeled as final-head integration here. The original publication overlap scan was for the previous head; this update preserves the existing feature and registration patch while refreshing main. New hosted CI is triggered for this head. Not run locally: native macOS, an actual older Python runtime, full system-library/product builds, browser/WASM, game/PS5 or GPU execution. Skipped or pending hosted jobs are not claimed as passes. <!-- 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. --> ### 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 (host tools only) - [x] AI-assisted: <!-- yes / no --> yes
MarcZX10 commented 2026-10-27 08:46:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T08:46:50Z.

Review: APPROVED


Reviewed head b536d3445aff458ce65c91ae1d5ceef18e8fd8f3 against current main. The preview passes only the document and timing options to compile_timeline with a local placeholder sequence; it has no command-file path or queue_timeline call. Its text and JSON projections omit the queue header and sequence, and duration is taken from the final event so the trailing inter-repeat gap is excluded. I extracted the exact PR blobs and ran the existing timeline suite plus the new preview suite under Python 3.11: 22 tests passed, 0 failures. The three-way merge tree with current main is clean, and GitHub path searches found no open PR editing these preview/compiler files. Hosted relinker/Windows checks are still pending; Linux product jobs are skipped, which is consistent with this host-tool-only change. The author-reported Windows/WSL coverage is documented in the PR, not independently rerun here.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5664307887 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11816#pullrequestreview-5664307887). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T08:46:50Z. **Review:** APPROVED --- Reviewed head b536d3445aff458ce65c91ae1d5ceef18e8fd8f3 against current main. The preview passes only the document and timing options to compile_timeline with a local placeholder sequence; it has no command-file path or queue_timeline call. Its text and JSON projections omit the queue header and sequence, and duration is taken from the final event so the trailing inter-repeat gap is excluded. I extracted the exact PR blobs and ran the existing timeline suite plus the new preview suite under Python 3.11: 22 tests passed, 0 failures. The three-way merge tree with current main is clean, and GitHub path searches found no open PR editing these preview/compiler files. Hosted relinker/Windows checks are still pending; Linux product jobs are skipped, which is consistent with this host-tool-only change. The author-reported Windows/WSL coverage is documented in the PR, not independently rerun here.
MarcZX10 commented 2026-10-27 09:30:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T09:30:52Z.

Review: DISMISSED


I rechecked the base after my earlier content review. The preview and test files are unchanged, and I reran the existing timeline suite plus the exact preview suite against current main's pad_input.py/pad_timeline.py: all 22 tests passed on Python 3.11. Current conventions, intake, eligibility, and labels pass; Windows product/relinker and Ubuntu/Windows relinker jobs passed, while macOS relinker jobs remain pending.

GitHub still reports base 5d52b06ff3de0b2ce640dd296db465295c80e7fa, whereas current upstream main is 801d5b9bc11049e6274daca09d70690bd5b8d0a9. CONTRIBUTING asks branches to stay current with main. Please update the branch and rerun conventions; I am changing my earlier approval to request that policy fix before merge. I found no new issue in the preview implementation.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5664890083 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11816#pullrequestreview-5664890083). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T09:30:52Z. **Review:** DISMISSED --- I rechecked the base after my earlier content review. The preview and test files are unchanged, and I reran the existing timeline suite plus the exact preview suite against current `main`'s `pad_input.py`/`pad_timeline.py`: all 22 tests passed on Python 3.11. Current conventions, intake, eligibility, and labels pass; Windows product/relinker and Ubuntu/Windows relinker jobs passed, while macOS relinker jobs remain pending. GitHub still reports base `5d52b06ff3de0b2ce640dd296db465295c80e7fa`, whereas current upstream `main` is `801d5b9bc11049e6274daca09d70690bd5b8d0a9`. CONTRIBUTING asks branches to stay current with `main`. Please update the branch and rerun conventions; I am changing my earlier approval to request that policy fix before merge. I found no new issue in the preview implementation.
THEMANnt commented 2026-10-28 04:21:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-28T04:21:36Z.

Review: APPROVED


Reviewed 1f563f246edd666b636b658b36ba204277fe150d — approve. The preview command delegates validation and compilation to the existing timeline compiler and emits scheduled events without opening a controller command file.

Windows/Python 3.11: head 4 passed (4 total). This is a new command; there is no prior implementation for a behavioral regression control. The cases cover valid previews, repeated timelines, invalid input and CLI output. No controller or title was driven.

The inspected hosted Windows relinker job merged this exact head and completed successfully. This is not a full product or game build.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5677755659 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11816#pullrequestreview-5677755659). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-28T04:21:36Z. **Review:** APPROVED --- Reviewed `1f563f246edd666b636b658b36ba204277fe150d` — approve. The preview command delegates validation and compilation to the existing timeline compiler and emits scheduled events without opening a controller command file. Windows/Python 3.11: head 4 passed (4 total). This is a new command; there is no prior implementation for a behavioral regression control. The cases cover valid previews, repeated timelines, invalid input and CLI output. No controller or title was driven. The inspected hosted Windows relinker job merged this exact head and completed successfully. This is not a full product or game build.
MarcZX10 commented 2026-10-29 07:44:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T07:44:14Z.

Review: APPROVED


Re-reviewed — approved

The preview reuses the production timeline compiler and exposes only event data; the CLI tests confirm that it does not create or modify controller command files.

What I checked

  • Reviewed exact head 1f563f246edd666b636b658b36ba204277fe150d against live main 10bec5c322eb581b3e959e6c7e18bcf09e068e96.
  • preview() delegates validation and event timing to pad_timeline.compile_timeline, then removes the private placeholder sequence/header from its output. Text output does not emit the queue header; JSON has no sequence field.
  • Applied the PR diff to a detached worktree at live main and ran both the new preview suite and the existing timeline suite. This also exercised the main-branch duplicate-button validation added since the PR base.
  • Ran the repository overlap checker. It could not compare six older PRs because their CMakeLists.txt branches conflict with main; I inspected those additions (#674, #1835, #3786, #5021, #9508, #9539). They add separate tests or options; none duplicates or edits the preview_pad_timeline registration.
  • Current-main merge preview is clean; conventions and diff checks pass.

Results

Check Result
Current-main merge preview Clean (eed741b6bf68ab4d1203d015a516aaaa76ee164b)
PR-head preview tests 4/4 passed
Live-main + PR preview tests 4/4 passed
Live-main timeline tests 21/21 passed
Conventions Pass
Diff check Pass; no output
Hosted checks Windows, all relinker platforms, ASan, conventions, labels, eligibility, and report pass; product Linux and specialized jobs skipped
Raw test output
# Exact PR head
Ran 4 tests in 0.236s
OK

# PR diff applied to live main
Ran 4 tests in 0.174s
OK
Ran 21 tests in 0.363s
OK

All conventions checks passed.

Negative control

No separate mutation control was reported or run. The suite does directly check that preview leaves existing command-file bytes, modification time, and directory contents unchanged.

Findings

Blocking

None found in the preview logic, side-effect boundary, or current-main integration.

Non-blocking

I did not run the native relinker build or the full CTest matrix locally. The hosted relinker jobs pass. The overlap tool's six uncomparable CMake warnings were manually checked as described above.

Sources

Not verified

I did not run Windows, macOS, controller hardware, a game, or the full CTest matrix locally. The 25 Python tests above ran on the live-main-plus-PR source tree in this Linux environment.

To get this to a good state

No further change is needed for the preview behavior reviewed here.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5694350326 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11816#pullrequestreview-5694350326). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T07:44:14Z. **Review:** APPROVED --- # Re-reviewed — approved The preview reuses the production timeline compiler and exposes only event data; the CLI tests confirm that it does not create or modify controller command files. ## What I checked - Reviewed exact head `1f563f246edd666b636b658b36ba204277fe150d` against live `main` `10bec5c322eb581b3e959e6c7e18bcf09e068e96`. - `preview()` delegates validation and event timing to `pad_timeline.compile_timeline`, then removes the private placeholder sequence/header from its output. Text output does not emit the queue header; JSON has no sequence field. - Applied the PR diff to a detached worktree at live `main` and ran both the new preview suite and the existing timeline suite. This also exercised the main-branch duplicate-button validation added since the PR base. - Ran the repository overlap checker. It could not compare six older PRs because their `CMakeLists.txt` branches conflict with main; I inspected those additions (#674, #1835, #3786, #5021, #9508, #9539). They add separate tests or options; none duplicates or edits the `preview_pad_timeline` registration. - Current-main merge preview is clean; conventions and diff checks pass. ## Results | Check | Result | |---|---| | Current-main merge preview | Clean (`eed741b6bf68ab4d1203d015a516aaaa76ee164b`) | | PR-head preview tests | 4/4 passed | | Live-main + PR preview tests | 4/4 passed | | Live-main timeline tests | 21/21 passed | | Conventions | Pass | | Diff check | Pass; no output | | Hosted checks | Windows, all relinker platforms, ASan, conventions, labels, eligibility, and report pass; product Linux and specialized jobs skipped | <details><summary>Raw test output</summary> ```text # Exact PR head Ran 4 tests in 0.236s OK # PR diff applied to live main Ran 4 tests in 0.174s OK Ran 21 tests in 0.363s OK All conventions checks passed. ``` </details> ## Negative control No separate mutation control was reported or run. The suite does directly check that preview leaves existing command-file bytes, modification time, and directory contents unchanged. ## Findings ### Blocking None found in the preview logic, side-effect boundary, or current-main integration. ### Non-blocking I did not run the native relinker build or the full CTest matrix locally. The hosted relinker jobs pass. The overlap tool's six uncomparable CMake warnings were manually checked as described above. ## Sources - [Preview implementation at reviewed head](https://github.com/boykopovar/AnyPS5/blob/1f563f246edd666b636b658b36ba204277fe150d/tools/preview_pad_timeline.py) - [Preview tests at reviewed head](https://github.com/boykopovar/AnyPS5/blob/1f563f246edd666b636b658b36ba204277fe150d/tools/tests/test_preview_pad_timeline.py) - [Timeline compiler at live main](https://github.com/boykopovar/AnyPS5/blob/10bec5c322eb581b3e959e6c7e18bcf09e068e96/tools/pad_timeline.py) - [Timeline regression tests at live main](https://github.com/boykopovar/AnyPS5/blob/10bec5c322eb581b3e959e6c7e18bcf09e068e96/tools/tests/test_pad_timeline.py) - [Live main](https://github.com/boykopovar/AnyPS5/commit/10bec5c322eb581b3e959e6c7e18bcf09e068e96) ## Not verified I did not run Windows, macOS, controller hardware, a game, or the full CTest matrix locally. The 25 Python tests above ran on the live-main-plus-PR source tree in this Linux environment. ## To get this to a good state No further change is needed for the preview behavior reviewed here.
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!11816
No description provided.