Robustness improvements for natebrennand codec#15
Merged
agavra merged 5 commits intoagavra:mainfrom Jan 31, 2026
Merged
Conversation
- Switch event_id deltas from u8 to varint-encoded u64 - Handles arbitrary gaps safely (u8 would overflow at 256) - Training data max delta is 251, varint costs only +72 bytes - Document all 16 GitHub event types in module docs - 4-bit encoding supports max 16 types - Will break if GitHub adds more event types Co-Authored-By: Claude Opus 4.5 <[email protected]>
Timestamp deltas use i16 (±32,767 seconds = ~9 hours max gap). Will break if adjacent events sorted by ID are >9 hours apart. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Size increased from 5,996,164 to 5,996,236 (+72 bytes) due to varint encoding for event_id deltas, which adds robustness for datasets with larger gaps between event IDs. Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Remove unnecessary .into_iter() call - Remove redundant u64 cast (event_id_deltas already Vec<u64>) - Add #[allow(dead_code)] to debug functions (used only with NATE_DEBUG=1) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
agavra
approved these changes
Jan 31, 2026
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.
Summary
Improves robustness of the natebrennand codec by using varint encoding for event_id deltas and documenting encoding limits.
Changes
Varint encoding for event_id deltas
Documented encoding limits
Other
🤖 Generated with Claude Code