Repository navigation
Conversation
ChangelogNo changelog entry. Semantic Diff2 commits · Full page Remove the alias pass's tracking of assigned variables9788182 · cknitt + Claude · Dec 05, 2026, 10:09 UTC
Review
Stop passing assigned variables through the Lambda analysesfb36509 · cknitt + Claude · Dec 05, 2026, 10:12 UTC
|
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
3467ee2 to
7213aa5
Compare
🎉 Compiler benchmarksAllocated wordsIn total: 661,232,105 → 660,470,647 (-0.12%). Generated projects: 628,540,539 → 628,100,888 (-0.07%).
109 more changes
InstructionsIn total: 8,976,822,365 → 8,945,579,689 (-0.35%). 🎉 Improvement: 3 benchmarks execute more than 1% fewer instructions.
1 more change
Output sizeIn total: 27,765,053 → 27,764,252 (±0.00%). None of the 13 benchmarks changed by 0.1% or more. Pull request fb36509 compared with base 696eef9 in this run. |
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
7213aa5 to
4473959
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Why:
#9424 taught the alias pass and two helpers about `Lassign`s in
bodies inlined from other modules: the pass collected the variables
such a body assigns, `Lam_bounded_vars.rewrite` renamed the assigned
variable, and `Lam_pass_collect` recorded nothing for a mutable `let`.
Since a body that updates a local ref is no longer stored (warning
113), no inlined body assigns a variable, and only
`Lam_pass_sroa`, which runs after every inlining pass, makes
`Lassign`s. `Lam_check.check` checks this after each pass before
sroa under `-check-lam`, which the compiler tests use. So the set was always
empty, no inlined body had an assignment to rename, and no mutable
`let` existed when the facts were collected. The code goes, and
`Lam_bounded_vars.rewrite` now fails on an assignment instead of
renaming it. The generated JavaScript doesn't change.
Review: Why not keep renaming the assignment, in case? A body with an
assignment that reaches inlining is already a bug: the passes before
sroa would move reads of the variable past it. Failing there names the
variable.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kbf3gHZYwA1rq7zbk3dhQq
Signed-off-by: Christoph Knittel <ck@cca.io>
Why:
`delay_safe`, `motion`, `refine_let`, the beta reductions, the let
pass, the occurrence count and `deep_flatten` took the set of
variables some `Lassign` assigns, and each caller computed it from
the term. All of them run before `Lam_pass_sroa`, the only pass that
makes `Lassign`s, and `Lam_check.check` checks under `-check-lam`
that no pass before sroa makes one. So the set was always empty.
Sroa itself kept a set of the fields it had turned into assigned
variables, for the `refine_let` of a read-only field. That field's
initializer runs before its block exists, so it can't read or change
a field this pass assigns: those are bound in the block's body or
inside the initializer. Blocks are replaced from the inside out, so a
field of an enclosing block is still a record field there, which
`delay_safe` already takes to change. The set made no difference
there either.
The argument goes, and a variable counts as unchanging in these
analyses. `Lam_stats.assignable`, which the JavaScript generation and
the JavaScript passes use after sroa, stays. The generated JavaScript
doesn't change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kbf3gHZYwA1rq7zbk3dhQq
Signed-off-by: Christoph Knittel <ck@cca.io>
4473959 to
fb36509
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## option-result-mark #9538 +/- ##
======================================================
- Coverage 82.63% 82.63% -0.01%
======================================================
Files 469 469
Lines 66638 66585 -53
======================================================
- Hits 55069 55021 -48
+ Misses 11569 11564 -5
🚀 New features to boost your workflow:
|
Two commits that remove dead code. Both rest on the invariant from the PR below: only
Lam_pass_sroamakesLassigns, no stored@inlinebody has one, andLam_check.checkchecks this after each pass under-check-lam.Lam_bounded_varsandLam_pass_collectabout assignments in inlined bodies. None reach them anymore.Lam_bounded_vars.rewritenow fails on an assignment instead of renaming it, since one there would already be a bug.delay_safe,motion,refine_let, the beta reductions, the let pass, the occurrence count anddeep_flattentook a set of assigned variables that was always empty before sroa. Sroa's own use goes too: a field's initializer runs before its block exists, so it can't read a field sroa assigns, and enclosing blocks are still records there. The commit message has the full argument.Lam_stats.assignableand the JavaScript-level checks of #9284 stay: they handle local refs after sroa.The generated JavaScript doesn't change.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Kbf3gHZYwA1rq7zbk3dhQq