Skip to content

Add HAMT node occupancy indexing - #448

Draft
helly25 wants to merge 2 commits into
feature/hamt-hash-pathfrom
feature/hamt-node-index
Draft

helly25 wants to merge 2 commits into
feature/hamt-hash-pathfrom
feature/hamt-node-index

Conversation

@helly25

@helly25 helly25 commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Add the shared CHAMP-style node occupancy primitive for HAMT map/set and flat/node implementations. Separate data and child bitmaps map logical hash fragments to dense storage indices while enforcing that a slot cannot hold both forms.

AG;DR

  • models empty, inline-data, and child-node slots
  • computes independent dense data and child indices through bitmap rank
  • supports insertion, erasure, promotion, and demotion without layout duplication
  • supports all benchmark-candidate fragment widths from 4 through 7 bits
  • tests disjoint occupancy, rank maintenance, transitions, and constexpr use
  • follows the internal PascalCase naming policy throughout the node-index API

Validation:

  • bazel test //mbo/container:hamt_node_index_test
  • focused pre-commit passed with local clang-tidy and the sandbox-incompatible trunk wrapper explicitly skipped; clang-format passed

This is a chained draft based on PR #447 and must not merge before its predecessors.

@helly25
helly25 force-pushed the feature/hamt-node-index branch from 47c5577 to 213a514 Compare September 11, 2026 11:49

This branch has not been deployed

No deployments
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