Commit graph

3 commits

Author SHA1 Message Date
9b1a60226d whitepaper: diagrams + stats refresh for GC / meta-GC / hash primitives
Diagrams:
  - asm-architecture.dot: adds GC_NAIVE memory cluster (bump, free
    list, conservative stack scan) + meta-GC (with-arena) cluster
    showing the reset path; updates line count (4968 -> 6645),
    builtin count (91 -> 95+), mentions native hash-table-* /
    hash-set-* and the GC-build primitives (with-arena, gc-collect,
    gc-stats, arena-stats).
  - benchmark-binary-size.dot: adds second asm bar for the GC_NAIVE
    build (27 KB stripped vs 23 KB bump-only); updated asm bump
    size from 22 KB (stale) to actual 23 KB.
  - benchmark-gc.dot (new): side-by-side peak RSS for asm bump-only
    (134 MB), naive GC (1.1 MB), meta-GC arena (1.2 MB, 2000/2000
    resets); embedded in §6.6.
  - meta-gc-policy.dot (new): three-way decision tree at
    (with-arena) exit — implicit-GC-fired / mark-in-arena-range /
    no-mark-in-range -> skip / sweep / bulk-reset; embedded in
    §6.6.1.

Stats:
  - 975 verified assertions -> 980 (asm gained 5 via hash-table &
    hash-set tests; 571 Python + 137 asm + 83 C + 189 shared).
  - asm test count 132 -> 137 in the summary list, intro abstract,
    and §11 tier table. Notes that the optional GC build passes
    the same 137 independently (1,117 assertions total when both
    asm binaries are exercised).
  - Stale 4,968 LOC -> 6,645 already fixed in the prior commit;
    the new asm-architecture diagram now matches.

PDF rebuilt, 2.58 MB (was 2.40 MB). All test suites green.
2026-04-18 10:46:29 -04:00
aff292ebc8 whitepaper: actually use diagrams — 5 PNGs embedded, .dot sources refreshed
Fox flagged that the "A diagram is worth 10,000 words" quote
appeared twice in the paper but nothing was actually illustrated.
Fixed by:

1. Refreshing every .dot source to match current reality:
   - docs/asm-architecture.dot: 22 KB (was "13 KB"), 14 syscalls
     (was 4), 91 builtins (was 34), djb2 hash (was "linear scan"),
     TCP stack + heap-snapshot + portal boxes added.
   - docs/benchmark-sumto.dot: sum-to(1M) i5-8350U numbers; C
     --fast 238 ms, asm 670 ms, Python --fast 5,136 ms. Was
     sum-to(50k) with stale numbers.
   - docs/benchmark-ack.dot: ackermann(3,8) i5-8350U numbers. Was
     ack(3,4) with stale numbers.
   - docs/benchmark-binary-size.dot: asm 22 KB, C 205 KB, busybox
     2.1 MB, python3 8.0 MB. Was comparing against different
     baselines.

2. Regenerated all PNGs via `make docs`.

3. Embedded in the paper at meaningful points:
   - §2 Architecture (Python): python-architecture.png
   - §6.4 Three-way bench: benchmark-sumto.png, benchmark-ack.png
   - §11 Three Implementations: c-architecture.png, asm-
     architecture.png
   - §11.3 HTTP + sockets: benchmark-binary-size.png

4. Removed the redundant quote from §12.3; the one in §11
   remains because §11 now follows it with two real diagrams.

Prerequisite fox noted: "make sure diagrams are up to date before
using them to code." Done — every embedded figure has the current
numbers/topology, not the old ones.
2026-04-17 19:09:16 -04:00
670487c01d Add architecture docs with dot diagrams, update Makefile and CLAUDE.md
4 architecture diagrams (Graphviz DOT → PNG):
  python-architecture.dot  — bytecode VM + continuations + portal
  c-architecture.dot       — tree-walker + VM + JIT tiers
  asm-architecture.dot     — syscalls-only, 13KB binary
  jit-pipeline.dot         — AST → x86_64 machine code flow

docs/README.md — full architecture docs with embedded diagrams
and performance summary across all implementations.

Makefile: add asm-repl, docs target, clean-docs. Header comments
document all targets and test suites.

CLAUDE.md: add "A diagram is worth 10,000 words" (russell@unturf.com),
implementation table, test suite inventory.

Assembly is 2.5-4x faster than C interpreter on recursive workloads.
JIT remains 33x faster than hand-written assembly.
2026-04-15 14:07:59 -04:00