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

[refactoring] Fix more instances of non-canonical PartialOrd implementations #11475

Merged
merged 3 commits into from
Dec 29, 2023

Conversation

vineethk
Copy link
Contributor

Description

The recent upgrade to Rust 1.74.1 (#11374) added new clippy checks.

One such check was adhering to this rule: https://rust-lang.github.io/rust-clippy/master/index.html#/non_canonical_partial_ord_impl

I have addressed most of the instances in our codebase that violated this rule, and fixed a bug found while doing so (PartialOrd, PartialEq, and Ord always need to agree with each other).

The only cases currently left in our codebase are because of the use of the external derivative crate (basically, due to this issue: mcarton/rust-derivative#115). It looks like the derivative crate may no longer be maintained, so we may want to look for alternatives (not done in this PR).

Test Plan

Existing tests.

Copy link

trunk-io bot commented Dec 21, 2023

⏱️ 6h 9m total CI duration on this PR
Job Cumulative Duration Recent Runs
rust-unit-tests 1h 7m 🟩🟩
windows-build 1h 3m 🟩🟩🟩
rust-move-unit-coverage 42m 🟩🟩
forge-framework-upgrade-test / forge 41m 🟩
rust-smoke-tests 34m 🟩
execution-performance / single-node-performance 21m 🟩
rust-lints 19m 🟩🟩
forge-e2e-test / forge 14m 🟩
forge-compat-test / forge 13m 🟩
rust-images / rust-all 12m 🟩
run-tests-main-branch 10m 🟩🟩
cli-e2e-tests / run-cli-tests 9m 🟩
check 9m 🟩🟩
check-dynamic-deps 6m 🟩🟩🟩
general-lints 6m 🟩🟩
semgrep/ci 1m 🟩🟩🟩
node-api-compatibility-tests / node-api-compatibility-tests 51s 🟩
file_change_determinator 36s 🟩🟩🟩
file_change_determinator 29s 🟩🟩🟩
execution-performance / file_change_determinator 11s 🟩
file_change_determinator 10s 🟩
permission-check 8s 🟩🟩🟩
permission-check 7s 🟩🟩🟩
execution-performance / sequential-execution-performance 7s 🟩
permission-check 7s 🟩🟩🟩
execution-performance / parallel-execution-performance 7s 🟩
permission-check 7s 🟩🟩🟩
permission-check 2s 🟩
determine-docker-build-metadata 2s 🟩

🚨 3 jobs on the last run were significantly faster/slower than expected

Job Duration vs 7d avg Delta
rust-lints 12m 8m +39%
windows-build 25m 19m +32%
rust-images / rust-all 12m 10m +24%

settingsfeedbackdocs ⋅ learn more about trunk.io

@vineethk vineethk requested review from wrwg, zjma, brmataptos and JoshLind and removed request for lightmark and msmouse December 21, 2023 22:29
pub struct FunctionDef {
name: Symbol,
start: Position,
attrs: Vec<String>,
#[derivative(PartialEq = "ignore")]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The implementations PartialEq, PartialOrd, and Ord should agree with each other: https://docs.rs/rust-libcore/latest/core/cmp/trait.PartialOrd.html#how-can-i-implement-partialord

@vineethk vineethk changed the title Vk/non canonical partial ord fix [refactoring] Fix more instances of non-canonical PartialOrd implementations Dec 21, 2023
Copy link

codecov bot commented Dec 21, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (c07d6aa) 69.0% compared to head (35e3814) 69.0%.

Files Patch % Lines
third_party/move/move-analyzer/src/symbols.rs 40.0% 3 Missing ⚠️
...ird_party/move/move-borrow-graph/src/references.rs 0.0% 1 Missing ⚠️
..._party/move/move-compiler/src/shared/unique_set.rs 0.0% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             main   #11475     +/-   ##
=========================================
- Coverage    69.0%    69.0%   -0.1%     
=========================================
  Files         768      768             
  Lines      178809   178804      -5     
=========================================
- Hits       123428   123397     -31     
- Misses      55381    55407     +26     

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

Copy link
Contributor

@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 doing this!

@vineethk vineethk enabled auto-merge (squash) December 29, 2023 00:50

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

✅ Forge suite compat success on aptos-node-v1.8.3 ==> 35e38146370064284486530412c9c338035d0656

Compatibility test results for aptos-node-v1.8.3 ==> 35e38146370064284486530412c9c338035d0656 (PR)
1. Check liveness of validators at old version: aptos-node-v1.8.3
compatibility::simple-validator-upgrade::liveness-check : committed: 5022 txn/s, latency: 6568 ms, (p50: 7200 ms, p90: 9200 ms, p99: 10200 ms), latency samples: 185820
2. Upgrading first Validator to new version: 35e38146370064284486530412c9c338035d0656
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 1764 txn/s, latency: 15989 ms, (p50: 19200 ms, p90: 22000 ms, p99: 22500 ms), latency samples: 91760
3. Upgrading rest of first batch to new version: 35e38146370064284486530412c9c338035d0656
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 1317 txn/s, latency: 22204 ms, (p50: 21300 ms, p90: 30100 ms, p99: 31200 ms), latency samples: 64560
4. upgrading second batch to new version: 35e38146370064284486530412c9c338035d0656
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 3499 txn/s, latency: 8975 ms, (p50: 9600 ms, p90: 13200 ms, p99: 13800 ms), latency samples: 143460
5. check swarm health
Compatibility test for aptos-node-v1.8.3 ==> 35e38146370064284486530412c9c338035d0656 passed
Test Ok

Copy link
Contributor

✅ Forge suite realistic_env_max_load success on 35e38146370064284486530412c9c338035d0656

two traffics test: inner traffic : committed: 7566 txn/s, latency: 5114 ms, (p50: 4800 ms, p90: 6300 ms, p99: 11200 ms), latency samples: 3276220
two traffics test : committed: 100 txn/s, latency: 2384 ms, (p50: 2100 ms, p90: 2600 ms, p99: 10300 ms), latency samples: 1820
Latency breakdown for phase 0: ["QsBatchToPos: max: 0.212, avg: 0.198", "QsPosToProposal: max: 0.178, avg: 0.150", "ConsensusProposalToOrdered: max: 0.612, avg: 0.558", "ConsensusOrderedToCommit: max: 0.496, avg: 0.473", "ConsensusProposalToCommit: max: 1.108, avg: 1.031"]
Max round gap was 1 [limit 4] at version 1680936. Max no progress secs was 6.310856 [limit 10] at version 1680936.
Test Ok

@vineethk vineethk merged commit 94dd366 into aptos-labs:main Dec 29, 2023
83 of 87 checks passed
Copy link
Contributor

✅ Forge suite framework_upgrade success on aptos-node-v1.8.3 ==> 35e38146370064284486530412c9c338035d0656

Compatibility test results for aptos-node-v1.8.3 ==> 35e38146370064284486530412c9c338035d0656 (PR)
Upgrade the nodes to version: 35e38146370064284486530412c9c338035d0656
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 6475 txn/s, latency: 5127 ms, (p50: 4800 ms, p90: 9600 ms, p99: 10200 ms), latency samples: 226640
5. check swarm health
Compatibility test for aptos-node-v1.8.3 ==> 35e38146370064284486530412c9c338035d0656 passed
Test Ok

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