Skip to content

Conversation

@furszy
Copy link
Member

@furszy furszy commented Dec 14, 2025

No behavior changes.

Refactors the previously monolithic ElligatorSwift test into isolated,
independent test cases. Doing so allows the test suite to execute
these cases in parallel rather than sequentially.

Overall, I'm seeing 35-40% tests time reduction locally.

This is quite useful for Debug builds with no optimizations,
which are noticeably slow.

 Local Debug-build Results (7 jobs):

  • master: 138.0 seconds.
  • this PR: 89.3 seconds.
    (~1.55× speedup, ~35% reduction)

 Local Release-build Results (7 jobs):

  • master: 9.5 seconds.
  • this PR: 5.9 seconds.
    (~1.61× speedup, ~38% reduction)

 rp5 Release-build results (5 jobs):

  • master: 39 seconds.
  • this PR: 24 seconds.
    (~1.62× speedup, ~38% reduction)

Copy link
Contributor

@real-or-random real-or-random left a comment

Choose a reason for hiding this comment

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

utACK f12e2e0

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

ACK f12e2e0, I have reviewed the code and it looks OK. Tested on Ubuntu 25.10.

Happy to re-ACK once #1788 (comment) is addressed.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

Here is log on my machine:

$ ./build/bin/tests -j=16 -t=ellswift -log=1
iterations = 16
jobs = 16. Parallel execution.
random seed = 3ccb907b6b59142af5e562fdf21e2a62
Running ellswift_encoding_test_vectors_tests..
Running ellswift_xdh_test_vectors_tests..
Running ellswift_decoding_test_vectors_tests..
Running ellswift_compute_shared_secret_tests..
Running ellswift_encode_decode_roundtrip_tests..
Running test_ellswift_xdh_correctness..
Running ellswift_hash_init_tests..
Running ellswift_create_tests..
Test ellswift_hash_init_tests PASSED (0.000 sec)
Test ellswift_xdh_test_vectors_tests PASSED (0.002 sec)
Test ellswift_decoding_test_vectors_tests PASSED (0.002 sec)
Test ellswift_encoding_test_vectors_tests PASSED (0.012 sec)
Test ellswift_create_tests PASSED (1.424 sec)
Test ellswift_compute_shared_secret_tests PASSED (2.448 sec)
Test ellswift_encode_decode_roundtrip_tests PASSED (2.702 sec)
Test test_ellswift_xdh_correctness PASSED (4.505 sec)
Total execution time: 4.509 seconds

Could we re-arrange test cases to run the longest ones first?

No behavior changes.

Refactors the previously monolithic ElligatorSwift test into isolated,
independent test cases. Doing so allows the test suite to execute
these cases in parallel rather than sequentially.

Overall, seen 35-40% tests time reduction locally.

This is quite useful for the Debug build with no optimizations,
which is noticeably slow.

#### Local Debug-build Results (7 jobs):

- master: 138.0 seconds.
- this PR: 89.3 seconds.
   (~1.55× speedup, ~35% reduction)

#### Local Release-build Results (7 jobs):

- master: 9.5 seconds.
- this PR: 5.9 seconds.
   (~1.61× speedup, ~38% reduction)
@furszy furszy force-pushed the 2025_tests_split_ellswift branch from f12e2e0 to d822b29 Compare December 15, 2025 14:28
Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

re-ACK d822b29.

@furszy
Copy link
Member Author

furszy commented Dec 15, 2025

Could we re-arrange test cases to run the longest ones first?

We could do it, but it wouldn’t make much of a difference atm. The ellswift module sits deep in the test registry (see). We should move the module up too. Which is really a small change.

Yet, it might be worth considering adding cost score functionality to the internal framework, so test execution can be automatically arranged based on it.

Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

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

ACK d822b29

Nice!

$ ./build/bin/tests -t=ellswift -log=1 -j=8
iterations = 16
jobs = 8. Parallel execution.
random seed = 81780fc09f616932c95e8182acab17d9
Running ellswift_encoding_test_vectors_tests..
Running ellswift_decoding_test_vectors_tests..
Running ellswift_xdh_test_vectors_tests..
Running ellswift_create_tests..
Running ellswift_compute_shared_secret_tests..
Running ellswift_encode_decode_roundtrip_tests..
Running ellswift_xdh_correctness_tests..
Running ellswift_hash_init_tests..
Test ellswift_hash_init_tests PASSED (0.000 sec)
Test ellswift_xdh_test_vectors_tests PASSED (0.001 sec)
Test ellswift_decoding_test_vectors_tests PASSED (0.002 sec)
Test ellswift_encoding_test_vectors_tests PASSED (0.012 sec)
Test ellswift_create_tests PASSED (1.157 sec)
Test ellswift_compute_shared_secret_tests PASSED (2.049 sec)
Test ellswift_encode_decode_roundtrip_tests PASSED (2.156 sec)
Test ellswift_xdh_correctness_tests PASSED (3.674 sec)
Total execution time: 3.675 seconds

@real-or-random real-or-random merged commit 540fec8 into bitcoin-core:master Dec 15, 2025
122 checks passed
@furszy furszy deleted the 2025_tests_split_ellswift branch December 15, 2025 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants