Skip to content

comp.ts: drop a dead pread binding, an unused ALC row and a redundant park case - #2063

Merged
nicolas-abril merged 3 commits into
bendlang:mainfrom
nicolas-abril:comp-cap
Nov 5, 2026
Merged

nicolas-abril merged 3 commits into
bendlang:mainfrom
nicolas-abril:comp-cap

Conversation

@nicolas-abril

@nicolas-abril nicolas-abril commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Three runtime simplifications in bend2/comp.ts (65,994 → 65,977 ttok). Each removes something nothing uses or a case the general path already covers.

Verified (on main b5e6b2e)

  • Emitted output: stdout, stderr and exit codes match main for every .bend under tests/, demos/ and bench/runtime/ (1,923 files, C and JS). The only differences in the emitted text are these three lines.
  • Clang: all 930 emitted C programs compile cleanly under clang's unused-function and unused-macro warnings, and the 67 ! programs under Metal. No runtime function or macro goes unused, apart from CUDA-, Linux- and ObjC-only code, which I checked by hand.
  • tsc: comp.ts type-checks with the same errors as main.
  • Gates: repo 56/56, test 1838/1838, perf level with main run back to back (121 vs 120 / 124; the machine is noisy).

🤖 Generated with Claude Code

… park case

The JS io_sys bound pread for the old file_read.js, which moved to
readvSync in bendlang#1881. ALC's extra row was for the old ALC[1 + arg] indexing;
the main thread uses ALC[0] and workers ALC[1..pool_size-1] since bendlang#1269.
io_park_add's w->next == w case writes what the next line writes anyway.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nicolas-abril nicolas-abril changed the title refactor(comp): shed 179 tokens with no output change comp.ts: drop a dead pread binding, an unused ALC row and a redundant park case Nov 5, 2026
nicolas-abril and others added 2 commits November 5, 2026 21:40
Nothing in the runtime reads through io_sys().read; its only caller was
the fifo_eof test, which now binds read in the dlopen it already makes.
file_read_no_ffi.bend's comment says io_sys bound read and pread, past.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reverts the read half of 07025d6: user effects call io_sys().read, so it
stays even with no caller in the repo. The test comment now says io_sys
binds read and once bound pread.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nicolas-abril
nicolas-abril merged commit ae7341d into bendlang:main Nov 5, 2026
1 check passed
nuxyel added a commit to nuxyel/bend-ml that referenced this pull request Nov 6, 2026
Bend 2.0.40 dropped the pread binding from io_sys() (bendlang/bend#2063), so
the JS lane threw "sys.pread is not a function". Base's own File.read_at
reads through fs since #1881; the six reads now do the same, retrying EINTR.
Same lines and errno on 2.0.39 and 2.0.40.
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