Merged
Conversation
…coding Adds a new decode path that preserves u64 alignment information through the entire pipeline, eliminating per-field alignment checks that bytemuck::try_cast_slice required when going through &[u8]. Key changes: - decode_u64s: returns (&[u64], u8) pairs instead of &[u8] slices, where the u8 indicates valid trailing bytes in the last word - from_u64s on FromBytes: non-panicking field construction that enables LLVM to eliminate unused tuple fields as dead code - validate/validate_typed: upfront structural and type-compatibility checks for encoded data, replacing the implicit panic-on-bad-data - Remove inspect module (superseded by examples/decode_asm.rs) Assembly impact for accessing field 0 of a k-tuple of u64s: Old (from_bytes): k=3 → 133 insns, k=8 → 273 insns (linear in k) New (from_u64s): k=3 → 68 insns, k=8 → 68 insns (constant in k) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…exed Indexed is now the sole encoding format with inherent methods, so callers don't need to import a trait. The Sequence format provided no random access or u64-aligned decoding and is no longer needed. Renames serialization_neu to indexed now that there is no other serialization module to distinguish from. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
validate_typed was partly a function of the Indexed format and partly of the type being decoded. It now lives as FromBytes::validate, which combines structural and type-compatibility checks using element_sizes. The Indexed struct's methods were all one-line delegates to free functions in the indexed module. Removed the struct and inlined length_in_words/length_in_bytes as free functions. Callers use the module directly (columnar::bytes::indexed::encode, etc). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
element_sizes is only used internally by validate. Mark it #[doc(hidden)] and simplify tests to exercise validate directly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
element_sizes is public for implementors to override. validate is public for callers to use at trust boundaries. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Trimmed from experimental accumulation to a clean comparison of: - from_bytes + decode (O(k) baseline) - from_u64s + decode_u64s (O(1) in k via dead code elimination) - decode_field random access (O(1) in both k and field position) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The bench and serde benchmarks referenced the removed EncodeDecode trait and Sequence type. Updated to use the indexed module directly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The enum container struct now uses a single `indexes: Discriminant` field instead of separate `variant` and `offset` fields. Update the derive macro's from_u64s to match, and add from_u64s/element_sizes to the Discriminant FromBytes impl. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
b6e9b45 to
7aeea5b
Compare
FromBytes::validate now takes &[(&[u64], u8)] matching the from_u64s input shape, making it composable for nested types. Added indexed::validate_typed::<T> as the single entry point that combines structural and type-level validation. Also added from_u64s and element_sizes for Discriminant. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The obvious name should do the obvious thing: indexed::validate::<T> does full validation (structural + type compatibility). The structural- only check is now validate_structure, an implementation detail. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
Author
|
There is still an increasing number of instructions for fields beyond 0, but saving that for a different PR. It seems likely related to taking larger steps through the iterator, removing the sequential dependencies, whereas this is mostly about tweaking the codegen to avoid panics. |
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.
The result of work with Claude code. This summary was written by Claude: