Repository navigation
comp.ts sheds 443 tokens of redundant code - #1395
Merged
Merged
Conversation
… a probe by its own index (no use asks for DUMMY's)
…ever-made n suffix; type_adts and ty_clo use the plain forms
… are boxes without laying out its params
… lists sliced back
…read and an unreachable guard
… its failure to pool_mmap
…ord printed before its brace
…it skips cost raytrace's compile 3%
…DUMMY, io_loop reads the clock only with something parked A constructor and a def can share a name, and book_fam returns the constructor's own name when its type is no ADT, so ctr_build must not overwrite an entry that is there. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bend2/comp.tsdrops from 63,975 to 63,532 ttok (−443) through simplifications, not minimizations: dead special cases, duplicated logic folded into one place, and helpers reused instead of copied. No identifiers are shortened and no comments are cut to save tokens.What changed
lay_boxis gone (only W32/W64/BOX have no arms, so it wasx === BOX);seg_openrenames a binding's words in place;compile_bookopens defs and foreign defs in one loop and indents a segment with oneseg_text;emit_forkpicks frame bindings with one filter; a few dead guards confirmed unreachable by instrumenting the corpus.js_match; a pure main's show descriptor is one array;show_chrtakes the character.WL_AGAINisWL_JMP;blk_wclsis the one word-class rule;task_dealpicks a ring in one expression;corpus_maploops its hints and falls back throughpool_mmap;io_strdrops a no-opio_seal;io_looptakes both of its every-64-steps checks under one test;mainreads a missing flag value as"", so--threads/--gpuneed no NULL checks;show_f32/show_valare simpler;gpu_hashlives in the CUDA branch, its only user.Output changes
.cand.jsdiffers in those runtime lines.js_def's shared emitter gives a foreign def the trailing blank line every other def has, so.js/.mjsfiles with a JS foreign def gain one blank line after it (this also fixes a}export default {run-on).Verification
term_const's fieldless-constructor shortcut slowed raytrace's compile by 3%, so it stays; raytrace now compiles in the same time as on main.ctr_buildkeeps itshascheck (a constructor and a def can share a name, andbook_famreturns the constructor's own name when its type is no ADT);term_usesstill skipsDUMMY;io_loopreads the clock only when something is parked.gpu_hashinto its branch and inlinesgpu_shape).Rejected for costing speed: a merged copy loop in
ctr_take(5–10% faster on CPU, slower on Metal),WL_ARGSpushing N words (+1% queens), and removingWL_FRAME'swtwtemporary (breaks an ldp/stp pairing).🤖 Generated with Claude Code