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

[Compiler-v2] Fix parsing of location in plan_builder of compiler v2 #15312

Merged
merged 3 commits into from
Nov 19, 2024

Conversation

rahxephon89
Copy link
Contributor

@rahxephon89 rahxephon89 commented Nov 19, 2024

Description

This PR closes #14635 by fixing how location is parsed in the attribute for move unit tests.

How Has This Been Tested?

Existing tests.

Key Areas to Review

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 Nov 19, 2024

⏱️ 1h 34m total CI duration on this PR
Slowest 15 Jobs Cumulative Duration Recent Runs
execution-performance / single-node-performance 23m 🟩
rust-move-tests 13m 🟩
rust-move-tests 12m 🟩
rust-move-tests 12m 🟩
check-dynamic-deps 5m 🟩🟩🟩🟩
rust-cargo-deny 5m 🟩🟩🟩
rust-doc-tests 5m 🟩
test-target-determinator 5m 🟩
execution-performance / test-target-determinator 4m 🟩
check 4m 🟩
fetch-last-released-docker-image-tag 2m 🟩
semgrep/ci 2m 🟩🟩🟩🟩
general-lints 1m 🟩🟩🟩
file_change_determinator 32s 🟩🟩🟩
permission-check 12s 🟩🟩🟩🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

@rahxephon89 rahxephon89 marked this pull request as ready for review November 19, 2024 06:30
@rahxephon89 rahxephon89 changed the title [WIP][Compiler-v2] Fix plan_builder of compiler v2 [Compiler-v2] Fix parsing of location in plan_builder of compiler v2 Nov 19, 2024
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.

Approving assuming comments are addressed.

