Preserve the valid idle sleep boundary after corrupt tail records - #56
Draft
SproutSeeds wants to merge 1 commit into
Draft
SproutSeeds wants to merge 1 commit into
SproutSeeds wants to merge 1 commit into
Conversation
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.
I found that a trailing record rejected for a bad checksum can still change the timestamp used to finish idle sleep filling. In a synthetic 100 Hz recording, a rejected tail record changes a 500 row result to either 300 or 900 rows. This patch retains the last checksum valid timestamp and preserves the 500 rows.
All 11 existing tests and 14 new corruption/truncation cases pass, along with the existing lint checks. I compared 96 synthetic cases across eight sample rates. The patch corrects the 24 corrupt tail outcomes and leaves the other 72 outcomes unchanged, including the documented initial sleep and clock reset exceptions. Local verification was on macOS arm64. Linux fork CI also passes original lint, all 25 tests, builds, and installed wheel tests on Python 3.11 and 3.12: https://github.com/SproutSeeds/pygt3x/actions/runs/34814758931. The workflow checks out this exact contribution commit.
Related to #53. I have not reproduced the original reporter recording or established ActiLife parity. This draft covers the checksum boundary correction. Missing exit events, terminal padding, and clock reset behavior still need an agreed output policy.
Cody