Conversation
…mboworks/mbo into implement/hamt-forward-iterator
…mboworks/mbo into implement/hamt-forward-iterator
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.
Add forward traversal over HAMT bitmap nodes and collision entries as the next step toward general map/set containers. Iterator copies carry independent traversal positions without allocating traversal storage.
AG;DR
Adds the shared-node iterator library, fixture-based tests, Bazel targets, and lifetime documentation. Traversal uses an inline bounded frame stack derived from hash width and fragment width. Entries remain borrowed: the snapshot root and allocation source must outlive iteration. End iterators compare equal; non-end positions include root identity. Public container range identity is a later layer.
Tests cover empty roots, bitmap data, children, collisions, independent iterator copies, and forward-iterator concepts. Initial validation passed 163 tests with one exception-only target skipped, measured focused LLVM coverage of 39/39 lines and 12/12 branches, and passed focused ASAN. These historical results are not substituted for current-head validation.
GCC 14 required explicit HamtInsertResult types for all four optional fallbacks. The subsequent CI clang-tidy diagnostics are corrected by explicitly parenthesizing the depth division and making three unchanged test iterators const. Focused tests and focused pre-commit pass on head 14d49ff, with local clang-tidy and trunk formatting disabled as requested. Full current-head local validation and replacement remote CI are in progress. macOS validation uses native Apple ld for SDK compatibility with the hermetic compiler.
C++20 compatible. No coverage scope, exclusion, threshold, or baseline changes. Draft implementation step; no merges or performance conclusions.