gen-orchestrator: emit the per-node bookkeeping once, not per node - #15
Merged
Merged
Conversation
A fan-out of ~140 nodes could not build: the generated orchestrator carried ~360 tokens of inline bookkeeping per node (selector gate, rc capture, status, telemetry record), so aether-ui's 138-node tree sat at 49,800 tokens and one more .build.ae tripped aetherc's 50,000-token cap on a main file — "source file exceeds maximum token limit" with no file named (aether-ui #140). The bookkeeping is now two helpers emitted once (_aeb_selected, _aeb_record); each node is a guarded extern call plus one record call, ~35 tokens. Same 138 nodes: 49,770 → 7,227 tokens. Semantics unchanged. tests/test_gen_orchestrator_budget.ae generates a 500-node orchestrator (~180k tokens under the old scheme) and requires `ae check` to accept it against lib/bldr; it fails 4/4 against the previous generator.
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.
Why
aether-lang-dev/aether-ui#140 adds one
.build.ae(tests/min_size) and the whole fan-out fails on both CI legs with:No file is named because the file is aeb's own generated
_orchestrator.ae.gen-orchestratoremitted ~360 tokens of bookkeeping inline per node (selector gate, rc capture, status, the telemetry record). Measured with the aetherc lexer over aether-ui's node list: main = 49,412 tokens, #140 = 49,770, against aetherc's 50,000-token cap on a main file (modules get 100,000). The tree was one node from the wall.What
The bookkeeping is emitted once as two helpers,
_aeb_selected(sel, label)and_aeb_record(s, root, records, label, type_word, nrc, start); each node becomes:The extern call stays inline because a fn passed as a value from another TU is DCE'd (aether #2037). Same 138 nodes: 49,770 → 7,227 tokens. Semantics unchanged: same selector gate, same rc→
_mark_failed, same record fields, same TU so bldr's cloned statics resolve.Verified
aetherc --check --lib libaccepts it with the same two bldr-internal warnings as the old one.tests/test_gen_orchestrator_budget.ae: generates a 500-node orchestrator (~180k tokens under the old scheme) and requiresae checkto accept it againstlib/bldr, plus counts that the helpers appear once and every node goes through them. Passes with the new generator, fails 4/4 against the old one.Follow-up for aether-ui: bump
AEB_REFonce this is released.