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

Astifier fixes #15026

Merged
merged 1 commit into from
Nov 3, 2024
Merged

Astifier fixes #15026

merged 1 commit into from
Nov 3, 2024

Conversation

wrwg
Copy link
Contributor

@wrwg wrwg commented Oct 21, 2024

Description

This PR implements some major improvements to the astifier:

  • Finally (I think) cracked the way how to do correct topological sorting and managing nested blocks. More complicated examples now produce more reasonable results.
  • Rewrote AST transformations for if-then-else and loops.
  • Fixed issues with the fixpoint analysis on the AST
  • Did some minor fixes in the sourcifier

The generated source is still not correct in some cases, but much better then before.

How Has This Been Tested?

Baseline tests

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)

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

Copy link

trunk-io bot commented Oct 21, 2024

⏱️ 27m total CI duration on this PR
Job Cumulative Duration Recent Runs
rust-move-tests 9m 🟩
rust-move-tests 9m 🟩
rust-cargo-deny 4m 🟩🟩
check-dynamic-deps 3m 🟩🟩
general-lints 54s 🟩🟩
semgrep/ci 40s 🟩🟩
file_change_determinator 20s 🟩🟩
permission-check 5s 🟩🟩
permission-check 4s 🟩🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

Copy link
Contributor Author

wrwg commented Oct 21, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @wrwg and the rest of your teammates on Graphite Graphite

Base automatically changed from wrwg/decompiler to main October 29, 2024 03:53
@wrwg wrwg marked this pull request as ready for review November 1, 2024 00:03
Copy link
Contributor

@rahxephon89 rahxephon89 left a comment

Choose a reason for hiding this comment

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

Still need more time to understand the astifier part but the generated code has been improved a lot! Thanks

third_party/move/move-model/src/sourcifier.rs Outdated Show resolved Hide resolved
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.

Some minor comments, but otherwise LGTM.

Copy link
Contributor

@brmataptos brmataptos left a comment

Choose a reason for hiding this comment

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

A few nits, one duplicated operation.

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 reviews!

third_party/move/move-model/src/sourcifier.rs Outdated Show resolved Hide resolved
third_party/move/move-model/bytecode/src/astifier.rs Outdated Show resolved Hide resolved
This PR implements some major improvements to the astifier:

- Finally (I think) cracked the way how to do correct topological sorting and managing nested blocks. More complicated examples now produce more reasonable results.
- Rewrote AST transformations for if-then-else and loops.
- Fixed issues with the fixpoint analysis on the AST
- Did some minor fixes in the sourcifier

The generated source is still not correct in some cases, but much better then before.
@wrwg wrwg requested a review from brmataptos November 3, 2024 18:52
@wrwg wrwg enabled auto-merge (squash) November 3, 2024 18:52

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Nov 3, 2024

✅ Forge suite realistic_env_max_load success on c6bb3ad84de216817a5e5cc1874db38932ec8efe

