Skip to content

ADR-0204 kickoff: binary-size campaign — measured baseline + levers (D-521/D-522)#144

Merged
chaploud merged 2 commits into
mainfrom
develop/binary-size-campaign
Jul 16, 2026
Merged

ADR-0204 kickoff: binary-size campaign — measured baseline + levers (D-521/D-522)#144
chaploud merged 2 commits into
mainfrom
develop/binary-size-campaign

Conversation

@chaploud

Copy link
Copy Markdown
Contributor

Summary

Kickoff for the binary-size campaign (ADR-0204), triggered by dogfooding mailbox from_cljw_05: cljw's binary-size campaign measured zwasm as its largest component (~2.99 MB of __text, 44% of all code) and sent three finished-form requests. This PR is docs + ledger only — stage PRs follow separately.

Measured baseline (2026-07-16, ReleaseSafe arm64 CLI 5,282,584 B @71cccba76)

Symbol attribution (nm -n, next-addr − addr) confirms cljw's numbers and re-prioritizes the levers:

Finding Size Consequence
api.jit_host_bridge comptime thunk cross-product (t2fp×2,880 + t1fp×960 + t0..4×320) 1,311 KB / 5,453 syms (92% of api.*) Lever #1 = D-522 — api-surface gating would NOT recover this; every JIT-enabled embedder pays it
engine.codegen.arm64.emit.compile (~161-arm ZirOp switch; handlers already in op_*.zig; dispatch_collector ADR-0074 substrate exists) 707 KB (one symbol) Lever #2 = D-521 — finish table registration, delete the fall-through switch
ReleaseFast base series 1,972,696 B (6/12) → 3,884,856 B binary doubled in a month, unnoticed (series cadence = phase-boundary)

Also corrected in the mailbox reply (to_cljw_05.md, local): the x86_64 emitter already exists and is target-comptime-gated (0 B in the arm64 binary), contrary to from_cljw_05's "planned" framing.

Changes

  • .dev/decisions/0204_binary_size_campaign.md — campaign ADR (D1 thunk collapse / D2 table-driven dispatch completion / D3 module split = only-if-free)
  • .dev/debt.yaml — new rows D-521, D-522 (front: binary-size)
  • .dev/handover.md — active-front section
  • bench/results/size_history.yaml — baseline rows re-recorded (base + lean)

Constraints carried from the request

No behaviour change, no JIT-output change, no API break; acceptance for D-521 = emitted JIT bytes identical (test-aot-diff + fuzz-diff); D-522 bench-gated against per-call regression.

chaploud added 2 commits July 16, 2026 12:06
…D-521/D-522)

Trigger: dogfooding mailbox from_cljw_05 (cljw measures zwasm at 44% of its
shipped code, 4.0 MB budget line). zwasm-side symbol attribution (ReleaseSafe
arm64 CLI 5,282,584 B @71cccba76) confirms and re-prioritizes:

- api.jit_host_bridge = 1,311 KB / 5,453 syms (92% of api.*) — a comptime
  thunk cross-product (t2fp x2,880 + t1fp x960 + t0..4), NOT api surface.
  Lever #1 = D-522 (descriptor-driven trampolines; ABI/api unchanged).
- engine.codegen.arm64.emit.compile = one 707 KB symbol (~161-arm ZirOp
  switch; handlers already extracted, dispatch_collector ADR-0074 substrate
  exists). Lever #2 = D-521 (finish registration, delete the switch;
  acceptance = emitted JIT bytes identical).
- size_history.yaml baseline re-recorded: ReleaseFast base DOUBLED since
  2026-06-12 (1,972,696 -> 3,884,856 B).

Docs+ledger only; stage PRs follow separately.
jit_host_bridge instantiation axes = arg-kinds x RetKind(5) x
MAX_HOST_SLOTS(64); the x64 slot axis is 94% of the product and exists
only to comptime-hardcode the slot index. Stage 1 = shared FP-bridge
delegation (~0.8 MB, no ABI change); stage 2 = slot-axis collapse via
runtime slot conveyance (~0.4 MB, internal call-sequence change).
@chaploud
chaploud enabled auto-merge (squash) July 16, 2026 03:29
@chaploud
chaploud merged commit 8bffe46 into main Jul 16, 2026
5 checks passed
@chaploud
chaploud deleted the develop/binary-size-campaign branch July 16, 2026 03:34
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.

1 participant