Repository navigation
Conversation
|
wtf Codex stole my authorship |
|
Thanks! As discussed,
|
cafbf36 to
60cb3ae
Compare
Co-authored-by: Flandia <[email protected]>
If lifting doesn't run, then eta expansion doesn't run. Co-authored-by: Flandia <[email protected]>
Carry annotations with rewritten function parameters and bodies so every definition builder consumes the eta rewrite's metadata. Remove stale @pure annotations when adding stages and mark extended calls as potentially effectful. Preserve existing deforestation annotations. Co-authored-by: Flandia <[email protected]>
Increment affine annotation indices when lifting adds a capture parameter list, so the annotation continues to describe the original stage. Update the eta-expansion golden output for a captured affine lambda. Co-authored-by: Flandia <[email protected]>
|
Please stop force-pushing to this branch, it makes following the latest changes very hard. Just use merge commits like a civilised person. |
Oh sorry I wanted to give a clean layer-by-layer review presentation I'll do that locally next time |
|
So I think this is ready for review. It adds Then a set of mutation analysis rules determine which functions are unsafe ( |
OK I managed to figure this out. It's not mysterious or unpredictable but a bit complex |
|
LP has spoken in the meeting; thus we shall change the word Gate |
LPTK
left a comment
There was a problem hiding this comment.
The PR tries to add hundreds of lines of unwanted extra output. Please be more careful and review your diff properly. We don't want to stage that much noise.
Co-authored-by: Lionel Parreaux <[email protected]>
Co-authored-by: Lionel Parreaux <[email protected]>
# Conflicts: # hkmc2/shared/src/main/scala/hkmc2/codegen/FlowAnalysisBasedRewrite.scala # hkmc2/shared/src/main/scala/hkmc2/codegen/deforest/Rewrite.scala # hkmc2/shared/src/main/scala/hkmc2/codegen/flowAnalysis/FlowAnalysis.scala # hkmc2/shared/src/test/mlscript/deforest/eta-expansion/basic.mls # hkmc2/shared/src/test/mlscript/deforest/eta-expansion/recursive.mls # hkmc2/shared/src/test/mlscript/opt/EtaExpansion.mls
Co-authored-by: Flandia <[email protected]>
| //│ eta-expansion > flatten_append$append⁰#0 @ <root>: [2, 5] | ||
| //│ eta-expansion > flatten$flatten⁰#0 @ <root>: [1, 5] |
There was a problem hiding this comment.
Reason is overly conservative field access classification. Just fixed
# Conflicts: # hkmc2/shared/src/test/mlscript/std/IterTest.mls
|
I feel like we should have a |
| :expect O | ||
| fun p() = X(Y(O)) | ||
| fun f(x) = if x is | ||
| X(y) then y | ||
| fun g(y) = if y is | ||
| Y(o) then o | ||
| g(f(p())) | ||
| //│ deforest > >>> fusing >>> | ||
| //│ deforest > X⁰(tmp⁰) -> | ||
| //│ deforest > match: x³ | ||
| //│ deforest > fields: x³.a⁰ | ||
| //│ deforest > Y⁰(O⁰) -> | ||
| //│ deforest > match: y⁰ | ||
| //│ deforest > fields: y⁰.b⁰ | ||
| //│ deforest > <<< fusing <<< | ||
| //│ eta-expansion > >>> eta-expansion targets shapes >>> | ||
| //│ eta-expansion > f$f⁰#0 @ <root>: [1, 2] | ||
| //│ eta-expansion > p$p⁰#0 @ <root>: [0, 2, 2] | ||
| //│ eta-expansion > f$x_X⁰#0 @ <root>: [1, 2, 2] | ||
| //│ eta-expansion > p$p⁰#0 @ <root>: [0, 2] | ||
| //│ eta-expansion > <<< eta-expansion targets shapes <<< | ||
| //│ = O |
There was a problem hiding this comment.
Just tracking this yet another regression. Codex told me fun f(x) = ... is deforested into
fun f$x_X(X_a)(...consumerVariables) =
X_a
then X_a becomes a capture, so our analysis classifies it as unsafe. This should be fixed by the capture analysis later
|
As discussed, pls ensure that there are no regressions to the existing committed tests – use |
This artifact is endorsed by Anto