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 bug in assign_unpack_references #12575

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

rahxephon89
Copy link
Contributor

Description

This PR fixes the bug revealed in the test case/simplifier-elimination/assign_unpack_references.move by 1) changing the type of nodeId generated for the Unpack operation; 2) fixing a bug in the bytecode_generator to recursively handle struct pattern when the unpack target is reference.

Type of Change

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

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
  • Other (specify)

How Has This Been Tested?

The fix can be validated by the output change in existing tests. Also added a transactional test assign_unpack_references.

Key Areas to Review

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

codecov bot commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.0%. Comparing base (36cd163) to head (3ceb266).
Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main   #12575       +/-   ##
===========================================
- Coverage    69.9%    64.0%     -6.0%     
===========================================
  Files        2285      817     -1468     
  Lines      432040   181066   -250974     
===========================================
- Hits       302391   115925   -186466     
+ Misses     129649    65141    -64508     

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

@rahxephon89 rahxephon89 marked this pull request as ready for review March 18, 2024 19:10
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.

LGTM, nice fix!

@@ -1264,14 +1264,15 @@ impl<'env> Generator<'env> {
} else {
ReferenceKind::Mutable
};
return self.gen_borrow_field_for_unpack_ref(id, str, arg, temps, ref_kind);
self.gen_borrow_field_for_unpack_ref(id, str, arg, temps, ref_kind);
Copy link
Contributor

Choose a reason for hiding this comment

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

Was the bug here really that the loop on 1276 wasn't run for this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are two issues, one is the loop wasn't run. The other one is that the type of struct pattern should be & instead of the struct type when unpacking a reference of a struct, which is fixed in the exp_builder.

@rahxephon89 rahxephon89 requested a review from wrwg March 20, 2024 05:19
@rahxephon89 rahxephon89 enabled auto-merge (squash) March 20, 2024 05:29

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

✅ Forge suite realistic_env_max_load success on 3ceb266187904d973fc8c4b184739e037c789d6a

two traffics test: inner traffic : committed: 7778 txn/s, latency: 5043 ms, (p50: 4800 ms, p90: 6000 ms, p99: 10800 ms), latency samples: 3360440
two traffics test : committed: 100 txn/s, latency: 1808 ms, (p50: 1800 ms, p90: 2000 ms, p99: 2200 ms), latency samples: 1740
Latency breakdown for phase 0: ["QsBatchToPos: max: 0.209, avg: 0.202", "QsPosToProposal: max: 0.272, avg: 0.254", "ConsensusProposalToOrdered: max: 0.465, avg: 0.429", "ConsensusOrderedToCommit: max: 0.311, avg: 0.293", "ConsensusProposalToCommit: max: 0.743, avg: 0.722"]
Max round gap was 1 [limit 4] at version 1602829. Max no progress secs was 4.702439 [limit 15] at version 1602829.
Test Ok

Copy link
Contributor

✅ Forge suite compat success on aptos-node-v1.9.5 ==> 3ceb266187904d973fc8c4b184739e037c789d6a

Compatibility test results for aptos-node-v1.9.5 ==> 3ceb266187904d973fc8c4b184739e037c789d6a (PR)
1. Check liveness of validators at old version: aptos-node-v1.9.5
compatibility::simple-validator-upgrade::liveness-check : committed: 6890 txn/s, latency: 4797 ms, (p50: 4800 ms, p90: 7800 ms, p99: 8400 ms), latency samples: 241180
2. Upgrading first Validator to new version: 3ceb266187904d973fc8c4b184739e037c789d6a
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 1105 txn/s, latency: 25949 ms, (p50: 28100 ms, p90: 36900 ms, p99: 38300 ms), latency samples: 58580
3. Upgrading rest of first batch to new version: 3ceb266187904d973fc8c4b184739e037c789d6a
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 256 txn/s, submitted: 494 txn/s, expired: 238 txn/s, latency: 36054 ms, (p50: 47100 ms, p90: 59800 ms, p99: 68500 ms), latency samples: 25097
4. upgrading second batch to new version: 3ceb266187904d973fc8c4b184739e037c789d6a
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 2479 txn/s, latency: 12433 ms, (p50: 11700 ms, p90: 18100 ms, p99: 19000 ms), latency samples: 119020
5. check swarm health
Compatibility test for aptos-node-v1.9.5 ==> 3ceb266187904d973fc8c4b184739e037c789d6a passed
Test Ok

@rahxephon89 rahxephon89 merged commit a3fbd84 into main Mar 20, 2024
83 checks passed
@rahxephon89 rahxephon89 deleted the teng/fix-assign-unpack branch March 20, 2024 06:03
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