Skip to content

[compiler-v2] Add loop labels to the language #14868

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

Merged
merged 3 commits into from
Oct 11, 2024
Merged

[compiler-v2] Add loop labels to the language #14868

merged 3 commits into from
Oct 11, 2024

Conversation

wrwg
Copy link
Contributor

@wrwg wrwg commented Oct 4, 2024

Description

Besides the user being able to describe complex algorithms more efficiently, loop labels are required to express aribtrary reducible control flow graphs in the AST language, and create parity of the AST with the bytecode level for this kind of code (which is also what can be generated from Move).

How Has This Been Tested?

New baseline tests in checking, v1-checking, bytecode generation, and a transactional test.

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Move Compiler
  • Other (specify)

Copy link

trunk-io bot commented Oct 4, 2024

⏱️ 4h 44m total CI duration on this PR
Slowest 15 Jobs Cumulative Duration Recent Runs
execution-performance / single-node-performance 21m 🟩
rust-move-unit-coverage 16m 🟩
dispatch_event 16m 🟩
rust-move-unit-coverage 16m 🟩
rust-move-unit-coverage 16m 🟩
dispatch_event 15m 🟩
dispatch_event 15m 🟩
rust-move-unit-coverage 15m 🟩
dispatch_event 14m 🟩
rust-cargo-deny 12m 🟩🟩🟩🟩 (+3 more)
rust-move-unit-coverage 11m 🟩
rust-move-unit-coverage 10m 🟩
rust-move-tests 10m 🟩
rust-move-tests 10m 🟩
rust-move-tests 10m 🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

Copy link
Contributor Author

wrwg commented Oct 4, 2024

Copy link

codecov bot commented Oct 4, 2024

Codecov Report

Attention: Patch coverage is 73.29193% with 43 lines in your changes missing coverage. Please review.

