Delete unreachable tree-walker HOF impls (PR D of ILO-45)#712
Merged
Conversation
PR D of ILO-45. The HOF builtins (map / flt / fld / srt 2-3 / rsrt 2-3 / ct / mapr / partition / flatmap / uniqby / grp) are no longer reachable from the tree-bridge: PRs A/B/C/earlier-3b/3c lifted each one to native VM dispatch and removed them from is_tree_bridge_eligible. Their tree-walker Rust impls inside call_function were dead code — nothing in the VM dispatch path routes a HOF call through the bridge any more, and the engine-Tree CLI surface was removed in PR #613. Cuts: - 12 HOF impl blocks in src/runtime/mod.rs call_function (3803-3854, 3901-3953, 5715-6186) - The closure_captures / resolve_fn_ref nested helpers that only those impls used - 14 runtime::tests inline unit tests that exercised the deleted impls via run_str (the tree-walker engine entry point) The tree-walker eval loop itself (eval_body / eval_stmt / eval_expr / Env / trampoline / ACTIVE_AST_PROGRAM) stays for PR E. After this PR, it is only reachable from the user-fn dispatch tail of call_function, which is now only reached by other tests in the runtime::tests module that exercise the tree-walker through run_str. PR E deletes that path and the eval loop. 864 lines of dead code gone. cargo test --release --features cranelift green.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
My PR D delete script stripped 14 failing tests but left two artefacts: - 20 duplicate `#[test]` lines stacked above other tests (the saved-but- never-cleared bug in the awk script). - 6 `run2_*` tests had `#[test]` then `#[cfg(not(target_family="wasm"))]` ordering; my awk's pending-attribute logic discarded `#[test]` because the next line wasn't `fn`. Restored. cargo clippy --release --features cranelift -- -D warnings clean.
This was referenced May 22, 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.
Summary
PR D of ILO-45 — fourth slice of the tree-walker eval-loop deletion. Deletes 864 lines of dead HOF implementations from `src/runtime/mod.rs`.
The HOF builtins (`map` / `flt` / `fld` / `srt 2-3` / `rsrt 2-3` / `ct` / `mapr` / `partition` / `flatmap` / `uniqby` / `grp`) were lifted to native VM + Cranelift dispatch in PRs A/B/C and earlier 3b/3c work. None of them appear in `is_tree_bridge_eligible` any more, and the public engine surface was removed in PR #613. Their tree-walker Rust impls inside `call_function` have been dead code since.
Audit (was originally going to be PR D's only deliverable)
Walked every entry in the current `is_tree_bridge_eligible` (72 non-HOF builtins after PR C). None of them call `eval_body` / `eval_stmt` / `eval_expr` transitively. The only callsites for those eval functions inside `call_function` were:
Since (2) is now deleted and (1) is only reachable via (2) from the bridge, the eval loop is genuinely unreachable from the live runtime. PR E can delete it.
What's in the diff
Single commit, one file:
Test plan
Follow-ups