fix(tools): round-trip input mapping settings in the input mapper #11860

Merged
rooklz merged 3 commits from upstream-pr/11860 into main 2026-11-04 17:36:18 +00:00
rooklz commented 2026-10-27 09:58:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-27T09:58:28Z.


What

anyps5-input.ini accepts twelve setting lines next to bindings (LeftStickDeadzone, RightStickDeadzone, MouseSensitivity, MouseVerticalScale, MouseCurve, MouseDeadzoneOffset, MouseMaxSpeed, MouseSmoothingMs, MouseDecayMs, StickModifierScale, KeyboardRampMs, TriggerRampMs); docs/user/INPUT_MAPPING.md documents them with examples like MouseSensitivity = 2.5 and StickModifierScale = 0.4.

The input mapper rejected every one of those lines at import (Expected Action = TYPE:VALUE.), so a documented configuration could not be imported at all, and an export from the tool could not carry settings, so a bindings-only round trip dropped them.

  • validation.js mirrors the native setting table; a test asserts names and order against the InputSettingName{...} array in core/libs/prx/libSceVideoOut/src/InputMapping.cpp, the same way the existing tests mirror the action list and built-in bindings.
  • Values are validated with the native grammar and ranges: whole percentages 0-90 for the deadzones, greater than 0 and at most 10 for the sensitivity, and the documented minimum and maximum for every other setting, in the std::from_chars grammar (no leading +, no hex, exponent forms accepted).
  • A setting set more than once is refused with the native wording; unknown names stay import errors, as the native parser refuses them too.
  • parseIni returns the settings it read, serialize writes them after the bindings in table order, and the app carries them through preview, download, copy, reset and the unsaved-changes tracking. New diagnostics are translated for ar-EG like the existing ones.

