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.
36 lines
No EOL
1 KiB
JSON
36 lines
No EOL
1 KiB
JSON
{
|
|
"jolt-dev": {
|
|
"created_by": "agent",
|
|
"use_count": 19,
|
|
"view_count": 29,
|
|
"patch_count": 29,
|
|
"last_used_at": "2026-06-02T16:56:23.616413+00:00",
|
|
"last_viewed_at": "2026-06-02T16:56:23.607520+00:00",
|
|
"last_patched_at": "2026-06-02T16:56:42.437173+00:00",
|
|
"created_at": "2026-06-01T21:26:06.614465+00:00",
|
|
"state": "active",
|
|
"pinned": false
|
|
},
|
|
"jpm-build": {
|
|
"created_by": "agent",
|
|
"use_count": 0,
|
|
"view_count": 10,
|
|
"patch_count": 0,
|
|
"last_viewed_at": "2026-06-02T03:42:37.626504+00:00",
|
|
"created_at": "2026-06-01T20:56:39.144222+00:00",
|
|
"state": "active",
|
|
"pinned": false
|
|
},
|
|
"jolt-bootstrap": {
|
|
"created_by": "agent",
|
|
"use_count": 8,
|
|
"view_count": 18,
|
|
"patch_count": 10,
|
|
"last_used_at": "2026-06-02T03:43:48.038435+00:00",
|
|
"last_viewed_at": "2026-06-02T03:43:48.028512+00:00",
|
|
"last_patched_at": "2026-06-02T03:44:45.935676+00:00",
|
|
"created_at": "2026-06-01T21:49:51.101718+00:00",
|
|
"state": "active",
|
|
"pinned": false
|
|
}
|
|
} |