From 736ed3fd52e38f7cc827dd98572becfd2ce2b08f Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 13:54:45 +0100 Subject: [PATCH 01/30] feat(timer): opt in high-resolution 16ms smoothing only for A/B --- include/rmf/Config.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/rmf/Config.h b/include/rmf/Config.h index d276ae7..79968f4 100644 --- a/include/rmf/Config.h +++ b/include/rmf/Config.h @@ -40,6 +40,7 @@ struct Config { unsigned statePollIntervalMs = 10; // cursor visibility / clip / anchor sampling period bool logStateChanges = true; bool traceCorrectionTiming = false; // opt-in timing trace for A/B tests + bool highResSmoothingTimer = false; // opt-in; default Windows WM_TIMER clock unsigned consoleStatusIntervalMs = 2000; // 0 disables the live console status line unsigned heartbeatIntervalMs = 10000; // periodic liveness line, 0 disables it From e1e603e918fc5ae7c1a96f02118209dec437e8db Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 13:54:48 +0100 Subject: [PATCH 02/30] feat(timer): opt in high-resolution 16ms smoothing only for A/B --- src/Config.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Config.cpp b/src/Config.cpp index 5d5d12e..670ecd7 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -304,6 +304,9 @@ bool LoadConfig(const std::wstring& path, Config& cfg) { } else if (key == L"trace_correction_timing") { if (ParseBool(value, b)) cfg.traceCorrectionTiming = b; else cfg.warnings.push_back(L"trace_correction_timing is not a boolean: " + value); + } else if (key == L"high_res_smoothing_timer") { + if (ParseBool(value, b)) cfg.highResSmoothingTimer = b; + else cfg.warnings.push_back(L"high_res_smoothing_timer is not a boolean: " + value); } else if (key == L"console_status_interval_ms") { if (ParseU64(value, u) && u <= 60000) cfg.consoleStatusIntervalMs = static_cast(u); else cfg.warnings.push_back(L"console_status_interval_ms must be 0..60000: " + value); From 294637514ccc91a1f5e03c110749acce08b65d73 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 13:54:51 +0100 Subject: [PATCH 03/30] feat(timer): opt in high-resolution 16ms smoothing only for A/B --- config/config-ab-test.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/config-ab-test.json b/config/config-ab-test.json index 7c0483b..9762e8f 100644 --- a/config/config-ab-test.json +++ b/config/config-ab-test.json @@ -46,6 +46,9 @@ "_trace_correction_timing": "Log 250 ms timing/anchor-gate summaries while absolute correction is active and the target holds the cursor.", "trace_correction_timing": true, + "_high_res_smoothing_timer": "Use the high-resolution 16ms waitable timer for smooth output in A/B tests; fall back to WM_TIMER if unavailable. Playing profile remains unchanged.", + "high_res_smoothing_timer": true, + "_console_status_interval_ms": "Live counter refresh in the console. 0 disables it.", "console_status_interval_ms": 2000, From 3f54c97cb3268afbb48e042e6d436786e4541838 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 13:55:47 +0100 Subject: [PATCH 04/30] perf(timer): opt-in high resolution waitable clock, coalesced ticks and safe WM_TIMER fallback --- src/main.cpp | 87 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 81 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 0827ded..17043b3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -75,6 +76,7 @@ constexpr HotkeySpec kHotkeys[] = { constexpr UINT kMsgQuitRequested = WM_APP + 1; constexpr UINT kMsgApplyDelta = WM_APP + 2; // posted by the hook: wParam = dx, lParam = dy +constexpr UINT kMsgSmoothTick = WM_APP + 3; // coalesced high-res timer tick, main thread only constexpr UINT_PTR kSmoothTimer = 1; constexpr UINT kSmoothIntervalMs = 16; constexpr long kSmoothMaxStepPx = 20; @@ -1032,8 +1034,71 @@ int main() { } }; - const UINT_PTR smoothTimerId = SetTimer(nullptr, kSmoothTimer, kSmoothIntervalMs, nullptr); - if (smoothTimerId == 0) { + // Windows WM_TIMER is low priority and was measured around 27 ms/tick despite a + // 16 ms requested period. An opt-in high-resolution waitable timer produces at + // most ONE outstanding thread message; the actual cursor output remains here on + // the message-loop/hook thread. Do not change system-wide timer resolution. + HANDLE highResTimer = nullptr; + std::thread highResWorker; + std::atomic stopHighResWorker {false}; + std::atomic highResTickQueued {false}; + std::atomic highResTimerFailed {false}; + if (cfg.highResSmoothingTimer) { + highResTimer = CreateWaitableTimerExW( + nullptr, nullptr, CREATE_WAITABLE_TIMER_HIGH_RESOLUTION, + TIMER_MODIFY_STATE | SYNCHRONIZE); + if (highResTimer) { + LARGE_INTEGER firstDue {}; + firstDue.QuadPart = -static_cast(kSmoothIntervalMs) * 10000; + if (!SetWaitableTimer(highResTimer, &firstDue, + static_cast(kSmoothIntervalMs), + nullptr, nullptr, FALSE)) { + CloseHandle(highResTimer); + highResTimer = nullptr; + } + } + if (highResTimer) { + // Ensure PostThreadMessage always has an existing message queue. + MSG initialQueueMessage {}; + PeekMessageW(&initialQueueMessage, nullptr, WM_USER, WM_USER, PM_NOREMOVE); + try { + highResWorker = std::thread([&] { + while (!stopHighResWorker.load(std::memory_order_acquire) && + g_running.load(std::memory_order_relaxed)) { + const DWORD waited = WaitForSingleObject(highResTimer, 100); + if (stopHighResWorker.load(std::memory_order_acquire)) break; + if (waited == WAIT_TIMEOUT) continue; + if (waited != WAIT_OBJECT_0) { + highResTimerFailed.store(true, std::memory_order_release); + RequestStop(); // fail closed if the timer breaks during a hold + break; + } + if (!highResTickQueued.exchange(true, std::memory_order_acq_rel) && + !PostThreadMessageW(g_mainThreadId, kMsgSmoothTick, 0, 0)) { + highResTickQueued.store(false, std::memory_order_release); + highResTimerFailed.store(true, std::memory_order_release); + RequestStop(); + break; + } + } + }); + } catch (const std::system_error&) { + CancelWaitableTimer(highResTimer); + CloseHandle(highResTimer); + highResTimer = nullptr; + } + } + if (!highResTimer) { + LogLine(L"# CONFIG WARNING : high-resolution smoothing timer unavailable; " + L"falling back to WM_TIMER"); + } + } + const UINT_PTR smoothTimerId = highResTimer ? 0 : + SetTimer(nullptr, kSmoothTimer, kSmoothIntervalMs, nullptr); + const bool smoothTimerAvailable = highResTimer || smoothTimerId != 0; + LogLine(highResTimer ? L"## SMOOTH TIMER source=high-res-waitable period_ms=16" : + L"## SMOOTH TIMER source=wm-timer period_ms=16"); + if (!smoothTimerAvailable) { LogLine(L"# CONFIG WARNING : smoothing timer unavailable; absolute mode uses immediate output"); } MSG msg {}; @@ -1072,7 +1137,7 @@ int main() { ++timing.incoming; timingLastInputMs = qpcNowMs(); } - if (mode == rmf::CorrectionMode::Absolute && smoothTimerId != 0) { + if (mode == rmf::CorrectionMode::Absolute && smoothTimerAvailable) { if (cfg.traceCorrectionTiming && smoothPendingX == 0 && smoothPendingY == 0) { timingPendingSinceMs = qpcNowMs(); } @@ -1101,7 +1166,12 @@ int main() { continue; } - if (msg.message == WM_TIMER && msg.wParam == smoothTimerId) { + if ((smoothTimerId != 0 && msg.message == WM_TIMER && + msg.wParam == smoothTimerId) || + (highResTimer && msg.message == kMsgSmoothTick)) { + if (msg.message == kMsgSmoothTick) { + highResTickQueued.store(false, std::memory_order_release); + } if (cfg.traceCorrectionTiming) { const bool active = correction.Mode() == rmf::CorrectionMode::Absolute && cursorHeldByTarget.load(std::memory_order_relaxed); @@ -1249,8 +1319,13 @@ int main() { } // ---- shutdown ------------------------------------------------------------------------ - if (smoothTimerId != 0) { - KillTimer(nullptr, smoothTimerId); + if (smoothTimerId != 0) KillTimer(nullptr, smoothTimerId); + stopHighResWorker.store(true, std::memory_order_release); + if (highResTimer) CancelWaitableTimer(highResTimer); + if (highResWorker.joinable()) highResWorker.join(); + if (highResTimer) CloseHandle(highResTimer); + if (highResTimerFailed.load(std::memory_order_acquire)) { + LogLine(L"## SMOOTH TIMER FAILED: stopped correction rather than continuing without ticks"); } g_running.store(false); correction.ForceOff(); From 97d57270873e653860087e563556e006ad0f1e53 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 13:56:15 +0100 Subject: [PATCH 05/30] docs(timer): explain opt-in highres smoothing test and safety fallback --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5639fa0..239ec04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ correction is still experimental. ## [Unreleased] +### Performance + +- A/B-only opt-in high-resolution 16 ms waitable timer replaces the low-priority + WM_TIMER smoothing cadence. A worker coalesces notifications; SendInput remains + exclusively on the original message-loop thread. Falls back to WM_TIMER when + unavailable; a runtime timer/post failure stops correction safely. +- Normal Playing retains WM_TIMER by default until Windows/TeamViewer testing. + ### Fixed - Relearn a relocated game warp anchor *during* a hidden-cursor hold only From 92eb8f08b18af75b3441665186cc5e54372b4baf Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 13:56:19 +0100 Subject: [PATCH 06/30] docs(timer): explain opt-in highres smoothing test and safety fallback --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2a81737..5d23a94 100644 --- a/README.md +++ b/README.md @@ -295,6 +295,7 @@ Keys beginning with `_` in the supplied configuration files are explanatory comm | `watchdog_max_output_failures` | `5` | consecutive failed output calls before the watchdog trips | | `log_mouse_moves` | `true` | `false` records buttons, wheel and state only | | `trace_correction_timing` | `false` | opt-in 250 ms timer/anchor/pending-delta summaries; enabled in A/B profile | +| `high_res_smoothing_timer` | `false` | opt-in high-resolution waitable clock for 16 ms smoothing; enabled only in A/B profile pending field validation | | `log_directory` | `logs` | relative paths resolve beside the EXE | | `log_file_prefix` | `remotemousefix` | log filename prefix | | `max_log_bytes` | `8388608` | rotate after this size | From 6f0360d3bb05281e7354c20ff8c28e52dc507d82 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 13:56:22 +0100 Subject: [PATCH 07/30] docs(timer): explain opt-in highres smoothing test and safety fallback --- docs/diagnostics.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/diagnostics.md b/docs/diagnostics.md index a6a1506..11528cc 100644 --- a/docs/diagnostics.md +++ b/docs/diagnostics.md @@ -329,3 +329,27 @@ without a multi-second `off_anchor` run or a burst of old queued motion. Repeat without moving the window. Probe A/B/C, relative and OFF modes, hotkey emergency-off and loss of focus must still behave correctly. **MSVC/CTest alone does not establish runtime safety or mouse-look quality.** + +## High-resolution smoothing A/B experiment (follow-up PR) + +The original `SetTimer(..., 16, ...)` often delivered a 27 ms average tick in +the WoW capture. With `high_res_smoothing_timer=true`, the A/B profile instead +uses a high-resolution Windows waitable timer and a dedicated waiter thread +which posts at most one outstanding `WM_APP` timer notification to the main +message loop. The mouse hook and all `SendInput` calls remain on the original +thread. No process-wide timer-resolution changes, DLL injection or game hooks. + +A startup line identifies `## SMOOTH TIMER source=high-res-waitable` or +`source=wm-timer`. If Windows cannot create or arm the high-resolution timer, +the tool logs a warning and uses `WM_TIMER`. If an active high-resolution +timer fails or cannot post to the original thread, the application shuts down +without silently leaving suppressed movements uncorrected. + +In the same WoW/TeamViewer scenario, compare `## TIMING` tick counts, +`max_timer_gap_ms`, pending age and perceived camera smoothness with +`high_res_smoothing_timer=true` versus `false`. Especially verify +`Ctrl+Alt+C`, focus loss, multiple modes, `own==applied`, no `queue drops` +or watchdog trips. Hardware, scheduling and game frame rate can still impose +limits: a 16 ms requested timer does not guarantee 16 ms output or cure +the input-side 500 ms pauses. The regular `Start-Playing.cmd` remains at the +old timer by default until field results justify enabling this system-wide. From 1a6fdcb4ff49a7f4c0f84ce835a145c21add2339 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:31:28 +0100 Subject: [PATCH 08/30] fix(anchor): exclude OWN cursor destinations in high-res timer branch --- include/rmf/RecentWarpAnchor.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/include/rmf/RecentWarpAnchor.h b/include/rmf/RecentWarpAnchor.h index be5c519..5c7b9d8 100644 --- a/include/rmf/RecentWarpAnchor.h +++ b/include/rmf/RecentWarpAnchor.h @@ -3,6 +3,8 @@ #include #include #include +#include +#include namespace rmf { @@ -14,6 +16,27 @@ class RecentWarpAnchor { void Reset() { count_ = 0; next_ = 0; + observedOwnCount_ = 0; + } + + // Keep only samples collected during a quiet interval without our SendInput + // output. OWN cursor locations are not independent evidence of a game warp. + // Returns true only when the sample was admitted to the consensus window. + bool Observe(POINT point, std::uint64_t ownCount, POINT lastOwnTarget, + std::uint64_t nowMs, std::uint64_t lastOwnOutputMs) { + const bool outputChanged = ownCount != observedOwnCount_; + observedOwnCount_ = ownCount; + const bool recentlyOutput = lastOwnOutputMs != 0 && + (nowMs < lastOwnOutputMs || nowMs - lastOwnOutputMs < 160); + const bool atOwnTarget = ownCount != 0 && + std::labs(point.x - lastOwnTarget.x) <= 2 && + std::labs(point.y - lastOwnTarget.y) <= 2; + if (outputChanged || recentlyOutput || atOwnTarget) { + ClearSamples(); + return false; + } + Add(point); + return true; } void Add(POINT point) { @@ -42,9 +65,15 @@ class RecentWarpAnchor { } private: + void ClearSamples() { + count_ = 0; + next_ = 0; + } + std::array samples_ {}; std::size_t count_ = 0; std::size_t next_ = 0; + std::uint64_t observedOwnCount_ = 0; }; } // namespace rmf From dc0e64f66c62d34692386190c29937434ed3f5c4 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:31:37 +0100 Subject: [PATCH 09/30] fix(anchor): exclude OWN cursor destinations in high-res timer branch --- tests/RecentWarpAnchorTests.cpp | 50 +++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/tests/RecentWarpAnchorTests.cpp b/tests/RecentWarpAnchorTests.cpp index b3e6c19..e1a55f8 100644 --- a/tests/RecentWarpAnchorTests.cpp +++ b/tests/RecentWarpAnchorTests.cpp @@ -49,6 +49,53 @@ void TestStaleHistoryExpires() { Check(!tracker.Stable(anchor, hits, total)); } +void TestOwnCorrectionTargetNeverBecomesAnchor() { + rmf::RecentWarpAnchor tracker; + POINT candidate {}; + unsigned hits = 0, total = 0; + const POINT ownTarget = At(922, 568); // 20 px from the real warp (942,568) + for (std::uint64_t t = 1000; t < 1600; t += 10) { + Check(!tracker.Observe(ownTarget, 1, ownTarget, t, 900)); + } + Check(!tracker.Stable(candidate, hits, total)); +} + +void TestRecentOutputQuarantinesSamples() { + rmf::RecentWarpAnchor tracker; + POINT candidate {}; + unsigned hits = 0, total = 0; + const POINT gameWarp = At(847, 573); + const POINT ownTarget = At(922, 568); + // Even a perfectly stable candidate is rejected while outputs continue. + for (std::uint64_t t = 1000; t < 1150; t += 10) { + Check(!tracker.Observe(gameWarp, 5, ownTarget, t, 1000)); + } + Check(!tracker.Stable(candidate, hits, total)); + // Once the output is quiet, the *different* true recenter may be learned. + for (std::uint64_t t = 1170; t < 1290; t += 10) { + Check(tracker.Observe(gameWarp, 5, ownTarget, t, 1000)); + } + Check(tracker.Stable(candidate, hits, total)); + Check(candidate.x == 847 && candidate.y == 573); +} + +void TestOutputWhileCollectingClearsOldConsensus() { + rmf::RecentWarpAnchor tracker; + POINT candidate {}; + unsigned hits = 0, total = 0; + const POINT gameWarp = At(847, 573); + const POINT ownTarget = At(922, 568); + for (std::uint64_t t = 1200; t < 1270; t += 10) + tracker.Observe(gameWarp, 2, ownTarget, t, 1000); + Check(!tracker.Stable(candidate, hits, total)); + Check(!tracker.Observe(ownTarget, 3, ownTarget, 1270, 1270)); + Check(!tracker.Stable(candidate, hits, total)); + for (std::uint64_t t = 1440; t < 1560; t += 10) + tracker.Observe(gameWarp, 3, ownTarget, t, 1270); + Check(tracker.Stable(candidate, hits, total)); + Check(candidate.x == 847); +} + } // namespace int main() { @@ -56,5 +103,8 @@ int main() { TestStableGameWarp(); TestScatteredRemoteSamplesRejected(); TestStaleHistoryExpires(); + TestOwnCorrectionTargetNeverBecomesAnchor(); + TestRecentOutputQuarantinesSamples(); + TestOutputWhileCollectingClearsOldConsensus(); return 0; } From ade54431c6bd08b387529cb52101f2c5e7007d14 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:31:57 +0100 Subject: [PATCH 10/30] fix(anchor): carry OWN quarantine and safe hold-release behavior into timer branch --- src/main.cpp | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 17043b3..929e5c2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -539,6 +539,12 @@ int main() { // Relearning changes the reference for outstanding smoothing steps: main thread // discards the stale backlog before emitting another corrected move. std::atomic anchorRevision {0}; + // Published only after successful absolute SendInput. Used solely by the + // sampler to exclude our own cursor destinations from warp-anchor learning. + std::atomic lastOwnTargetX {0}; + std::atomic lastOwnTargetY {0}; + std::atomic lastOwnOutputMs {0}; + std::uint64_t ownCountAtHoldStart = 0; // sampler-thread only bool haveLastShownCursor = false; POINT lastShownCursor {0, 0}; bool sawWarpAtHoldStart = false; @@ -606,12 +612,18 @@ int main() { // insufficient (Probe mode B can keep the cursor perfectly still). if (!holdPhaseOpen) { recentAnchor.Reset(); + ownCountAtHoldStart = correction.applied.load(std::memory_order_acquire); sawWarpAtHoldStart = haveLastShownCursor && (std::labs(now.cursorPos.x - lastShownCursor.x) >= 30 || std::labs(now.cursorPos.y - lastShownCursor.y) >= 30); } - recentAnchor.Add(now.cursorPos); const ULONGLONG tick = GetTickCount64(); + const auto ownCount = correction.applied.load(std::memory_order_acquire); + const POINT lastOwnTarget { + lastOwnTargetX.load(std::memory_order_relaxed), + lastOwnTargetY.load(std::memory_order_relaxed)}; + recentAnchor.Observe(now.cursorPos, ownCount, lastOwnTarget, tick, + lastOwnOutputMs.load(std::memory_order_acquire)); const std::uint32_t generation = correction.generation.load(); if (!holdPhaseOpen || generation != hiddenGeneration) { // The watchdog clock starts with the hold, or with the latest mode @@ -681,7 +693,17 @@ int main() { POINT anchor {}; unsigned hits = 0, total = 0; - if (!anchorLearner.Finish(anchor, hits, total)) { + if (!anchorLearner.Finish(anchor, hits, total)) return; + + // Whole-hold estimates include our own SendInput positions. When output + // happened in this hold, they MUST NOT overwrite a learned game anchor + // on button release. Mid-hold re-learning uses the stricter, own-filtered + // recent consensus instead. + if (filter.anchorValid.load(std::memory_order_acquire) && + correction.applied.load(std::memory_order_acquire) != ownCountAtHoldStart) { + if (cfg.logStateChanges) { + LogLine(L"## STATE anchor-release-estimate ignored: own output during hold"); + } return; } publishAnchor(anchor, hits, total, holdPhaseClient); @@ -1016,7 +1038,12 @@ int main() { } if (ok) { - correction.applied.fetch_add(1, std::memory_order_relaxed); + if (mode == rmf::CorrectionMode::Absolute) { + lastOwnTargetX.store(target.x, std::memory_order_relaxed); + lastOwnTargetY.store(target.y, std::memory_order_relaxed); + lastOwnOutputMs.store(GetTickCount64(), std::memory_order_release); + } + correction.applied.fetch_add(1, std::memory_order_release); consecutiveOutputFailures = 0; const std::int64_t pending = correction.pendingEcho.fetch_add(1) + 1; if (pending > static_cast(cfg.watchdogMaxUnechoed)) { From af629c410d18e76052edb52f3608d1327140fc48 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:32:14 +0100 Subject: [PATCH 11/30] docs(anchor): include synthetic-event guard in combined fix --- docs/diagnostics.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/diagnostics.md b/docs/diagnostics.md index 11528cc..b677b2d 100644 --- a/docs/diagnostics.md +++ b/docs/diagnostics.md @@ -315,6 +315,15 @@ a random remote mouse location; a stable cursor position alone is not proof of recentring. If there is insufficient evidence, output still stays blocked rather than guessing. +A sample matching the most recent successful `SendInput` target (within +2 px) is never admitted to the recent-anchor consensus. Observations during +the first 160 ms after an own output are also quarantined, and any new +own output clears the in-progress sample window. At the end of a hold, an +estimate collected alongside own correction output is not allowed to replace +an already valid anchor. These checks address a captured false relocation +exactly 20 px from the real anchor (`kSmoothMaxStepPx`), which was followed +by a stale-pending reset. A repeated synthetic point is not game warp proof. + A successful recovery logs `## STATE anchor-relearned during hold` followed by `anchor-learned`. Any remaining smoothing movement queued for the previous anchor is dropped on the main message-loop thread with From d3fea43cfaf395470766235c8db36d36530fb27f Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:41:41 +0100 Subject: [PATCH 12/30] ci: upgrade checkout and artifact upload to Node.js 24 actions --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9521c03..eb35a33 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: name: MSVC x64 runs-on: windows-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Configure # No -G: CMake picks the newest Visual Studio on the runner image. @@ -31,7 +31,7 @@ jobs: run: Copy-Item build/bin/Release/MouseLookProbe.exe stage/RemoteMouseFix-win-x64/MouseLookProbe.exe - name: Upload the build output - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: RemoteMouseFix-win-x64 path: stage/RemoteMouseFix-win-x64 From a5cb6d0c2cd3b3435abfc9c7e3b1182d90f4a6ef Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:50:17 +0100 Subject: [PATCH 13/30] feat(playing): enable measured 16ms smoothing and document WM_TIMER fallback --- config/config-play.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/config-play.json b/config/config-play.json index 1506597..3374cd8 100644 --- a/config/config-play.json +++ b/config/config-play.json @@ -22,6 +22,10 @@ "anchor_tolerance_px": 3, "state_poll_interval_ms": 10, "log_state_changes": true, + + "_high_res_smoothing_timer": "Use 16ms high-resolution waitable timer, with WM_TIMER fallback if unsupported. Validated in A/B profile, enabled for Playing trial.", + "high_res_smoothing_timer": true, + "console_status_interval_ms": 2000, "heartbeat_interval_ms": 10000 } From 897a91e4fd68f25d4c5ac3ab01033f3cb50e297c Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:50:21 +0100 Subject: [PATCH 14/30] feat(playing): enable measured 16ms smoothing and document WM_TIMER fallback --- config/config-ab-test.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config-ab-test.json b/config/config-ab-test.json index 9762e8f..3224805 100644 --- a/config/config-ab-test.json +++ b/config/config-ab-test.json @@ -46,7 +46,7 @@ "_trace_correction_timing": "Log 250 ms timing/anchor-gate summaries while absolute correction is active and the target holds the cursor.", "trace_correction_timing": true, - "_high_res_smoothing_timer": "Use the high-resolution 16ms waitable timer for smooth output in A/B tests; fall back to WM_TIMER if unavailable. Playing profile remains unchanged.", + "_high_res_smoothing_timer": "Use the high-resolution 16ms waitable timer; fall back to WM_TIMER if unavailable. Also enabled in Playing after successful A/B measurements.", "high_res_smoothing_timer": true, "_console_status_interval_ms": "Live counter refresh in the console. 0 disables it.", From 4298c2914fee1b790dfb82c0115d98ccd1ec4cd9 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:50:26 +0100 Subject: [PATCH 15/30] feat(playing): enable measured 16ms smoothing and document WM_TIMER fallback --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5d23a94..3a2218b 100644 --- a/README.md +++ b/README.md @@ -295,7 +295,7 @@ Keys beginning with `_` in the supplied configuration files are explanatory comm | `watchdog_max_output_failures` | `5` | consecutive failed output calls before the watchdog trips | | `log_mouse_moves` | `true` | `false` records buttons, wheel and state only | | `trace_correction_timing` | `false` | opt-in 250 ms timer/anchor/pending-delta summaries; enabled in A/B profile | -| `high_res_smoothing_timer` | `false` | opt-in high-resolution waitable clock for 16 ms smoothing; enabled only in A/B profile pending field validation | +| `high_res_smoothing_timer` | `false` | high-resolution waitable clock for 16 ms smoothing; enabled in both A/B and Playing profiles after successful A/B field tests; optional to disable | | `log_directory` | `logs` | relative paths resolve beside the EXE | | `log_file_prefix` | `remotemousefix` | log filename prefix | | `max_log_bytes` | `8388608` | rotate after this size | From ee01aa269ba2f687f9d7c09b61c368cda2f334b7 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:50:31 +0100 Subject: [PATCH 16/30] feat(playing): enable measured 16ms smoothing and document WM_TIMER fallback --- docs/diagnostics.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/diagnostics.md b/docs/diagnostics.md index b677b2d..ef54a25 100644 --- a/docs/diagnostics.md +++ b/docs/diagnostics.md @@ -360,5 +360,10 @@ In the same WoW/TeamViewer scenario, compare `## TIMING` tick counts, `Ctrl+Alt+C`, focus loss, multiple modes, `own==applied`, no `queue drops` or watchdog trips. Hardware, scheduling and game frame rate can still impose limits: a 16 ms requested timer does not guarantee 16 ms output or cure -the input-side 500 ms pauses. The regular `Start-Playing.cmd` remains at the -old timer by default until field results justify enabling this system-wide. +the input-side 500 ms pauses. The A/B tests of 27 October 2026 showed a +measured interval of about 16.2 ms versus 26.7 ms with WM_TIMER, with subjective +improvement and no failed or missing SendInput echoes. Therefore the Playing +profile also enables this timer by default; disable +`high_res_smoothing_timer` in `config-play.json` to revert to WM_TIMER. +The new Playing default still requires an ordinary-playing smoke test on +Windows/TeamViewer before merging this PR. From 32f857c664c29da8d7689f84829b06a60e4a629a Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:50:34 +0100 Subject: [PATCH 17/30] feat(playing): enable measured 16ms smoothing and document WM_TIMER fallback --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 239ec04..e10832e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,10 @@ correction is still experimental. WM_TIMER smoothing cadence. A worker coalesces notifications; SendInput remains exclusively on the original message-loop thread. Falls back to WM_TIMER when unavailable; a runtime timer/post failure stops correction safely. -- Normal Playing retains WM_TIMER by default until Windows/TeamViewer testing. +- After A/B test measurements (~16.2 ms vs ~26.7 ms per tick), normal Playing + now enables the high-resolution timer by default, while remaining switchable + back to WM_TIMER through `high_res_smoothing_timer=false`. Playing runtime + smoke test is required before merging. ### Fixed From 3cfabd902b3b292af9fe10e8d4d5afd97cb996db Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 15:07:06 +0100 Subject: [PATCH 18/30] feat(safety): add warp evidence and regressions to timer branch --- include/rmf/WarpEvidence.h | 148 +++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 include/rmf/WarpEvidence.h diff --git a/include/rmf/WarpEvidence.h b/include/rmf/WarpEvidence.h new file mode 100644 index 0000000..1dd0843 --- /dev/null +++ b/include/rmf/WarpEvidence.h @@ -0,0 +1,148 @@ +#pragma once + +#include + +#include +#include +#include + +namespace rmf { + +// Only a *repeated unexplained return* toward one interior location constitutes +// evidence that a hidden cursor is being recentered by the game. A hidden or +// motionless cursor alone is not evidence (MouseLookProbe mode B). +struct RemotePointerSample { + POINT point {0, 0}; + std::uint64_t serial = 0; + std::uint64_t tickMs = 0; +}; + +class WarpEvidence { +public: + void Reset() { + candidates_ = {}; + havePrevious_ = false; + observedOwnCount_ = 0; + } + + bool Observe(POINT cursor, RECT client, RECT desktop, RemotePointerSample remote, + std::uint64_t nowMs, std::uint64_t ownCount, + POINT lastOwnTarget, std::uint64_t lastOwnOutputMs, + bool ownOutputInHold, POINT& confirmed, unsigned& returns) { + const bool ownChanged = ownCount != observedOwnCount_; + observedOwnCount_ = ownCount; + const bool recentOwn = ownOutputInHold && lastOwnOutputMs != 0 && + (nowMs < lastOwnOutputMs || nowMs - lastOwnOutputMs < 160); + const bool ownTarget = ownOutputInHold && + Close(cursor, lastOwnTarget, 2); + const bool recentlyRemote = remote.serial != 0 && + remote.tickMs <= nowMs && nowMs - remote.tickMs <= 80; + const bool interior = Inside(cursor, client, 24) && + Inside(cursor, desktop, 24); + + // If our own SendInput might explain this position, the complete + // hypothesis is tainted. Do not resume an old count later. + if (ownChanged || recentOwn || ownTarget) { + ClearCandidates(); + } + + bool verified = false; + if (!ownChanged && !recentOwn && !ownTarget && + recentlyRemote && interior && Far(cursor, remote.point, 45)) { + Candidate* slot = nullptr; + for (Candidate& candidate : candidates_) { + if (candidate.active && nowMs >= candidate.lastMs && + nowMs - candidate.lastMs <= 280 && + Close(candidate.anchor, cursor, 3)) { + slot = &candidate; + break; + } + } + if (!slot) { + for (Candidate& candidate : candidates_) { + if (!candidate.active || nowMs < candidate.lastMs || + nowMs - candidate.lastMs > 280) { + slot = &candidate; + break; + } + } + } + if (!slot) { + slot = &candidates_[0]; + for (Candidate& candidate : candidates_) { + if (candidate.lastMs < slot->lastMs) slot = &candidate; + } + } + const bool same = slot->active && nowMs >= slot->lastMs && + nowMs - slot->lastMs <= 280 && + Close(slot->anchor, cursor, 3); + + if (!same) { + *slot = Candidate{}; + slot->active = true; + slot->anchor = cursor; + slot->firstMs = nowMs; + slot->firstRemote = remote.point; + } + + if (remote.serial != slot->lastSerial) { + slot->lastSerial = remote.serial; + slot->lastMs = nowMs; + ++slot->hits; + if (Far(slot->firstRemote, remote.point, 60)) { + slot->remoteMoved = true; + } + // This is the critical distinction from a stationary cursor: + // we must actually SEE the cursor away from this same point, + // then back while the latest remote input aims elsewhere. + if (havePrevious_ && Far(previousCursor_, slot->anchor, 45)) { + ++slot->returns; + } + if (!slot->reported && slot->hits >= 5 && slot->returns >= 2 && + slot->remoteMoved && nowMs - slot->firstMs >= 80) { + slot->reported = true; + confirmed = slot->anchor; + returns = slot->returns; + verified = true; + } + } + } + + previousCursor_ = cursor; + havePrevious_ = true; + return verified; + } + +private: + struct Candidate { + bool active = false; + bool reported = false; + bool remoteMoved = false; + POINT anchor {0, 0}; + POINT firstRemote {0, 0}; + std::uint64_t firstMs = 0; + std::uint64_t lastMs = 0; + std::uint64_t lastSerial = 0; + unsigned hits = 0; + unsigned returns = 0; + }; + + static bool Close(POINT a, POINT b, long delta) { + return std::labs(a.x - b.x) <= delta && std::labs(a.y - b.y) <= delta; + } + static bool Far(POINT a, POINT b, long delta) { + return std::labs(a.x - b.x) >= delta || std::labs(a.y - b.y) >= delta; + } + static bool Inside(POINT p, RECT rect, long margin) { + return p.x >= rect.left + margin && p.x < rect.right - margin && + p.y >= rect.top + margin && p.y < rect.bottom - margin; + } + void ClearCandidates() { candidates_ = {}; } + + std::array candidates_ {}; + POINT previousCursor_ {0, 0}; + bool havePrevious_ = false; + std::uint64_t observedOwnCount_ = 0; +}; + +} // namespace rmf From 0ff0089487b339e16d710899835ae476435f10b7 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 15:07:10 +0100 Subject: [PATCH 19/30] feat(safety): add warp evidence and regressions to timer branch --- tests/WarpEvidenceTests.cpp | 119 ++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 tests/WarpEvidenceTests.cpp diff --git a/tests/WarpEvidenceTests.cpp b/tests/WarpEvidenceTests.cpp new file mode 100644 index 0000000..b39fd5d --- /dev/null +++ b/tests/WarpEvidenceTests.cpp @@ -0,0 +1,119 @@ +#include "rmf/WarpEvidence.h" + +#include +#include + +namespace { +constexpr RECT kClient {100, 100, 1100, 800}; +constexpr RECT kScreen {0, 0, 1920, 1080}; + +void Check(bool ok) { if (!ok) std::abort(); } +POINT P(long x, long y) { return POINT{x, y}; } + +bool Step(rmf::WarpEvidence& detector, POINT cursor, POINT remote, unsigned seq, + std::uint64_t ms, std::uint64_t own = 0, + POINT lastOwn = POINT{0, 0}, std::uint64_t lastOwnMs = 0, + bool ownInHold = false) { + POINT verified {}; + unsigned returns = 0; + return detector.Observe(cursor, kClient, kScreen, + rmf::RemotePointerSample{remote, seq, ms}, ms, + own, lastOwn, lastOwnMs, ownInHold, verified, returns); +} + +void TestHiddenNoWarpInputPasses() { + rmf::WarpEvidence detector; + for (unsigned i = 1; i < 200; ++i) { + const POINT cursor = P(300 + static_cast(i * 2), + 300 + static_cast(i % 10)); + Check(!Step(detector, cursor, cursor, i, 1000 + i * 16)); + } +} + +void TestStationaryNoWarpDoesNotProveRecenter() { + rmf::WarpEvidence detector; + // Cursor remains inside the client even as the remote updates. A naive + // 5/5 stable-anchor learner incorrectly accepted this in Probe B. + for (unsigned i = 1; i < 35; ++i) { + Check(!Step(detector, P(500, 450), + P(600 + static_cast(i * 3), 650), + i, 1000 + i * 16)); + } +} + +void TestIntentionalReturnWithRemoteToSamePointDoesNotCount() { + rmf::WarpEvidence detector; + // Moving the cursor back manually is a remote event, NOT a hidden game warp. + for (unsigned i = 1; i < 60; ++i) { + const POINT cursor = i % 2 == 0 ? P(500, 450) : P(700, 450); + Check(!Step(detector, cursor, cursor, i, 1000 + i * 16)); + } +} + +void TestRepeatedUnexplainedWarpArmsGate() { + rmf::WarpEvidence detector; + const POINT anchor = P(500, 450); + Check(!Step(detector, anchor, P(650, 450), 1, 1000)); + Check(!Step(detector, P(660, 450), P(660, 450), 2, 1020)); + Check(!Step(detector, anchor, P(720, 450), 3, 1040)); + Check(!Step(detector, P(730, 450), P(730, 450), 4, 1060)); + Check(!Step(detector, anchor, P(790, 450), 5, 1080)); + Check(!Step(detector, anchor, P(810, 450), 6, 1100)); + Check(Step(detector, anchor, P(850, 450), 7, 1120)); + // Once confirmed, the same candidate isn't announced every sample. + Check(!Step(detector, anchor, P(870, 450), 8, 1140)); +} + +void TestOwnOutputCannotManufactureWarp() { + rmf::WarpEvidence detector; + const POINT anchor = P(500, 450); + for (unsigned i = 1; i <= 50; ++i) { + const POINT c = i % 2 == 0 ? anchor : P(650, 450); + Check(!Step(detector, c, P(900, 450), i, 1000 + i * 16, + i, anchor, 1000 + i * 16, true)); + } +} + +void TestScreenBoundaryDoesNotCount() { + rmf::WarpEvidence detector; + const POINT pinned = P(5, 450); + for (unsigned i = 1; i <= 80; ++i) { + Check(!Step(detector, pinned, P(800 + static_cast(i), 450), + i, 1000 + i * 16)); + } +} + +void TestResetRequiresFreshEvidence() { + rmf::WarpEvidence detector; + const POINT anchor = P(500, 450); + Step(detector, anchor, P(650, 450), 1, 1000); + Step(detector, P(660, 450), P(660, 450), 2, 1020); + Step(detector, anchor, P(720, 450), 3, 1040); + detector.Reset(); + Check(!Step(detector, anchor, P(800, 450), 4, 1060)); + Check(!Step(detector, anchor, P(820, 450), 5, 1080)); + Check(!Step(detector, anchor, P(840, 450), 6, 1100)); +} + +void TestOwnQuietInterval() { + rmf::WarpEvidence detector; + const POINT anchor = P(500, 450); + const POINT ownTarget = P(520, 450); + for (unsigned i = 1; i <= 8; ++i) { + Check(!Step(detector, anchor, P(700 + i * 10, 450), i, + 1000 + i * 16, 3, ownTarget, 1000, true)); + } +} +} // namespace + +int main() { + TestHiddenNoWarpInputPasses(); + TestStationaryNoWarpDoesNotProveRecenter(); + TestIntentionalReturnWithRemoteToSamePointDoesNotCount(); + TestRepeatedUnexplainedWarpArmsGate(); + TestOwnOutputCannotManufactureWarp(); + TestScreenBoundaryDoesNotCount(); + TestResetRequiresFreshEvidence(); + TestOwnQuietInterval(); + return 0; +} From 8f059e3c9c1aa27f91cd2f25e4137e5edb39c631 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 15:07:14 +0100 Subject: [PATCH 20/30] fix(hook): bring warp-verification gate into high-res timer branch --- include/rmf/MouseHook.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/rmf/MouseHook.h b/include/rmf/MouseHook.h index 7702bdf..1c0f342 100644 --- a/include/rmf/MouseHook.h +++ b/include/rmf/MouseHook.h @@ -28,6 +28,16 @@ class MouseHook { // Learned warp anchor, as an offset inside the target client area so it survives // the window being moved. std::atomic anchorValid {false}; + // Explicitly armed only after multiple observed, unexplained recenter + // events. Hidden cursor without warp MUST pass through (Probe mode B). + std::atomic warpVerified {false}; + + // Single hook writer; odd/even version makes the last external injected + // move an atomic snapshot for the state sampler, without a lock or I/O. + std::atomic remoteVersion {0}; + std::atomic remoteX {0}; + std::atomic remoteY {0}; + std::atomic remoteMs {0}; std::atomic anchorOffsetX {0}; std::atomic anchorOffsetY {0}; }; From 57cd66e8ed5d11ee2a483906fcbe409f297db230 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 15:07:18 +0100 Subject: [PATCH 21/30] fix(hook): bring warp-verification gate into high-res timer branch --- src/MouseHook.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/MouseHook.cpp b/src/MouseHook.cpp index 054dfb2..ddb369c 100644 --- a/src/MouseHook.cpp +++ b/src/MouseHook.cpp @@ -106,6 +106,16 @@ LRESULT CALLBACK MouseHook::HookProc(int nCode, WPARAM wParam, LPARAM lParam) { // position is the anchor, not the remote pointer, and would fake a delta. if (kind == EventKind::Move && injected && !own) { if (mode != CorrectionMode::Off && cursorHidden) { + // Observe all remote input BEFORE deciding to withhold it. Until a + // genuine recenter is established the event must reach the game. + filter.remoteVersion.fetch_add(1, std::memory_order_seq_cst); // odd + filter.remoteX.store(info->pt.x, std::memory_order_seq_cst); + filter.remoteY.store(info->pt.y, std::memory_order_seq_cst); + filter.remoteMs.store(GetTickCount64(), std::memory_order_seq_cst); + filter.remoteVersion.fetch_add(1, std::memory_order_seq_cst); // even + } + if (mode != CorrectionMode::Off && cursorHidden && + filter.warpVerified.load(std::memory_order_acquire)) { if (g_tracking.valid) { remoteDx = info->pt.x - g_tracking.last.x; remoteDy = info->pt.y - g_tracking.last.y; From e4bf9ad851b24860d4db41b3f11aa10ed06d3ee4 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 15:07:22 +0100 Subject: [PATCH 22/30] fix(hook): bring warp-verification gate into high-res timer branch --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b0e92e..cd2357c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,6 +108,10 @@ if(BUILD_TESTING) add_executable(RecentWarpAnchorTests tests/RecentWarpAnchorTests.cpp) rmf_apply_common_settings(RecentWarpAnchorTests) add_test(NAME RecentWarpAnchorTests COMMAND RecentWarpAnchorTests) + + add_executable(WarpEvidenceTests tests/WarpEvidenceTests.cpp) + rmf_apply_common_settings(WarpEvidenceTests) + add_test(NAME WarpEvidenceTests COMMAND WarpEvidenceTests) endif() # What an unpacked release looks like: the two launchers, the programs, README and From 21ac3e8fec77a5873ae2dbea67d89c56f8858435 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 15:07:44 +0100 Subject: [PATCH 23/30] fix(anchor): fail-open correction unless genuine warp evidence observed --- src/main.cpp | 190 +++++++++++++++++++++++---------------------------- 1 file changed, 85 insertions(+), 105 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 929e5c2..93ab2e3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,7 +26,7 @@ #include "rmf/Logger.h" #include "rmf/MouseHook.h" #include "rmf/ProcessInfo.h" -#include "rmf/RecentWarpAnchor.h" +#include "rmf/WarpEvidence.h" #include "rmf/StateSampler.h" #include "rmf/StatusView.h" #include "rmf/WinCompat.h" @@ -533,25 +533,25 @@ int main() { std::atomic targetInForeground {false}; std::atomic cursorHeldByTarget {false}; - // Sampler thread only. - rmf::AnchorLearner anchorLearner; - rmf::RecentWarpAnchor recentAnchor; + // Sampler thread only. A hidden cursor is NOT proof of a game warp. + rmf::WarpEvidence warpEvidence; // Relearning changes the reference for outstanding smoothing steps: main thread // discards the stale backlog before emitting another corrected move. std::atomic anchorRevision {0}; // Published only after successful absolute SendInput. Used solely by the - // sampler to exclude our own cursor destinations from warp-anchor learning. + // sampler to exclude our own cursor destinations from warp learning. std::atomic lastOwnTargetX {0}; std::atomic lastOwnTargetY {0}; std::atomic lastOwnOutputMs {0}; - std::uint64_t ownCountAtHoldStart = 0; // sampler-thread only - bool haveLastShownCursor = false; - POINT lastShownCursor {0, 0}; - bool sawWarpAtHoldStart = false; - bool holdPhaseOpen = false; - RECT holdPhaseClient {0, 0, 0, 0}; - ULONGLONG hiddenSince = 0; + std::uint64_t ownCountAtHoldStart = 0; // sampler thread only + bool holdPhaseOpen = false; + ULONGLONG hiddenSince = 0; std::uint32_t hiddenGeneration = 0; + const RECT virtualDesktop { + GetSystemMetrics(SM_XVIRTUALSCREEN), + GetSystemMetrics(SM_YVIRTUALSCREEN), + GetSystemMetrics(SM_XVIRTUALSCREEN) + GetSystemMetrics(SM_CXVIRTUALSCREEN), + GetSystemMetrics(SM_YVIRTUALSCREEN) + GetSystemMetrics(SM_CYVIRTUALSCREEN)}; auto publishAnchor = [&](POINT anchor, unsigned hits, unsigned total, RECT client) { const long offsetX = anchor.x - client.left; @@ -603,110 +603,87 @@ int main() { LogLine(rmf::FormatStateLine(prev, now, samplerNames.NameForPid(now.foregroundPid))); }, [&](const rmf::StateSampler::Snapshot& now) { - const bool holding = targetInForeground.load() && !now.cursorVisible; + const bool holding = targetInForeground.load(std::memory_order_relaxed) && + !now.cursorVisible; cursorHeldByTarget.store(holding, std::memory_order_relaxed); - if (holding) { - // A warp-like discontinuity when the cursor becomes hidden is - // independent evidence of recentering. Stable positions alone are - // insufficient (Probe mode B can keep the cursor perfectly still). - if (!holdPhaseOpen) { - recentAnchor.Reset(); - ownCountAtHoldStart = correction.applied.load(std::memory_order_acquire); - sawWarpAtHoldStart = haveLastShownCursor && - (std::labs(now.cursorPos.x - lastShownCursor.x) >= 30 || - std::labs(now.cursorPos.y - lastShownCursor.y) >= 30); - } - const ULONGLONG tick = GetTickCount64(); - const auto ownCount = correction.applied.load(std::memory_order_acquire); - const POINT lastOwnTarget { - lastOwnTargetX.load(std::memory_order_relaxed), - lastOwnTargetY.load(std::memory_order_relaxed)}; - recentAnchor.Observe(now.cursorPos, ownCount, lastOwnTarget, tick, - lastOwnOutputMs.load(std::memory_order_acquire)); - const std::uint32_t generation = correction.generation.load(); - if (!holdPhaseOpen || generation != hiddenGeneration) { - // The watchdog clock starts with the hold, or with the latest mode - // change, so re-enabling during a long hold does not trip at once. - hiddenSince = tick; - hiddenGeneration = generation; - } - holdPhaseOpen = true; - holdPhaseClient = now.clientScreenRect; - anchorLearner.Add(now.cursorPos); - - POINT liveAnchor {}; - unsigned liveHits = 0, liveTotal = 0; - if (!filter.anchorValid.load(std::memory_order_relaxed) && - anchorLearner.Estimate(liveAnchor, liveHits, liveTotal)) { - publishAnchor(liveAnchor, liveHits, liveTotal, now.clientScreenRect); - } - - // A previous game anchor can become stale after moving the window or - // changing the game's camera mode. Accept a NEW location only after - // both an onset warp and a strong, recent 12-sample consensus. - // No output is issued from this sampler thread. - POINT candidate {}; - unsigned candidateHits = 0, candidateSamples = 0; - if (sawWarpAtHoldStart && - correction.Mode() == rmf::CorrectionMode::Absolute && - filter.anchorValid.load(std::memory_order_relaxed) && - recentAnchor.Stable(candidate, candidateHits, candidateSamples)) { - const long expectedX = now.clientScreenRect.left + - filter.anchorOffsetX.load(std::memory_order_relaxed); - const long expectedY = now.clientScreenRect.top + - filter.anchorOffsetY.load(std::memory_order_relaxed); - if (std::labs(candidate.x - expectedX) > cfg.anchorTolerancePx || - std::labs(candidate.y - expectedY) > cfg.anchorTolerancePx) { - if (cfg.logStateChanges) { - LogLine(Format( - L"## STATE anchor-relearned during hold: previous=(%ld,%ld) " - L"candidate=(%ld,%ld) hits=%u/%u (warp transition observed)", - expectedX, expectedY, candidate.x, candidate.y, - candidateHits, candidateSamples)); - } - publishAnchor(candidate, candidateHits, candidateSamples, now.clientScreenRect); - } - } - - if (cfg.watchdogMaxHiddenMs > 0 && - correction.Mode() != rmf::CorrectionMode::Off && - tick - hiddenSince > cfg.watchdogMaxHiddenMs) { - tripWatchdog(Format(L"cursor hidden continuously for more than %u ms", - cfg.watchdogMaxHiddenMs)); + if (!holding) { + if (holdPhaseOpen) { + filter.warpVerified.store(false, std::memory_order_release); + filter.anchorValid.store(false, std::memory_order_release); + warpEvidence.Reset(); + holdPhaseOpen = false; } return; } - if (targetInForeground.load(std::memory_order_relaxed) && now.cursorVisible) { - lastShownCursor = now.cursorPos; - haveLastShownCursor = true; - } else { - haveLastShownCursor = false; + const ULONGLONG tick = GetTickCount64(); + const std::uint32_t generation = + correction.generation.load(std::memory_order_acquire); + if (!holdPhaseOpen || generation != hiddenGeneration) { + // New hidden hold or new correction mode: never reuse an old + // game's warp classification, even in the same target window. + filter.warpVerified.store(false, std::memory_order_release); + filter.anchorValid.store(false, std::memory_order_release); + warpEvidence.Reset(); + hiddenSince = tick; + hiddenGeneration = generation; + ownCountAtHoldStart = correction.applied.load(std::memory_order_acquire); } - if (!holdPhaseOpen) { - return; + holdPhaseOpen = true; + + // A seqlock snapshot of the most recent non-own injected move. The + // hook never waits for the sampler, and only writes this telemetry + // while the foreground target holds a hidden cursor. + rmf::RemotePointerSample remote {}; + const auto version1 = filter.remoteVersion.load(std::memory_order_seq_cst); + if ((version1 & 1u) == 0 && version1 != 0) { + const POINT point { + filter.remoteX.load(std::memory_order_seq_cst), + filter.remoteY.load(std::memory_order_seq_cst)}; + const auto remoteMs = filter.remoteMs.load(std::memory_order_seq_cst); + const auto version2 = filter.remoteVersion.load(std::memory_order_seq_cst); + if (version1 == version2 && remoteMs >= hiddenSince) { + remote.point = point; + remote.tickMs = remoteMs; + remote.serial = version2 / 2u; + } } - holdPhaseOpen = false; - sawWarpAtHoldStart = false; - recentAnchor.Reset(); - - POINT anchor {}; - unsigned hits = 0, total = 0; - if (!anchorLearner.Finish(anchor, hits, total)) return; - - // Whole-hold estimates include our own SendInput positions. When output - // happened in this hold, they MUST NOT overwrite a learned game anchor - // on button release. Mid-hold re-learning uses the stricter, own-filtered - // recent consensus instead. - if (filter.anchorValid.load(std::memory_order_acquire) && - correction.applied.load(std::memory_order_acquire) != ownCountAtHoldStart) { + + const auto ownCount = correction.applied.load(std::memory_order_acquire); + const POINT lastOwnTarget { + lastOwnTargetX.load(std::memory_order_relaxed), + lastOwnTargetY.load(std::memory_order_relaxed)}; + POINT verifiedAnchor {}; + unsigned observedReturns = 0; + if (correction.Mode() != rmf::CorrectionMode::Off && + warpEvidence.Observe( + now.cursorPos, now.clientScreenRect, virtualDesktop, remote, + tick, ownCount, lastOwnTarget, + lastOwnOutputMs.load(std::memory_order_acquire), + ownCount != ownCountAtHoldStart, + verifiedAnchor, observedReturns)) { + const bool wasVerified = + filter.warpVerified.load(std::memory_order_acquire); if (cfg.logStateChanges) { - LogLine(L"## STATE anchor-release-estimate ignored: own output during hold"); + LogLine(Format( + L"## STATE warp-evidence confirmed anchor=(%ld,%ld) " + L"returns=%u remote_serial=%llu previous_verified=%ls", + verifiedAnchor.x, verifiedAnchor.y, observedReturns, + static_cast(remote.serial), + wasVerified ? L"yes" : L"no")); } - return; + publishAnchor(verifiedAnchor, observedReturns, observedReturns, + now.clientScreenRect); + filter.warpVerified.store(true, std::memory_order_release); + } + + if (cfg.watchdogMaxHiddenMs > 0 && + correction.Mode() != rmf::CorrectionMode::Off && + tick - hiddenSince > cfg.watchdogMaxHiddenMs) { + tripWatchdog(Format(L"cursor hidden continuously for more than %u ms", + cfg.watchdogMaxHiddenMs)); } - publishAnchor(anchor, hits, total, holdPhaseClient); }); // ---- mode switching (message-loop thread only) ------------------------------------ @@ -721,6 +698,9 @@ int main() { return; } const rmf::CorrectionMode previous = correction.SetMode(target); + // Even an already verified warp must be re-established after a mode change. + // The sampler will also clear the anchor on the next generation transition. + filter.warpVerified.store(false, std::memory_order_release); consecutiveOutputFailures = 0; if (target != rmf::CorrectionMode::Off) { // Switching a mode back on clears the last stop, so the panel stops showing a From 92cb98b0637305542ee179b71c0409a0b4564679 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 15:07:57 +0100 Subject: [PATCH 24/30] docs(safety): document external warp proof and no-warp regression --- docs/diagnostics.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/diagnostics.md b/docs/diagnostics.md index ef54a25..844ecde 100644 --- a/docs/diagnostics.md +++ b/docs/diagnostics.md @@ -303,6 +303,38 @@ Before repeating tests, copy important captures into a separate folder that does contain the `remotemousefix-*.log` rotation target. Preserve the raw timestamps, and do not commit session logs to Git. +## Warp-evidence gate: hidden cursor without recenter (mode B) + +**Safety requirement:** A hidden cursor alone is not sufficient to intercept +remote mouse input. The prior heuristic would suppress every injected move in +MouseLookProbe mode B and then fail the anchor gate: measured 1,661 suppressed +moves, five applied corrections, 1,476 off-anchor timer skips and a maximum +5.48 s pending age. The 16 ms high-resolution timer was not at fault. + +Now the hook passes injected moves through untouched **until** the state +sampler observes multiple unexplained returns to the same interior cursor +point, while a series of distinct remote inputs aims elsewhere. Evidence +must include at least two observed away-then-back transitions, five distinct +remote events, remote travel of at least 60 px and an 80 ms observation span. +Window/desktop edges and locations recently affected by our own SendInput are +excluded. Mere stillness or a jump when the cursor first hides never qualifies. +After a confirmed recenter event, correction may begin for that hold only. +Evidence and permission are reset on hold end, target focus loss or mode change. + +A successful classification logs `## STATE warp-evidence confirmed`. +Without this line, no mouse move should be tagged `DROP` in mode B. +For mode C, expect the line followed by `anchor-learned`, actual +`APPLY` and `OWN` movements, and continued 16 ms smoothing. +This is a conservative heuristic, **not** a direct Win32 notification that a +game called SetCursorPos; if samples cannot establish a warp, the fix +intentionally leaves the input alone. Do not weaken this behavior to make +a missed recenter look like a successful correction. + +Run all Probe modes over TeamViewer with Fix OFF and ON. Confirm mode B has +no suppressed moves and normal free cursor movement and that mode C still +acquires a warp and rotates smoothly. Finish with a WoW Start-Playing.cmd smoke +test and verify emergency OFF. These runtime tests are required before merging. + ## Anchor-recovery experiment (follow-up PR) When an existing anchor is wrong after the game window moves or changes its From 92ec71665e890156e133b09b2b87037dffd70320 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 15:08:00 +0100 Subject: [PATCH 25/30] docs(safety): document external warp proof and no-warp regression --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e10832e..c26391d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,11 @@ correction is still experimental. ### Fixed +- Require repeated, observed game recenter events before intercepting hidden-cursor + mouse input. Hidden/no-warp mode now passes through (MouseLookProbe B). + Recheck each hold and correction-mode change, keep the 16ms timer unchanged. + Regression cases cover no-warp, false-stable cursor and true warp evidence. + - Relearn a relocated game warp anchor *during* a hidden-cursor hold only after an onset warp-like transition and a strong 12-sample stable consensus. On significant anchor changes, discard queued smoothing movement from the From f16535f921a6af66c80a5e83aadd872eb4f1b904 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 15:09:29 +0100 Subject: [PATCH 26/30] docs: replace obsolete anchor heuristics with verified-recenter recovery --- docs/diagnostics.md | 56 +++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 35 deletions(-) diff --git a/docs/diagnostics.md b/docs/diagnostics.md index 844ecde..855c2f4 100644 --- a/docs/diagnostics.md +++ b/docs/diagnostics.md @@ -335,41 +335,27 @@ no suppressed moves and normal free cursor movement and that mode C still acquires a warp and rotates smoothly. Finish with a WoW Start-Playing.cmd smoke test and verify emergency OFF. These runtime tests are required before merging. -## Anchor-recovery experiment (follow-up PR) - -When an existing anchor is wrong after the game window moves or changes its -recenter position, the old implementation continues suppressing input and cannot -emit a camera step until the hold ends. The guarded recovery path looks for -**both** a cursor jump of at least 30 px when the game hides the cursor and a -stable location in recent (up to 12) state samples: at least eight identical -screen positions and at least 75% agreement. This reduces the risk of learning -a random remote mouse location; a stable cursor position alone is not proof of -recentring. If there is insufficient evidence, output still stays blocked -rather than guessing. - -A sample matching the most recent successful `SendInput` target (within -2 px) is never admitted to the recent-anchor consensus. Observations during -the first 160 ms after an own output are also quarantined, and any new -own output clears the in-progress sample window. At the end of a hold, an -estimate collected alongside own correction output is not allowed to replace -an already valid anchor. These checks address a captured false relocation -exactly 20 px from the real anchor (`kSmoothMaxStepPx`), which was followed -by a stale-pending reset. A repeated synthetic point is not game warp proof. - -A successful recovery logs `## STATE anchor-relearned during hold` followed by -`anchor-learned`. Any remaining smoothing movement queued for the previous -anchor is dropped on the main message-loop thread with -`## SMOOTH RESET reason=anchor-relearned` to prevent a large delayed jump. -No output is sent from the state sampler and the hook's safety gates are -unchanged. - -Windows regression: with TeamViewer and the A/B profile targeting Wow.exe, -rotate the camera, move the WoW window while the cursor is visible, then drag -again with the fix ON. An incorrect anchor must recover inside the new hold, -without a multi-second `off_anchor` run or a burst of old queued motion. -Repeat without moving the window. Probe A/B/C, relative and OFF modes, -hotkey emergency-off and loss of focus must still behave correctly. -**MSVC/CTest alone does not establish runtime safety or mouse-look quality.** +## Verified-anchor recovery + +If a game changes its recenter position while a hidden-cursor hold is active, +the sampler must **observe new unexplained return events** at the new point. +The same multi-event proof used for initial classification applies again; +an initially hidden cursor, position jump or a stable coordinate alone cannot +authorize an anchor. Candidate positions that coincide with our recent +`SendInput` output are ignored, along with a 160 ms quiet period after output. + +A validated relocation logs `## STATE warp-evidence confirmed` and +`anchor-learned`. If the new client-relative anchor differs from the old +one by more than the configured tolerance, the main message loop discards +smoothing movement queued against the previous anchor and logs +`## SMOOTH RESET reason=anchor-relearned`. The sampler never sends input. + +An anchor classified in one hold is **never reused as proof** in the next +hold. Until genuine recenter behavior is observed again, events pass through. +A temporary loss of correction is safer than suppressing cursor movements +in a game with no warp. Runtime verification must include moving the WoW +window before the next hold, all Probe A/B/C modes, loss of target focus, +the OFF/relative modes and emergency-off. ## High-resolution smoothing A/B experiment (follow-up PR) From 49dfc6275dd467ac34d982e4db249a79da2e4a5e Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 15:10:19 +0100 Subject: [PATCH 27/30] fix(safety): revoke stale warp gate and discard pending movement on fail-open --- src/main.cpp | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 93ab2e3..1dca56b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -546,6 +546,7 @@ int main() { std::uint64_t ownCountAtHoldStart = 0; // sampler thread only bool holdPhaseOpen = false; ULONGLONG hiddenSince = 0; + ULONGLONG offAnchorSince = 0; std::uint32_t hiddenGeneration = 0; const RECT virtualDesktop { GetSystemMetrics(SM_XVIRTUALSCREEN), @@ -612,6 +613,7 @@ int main() { filter.warpVerified.store(false, std::memory_order_release); filter.anchorValid.store(false, std::memory_order_release); warpEvidence.Reset(); + offAnchorSince = 0; holdPhaseOpen = false; } return; @@ -627,6 +629,7 @@ int main() { filter.anchorValid.store(false, std::memory_order_release); warpEvidence.Reset(); hiddenSince = tick; + offAnchorSince = 0; hiddenGeneration = generation; ownCountAtHoldStart = correction.applied.load(std::memory_order_acquire); } @@ -676,6 +679,39 @@ int main() { publishAnchor(verifiedAnchor, observedReturns, observedReturns, now.clientScreenRect); filter.warpVerified.store(true, std::memory_order_release); + offAnchorSince = 0; + } + + // A verified game may stop warping or move its anchor mid-hold. + // Never suppress indefinitely when the actual cursor remains far + // from the learned point with no recent own SendInput explaining it. + if (filter.warpVerified.load(std::memory_order_acquire) && + filter.anchorValid.load(std::memory_order_acquire)) { + const long expectedX = now.clientScreenRect.left + + filter.anchorOffsetX.load(std::memory_order_relaxed); + const long expectedY = now.clientScreenRect.top + + filter.anchorOffsetY.load(std::memory_order_relaxed); + const auto ownMs = lastOwnOutputMs.load(std::memory_order_acquire); + const bool recentOwn = ownCount != ownCountAtHoldStart && + ownMs != 0 && (tick < ownMs || tick - ownMs < 160); + const bool offAnchor = + std::labs(now.cursorPos.x - expectedX) > cfg.anchorTolerancePx || + std::labs(now.cursorPos.y - expectedY) > cfg.anchorTolerancePx; + if (!offAnchor || recentOwn) { + offAnchorSince = 0; + } else if (offAnchorSince == 0) { + offAnchorSince = tick; + } else if (tick - offAnchorSince >= 300) { + filter.warpVerified.store(false, std::memory_order_release); + filter.anchorValid.store(false, std::memory_order_release); + warpEvidence.Reset(); + anchorRevision.fetch_add(1, std::memory_order_release); + offAnchorSince = 0; + if (cfg.logStateChanges) { + LogLine(L"## STATE warp-evidence revoked: off-anchor >300ms; " + L"remote moves now pass through"); + } + } } if (cfg.watchdogMaxHiddenMs > 0 && @@ -1133,7 +1169,8 @@ int main() { if (msg.message == kMsgApplyDelta) { const rmf::CorrectionMode mode = correction.Mode(); - if (mode == rmf::CorrectionMode::Off) { + if (mode == rmf::CorrectionMode::Off || + !filter.warpVerified.load(std::memory_order_acquire)) { smoothPendingX = 0; smoothPendingY = 0; continue; // switched off after the hook posted: drop quietly @@ -1222,7 +1259,8 @@ int main() { } } if (correction.Mode() != rmf::CorrectionMode::Absolute || - !cursorHeldByTarget.load(std::memory_order_relaxed)) { + !cursorHeldByTarget.load(std::memory_order_relaxed) || + !filter.warpVerified.load(std::memory_order_acquire)) { smoothPendingX = 0; smoothPendingY = 0; continue; From 5afc0c27f464bcbcff42ec1c18ce5846bf9bfdf2 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 15:10:51 +0100 Subject: [PATCH 28/30] docs: clarify verified warp detection and fail-open timeout --- docs/diagnostics.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/diagnostics.md b/docs/diagnostics.md index 855c2f4..fb35812 100644 --- a/docs/diagnostics.md +++ b/docs/diagnostics.md @@ -99,9 +99,11 @@ events, which is why it is polled: - `cursor=HIDDEN` / `SHOWN` bracket the phase in which the game holds the mouse. The game's cursor warp itself uses `SetCursorPos` and is **invisible** in the event stream; it shows up only as `cursor_at` here. -- `anchor-learned` is written when a hidden phase ends and one cursor position clearly - dominated its samples (at least 5 hits and 20%). The anchor is stored as a client offset, - so it follows the window when it moves. +- `warp-evidence confirmed` requires repeated unexplained away-then-back + cursor motion correlated with distinct remote input events. Only then is + `anchor-learned` written and mouse-move suppression armed for that hidden + phase. The anchor is stored as a client offset, so it follows the window. + Without evidence, remote events pass through unchanged. - `clip=CONFINED` means `ClipCursor` is active. WoW 3.3.5a does not use it. - `focus-left-target` names the new foreground process. No input from it is recorded. From 0a9b1d13b7f77ee09515737be3a9f93a775ec1cb Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 15:10:55 +0100 Subject: [PATCH 29/30] docs: clarify verified warp detection and fail-open timeout --- docs/diagnostics.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/diagnostics.md b/docs/diagnostics.md index fb35812..bc66d6b 100644 --- a/docs/diagnostics.md +++ b/docs/diagnostics.md @@ -355,7 +355,10 @@ smoothing movement queued against the previous anchor and logs An anchor classified in one hold is **never reused as proof** in the next hold. Until genuine recenter behavior is observed again, events pass through. A temporary loss of correction is safer than suppressing cursor movements -in a game with no warp. Runtime verification must include moving the WoW +in a game with no warp. If the sampled cursor remains outside an already +verified anchor for more than 300 ms (excluding recent own output), the +classification is revoked, pending movement is discarded, and input passes +through again (`## STATE warp-evidence revoked`). Runtime verification must include moving the WoW window before the next hold, all Probe A/B/C modes, loss of target focus, the OFF/relative modes and emergency-off. From b4256a13c7bcd631c07501e2c926b85cd1dfb7f4 Mon Sep 17 00:00:00 2001 From: quasistatic-setup <76494705+quasistatic-setup@users.noreply.github.com> Date: Tue, 27 Oct 2026 15:11:03 +0100 Subject: [PATCH 30/30] docs: clarify verified warp detection and fail-open timeout --- CHANGELOG.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c26391d..c45f496 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,11 +25,12 @@ correction is still experimental. Recheck each hold and correction-mode change, keep the 16ms timer unchanged. Regression cases cover no-warp, false-stable cursor and true warp evidence. -- Relearn a relocated game warp anchor *during* a hidden-cursor hold only - after an onset warp-like transition and a strong 12-sample stable consensus. - On significant anchor changes, discard queued smoothing movement from the - old coordinate system rather than replay stale camera motion. -- Add a bounded recent-anchor consensus regression test (also run in CI). +- Relearn a relocated game warp anchor only after repeated unexplained + recenter events; do not trust the former onset-jump/stable-sample shortcut. + On significant relocation, discard queued smoothing movement from the + old coordinate system. Revoke the warp gate after 300 ms of sustained + off-anchor readings to avoid indefinite suppression. +- Add no-warp and recenter-evidence regressions (run in CI). ### Added