fix(examples): ys-lower-report calls the public compile-form - #797
fix(examples): ys-lower-report calls the public compile-form#797mparrett wants to merge 1 commit into
Conversation
Review summaryVerified end to end:
Small, precise, well-verified fix. LGTM — approving. |
nooga
left a comment
There was a problem hiding this comment.
Verified: reproduced the original error, confirmed the fix resolves it and matches the PR's reported output across all five test files, and confirmed compile-form's :multi-fn-template normalization is the correct (not just reachable) entry point here.
|
Approved and green at @mparrett, please update/rebase the contributor-owned branch and let CI rerun. I will not push to it. Once it is current-base and fully green, it is next eligible to land. |
cb90b43 to
1710dac
Compare
|
Rebased onto Re-verified on the new base. The pre-fix script still fails at the same line, and the fixed version reproduces the PR body's table: CI is green on the new head: all 15 checks pass. |
|
Thanks for updating this to @mparrett, please update the contributor-owned branch once more and let CI rerun. I will not push it. I’ll merge after confirming the new head/base, approval, mergeability, and every required check. |
acfe213 to
9ee86d1
Compare
|
Updated again: head is now The branch had picked up a merge commit from the Update-branch button ( Re-verified on the new base, since #764 changes small-map ordering and the IR pipeline reads those maps: the five files still report All 15 checks green. |
The tool has been unable to run since compile-form* became private: every invocation dies at load with "Can't resolve ir.passes.pipeline/compile-form* in this context" before reporting on a single form. compile-form is the public wrapper over it, and is the right entry point for this caller for a second reason. It normalises a :multi-fn-template result to :status :lowered, which its own comment explains is there for callers that key off :status — otherwise a form that lowered via lambda-lift reads as unlowered. ys-lower-report is exactly such a caller: it branches on :status and prints anything that is not :lowered as a fallback. Verified by running the tool over five in-repo namespaces, which is the whole of its contract: examples/aot/native-entry/fib.lg ok=2 fallback=0 threw=0 examples/aot/cross-package/src/lib.lg ok=2 fallback=0 threw=0 test/native-entry/closure_capture.lg ok=2 fallback=0 threw=0 test/native-entry/loop_carried_closure.lg ok=3 fallback=0 threw=0 test/native-entry/conditional_closure.lg ok=4 fallback=0 threw=0 fib.lg's ok=2 agrees with the "2 fns lowered" that lg-compile reports for the same file. The three closure fixtures are the lambda-lift shapes, though they only demonstrate that the fixed tool reports them as lowered — there is no before-and-after to compare, since nothing ran before. The header comment is updated to match. Other references to compile-form* in the tree describe the private function itself and stay as they are. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
9ee86d1 to
782b7f8
Compare
examples/aot/yamlstar/ys-lower-report.lghas been unable to run sincecompile-form*became private. Every invocation dies at load:It never reports on a single form, so the per-fn lower/fallback report described
in
examples/aot/README.mdis currently unavailable.Why the public wrapper, beyond it resolving
compile-formnormalises a:multi-fn-templateresult to:status :lowered.Its own comment gives the reason: public callers key off
:status, and withoutthe normalisation "a form that lowered via lambda-lift reads as unlowered".
ys-lower-reportis one of those callers — it branches on:statusand printsanything other than
:loweredas a fallback. So the wrapper is the correctentry point here, not just the reachable one.
Verification
Ran the tool over five in-repo namespaces, which exercises the whole of its
contract:
examples/aot/native-entry/fib.lgok=2 fallback=0 threw=0examples/aot/cross-package/src/lib.lgok=2 fallback=0 threw=0test/native-entry/closure_capture.lgok=2 fallback=0 threw=0test/native-entry/loop_carried_closure.lgok=3 fallback=0 threw=0test/native-entry/conditional_closure.lgok=4 fallback=0 threw=0fib.lg'sok=2agrees with the2 fns loweredthatlg-compilereports forthe same file.
The three closure fixtures are the lambda-lift shapes, and they only show that
the fixed tool reports them lowered. There is no before-and-after to compare,
because nothing ran before.
Scope
Two lines: the call site and the header comment that describes it. Other
references to
compile-form*in the tree describe the private function itselfand are left alone.
Found while using the tool to survey a demo's lowerability against tip, which
also produced #796 and the comments on #551, #562, #660 and #358.