@@ -505,10 +505,17 @@ fn convert_location(env: &GlobalEnv, attr: Attribute) -> Option<ModuleId> {
match value {
AttributeValue::Name(id, opt_module_name, _sym) => {
let vloc = env.get_node_loc(id);
convert_module_id(env, vloc, opt_module_name)
let module_id_opt = convert_module_id(env, vloc.clone(), opt_module_name);
if !_sym.display(env.symbol_pool()).to_string().is_empty() || module_id_opt.is_none() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if !_sym.display(env.symbol_pool()).to_string().is_empty() || module_id_opt.is_none() {
if !sym.display(env.symbol_pool()).to_string().is_empty() || module_id_opt.is_none() {

Copy link
Contributor

Choose a reason for hiding this comment

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

Also change _sym -> sym elsewhere.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a test case corresponding to !_sym.display(env.symbol_pool()).to_string().is_empty()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, in the test case where we have #[expected_failure(out_of_gas, location=0x1::m::t0)] and _sym corresponds to t0.

Copy link
Contributor

Choose a reason for hiding this comment

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

And when would it be an empty string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

when it is a module: 0x1::m. Added a test for this case.

},
AttributeValue::Value(id, _val) => {
let vloc = env.get_node_loc(id);
let vloc: Loc = env.get_node_loc(id);
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this explicit type annotation temporarily added for debugging?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor Author

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

@rahxephon89 rahxephon89 requested a review from vineethk November 19, 2024 17:29
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.

It would be nice to better localize the errors, but this is OK.

@rahxephon89 rahxephon89 enabled auto-merge (squash) November 19, 2024 22:55

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

✅ Forge suite realistic_env_max_load success on e31dc733965e6d0471f75706b16a2b57697ac4c0

two traffics test: inner traffic : committed: 14470.12 txn/s, latency: 2746.86 ms, (p50: 2700 ms, p70: 2700, p90: 2900 ms, p99: 3000 ms), latency samples: 5501900
two traffics test : committed: 99.97 txn/s, latency: 1479.13 ms, (p50: 1400 ms, p70: 1500, p90: 1600 ms, p99: 2500 ms), latency samples: 1800
Latency breakdown for phase 0: ["MempoolToBlockCreation: max: 1.980, avg: 1.519", "ConsensusProposalToOrdered: max: 0.324, avg: 0.293", "ConsensusOrderedToCommit: max: 0.379, avg: 0.369", "ConsensusProposalToCommit: max: 0.674, avg: 0.662"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 1.10s no progress at version 2192631 (avg 0.20s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 8.63s no progress at version 2192629 (avg 8.63s) [limit 15].
Test Ok

Copy link
Contributor

✅ Forge suite framework_upgrade success on be3ccc58ef518259d63fab7f3e3613f2a6214268 ==> e31dc733965e6d0471f75706b16a2b57697ac4c0

Compatibility test results for be3ccc58ef518259d63fab7f3e3613f2a6214268 ==> e31dc733965e6d0471f75706b16a2b57697ac4c0 (PR)
Upgrade the nodes to version: e31dc733965e6d0471f75706b16a2b57697ac4c0
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1317.70 txn/s, submitted: 1321.21 txn/s, failed submission: 3.51 txn/s, expired: 3.51 txn/s, latency: 2397.59 ms, (p50: 2100 ms, p70: 2400, p90: 3600 ms, p99: 4800 ms), latency samples: 120180
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1362.17 txn/s, submitted: 1365.24 txn/s, failed submission: 3.06 txn/s, expired: 3.06 txn/s, latency: 2201.30 ms, (p50: 2100 ms, p70: 2400, p90: 3200 ms, p99: 4500 ms), latency samples: 124460
5. check swarm health
Compatibility test for be3ccc58ef518259d63fab7f3e3613f2a6214268 ==> e31dc733965e6d0471f75706b16a2b57697ac4c0 passed
Upgrade the remaining nodes to version: e31dc733965e6d0471f75706b16a2b57697ac4c0
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1353.09 txn/s, submitted: 1356.24 txn/s, failed submission: 3.15 txn/s, expired: 3.15 txn/s, latency: 2280.23 ms, (p50: 2100 ms, p70: 2400, p90: 3600 ms, p99: 5300 ms), latency samples: 120180
Test Ok

Copy link
Contributor

✅ Forge suite compat success on be3ccc58ef518259d63fab7f3e3613f2a6214268 ==> e31dc733965e6d0471f75706b16a2b57697ac4c0

Compatibility test results for be3ccc58ef518259d63fab7f3e3613f2a6214268 ==> e31dc733965e6d0471f75706b16a2b57697ac4c0 (PR)
1. Check liveness of validators at old version: be3ccc58ef518259d63fab7f3e3613f2a6214268
compatibility::simple-validator-upgrade::liveness-check : committed: 14645.71 txn/s, latency: 1992.48 ms, (p50: 1900 ms, p70: 2100, p90: 2400 ms, p99: 3200 ms), latency samples: 559200
2. Upgrading first Validator to new version: e31dc733965e6d0471f75706b16a2b57697ac4c0
compatibility::simple-validator-upgrade::single-validator-upgrading : committed: 7872.66 txn/s, latency: 3518.28 ms, (p50: 3500 ms, p70: 4100, p90: 4600 ms, p99: 5000 ms), latency samples: 144120
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 7894.84 txn/s, latency: 4065.43 ms, (p50: 4200 ms, p70: 4300, p90: 6200 ms, p99: 6500 ms), latency samples: 260320
3. Upgrading rest of first batch to new version: e31dc733965e6d0471f75706b16a2b57697ac4c0
compatibility::simple-validator-upgrade::half-validator-upgrading : committed: 7760.85 txn/s, latency: 3685.22 ms, (p50: 4100 ms, p70: 4200, p90: 4400 ms, p99: 4500 ms), latency samples: 144940
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 6877.31 txn/s, latency: 4583.88 ms, (p50: 4500 ms, p70: 4600, p90: 7100 ms, p99: 7400 ms), latency samples: 237000
4. upgrading second batch to new version: e31dc733965e6d0471f75706b16a2b57697ac4c0
compatibility::simple-validator-upgrade::rest-validator-upgrading : committed: 10380.83 txn/s, latency: 2619.35 ms, (p50: 2500 ms, p70: 2700, p90: 3900 ms, p99: 4000 ms), latency samples: 178580
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 11113.39 txn/s, latency: 2802.36 ms, (p50: 2600 ms, p70: 2600, p90: 5200 ms, p99: 6600 ms), latency samples: 360340
5. check swarm health
Compatibility test for be3ccc58ef518259d63fab7f3e3613f2a6214268 ==> e31dc733965e6d0471f75706b16a2b57697ac4c0 passed
Test Ok

@rahxephon89 rahxephon89 merged commit c9c6d64 into main Nov 19, 2024
82 of 92 checks passed
@rahxephon89 rahxephon89 deleted the teng/fix-14635 branch November 19, 2024 23:29
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.

[Bug][move-compiler-v2] #[expected_failure] with invalid location yields no error in V2
3 participants