Reset the mouse baseline when the cursor source changes (RT-KEYBOARD-PAD-CURSOR-SOURCE) #2086

Merged
alexandersato0830 merged 1 commit from upstream-pr/2086 into main 2026-11-28 18:12:10 +00:00
alexandersato0830 commented 2026-11-25 19:51:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by alexandersato0830 on 2026-11-25T19:51:47Z.


Claimed in the coordination issue as: RT-KEYBOARD-PAD-CURSOR-SOURCE

What and why

The first poll after raw input starts can subtract a screen cursor coordinate from a raw-motion counter. That difference can appear as a full stick movement while the mouse is stationary. Select one cursor source for each poll and establish a new baseline when the source changes. Accumulated stick motion continues its normal decay.

Tested

  • Windows 11, MSVC 19.51 and pinned SDL 3.4.20. Main 0afcf9b failed all three source-switch checks. The patched gameinput and gameinput_script CTests passed with 377 checks, zero failures.
  • The test switches between two synthetic position sources with different origins, verifies real movement on the new source, and verifies no extra movement when switching back. A merge-tree check with #2082 succeeded.
  • Verified git diff --check and the source-only check.

GPUs tested: n/a. The tests use virtual pads.

AI-assisted: yes.

  • Based on current main.
  • One topic.
  • Uses source and synthetic fixtures.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5498111370 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2086). Originally posted by [alexandersato0830](https://github.com/alexandersato0830) on 2026-11-25T19:51:47Z. --- Claimed in the coordination issue as: [RT-KEYBOARD-PAD-CURSOR-SOURCE](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7172790613) ### What and why The first poll after raw input starts can subtract a screen cursor coordinate from a raw-motion counter. That difference can appear as a full stick movement while the mouse is stationary. Select one cursor source for each poll and establish a new baseline when the source changes. Accumulated stick motion continues its normal decay. ### Tested - Windows 11, MSVC 19.51 and pinned SDL 3.4.20. Main `0afcf9b` failed all three source-switch checks. The patched `gameinput` and `gameinput_script` CTests passed with **377 checks, zero failures**. - The test switches between two synthetic position sources with different origins, verifies real movement on the new source, and verifies no extra movement when switching back. A merge-tree check with #2082 succeeded. - Verified `git diff --check` and the source-only check. GPUs tested: n/a. The tests use virtual pads. AI-assisted: yes. - [x] Based on current `main`. - [x] One topic. - [x] Uses source and synthetic fixtures.
MoonEyes commented 2026-11-28 18:12:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T18:12:07Z.


Red/green: On main gameinput_test fails 3 of 370 checks (the mouse baseline is not reset when the cursor source changes), and with the PR ctest -R "^(gameinput|gameinput_script)$" passes 2/2.
Independent tester (OreoFR, RTX 4070, Windows 11): PR head merged with the other PRs of its batch on main c1ecf04ed, full ctest run (485 tests, tests that launch the game excluded): no new failure compared with main.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7243608595 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2086#issuecomment-7243608595). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T18:12:07Z. --- Red/green: On main gameinput_test fails 3 of 370 checks (the mouse baseline is not reset when the cursor source changes), and with the PR ctest -R "^(gameinput|gameinput_script)$" passes 2/2. Independent tester (OreoFR, RTX 4070, Windows 11): PR head merged with the other PRs of its batch on main c1ecf04ed, full ctest run (485 tests, tests that launch the game excluded): no new failure compared with main.
OreoFR commented 2026-11-28 21:59:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:59:40Z.


Verified by OreoFR

Run 1 (nat02)

  • Base: main c1ecf04ed + PR head 361c3abe6
  • Test: ctest -R "^(gameinput|gameinput_script)$"
  • Red on main: gameinput 3 failures of 370 (cursor source change without a new baseline)
  • Green with the PR: 2/2 OK
  • Verdict: READY

Run 2 (lot 4)

  • Base: main 09c153948 + PR head 361c3abe6; integration package 3 of 6 (4 PRs, merged without conflict)
  • Test: full runtime build; ctest -j 6 without the 28 tests that launch gta6rt; the PRs' Python tests
  • Red on main: n/a (integration test; main baseline: xbox_present and d3d12_set_descriptor_heaps)
  • Green with the PR: ctest: only xbox_present and d3d12_set_descriptor_heaps fail, as on main
  • Verdict: CLEAN PACKAGE (no new failure vs main)

Run 3 (lot 4 bis)

  • Base: main 33db04a70 + PR head 361c3abe6; integration package of 15 PRs
  • Test: full runtime build; ctest -j 6 without the 28 tests that launch gta6rt; the PRs' Python tests; translator suite
  • Red on main: n/a (integration test; main baseline: xbox_present, and flaky xmem)
  • Green with the PR: ctest: only xbox_present fails as on main (xs_proxy_mock failed once, flaky: passes on rerun and 5/5 direct runs); Python: same failures as main, the PRs' tests pass; translator: 507 files, 6405 tests, 0 failures
  • Verdict: CLEAN PACKAGE (no new failure vs main)

All runs

  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246419975 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2086#issuecomment-7246419975). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-28T21:59:40Z. --- **Verified by OreoFR** **Run 1 (nat02)** - Base: main `c1ecf04ed` + PR head `361c3abe6` - Test: `ctest -R "^(gameinput|gameinput_script)$"` - Red on main: gameinput 3 failures of 370 (cursor source change without a new baseline) - Green with the PR: 2/2 OK - Verdict: READY **Run 2 (lot 4)** - Base: main `09c153948` + PR head `361c3abe6`; integration package 3 of 6 (4 PRs, merged without conflict) - Test: full runtime build; ctest -j 6 without the 28 tests that launch gta6rt; the PRs' Python tests - Red on main: n/a (integration test; main baseline: xbox_present and d3d12_set_descriptor_heaps) - Green with the PR: ctest: only xbox_present and d3d12_set_descriptor_heaps fail, as on main - Verdict: CLEAN PACKAGE (no new failure vs main) **Run 3 (lot 4 bis)** - Base: main `33db04a70` + PR head `361c3abe6`; integration package of 15 PRs - Test: full runtime build; ctest -j 6 without the 28 tests that launch gta6rt; the PRs' Python tests; translator suite - Red on main: n/a (integration test; main baseline: xbox_present, and flaky xmem) - Green with the PR: ctest: only xbox_present fails as on main (xs_proxy_mock failed once, flaky: passes on rerun and 5/5 direct runs); Python: same failures as main, the PRs' tests pass; translator: 507 files, 6405 tests, 0 failures - Verdict: CLEAN PACKAGE (no new failure vs main) **All runs** - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
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
ProjectLeonida/mandy!2086
No description provided.