Skip to content

add hashmap - #2

Open
mallang wants to merge 80 commits into
rotaki:hashmapfrom
mallang:master
Open

add hashmap#2
mallang wants to merge 80 commits into
rotaki:hashmapfrom
mallang:master

Conversation

@mallang

@mallang mallang commented Jun 11, 2024

Copy link
Copy Markdown
Collaborator

No description provided.

rotaki added a commit that referenced this pull request Apr 23, 2026
This commit contains three critical fixes for order-preserving hash (ophash) support:

1. Fix overflow table bucket mismatch (Bug #1)
   - Added insert_at_bucket() method to OverflowTable
   - Updated PT to explicitly insert pages at their preferred bucket
   - Previously, ophash pages were inserted using default hash but looked up using
     preferred_frame hash, causing 99.9% page faults

2. Fix fastmod underflow for small values (Bug #2)
   - Changed ophash path from fastmod() to regular % modulo
   - fastmod returns 0 for all values <2^55, breaking sequential mapping
   - Affects both PT implementation and pt_preferred_slot utility function
   - This preserves order-preserving property: adjacent pages → adjacent slots

3. Add multi-container support to collision benchmark
   - Added --num-containers CLI argument to pt_fastpath_coverage
   - Distribute pages across multiple containers to create ophash collisions
   - Single-container ophash has perfect sequential mapping (no collisions)
   - Multi-container creates overlapping slot ranges → realistic collision testing

Results after fixes:
- Single container: 100% coverage (perfect alignment)
- Multi-container (10+): ~50-100% coverage depending on collision width
- Collision benchmark now works for ophash variants (previously crashed)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

2 participants