test: split monolithic ellswift test into independent cases #1788

pull furszy wants to merge 1 commits into bitcoin-core:master from furszy:2025_tests_split_ellswift changing 1 files +65 −33
  1. furszy commented at 5:01 PM on December 14, 2025: member

    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)
  2. in src/modules/ellswift/tests_impl.h:320 in f12e2e04d2
     314 | @@ -293,6 +315,10 @@ void run_ellswift_tests(void) {
     315 |          /* Compare. */
     316 |          CHECK(fe_equal(&res.x, &share_x));
     317 |      }
     318 | +}
     319 | +
     320 | +void test_ellswift_xdh_correctness(void) {
    


    real-or-random commented at 7:23 AM on December 15, 2025:

    consistency nit if you touch again:

    void ellswift_xdh_correctness_tests(void) {
    

    furszy commented at 2:35 PM on December 15, 2025:

    upps, fixed. Thanks!

  3. real-or-random approved
  4. real-or-random commented at 7:24 AM on December 15, 2025: contributor

    utACK f12e2e04d2b88a0eec3a676be0f2443d2b082c4f

  5. real-or-random added the label assurance on Dec 15, 2025
  6. real-or-random added the label tweak/refactor on Dec 15, 2025
  7. hebasto approved
  8. hebasto commented at 12:42 PM on December 15, 2025: member

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

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

  9. hebasto commented at 12:48 PM on December 15, 2025: member

    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?

  10. test: split monolithic ellswift test into independent cases
    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)
    d822b29021
  11. furszy force-pushed on Dec 15, 2025
  12. hebasto approved
  13. hebasto commented at 2:30 PM on December 15, 2025: member

    re-ACK d822b2902106829bae1455cabec6bfca9a265a77.

  14. furszy commented at 2:34 PM on December 15, 2025: member

    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.

  15. theStack approved
  16. theStack commented at 5:47 PM on December 15, 2025: contributor

    ACK d822b2902106829bae1455cabec6bfca9a265a77

    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
    
  17. real-or-random merged this on Dec 15, 2025
  18. real-or-random closed this on Dec 15, 2025

  19. furszy deleted the branch on Dec 15, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me