jolt/.dirge/memory
Yogthos 979486600a fix: persistent hash map — working with simple array implementation
Root cause of HAMT failure: Janet uses 64-bit doubles, bit operations
require 32-bit signed ints. Hash values from Janet exceed this range.

Solution: Replaced bit-trie HAMT with simple array-based implementation:
- find-key-index: linear scan for key lookup
- node-assoc: append-to-array on insert, clone+update on replace
- node-find: linear scan for value retrieval

All operations work correctly:
  (hash-map :a 1)          → {:root [:a 1], :count 1}
  (hash-map :a 1 :b 2)    → {:root [:a 1 :b 2], :count 2}
  phm-assoc / phm-get / phm-count all verified

O(n) lookup (acceptable for small maps). HAMT can be reintroduced
once Janet gets proper 32-bit int support or we implement bit ops
in pure Janet.
2026-06-02 13:25:20 -04:00
..
.cross_session_state bootstrap: SCI core deps loading with 284/304 forms passing 2026-06-01 23:24:13 -04:00
.curator_state bootstrap: SCI core deps loading with 284/304 forms passing 2026-06-01 23:24:13 -04:00
MEMORY.md fix: persistent hash map — working with simple array implementation 2026-06-02 13:25:20 -04:00
PITFALLS.md fix: persistent hash map — working with simple array implementation 2026-06-02 13:25:20 -04:00