Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler): lifting globals from inflight classes defined in preflight fails #5559

Draft
wants to merge 41 commits into
base: main
Choose a base branch
from

Conversation

yoav-steinberg
Copy link
Collaborator

@yoav-steinberg yoav-steinberg commented Jan 28, 2024

See #2730

  • Title matches Winglang's style guide
  • Description explains motivation and solution
  • Tests added (always)
  • Docs updated (only required for features)
  • Added pr/e2e-full label if this feature requires end-to-end testing

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

@yoav-steinberg yoav-steinberg changed the title fix(compiler): we fail to detect errors qualifying inflight closure lifts fix(compiler): ail to detect errors qualifying inflight closure lifts Jan 28, 2024
@monadabot
Copy link
Contributor

monadabot commented Jan 28, 2024

Thanks for opening this pull request! 🎉
Please consult the contributing guidelines for details on how to contribute to this project.
If you need any assistence, don't hesitate to ping the relevant owner over Discord.

Topic Owner
Wing SDK and utility APIs @chriscbr
Wing Console @ainvoner, @skyrpex, @polamoros
JSON, structs, primitives and collections @hasanaburayyan
Platforms and plugins @hasanaburayyan
Frontend resources (website, react, etc) @tsuf239
Language design @eladb
VSCode extension and language server @markmcculloh
Compiler architecture, inflights, lifting @yoav-steinberg
Wing Testing Framework @tsuf239
Wing CLI @markmcculloh
Build system, dev environment, releases @markmcculloh
Library Ecosystem @chriscbr
Documentation @hasanaburayyan
SDK test suite @tsuf239
Examples @skorfmann
Wing Playground @eladcon

@monadabot
Copy link
Contributor

monadabot commented Jan 28, 2024

Console preview environment is available at https://wing-console-pr-5559.fly.dev 🚀

Last Updated (UTC) 2024-03-10 09:41

@monadabot
Copy link
Contributor

monadabot commented Jan 28, 2024

Benchmarks

Comparison to Baseline ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
Benchmark Before After Change
version 58ms±0.33 59ms±0.43 +1ms (+1.38%)⬜
functions_1.test.w -t sim 544ms±18.05 521ms±4.05 -23ms (-4.21%)⬜
functions_1.test.w -t tf-aws 940ms±4.88 948ms±6.76 +8ms (+0.82%)⬜
jsii_small.test.w -t sim 487ms±4.76 491ms±7.09 +4ms (+0.92%)⬜
jsii_small.test.w -t tf-aws 711ms±2.87 721ms±16.98 +10ms (+1.42%)⬜
jsii_big.test.w -t sim 2920ms±8.3 2904ms±12.66 -15ms (-0.52%)⬜
jsii_big.test.w -t tf-aws 3121ms±11.79 3121ms±9.67 ...
hello_world.test.w -t sim 514ms±3.32 518ms±4.15 +4ms (+0.79%)⬜
hello_world.test.w -t tf-aws 1640ms±10.22 1645ms±6.79 +5ms (+0.32%)⬜
empty.test.w -t sim 481ms±4.04 483ms±3.94 +2ms (+0.41%)⬜
empty.test.w -t tf-aws 701ms±3.3 707ms±5.93 +6ms (+0.9%)⬜
functions_10.test.w -t sim 598ms±10.19 597ms±9.58 -2ms (-0.29%)⬜
functions_10.test.w -t tf-aws 2226ms±9.49 2236ms±12.65 +10ms (+0.44%)⬜

⬜ Within 1.5 standard deviations
🟩 Faster, Above 1.5 standard deviations
🟥 Slower, Above 1.5 standard deviations

Benchmarks may vary outside of normal expectations, especially when running in GitHub Actions CI.

Results
name mean min max moe sd
version 59ms 58ms 60ms 0ms 1ms
functions_1.test.w -t sim 521ms 512ms 531ms 4ms 6ms
functions_1.test.w -t tf-aws 948ms 931ms 960ms 7ms 9ms
jsii_small.test.w -t sim 491ms 477ms 508ms 7ms 10ms
jsii_small.test.w -t tf-aws 721ms 705ms 787ms 17ms 24ms
jsii_big.test.w -t sim 2904ms 2882ms 2935ms 13ms 18ms
jsii_big.test.w -t tf-aws 3121ms 3105ms 3147ms 10ms 14ms
hello_world.test.w -t sim 518ms 510ms 528ms 4ms 6ms
hello_world.test.w -t tf-aws 1645ms 1631ms 1662ms 7ms 9ms
empty.test.w -t sim 483ms 474ms 489ms 4ms 6ms
empty.test.w -t tf-aws 707ms 695ms 720ms 6ms 8ms
functions_10.test.w -t sim 597ms 576ms 611ms 10ms 13ms
functions_10.test.w -t tf-aws 2236ms 2208ms 2266ms 13ms 18ms
Last Updated (UTC) 2024-03-10 09:47

@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Jan 28, 2024
@yoav-steinberg yoav-steinberg changed the title fix(compiler): ail to detect errors qualifying inflight closure lifts fix(compiler): fail to detect errors qualifying inflight closure lifts Jan 28, 2024
@yoav-steinberg yoav-steinberg linked an issue Jan 28, 2024 that may be closed by this pull request
Because the type system can't distinguish between a closure class (which needs to be lifted) and a regular function type...
Also lift on reference and not all call, by assuming a ref to a closure will actually call it later on, we can correctly lift (and setup permissions) for closures stored in collections (for example). This is a special exception to our qualification rules, since closures only have a single method (`handle`) so we can implicitly qualify it.
yoav-steinberg and others added 19 commits February 16, 2024 18:50
Signed-off-by: monada-bot[bot] <monabot@monada.co>
Signed-off-by: monada-bot[bot] <monabot@monada.co>
Signed-off-by: monada-bot[bot] <monabot@monada.co>
this should resolve issue with lifting the type base class of inflight classes.
Signed-off-by: monada-bot[bot] <monabot@monada.co>
Signed-off-by: monada-bot[bot] <monabot@monada.co>
Signed-off-by: monada-bot[bot] <monabot@monada.co>
@yoav-steinberg yoav-steinberg changed the title fix(compiler): fail to detect errors qualifying inflight closure lifts fix(compiler): lifting globals from inflight classes defined in preflight fails Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to capture preflight object from within an inflight class
3 participants