Skip to content

Commit 56c3bee

Browse files
committed
Plan Phase 42-45: SKIP recovery roadmap
Analyze 165 SKIP vars into 8 categories with user decisions: - Phase 42: Quick wins + protocol extension API (~15 vars) - Phase 43: BigInt/BigDecimal/Ratio + Array types (~42 vars) - Phase 44: Future/thread pool concurrency (~9 vars) - Phase 45: import→wasm mapping design research - Agent (17 vars): DEFERRED - STM/Ref (9 vars): OUT OF SCOPE New files: .dev/skip-recovery.md (master plan) New checklist: F130-F135
1 parent 29d06c2 commit 56c3bee

5 files changed

Lines changed: 419 additions & 131 deletions

File tree

.dev/checklist.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Check at session start for items that become actionable.
1414

1515
| ID | Item | Trigger |
1616
| ---- | -------------------------------------------- | ------------------------------------------------------------------ |
17-
| F3 | Ratio type (`1/3`) | SCI tests fail on float precision loss |
17+
| F3 | Ratio type (`1/3`) | → subsumed by F132, Phase 43 |
1818
| F4 | Persistent data structures (HAMT, RRB-Tree) | Collection benchmarks show bottleneck |
19-
| F6 | Multi-thread dynamic bindings | Native multi-thread target |
19+
| F6 | Multi-thread dynamic bindings | Prerequisite for F133 (Future), native multi-thread target |
2020
| F94 | Upstream Alignment pass | Replace UPSTREAM-DIFF implementations with upstream verbatim |
2121
| F95 | VM intrinsic ns awareness | :exclude of +,-,*,/ in refer-clojure ineffective on VM backend |
2222
| F99 | Iterative lazy-seq realization engine | D74 fixes sieve. General recursion remains. See `optimizations.md` |
@@ -26,3 +26,9 @@ Check at session start for items that become actionable.
2626
| F105 | JIT compilation | Future major phase — trace-based or method-based. See `optimizations.md` |
2727
| F110 | Directory restructure (core/eval/cli) | Phase 29 — common/native/ -> core/eval/cli/ |
2828
| F120 | Native SIMD optimization (CW internals) | Investigate Zig `@Vector` for CW hot paths. Profile first. |
29+
| F130 | Array Value type + ops (35 vars) | New NanHeapTag, aget/aset/make-array etc. Phase 43 |
30+
| F131 | BigInt + BigDecimal (pure Zig) | Arbitrary precision, no external deps. Phase 43 |
31+
| F132 | Ratio type + numerator/denominator | Extends F3, ties into F131. Phase 43 |
32+
| F133 | Future + thread pool | Zig std.Thread, GC safety, deref timeout. Phase 44 |
33+
| F134 | Protocol extension API | extend, extenders, extends? etc. (5 vars). Phase 42 |
34+
| F135 | import → wasm mapping design | Explore ClojureDart-like :import for .wasm. Phase 45 |

.dev/memo.md

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -20,50 +20,22 @@ Native production-grade Clojure runtime. Differentiation vs Babashka:
2020

2121
## Task Queue
2222

23-
Phase 38: Core Library Completeness
24-
1. [x] 38.1: thrown-with-msg? test assertion — enable skipped multimethod tests
25-
2. [x] 38.2: Matcher Value type + re-matcher, re-groups — regex group extraction
26-
3. [x] 38.3: Upstream alignment pass — fix highest-impact UPSTREAM-DIFF items
27-
4. [-] 38.4: case* compiler special form — DEFERRED (case works, O(1) is optimization)
28-
5. [x] 38.5: ns macro enhancement — :import support, docstring
23+
Phase 42: Quick Wins + Protocol Extension
24+
1. [ ] 42.1: Quick wins (with-in-str, uri?, uuid?, destructure, bytes?)
25+
2. [ ] 42.2: Protocol extension API (extend, extenders, extends?, satisfies?, find-protocol-impl)
26+
3. [ ] 42.3: Remaining implementable core vars (bound-fn, get-thread-bindings, seq-to-map-for-destructuring)
2927