Tested

  • npm --prefix tools/input-mapper test: 32 tests pass, 8 new: the native setting-table mirror, a documented-configuration round trip (BOM, CRLF, inline comments), a settings-only import, case canonicalization of setting names, line-numbered refusals for out-of-range and malformed values, the duplicate refusal, serialize refusing invalid settings, and the ar-EG diagnostics.
  • macOS 15 (arm64), node 26: tools/check_conventions.py --base upstream/main and tools/pr_overlap.py pass; the relinker-only build with BUILD_TESTING passes ctest 361/361.
  • Not exercised by hand in a browser; the app changes only thread the imported settings through the existing preview, download, copy, reset and dirty-state call sites.

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:5031982723 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11860). Originally posted by [rooklz](https://github.com/rooklz) on 2026-10-27T09:58:28Z. --- ### What `anyps5-input.ini` accepts twelve setting lines next to bindings (`LeftStickDeadzone`, `RightStickDeadzone`, `MouseSensitivity`, `MouseVerticalScale`, `MouseCurve`, `MouseDeadzoneOffset`, `MouseMaxSpeed`, `MouseSmoothingMs`, `MouseDecayMs`, `StickModifierScale`, `KeyboardRampMs`, `TriggerRampMs`); `docs/user/INPUT_MAPPING.md` documents them with examples like `MouseSensitivity = 2.5` and `StickModifierScale = 0.4`. The input mapper rejected every one of those lines at import (`Expected Action = TYPE:VALUE.`), so a documented configuration could not be imported at all, and an export from the tool could not carry settings, so a bindings-only round trip dropped them. - `validation.js` mirrors the native setting table; a test asserts names and order against the `InputSettingName{...}` array in `core/libs/prx/libSceVideoOut/src/InputMapping.cpp`, the same way the existing tests mirror the action list and built-in bindings. - Values are validated with the native grammar and ranges: whole percentages 0-90 for the deadzones, greater than 0 and at most 10 for the sensitivity, and the documented minimum and maximum for every other setting, in the `std::from_chars` grammar (no leading `+`, no hex, exponent forms accepted). - A setting set more than once is refused with the native wording; unknown names stay import errors, as the native parser refuses them too. - `parseIni` returns the settings it read, `serialize` writes them after the bindings in table order, and the app carries them through preview, download, copy, reset and the unsaved-changes tracking. New diagnostics are translated for ar-EG like the existing ones. ### Tested - `npm --prefix tools/input-mapper test`: 32 tests pass, 8 new: the native setting-table mirror, a documented-configuration round trip (BOM, CRLF, inline comments), a settings-only import, case canonicalization of setting names, line-numbered refusals for out-of-range and malformed values, the duplicate refusal, `serialize` refusing invalid settings, and the ar-EG diagnostics. - macOS 15 (arm64), node 26: `tools/check_conventions.py --base upstream/main` and `tools/pr_overlap.py` pass; the relinker-only build with `BUILD_TESTING` passes ctest 361/361. - Not exercised by hand in a browser; the app changes only thread the imported settings through the existing preview, download, copy, reset and dirty-state call sites. ### Checklist - [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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical 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: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-27 10:33:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T10:33:18Z.

Review: COMMENTED


The focused input-mapper suite passes locally (32/32). I found one small native-parity edge case: parseDeadzonePercent uses std::from_chars into a signed int, so -0 parses completely to 0 and passes the native 0–90 range check. I confirmed the host result locally; this PR’s ^\\d+$ check rejects the same LeftStickDeadzone = -0 input. Could you add a regression case and accept the signed-zero form (while still rejecting negative nonzero values)? This is a non-blocking compatibility note; the rest of the reviewed settings flow looks consistent with the native table and ranges.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5665646351 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11860#pullrequestreview-5665646351). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T10:33:18Z. **Review:** COMMENTED --- The focused input-mapper suite passes locally (32/32). I found one small native-parity edge case: `parseDeadzonePercent` uses `std::from_chars` into a signed `int`, so `-0` parses completely to `0` and passes the native 0–90 range check. I confirmed the host result locally; this PR’s `^\\d+$` check rejects the same `LeftStickDeadzone = -0` input. Could you add a regression case and accept the signed-zero form (while still rejecting negative nonzero values)? This is a non-blocking compatibility note; the rest of the reviewed settings flow looks consistent with the native table and ranges.
THEMANnt commented 2026-10-28 04:22:57 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Reviewed 7a091f0893b1ac50a79c2b5370f2650fd95f8f24 — comment; validation remains incomplete. Input settings now round-trip alongside bindings and participate in dirty-state, reset, preview, download and clipboard snapshots. Local Node checks pass, but hosted Windows CI failed.

Windows/Node: Node suites pass 33/33 on head and 24/24 on base. The inspected exact-head Windows job timed out in conventions_bom_shebang, check_compile_modes_test_library_directory_values_can_look_like_modes and conventions_env_reference_test_a_check_from_a_subdirectory_reports_the_same_findings. These logs do not establish a mapper defect; obtain a successful rerun. The added native signed-zero assertion and browser interaction were not executed locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5677763196 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11860#pullrequestreview-5677763196). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-28T04:22:57Z. **Review:** COMMENTED --- Reviewed `7a091f0893b1ac50a79c2b5370f2650fd95f8f24` — comment; validation remains incomplete. Input settings now round-trip alongside bindings and participate in dirty-state, reset, preview, download and clipboard snapshots. Local Node checks pass, but hosted Windows CI failed. Windows/Node: Node suites pass 33/33 on head and 24/24 on base. The inspected exact-head Windows job timed out in conventions_bom_shebang, check_compile_modes_test_library_directory_values_can_look_like_modes and conventions_env_reference_test_a_check_from_a_subdirectory_reports_the_same_findings. These logs do not establish a mapper defect; obtain a successful rerun. The added native signed-zero assertion and browser interaction were not executed locally.
THEMANnt commented 2026-10-28 17:06:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-28T17:06:29Z.

Review: APPROVED


Re-reviewed 68b434cca704a7fe4ba158c8a09f567cf8e81e66 — approve. Input settings round-trip with bindings and now participate in preview, download/clipboard snapshots, dirty-state and reset. Signed zero deadzones agree with the native parser.

Windows/Node: all 33 head and 24 baseline tests pass. Fresh GCC 15.3 Release builds also pass pad_input_mapping on both pinned revisions, including the new signed-zero assertion. In the actual local browser, importing a synthetic INI preserved three settings (including -0) and the Cross binding in the preview; Reset cleared both settings and bindings. The browser reported a download request, but its download-event wait timed out, so I do not claim the downloaded file was verified. Node serialization tests and source inspection cover that shared serializer.

Current-head hosted checks pass. Initial Node runs hit sandbox loopback restrictions and then missing sparse fixtures; both setup issues were corrected before the passing rerun. These are parser/UI checks, not rendering or title execution. No remaining actionable issue was found in this scope.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5686645483 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11860#pullrequestreview-5686645483). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-28T17:06:29Z. **Review:** APPROVED --- Re-reviewed `68b434cca704a7fe4ba158c8a09f567cf8e81e66` — approve. Input settings round-trip with bindings and now participate in preview, download/clipboard snapshots, dirty-state and reset. Signed zero deadzones agree with the native parser. Windows/Node: all 33 head and 24 baseline tests pass. Fresh GCC 15.3 Release builds also pass `pad_input_mapping` on both pinned revisions, including the new signed-zero assertion. In the actual local browser, importing a synthetic INI preserved three settings (including `-0`) and the Cross binding in the preview; Reset cleared both settings and bindings. The browser reported a download request, but its download-event wait timed out, so I do not claim the downloaded file was verified. Node serialization tests and source inspection cover that shared serializer. Current-head hosted checks pass. Initial Node runs hit sandbox loopback restrictions and then missing sparse fixtures; both setup issues were corrected before the passing rerun. These are parser/UI checks, not rendering or title execution. No remaining actionable issue was found in this scope.
MarcZX10 commented 2026-10-30 06:40:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T06:40:29Z.

Review: APPROVED


Re-checked — new head, looks good

The signed-zero deadzone behavior from my earlier note is corrected and covered on this head.

Reviewed head 68b434cca704a7fe4ba158c8a09f567cf8e81e66 against recorded base 7fe2b2249b9f7054312cef0fb066ebee4adc25f0; the merge preview onto current main is clean and preserves both the PR's translated diagnostics and the separate main translation update. I ran npm test --prefix tools/input-mapper from an exact-head archive (33/33), git diff --check, and the conventions check. Hosted Windows and input-mapper jobs pass; Linux is skipped. I did not run a browser or local native build. The native parser accepts -0 as zero, matching the new regression; a separate reviewer reports exact-head GCC target builds and browser validation.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5708898743 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11860#pullrequestreview-5708898743). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T06:40:29Z. **Review:** APPROVED --- # Re-checked — new head, looks good The signed-zero deadzone behavior from my earlier note is corrected and covered on this head. Reviewed head `68b434cca704a7fe4ba158c8a09f567cf8e81e66` against recorded base `7fe2b2249b9f7054312cef0fb066ebee4adc25f0`; the merge preview onto current `main` is clean and preserves both the PR's translated diagnostics and the separate main translation update. I ran `npm test --prefix tools/input-mapper` from an exact-head archive (33/33), `git diff --check`, and the conventions check. Hosted Windows and input-mapper jobs pass; Linux is skipped. I did not run a browser or local native build. The [native parser](https://github.com/boykopovar/AnyPS5/blob/68b434cca704a7fe4ba158c8a09f567cf8e81e66/core/libs/prx/libSceVideoOut/src/InputMapping.cpp#L179-L184) accepts `-0` as zero, matching the [new regression](https://github.com/boykopovar/AnyPS5/blob/68b434cca704a7fe4ba158c8a09f567cf8e81e66/tools/input-mapper/tests/mapping.test.js#L71-L76); a separate reviewer reports exact-head GCC target builds and browser validation.
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!11860
No description provided.