Project coverage is 60.1%. Comparing base (a822e65) to head (d1e567a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...hird_party/move/move-compiler/src/expansion/ast.rs 0.0% 18 Missing ⚠️
third_party/move/move-compiler/src/parser/ast.rs 0.0% 18 Missing ⚠️
third_party/move/move-model/src/lib.rs 0.0% 4 Missing ⚠️
...arty/move/move-compiler/src/expansion/translate.rs 66.6% 2 Missing ⚠️
third_party/move/move-compiler/src/parser/lexer.rs 90.9% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #14868    +/-   ##
========================================
  Coverage    60.0%    60.1%            
========================================
  Files         856      856            
  Lines      210892   211013   +121     
========================================
+ Hits       126742   126824    +82     
- Misses      84150    84189    +39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@vineethk vineethk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking pretty good! I have a few comments, but should be ready to go once they are addressed.

@wrwg wrwg force-pushed the wrwg/loop-labels branch from c24ecf7 to 8990356 Compare October 8, 2024 05:25
@wrwg wrwg force-pushed the wrwg/astifier branch 3 times, most recently from 4352c47 to ae2049a Compare October 9, 2024 02:49
@wrwg wrwg force-pushed the wrwg/loop-labels branch from 116fb63 to ffc69a0 Compare October 9, 2024 02:50
Copy link
Contributor Author

@wrwg wrwg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review!

@wrwg wrwg requested a review from vineethk October 9, 2024 02:51
Base automatically changed from wrwg/astifier to main October 9, 2024 04:27
@wrwg wrwg force-pushed the wrwg/loop-labels branch 2 times, most recently from e50a64b to d134193 Compare October 9, 2024 06:01
Copy link
Contributor

@vineethk vineethk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, have one comment to be addressed.

Copy link
Contributor Author

@wrwg wrwg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments addressed, thanks for the review!

@wrwg wrwg requested a review from brmataptos October 11, 2024 03:40
@wrwg wrwg force-pushed the wrwg/loop-labels branch from cb2f2e1 to 9ca62ec Compare October 11, 2024 03:42
@wrwg wrwg enabled auto-merge (squash) October 11, 2024 03:43

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

wrwg and others added 3 commits October 11, 2024 11:06
Besides the user being able to describe more complex algorithms more efficiently, loop labels are required to express any reducible control flow in the AST language, and create parity of the AST with the bytecode level for this kind of code (which is also what can be generated from Move).
@wrwg wrwg force-pushed the wrwg/loop-labels branch from 9ca62ec to d1e567a Compare October 11, 2024 18:06

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

✅ Forge suite compat success on beff51858b445401e49d5be352feadcf05652cc0 ==> d1e567aadd52708476b0c192569c1510274ab0c9

Compatibility test results for beff51858b445401e49d5be352feadcf05652cc0 ==> d1e567aadd52708476b0c192569c1510274ab0c9 (PR)
1. Check liveness of validators at old version: beff51858b445401e49d5be352feadcf05652cc0
compatibility::simple-validator-upgrade::liveness-check : committed: 11480.77 txn/s, latency: 2809.69 ms, (p50: 2100 ms, p70: 2400, p90: 6300 ms, p99: 16100 ms), latency samples: 391900
2. Upgrading first Validator to new version: d1e567aadd52708476b0c192569c1510274ab0c9
compatibility::simple-validator-upgrade::single-validator-upgrading : committed: 5145.43 txn/s, latency: 5593.56 ms, (p50: 6300 ms, p70: 6900, p90: 7600 ms, p99: 7900 ms), latency samples: 100000
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 5504.46 txn/s, latency: 5898.21 ms, (p50: 6400 ms, p70: 6700, p90: 7300 ms, p99: 8000 ms), latency samples: 191460
3. Upgrading rest of first batch to new version: d1e567aadd52708476b0c192569c1510274ab0c9
compatibility::simple-validator-upgrade::half-validator-upgrading : committed: 6759.89 txn/s, latency: 4230.44 ms, (p50: 4900 ms, p70: 5100, p90: 5300 ms, p99: 5400 ms), latency samples: 120300
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 7167.46 txn/s, latency: 4534.12 ms, (p50: 5000 ms, p70: 5100, p90: 5200 ms, p99: 5300 ms), latency samples: 240660
4. upgrading second batch to new version: d1e567aadd52708476b0c192569c1510274ab0c9
compatibility::simple-validator-upgrade::rest-validator-upgrading : committed: 11756.34 txn/s, latency: 2305.10 ms, (p50: 2400 ms, p70: 2600, p90: 2800 ms, p99: 2900 ms), latency samples: 203840
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 10431.59 txn/s, latency: 2965.72 ms, (p50: 2600 ms, p70: 2800, p90: 6000 ms, p99: 7000 ms), latency samples: 339980
5. check swarm health
Compatibility test for beff51858b445401e49d5be352feadcf05652cc0 ==> d1e567aadd52708476b0c192569c1510274ab0c9 passed
Test Ok

Copy link
Contributor

✅ Forge suite realistic_env_max_load success on d1e567aadd52708476b0c192569c1510274ab0c9

two traffics test: inner traffic : committed: 13157.16 txn/s, latency: 3022.67 ms, (p50: 3000 ms, p70: 3000, p90: 3300 ms, p99: 6300 ms), latency samples: 5002660
two traffics test : committed: 100.05 txn/s, latency: 2651.66 ms, (p50: 2500 ms, p70: 2700, p90: 2900 ms, p99: 5500 ms), latency samples: 1700
Latency breakdown for phase 0: ["QsBatchToPos: max: 0.264, avg: 0.225", "QsPosToProposal: max: 0.287, avg: 0.227", "ConsensusProposalToOrdered: max: 0.336, avg: 0.304", "ConsensusOrderedToCommit: max: 0.508, avg: 0.470", "ConsensusProposalToCommit: max: 0.810, avg: 0.774"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.84s no progress at version 3999340 (avg 0.21s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 8.00s no progress at version 3999338 (avg 4.30s) [limit 15].
Test Ok

Copy link
Contributor

✅ Forge suite framework_upgrade success on beff51858b445401e49d5be352feadcf05652cc0 ==> d1e567aadd52708476b0c192569c1510274ab0c9

Compatibility test results for beff51858b445401e49d5be352feadcf05652cc0 ==> d1e567aadd52708476b0c192569c1510274ab0c9 (PR)
Upgrade the nodes to version: d1e567aadd52708476b0c192569c1510274ab0c9
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1134.31 txn/s, submitted: 1136.76 txn/s, failed submission: 2.46 txn/s, expired: 2.46 txn/s, latency: 2783.13 ms, (p50: 2400 ms, p70: 2900, p90: 4500 ms, p99: 6000 ms), latency samples: 101600
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1120.94 txn/s, submitted: 1122.96 txn/s, failed submission: 2.02 txn/s, expired: 2.02 txn/s, latency: 2754.40 ms, (p50: 2400 ms, p70: 3000, p90: 4800 ms, p99: 5900 ms), latency samples: 99820
5. check swarm health
Compatibility test for beff51858b445401e49d5be352feadcf05652cc0 ==> d1e567aadd52708476b0c192569c1510274ab0c9 passed
Upgrade the remaining nodes to version: d1e567aadd52708476b0c192569c1510274ab0c9
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1288.98 txn/s, submitted: 1291.30 txn/s, failed submission: 2.32 txn/s, expired: 2.32 txn/s, latency: 2739.56 ms, (p50: 2100 ms, p70: 3000, p90: 5100 ms, p99: 7400 ms), latency samples: 100000
Test Ok

@wrwg wrwg merged commit 55e368c into main Oct 11, 2024
50 checks passed
@wrwg wrwg deleted the wrwg/loop-labels branch October 11, 2024 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants