Skip to content

Implement HashMap — O(1) hash map primitive (#162) - #164

Merged
nockawa merged 4 commits into
mainfrom
feature/162-linear-hash-map
Mar 14, 2026
Merged

nockawa merged 4 commits into
mainfrom
feature/162-linear-hash-map

Conversation

@nockawa

@nockawa nockawa commented Mar 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Page-backed HashMap<TKey, TValue> — O(1) average-case lookup, insert, delete on exact-match keys
  • Single generic class, JIT-specialized hash function via sizeof(TKey) branching (no subclasses)
  • 256-byte chunks in ChunkBasedSegment, OLC per-bucket concurrency, gradual growth via linear hashing
  • ConcurrentEnumerator with per-bucket OLC + collect-then-yield for query pipeline use
  • AllowMultiple support for multi-value keys via VSBS buffer indirection
  • 71 tests passing (CRUD, split, concurrent stress, enumeration, AllowMultiple)

Test plan

  • All 71 HashMap tests pass (dotnet test --filter HashMapTests)
  • Full solution builds clean
  • No regressions in existing test suite

Closes #162

🤖 Generated with Claude Code

@nockawa
nockawa merged commit 28c1510 into main Mar 14, 2026
5 checks passed
@nockawa
nockawa deleted the feature/162-linear-hash-map branch March 14, 2026 21:58
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.

Implement Hash Map

1 participant