30-
## Task Queue
31-
32-
Phase 40: Library Expansion — COMPLETE
33-
1. [x] 40.1: clojure.zip — zipper library (28 vars, upstream near-verbatim)
34-
2. [x] 40.2: clojure.data — diff (skipped, protocols only)
35-
3. [x] 40.3: clojure.test expansion — 18 vars added
36-
4. [x] 40.4: clojure.walk/math/repl remaining vars (6 vars)
37-
38-
## Task Queue
28+
## Current Task
3929

40-
Phase 41: Polish & Hardening
41-
1. [x] 41.1: ex-cause fix + pprint dynamic vars (7 vars)
42-
2. [x] 41.2: clojure.edn/read — SKIPPED (needs PushbackReader)
43-
3. [x] 41.3: clojure.core.reducers — SKIPPED (needs reify, protocols, ForkJoin)
44-
4. [x] 41.4: Upstream test porting
45-
5. [x] 41.5: Additional bug fixes and edge cases
30+
Phase 42.1: Quick wins — implement straightforward SKIP vars that need no new Value types.
4631

47-
## Current Task
32+
Target vars: `with-in-str`, `uri?`, `uuid?`, `destructure`, `seq-to-map-for-destructuring`, `bytes?`
4833

49-
Phase 41 complete. Plan next phase.
34+
Reference: `.dev/skip-recovery.md` Category 8 for full context.
5035

5136
## Previous Task
5237

53-
41.5: Bug fixes and edge cases (round 3).
54-
- Fixed peephole optimizer not updating try_begin jump offset (compiler.zig)
55-
- Root cause: when superinstructions removed instructions, try_begin operand wasn't remapped
56-
- Caused try/catch to silently bypass catch handler in specific patterns
57-
- Fix: add .try_begin to jump fixup pass alongside .jump/.jump_if_false/.jump_back
58-
- Fixed sorted collection support:
59-
- TransientHashSet: preserve comparator through transient/persistent cycle
60-
- with-meta for sets/maps: preserve comparator field
61-
- sorted? predicate: check comparator != null (was always false)
62-
- into: bypass transient path for sorted collections, use reduce conj
63-
- into 3-arity: match JVM (persistent! in rf completion, not outside transduce)
64-
- Fixed take 0 returning nil instead of empty list (= (take 0 x) () now true)
65-
- Fixed case macro throwing plain string instead of ex-info
66-
- Result: control 157/157, sequences 593/593, transducers 100/100 (all 0 errors)
38+
Phase 41 complete. SKIP recovery plan created (`.dev/skip-recovery.md`).
6739

6840
## Known Issues
6941

@@ -95,10 +67,25 @@ Session resume procedure: read this file → follow references below.
9567
| Optimizations | `.dev/optimizations.md` |
9668
| Benchmarks | `bench/history.yaml` |
9769
| Zig tips | `.claude/references/zig-tips.md` |
70+
| Skip recovery | `.dev/skip-recovery.md` |
9871
| Archived plans | `.dev/archive/` (Phase 24-30, CX, A) |
9972

10073
## Handover Notes
10174

75+
- **Phase 41 COMPLETE**: Polish & Hardening
76+
- 41.1: ex-cause fix + pprint dynamic vars (7 vars)
77+
- 41.4: Upstream test porting (control, sequences, transducers)
78+
- 41.5: Bug fixes (try/catch peephole, sorted collections, take 0)
79+
- **SKIP Recovery Plan**: 165 skip vars analyzed, 8 categories decided:
80+
- Cat 1 (Array 35 vars): IMPLEMENT Phase 43 — new Array Value type
81+
- Cat 2 (Agent 17 vars): DEFER — needs multi-thread GC
82+
- Cat 3 (STM 9 vars): OUT OF SCOPE — atom sufficient
83+
- Cat 4 (Proxy/Reify ~20 vars): PARTIAL — 5 protocol extension vars in Phase 42
84+
- Cat 5 (Future 9 vars): IMPLEMENT Phase 44 — Zig thread pool
85+
- Cat 6 (import 2 vars): DESIGN EXPLORE Phase 45
86+
- Cat 7 (BigNum 7 vars): IMPLEMENT Phase 43 — pure Zig BigInt/BigDecimal
87+
- Cat 8 (Quick wins ~10 vars): IMPLEMENT Phase 42
88+
- Full details: `.dev/skip-recovery.md`
10289
- **Phase 37 COMPLETE**: VM Optimization + JIT PoC
10390
- 37.1: Profiling (-Dprofile-opcodes, -Dprofile-alloc), GC benchmarks 26/27
10491
- 37.2: 10 superinstructions (0xC0-0xC9), arith_loop 53→40ms (1.33x)