two traffics test: inner traffic : committed: 14176.92 txn/s, latency: 2801.87 ms, (p50: 2700 ms, p70: 2700, p90: 3000 ms, p99: 3600 ms), latency samples: 5390480
two traffics test : committed: 99.95 txn/s, latency: 1482.41 ms, (p50: 1400 ms, p70: 1400, p90: 1500 ms, p99: 7600 ms), latency samples: 1760
Latency breakdown for phase 0: ["MempoolToBlockCreation: max: 2.123, avg: 1.617", "ConsensusProposalToOrdered: max: 0.327, avg: 0.299", "ConsensusOrderedToCommit: max: 0.363, avg: 0.351", "ConsensusProposalToCommit: max: 0.659, avg: 0.651"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 1.04s no progress at version 1886596 (avg 0.20s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 8.47s no progress at version 1886594 (avg 8.23s) [limit 15].
Test Ok

Copy link
Contributor

github-actions bot commented Nov 3, 2024

✅ Forge suite framework_upgrade success on 1086a5e00d773704731ab84fb4ed3538613b2250 ==> c6bb3ad84de216817a5e5cc1874db38932ec8efe

Compatibility test results for 1086a5e00d773704731ab84fb4ed3538613b2250 ==> c6bb3ad84de216817a5e5cc1874db38932ec8efe (PR)
Upgrade the nodes to version: c6bb3ad84de216817a5e5cc1874db38932ec8efe
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1348.64 txn/s, submitted: 1352.21 txn/s, failed submission: 3.58 txn/s, expired: 3.58 txn/s, latency: 2236.66 ms, (p50: 2100 ms, p70: 2400, p90: 3100 ms, p99: 4800 ms), latency samples: 120680
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1416.05 txn/s, submitted: 1419.36 txn/s, failed submission: 3.31 txn/s, expired: 3.31 txn/s, latency: 2105.00 ms, (p50: 1800 ms, p70: 2100, p90: 3300 ms, p99: 4400 ms), latency samples: 128180
5. check swarm health
Compatibility test for 1086a5e00d773704731ab84fb4ed3538613b2250 ==> c6bb3ad84de216817a5e5cc1874db38932ec8efe passed
Upgrade the remaining nodes to version: c6bb3ad84de216817a5e5cc1874db38932ec8efe
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1340.30 txn/s, submitted: 1343.40 txn/s, failed submission: 3.10 txn/s, expired: 3.10 txn/s, latency: 2427.50 ms, (p50: 2100 ms, p70: 2600, p90: 3600 ms, p99: 5500 ms), latency samples: 120900
Test Ok

Copy link
Contributor

github-actions bot commented Nov 3, 2024

✅ Forge suite compat success on 1086a5e00d773704731ab84fb4ed3538613b2250 ==> c6bb3ad84de216817a5e5cc1874db38932ec8efe

Compatibility test results for 1086a5e00d773704731ab84fb4ed3538613b2250 ==> c6bb3ad84de216817a5e5cc1874db38932ec8efe (PR)
1. Check liveness of validators at old version: 1086a5e00d773704731ab84fb4ed3538613b2250
compatibility::simple-validator-upgrade::liveness-check : committed: 14073.32 txn/s, latency: 2412.73 ms, (p50: 1700 ms, p70: 1900, p90: 4200 ms, p99: 13900 ms), latency samples: 501700
2. Upgrading first Validator to new version: c6bb3ad84de216817a5e5cc1874db38932ec8efe
compatibility::simple-validator-upgrade::single-validator-upgrading : committed: 6082.58 txn/s, latency: 4671.86 ms, (p50: 5200 ms, p70: 5500, p90: 5800 ms, p99: 5900 ms), latency samples: 113060
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 6553.97 txn/s, latency: 4926.20 ms, (p50: 5300 ms, p70: 5500, p90: 6500 ms, p99: 6800 ms), latency samples: 216980
3. Upgrading rest of first batch to new version: c6bb3ad84de216817a5e5cc1874db38932ec8efe
compatibility::simple-validator-upgrade::half-validator-upgrading : committed: 6045.55 txn/s, latency: 4676.63 ms, (p50: 5200 ms, p70: 5400, p90: 6000 ms, p99: 6200 ms), latency samples: 113820
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 6461.68 txn/s, latency: 5020.05 ms, (p50: 5400 ms, p70: 5500, p90: 6900 ms, p99: 7300 ms), latency samples: 220880
4. upgrading second batch to new version: c6bb3ad84de216817a5e5cc1874db38932ec8efe
compatibility::simple-validator-upgrade::rest-validator-upgrading : committed: 8403.26 txn/s, latency: 3305.84 ms, (p50: 3100 ms, p70: 3300, p90: 5500 ms, p99: 5800 ms), latency samples: 150700
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 7421.23 txn/s, latency: 4234.65 ms, (p50: 3200 ms, p70: 6100, p90: 7000 ms, p99: 9100 ms), latency samples: 244700
5. check swarm health
Compatibility test for 1086a5e00d773704731ab84fb4ed3538613b2250 ==> c6bb3ad84de216817a5e5cc1874db38932ec8efe passed
Test Ok

@wrwg wrwg merged commit 9baf39b into main Nov 3, 2024
87 of 93 checks passed
@wrwg wrwg deleted the wrwg/asti2 branch November 3, 2024 19:25
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.

4 participants