Repository navigation
Recorrect through sustained transient jitter - #122
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adjusts the recorrection (hard resync) drift detector so that sustained “transient” suppression caused by persistent jitter no longer prevents a real drift breach from maturing.
Changes:
- Adds
transientStartedAtMstracking to measure how long transient-jump suppression has been continuously active while the smoothed error remains above the trigger. - After
RECORRECTION_SUSTAIN_MSof continuous transient suppression, treats the “transient” classification as incorrect and seedsbreachStartedAtMsfrom the suppression start time so the breach matures on the same time budget as clean drift. - Minor formatting change for
isJumpDetectedassignment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
maximmaxim345
added a commit
that referenced
this pull request
Jun 4, 2026
…st a real aiosendspin server. (#93) Adds a vitest test suite covering the SDK and an end-to-end run against a real aiosendspin server. No changes to `src/`. ## Unit tests (13 files, `tests/unit/`) clock-source, codec-support, core, decoder, decoder-codecs, output-latency-tracker, protocol-handler, recorrection-monitor, scheduler, state-manager, time-filter, time-sync-manager, websocket-manager. ## E2E (1 file, `tests/e2e/`) `sendspin-core.e2e.test.ts` drives a real aiosendspin Python server through a line-based stdin/stdout control protocol implemented by `tests/helpers/sendspin-server.py`. The Node side spawns and controls the subprocess via `tests/helpers/aiosendspin-server.ts`. ## Stats 234 tests across 14 files. `yarn test` ~32s locally. ## Bugs already caught and fixed Added a couple more tests which were able to flag bugs in this library. Each of them was already fixed in a separate PR before this one so all tests pass: - #116 - #117 - #118 - #119 - #121 - #122 --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Maxim Raznatovski <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #118 signed jumps with
Math.sign(jumpDeltaMs)to stop oscillation around zero confirming as drift. That over-corrected: oscillation around any nonzero value never confirms either, so a sustained drift whose raw error bounces ≥25ms each check reads as a permanent transient and never fires, even with smoothed pinned at 2× trigger.This tracks how long suppression has run while smoothed stays high. Past
SUSTAIN_MS, thetransientdiagnosis is treated as wrong and the breach matures, seeded from when suppression began so jittery drift fires on the same budget as clean drift.