.dev/roadmap.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ Goal: Babashka-competitive startup, single binary distribution, behavioral compa
8484
| 40.1 | clojure.zip (28 vars) | Upstream near-verbatim, fix & rest destructuring |
8585
| 40.3 | clojure.test expansion (18 vars) | Dynamic vars, macros, runner functions |
8686
| 40.4 | Walk/math/repl remaining (6 vars) | postwalk-demo, random, demunge, root-cause |
87+
| 41.1 | ex-cause fix + pprint dynamic vars (7 vars) | ex-cause, *print-right-margin*, etc. |
88+
| 41.4 | Upstream test porting | control, sequences, transducers tests |
89+
| 41.5 | Bug fixes and edge cases | try/catch peephole, sorted collections, take 0 |
8790

8891
**Stats**: 742 vars done (540 clojure.core, 14+ namespaces total)
8992

@@ -166,6 +169,49 @@ Bug fixes, edge cases, upstream test porting.
166169
| 41.4 | Upstream test porting | COMPLETE |
167170
| 41.5 | Bug fixes and edge cases | COMPLETE |
168171

172+
### Phase 42: Quick Wins + Protocol Extension — PLANNED
173+
174+
SKIP recovery Phase 1. See `.dev/skip-recovery.md` for full context.
175+
176+
| Sub | Content | Status |
177+
|-------|----------------------------------------------------|---------|
178+
| 42.1 | Quick wins (with-in-str, uri?, uuid?, destructure) | TODO |
179+
| 42.2 | Protocol extension API (extend, extenders, extends?)| TODO |
180+
| 42.3 | Remaining implementable core vars (bytes?, bound-fn)| TODO |
181+
182+
### Phase 43: Numeric Types + Arrays — PLANNED
183+
184+
New Value types: BigInt, BigDecimal, Ratio, Array.
185+
186+
| Sub | Content | Status |
187+
|-------|-------------------------------------------|---------|
188+
| 43.1 | BigInt (pure Zig arbitrary precision) | TODO |
189+
| 43.2 | BigDecimal | TODO |
190+
| 43.3 | Ratio type (F3/F132) | TODO |
191+
| 43.4 | Array Value type + core ops | TODO |
192+
| 43.5 | Typed array constructors + utilities | TODO |
193+
194+
### Phase 44: Concurrency Primitives — PLANNED
195+
196+
Thread pool and future-based concurrency.
197+
198+
| Sub | Content | Status |
199+
|-------|-------------------------------------------|---------|
200+
| 44.1 | Thread pool infrastructure (Zig) | TODO |
201+
| 44.2 | future, future-call, deref timeout | TODO |
202+
| 44.3 | pmap, pcalls, pvalues | TODO |
203+
| 44.4 | bound-fn, get-thread-bindings | TODO |
204+
205+
### Phase 45: import Design Research — PLANNED
206+
207+
Research mapping Java-style import to wasm module loading.
208+
209+
| Sub | Content | Status |
210+
|-------|-------------------------------------------------|---------|
211+
| 45.1 | Research: ClojureDart :import model | TODO |
212+
| 45.2 | Design: map Java import to wasm module loading | TODO |
213+
| 45.3 | Implementation (if design viable) | TODO |
214+
169215
### Phase 29: Codebase Restructuring (deferred)
170216

171217
Directory reorganization: common/native/ → core/eval/cli/.

0 commit comments

Comments
 (0)