Skip to content

Preserve the valid idle sleep boundary after corrupt tail records - #56

Draft
SproutSeeds wants to merge 1 commit into
actigraph:mainfrom
SproutSeeds:fix/53-valid-idle-sleep-boundary
Draft

SproutSeeds wants to merge 1 commit into
actigraph:mainfrom
SproutSeeds:fix/53-valid-idle-sleep-boundary

Conversation

@SproutSeeds

Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant