Skip to content

comp.ts: one function makes the per-pass File state - #1507

Open
nicolas-abril wants to merge 1 commit into
bendlang:mainfrom
nicolas-abril:simplify-c8-file-pass
Open

nicolas-abril wants to merge 1 commit into
bendlang:mainfrom
nicolas-abril:simplify-c8-file-pass

Conversation

@nicolas-abril

@nicolas-abril nicolas-abril commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

File held ten fields that each emitting pass writes and the next pass clears (lend, segs, spins, spun, clos, tabs, img, lits, consts, brws). They were listed three times: in the type, in file_new, and in compile_book's clear-and-reset before each pass. file_pass() now builds them. file_new spreads it, compile_book does Object.assign(FL, file_pass()), and File takes its type from it. This frees 62 ttok (63,929 → 63,867).

Validation

  • Generated C: byte-identical to main for all 17 runtime benches.
  • Gates on the cluster: repo 54/54, test 1602/1602.
  • Perf: 3 interleaved gates/perf.ts runs against main. Geomean compiler 0.997, runtime 1.000.

#1506 (Nat as number) deletes marsh from the same File block, so whichever lands second needs a one-line rebase.

🤖 Generated with Claude Code

file_pass() returns the ten fields an emitting pass writes (lend, segs,
spins, spun, clos, tabs, img, lits, consts, brws). file_new spreads it,
compile_book assigns a fresh one before each pass, and File takes its
type, so the list is written once instead of three times.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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