diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b0e5ef..8f27b50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -199,9 +199,14 @@ jobs: rm -rf .git - name: Install test dependencies shell: bash + # Workaround #113 and https://github.com/status-im/nim-serialization/issues/33 + # and nimble flaky pinning / dependency resolution, + # json_serialization install would override nim-serialization pinning run: | nimble refresh - nimble install -y gmp stew serialization json_serialization + nimble install -y gmp stew json_serialization + nimble uninstall -y serialization + nimble install serialization@#217d78a - name: Run Constantine tests (with Assembler & with GMP) if: (runner.os == 'Linux' || runner.os == 'macOS') && matrix.target.cpu == 'amd64' shell: bash diff --git a/.travis.yml b/.travis.yml index 20a11a0..ffd6ea7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -127,7 +127,13 @@ before_script: - export PATH="$PWD/nim-${CHANNEL}/bin${PATH:+:$PATH}" script: - nimble refresh - - nimble install -y gmp stew serialization json_serialization + - nimble install -y gmp stew json_serialization + # Workaround #113 and https://github.com/status-im/nim-serialization/issues/33 + # and nimble flaky pinning / dependency resolution, + # json_serialization install would override nim-serialization pinning + - nimble uninstall -y serialization + - nimble install serialization@#217d78a + # Installing Clang9.0 or later is a pain in Travis # for inline assembly "flag output constraint" # Also MacOS build is timing out with 2 series of tests. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2a866b3..9d14ddb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -216,10 +216,15 @@ steps: displayName: 'Downloading GMP (Linux 32-bit)' condition: and(eq(variables['Agent.OS'], 'Linux'), eq(variables['UCPU'], 'i686')) + # Workaround #113 and https://github.com/status-im/nim-serialization/issues/33 + # and nimble flaky pinning / dependency resolution, + # json_serialization install would override nim-serialization pinning - bash: | echo "PATH=${PATH}" nimble refresh - nimble install -y gmp stew serialization json_serialization + nimble install -y gmp stew json_serialization + nimble uninstall -y serialization + nimble install serialization@#217d78a displayName: 'Installing package and testing dependencies' - bash: | diff --git a/benchmarks/bench_sha256.nim b/benchmarks/bench_sha256.nim index d125580..3687b90 100644 --- a/benchmarks/bench_sha256.nim +++ b/benchmarks/bench_sha256.nim @@ -7,16 +7,41 @@ import proc separator*() = separator(69) +# Deal with platform mess +# -------------------------------------------------------------------- +when defined(windows): + when sizeof(int) == 8: + const DLLSSLName* = "(libssl-1_1-x64|ssleay64|libssl64).dll" + else: + const DLLSSLName* = "(libssl-1_1|ssleay32|libssl32).dll" +else: + when defined(macosx): + const versions = "(.1.1|.38|.39|.41|.43|.44|.45|.46|.47|.48|.10|.1.0.2|.1.0.1|.1.0.0|.0.9.9|.0.9.8|)" + else: + const versions = "(.1.1|.1.0.2|.1.0.1|.1.0.0|.0.9.9|.0.9.8|.48|.47|.46|.45|.44|.43|.41|.39|.38|.10|)" + + when defined(macosx): + const DLLSSLName* = "libssl" & versions & ".dylib" + elif defined(genode): + const DLLSSLName* = "libssl.lib.so" + else: + const DLLSSLName* = "libssl.so" & versions + +# OpenSSL wrapper +# -------------------------------------------------------------------- + proc SHA256[T: byte|char]( msg: openarray[T], digest: ptr array[32, byte] = nil - ): ptr array[32, byte] {.cdecl, dynlib: "libssl.so", importc.} + ): ptr array[32, byte] {.cdecl, dynlib: DLLSSLName, importc.} proc SHA256_OpenSSL[T: byte|char]( digest: var array[32, byte], s: openarray[T]) = discard SHA256(s, digest.addr) +# -------------------------------------------------------------------- + proc report(op: string, bytes: int, startTime, stopTime: MonoTime, startClk, stopClk: int64, iters: int) = let ns = inNanoseconds((stopTime-startTime) div iters) let throughput = 1e9 / float64(ns) diff --git a/constantine.nimble b/constantine.nimble index bdf654a..a511075 100644 --- a/constantine.nimble +++ b/constantine.nimble @@ -14,11 +14,19 @@ requires "nim >= 1.1.0" const buildParallel = "test_parallel.txt" +# Testing strategy: to reduce CI time we test leaf functionality +# and skip testing codepath that would be exercised by leaves. +# While debugging, relevant unit-test can be reactivated. +# New features should stay on. +# Code refactoring requires re-enabling the full suite. +# Basic primitives should stay on to catch compiler regressions. const testDesc: seq[tuple[path: string, useGMP: bool]] = @[ # Primitives + # ---------------------------------------------------------- ("tests/t_primitives.nim", false), ("tests/t_primitives_extended_precision.nim", false), # Big ints + # ---------------------------------------------------------- ("tests/t_io_bigints.nim", false), ("tests/t_bigints.nim", false), ("tests/t_bigints_multimod.nim", false), @@ -26,6 +34,7 @@ const testDesc: seq[tuple[path: string, useGMP: bool]] = @[ ("tests/t_bigints_mul_vs_gmp.nim", true), ("tests/t_bigints_mul_high_words_vs_gmp.nim", true), # Field + # ---------------------------------------------------------- ("tests/t_io_fields", false), ("tests/t_finite_fields.nim", false), ("tests/t_finite_fields_conditional_arithmetic.nim", false), @@ -35,95 +44,104 @@ const testDesc: seq[tuple[path: string, useGMP: bool]] = @[ ("tests/t_finite_fields_vs_gmp.nim", true), ("tests/t_fp_cubic_root.nim", false), # Double-width finite fields + # ---------------------------------------------------------- ("tests/t_finite_fields_double_width.nim", false), # Towers of extension fields - ("tests/t_fp2.nim", false), + # ---------------------------------------------------------- + # ("tests/t_fp2.nim", false), ("tests/t_fp2_sqrt.nim", false), - ("tests/t_fp6_bn254_snarks.nim", false), - ("tests/t_fp6_bls12_377.nim", false), - ("tests/t_fp6_bls12_381.nim", false), + # ("tests/t_fp6_bn254_snarks.nim", false), + # ("tests/t_fp6_bls12_377.nim", false), + # ("tests/t_fp6_bls12_381.nim", false), ("tests/t_fp6_bw6_761.nim", false), ("tests/t_fp12_bn254_snarks.nim", false), ("tests/t_fp12_bls12_377.nim", false), ("tests/t_fp12_bls12_381.nim", false), ("tests/t_fp12_exponentiation.nim", false), - ("tests/t_fp4_frobenius.nim", false), + # ("tests/t_fp4_frobenius.nim", false), + # ("tests/t_fp6_frobenius.nim", false), + ("tests/t_fp12_frobenius.nim", false), # Elliptic curve arithmetic G1 - ("tests/t_ec_shortw_prj_g1_add_double.nim", false), - ("tests/t_ec_shortw_prj_g1_mul_sanity.nim", false), - ("tests/t_ec_shortw_prj_g1_mul_distri.nim", false), + # ---------------------------------------------------------- + # ("tests/t_ec_shortw_prj_g1_add_double.nim", false), + # ("tests/t_ec_shortw_prj_g1_mul_sanity.nim", false), + # ("tests/t_ec_shortw_prj_g1_mul_distri.nim", false), ("tests/t_ec_shortw_prj_g1_mul_vs_ref.nim", false), ("tests/t_ec_shortw_prj_g1_mixed_add.nim", false), - ("tests/t_ec_shortw_jac_g1_add_double.nim", false), - ("tests/t_ec_shortw_jac_g1_mul_sanity.nim", false), - ("tests/t_ec_shortw_jac_g1_mul_distri.nim", false), + # ("tests/t_ec_shortw_jac_g1_add_double.nim", false), + # ("tests/t_ec_shortw_jac_g1_mul_sanity.nim", false), + # ("tests/t_ec_shortw_jac_g1_mul_distri.nim", false), ("tests/t_ec_shortw_jac_g1_mul_vs_ref.nim", false), # mixed_add # Elliptic curve arithmetic G2 - ("tests/t_ec_shortw_prj_g2_add_double_bn254_snarks.nim", false), - ("tests/t_ec_shortw_prj_g2_mul_sanity_bn254_snarks.nim", false), - ("tests/t_ec_shortw_prj_g2_mul_distri_bn254_snarks.nim", false), + # ---------------------------------------------------------- + # ("tests/t_ec_shortw_prj_g2_add_double_bn254_snarks.nim", false), + # ("tests/t_ec_shortw_prj_g2_mul_sanity_bn254_snarks.nim", false), + # ("tests/t_ec_shortw_prj_g2_mul_distri_bn254_snarks.nim", false), ("tests/t_ec_shortw_prj_g2_mul_vs_ref_bn254_snarks.nim", false), ("tests/t_ec_shortw_prj_g2_mixed_add_bn254_snarks.nim", false), - ("tests/t_ec_shortw_prj_g2_add_double_bls12_381.nim", false), - ("tests/t_ec_shortw_prj_g2_mul_sanity_bls12_381.nim", false), - ("tests/t_ec_shortw_prj_g2_mul_distri_bls12_381.nim", false), + # ("tests/t_ec_shortw_prj_g2_add_double_bls12_381.nim", false), + # ("tests/t_ec_shortw_prj_g2_mul_sanity_bls12_381.nim", false), + # ("tests/t_ec_shortw_prj_g2_mul_distri_bls12_381.nim", false), ("tests/t_ec_shortw_prj_g2_mul_vs_ref_bls12_381.nim", false), ("tests/t_ec_shortw_prj_g2_mixed_add_bls12_381.nim", false), - ("tests/t_ec_shortw_prj_g2_add_double_bls12_377.nim", false), - ("tests/t_ec_shortw_prj_g2_mul_sanity_bls12_377.nim", false), - ("tests/t_ec_shortw_prj_g2_mul_distri_bls12_377.nim", false), + # ("tests/t_ec_shortw_prj_g2_add_double_bls12_377.nim", false), + # ("tests/t_ec_shortw_prj_g2_mul_sanity_bls12_377.nim", false), + # ("tests/t_ec_shortw_prj_g2_mul_distri_bls12_377.nim", false), ("tests/t_ec_shortw_prj_g2_mul_vs_ref_bls12_377.nim", false), ("tests/t_ec_shortw_prj_g2_mixed_add_bls12_377.nim", false), - ("tests/t_ec_shortw_prj_g2_add_double_bw6_761.nim", false), - ("tests/t_ec_shortw_prj_g2_mul_sanity_bw6_761.nim", false), - ("tests/t_ec_shortw_prj_g2_mul_distri_bw6_761.nim", false), + # ("tests/t_ec_shortw_prj_g2_add_double_bw6_761.nim", false), + # ("tests/t_ec_shortw_prj_g2_mul_sanity_bw6_761.nim", false), + # ("tests/t_ec_shortw_prj_g2_mul_distri_bw6_761.nim", false), ("tests/t_ec_shortw_prj_g2_mul_vs_ref_bw6_761.nim", false), ("tests/t_ec_shortw_prj_g2_mixed_add_bw6_761.nim", false), - ("tests/t_ec_shortw_jac_g2_add_double_bn254_snarks.nim", false), - ("tests/t_ec_shortw_jac_g2_mul_sanity_bn254_snarks.nim", false), - ("tests/t_ec_shortw_jac_g2_mul_distri_bn254_snarks.nim", false), + # ("tests/t_ec_shortw_jac_g2_add_double_bn254_snarks.nim", false), + # ("tests/t_ec_shortw_jac_g2_mul_sanity_bn254_snarks.nim", false), + # ("tests/t_ec_shortw_jac_g2_mul_distri_bn254_snarks.nim", false), ("tests/t_ec_shortw_jac_g2_mul_vs_ref_bn254_snarks.nim", false), # mixed_add - ("tests/t_ec_shortw_jac_g2_add_double_bls12_381.nim", false), - ("tests/t_ec_shortw_jac_g2_mul_sanity_bls12_381.nim", false), - ("tests/t_ec_shortw_jac_g2_mul_distri_bls12_381.nim", false), + # ("tests/t_ec_shortw_jac_g2_add_double_bls12_381.nim", false), + # ("tests/t_ec_shortw_jac_g2_mul_sanity_bls12_381.nim", false), + # ("tests/t_ec_shortw_jac_g2_mul_distri_bls12_381.nim", false), ("tests/t_ec_shortw_jac_g2_mul_vs_ref_bls12_381.nim", false), # mixed_add - ("tests/t_ec_shortw_jac_g2_add_double_bls12_377.nim", false), - ("tests/t_ec_shortw_jac_g2_mul_sanity_bls12_377.nim", false), - ("tests/t_ec_shortw_jac_g2_mul_distri_bls12_377.nim", false), + # ("tests/t_ec_shortw_jac_g2_add_double_bls12_377.nim", false), + # ("tests/t_ec_shortw_jac_g2_mul_sanity_bls12_377.nim", false), + # ("tests/t_ec_shortw_jac_g2_mul_distri_bls12_377.nim", false), ("tests/t_ec_shortw_jac_g2_mul_vs_ref_bls12_377.nim", false), # mixed_add - ("tests/t_ec_shortw_jac_g2_add_double_bw6_761.nim", false), - ("tests/t_ec_shortw_jac_g2_mul_sanity_bw6_761.nim", false), - ("tests/t_ec_shortw_jac_g2_mul_distri_bw6_761.nim", false), + # ("tests/t_ec_shortw_jac_g2_add_double_bw6_761.nim", false), + # ("tests/t_ec_shortw_jac_g2_mul_sanity_bw6_761.nim", false), + # ("tests/t_ec_shortw_jac_g2_mul_distri_bw6_761.nim", false), ("tests/t_ec_shortw_jac_g2_mul_vs_ref_bw6_761.nim", false), # mixed_add # Elliptic curve arithmetic vs Sagemath + # ---------------------------------------------------------- ("tests/t_ec_frobenius.nim", false), ("tests/t_ec_sage_bn254_nogami.nim", false), ("tests/t_ec_sage_bn254_snarks.nim", false), ("tests/t_ec_sage_bls12_377.nim", false), ("tests/t_ec_sage_bls12_381.nim", false), # Edge cases highlighted by past bugs + # ---------------------------------------------------------- ("tests/t_ec_shortw_prj_edge_cases.nim", false), # Pairing - ("tests/t_pairing_bls12_377_line_functions.nim", false), - ("tests/t_pairing_bls12_381_line_functions.nim", false), - ("tests/t_pairing_mul_fp12_by_lines.nim", false), - ("tests/t_pairing_cyclotomic_fp12.nim", false), + # ---------------------------------------------------------- + # ("tests/t_pairing_bls12_377_line_functions.nim", false), + # ("tests/t_pairing_bls12_381_line_functions.nim", false), + # ("tests/t_pairing_mul_fp12_by_lines.nim", false), + # ("tests/t_pairing_cyclotomic_fp12.nim", false), ("tests/t_pairing_bn254_nogami_optate.nim", false), ("tests/t_pairing_bn254_snarks_optate.nim", false), ("tests/t_pairing_bls12_377_optate.nim", false), @@ -149,11 +167,15 @@ const skipSanitizers = [ "tests/t_ec_sage_bls12_381.nim", ] -const sanitizers = - " --passC:-fsanitize=undefined --passL:-fsanitize=undefined" & - " --passC:-fno-sanitize-recover" & # Enforce crash on undefined behaviour - " --gc:none" # The conservative stack scanning of Nim default GC triggers, alignment UB and stack-buffer-overflow check. - # " --passC:-fsanitize=address --passL:-fsanitize=address" & # Requires too much stack for the inline assembly +when defined(windows): + # UBSAN is not available on mingw + const sanitizers = "" +else: + const sanitizers = + " --passC:-fsanitize=undefined --passL:-fsanitize=undefined" & + " --passC:-fno-sanitize-recover" & # Enforce crash on undefined behaviour + " --gc:none" # The conservative stack scanning of Nim default GC triggers, alignment UB and stack-buffer-overflow check. + # " --passC:-fsanitize=address --passL:-fsanitize=address" & # Requires too much stack for the inline assembly # Helper functions @@ -175,7 +197,10 @@ proc test(flags, path: string, commandFile = false) = if existsEnv"CC": cc = " --cc:" & getEnv"CC" - var flags = flags & " --passC:-fstack-protector-all" + var flags = flags + when not defined(windows): + # Not available in MinGW https://github.com/libressl-portable/portable/issues/54 + flags &= " --passC:-fstack-protector-all" let command = "nim " & lang & cc & " " & flags & " --verbosity:0 --outdir:build/testsuite -r --hints:off --warnings:off " & " --nimcache:nimcache/" & path & " " & @@ -189,10 +214,13 @@ proc test(flags, path: string, commandFile = false) = else: exec "echo \'" & command & "\' >> " & buildParallel -proc runBench(benchName: string, compiler = "", useAsm = true) = +proc buildBench(benchName: string, compiler = "", useAsm = true, run = false) = if not dirExists "build": mkDir "build" + let runFlag = if run: " -r " + else: " " + var cc = "" if compiler != "": cc = "--cc:" & compiler @@ -201,7 +229,10 @@ proc runBench(benchName: string, compiler = "", useAsm = true) = exec "nim c " & cc & " -d:danger --verbosity:0 -o:build/bench/" & benchName & "_" & compiler & "_" & (if useAsm: "useASM" else: "noASM") & " --nimcache:nimcache/" & benchName & "_" & compiler & "_" & (if useAsm: "useASM" else: "noASM") & - " -r --hints:off --warnings:off benchmarks/" & benchName & ".nim" + runFlag & "--hints:off --warnings:off benchmarks/" & benchName & ".nim" + +proc runBench(benchName: string, compiler = "", useAsm = true) = + buildBench(benchName, compiler, useAsm, run = true) proc runTests(requireGMP: bool, dumpCmdFile = false, test32bit = false, testASM = true) = for td in testDesc: @@ -217,6 +248,23 @@ proc runTests(requireGMP: bool, dumpCmdFile = false, test32bit = false, testASM flags &= sanitizers test flags, td.path, dumpCmdFile +proc buildAllBenches() = + echo "\n\n------------------------------------------------------\n" + echo "Building benchmarks to ensure they stay relevant ..." + buildBench("bench_fp") + buildBench("bench_fp_double_width") + buildBench("bench_fp2") + buildBench("bench_fp6") + buildBench("bench_fp12") + buildBench("bench_ec_g1") + buildBench("bench_ec_g2") + buildBench("bench_pairing_bls12_377") + buildBench("bench_pairing_bls12_381") + buildBench("bench_pairing_bn254_nogami") + buildBench("bench_pairing_bn254_snarks") + buildBench("bench_sha256") + echo "All benchmarks compile successfully." + # Tasks # ---------------------------------------------------------------- @@ -229,18 +277,7 @@ task test, "Run all tests": # Ensure benchmarks stay relevant. Ignore Windows 32-bit at the moment if not defined(windows) or not (existsEnv"UCPU" or getEnv"UCPU" == "i686"): - runBench("bench_fp") - runBench("bench_fp_double_width") - runBench("bench_fp2") - runBench("bench_fp6") - runBench("bench_fp12") - runBench("bench_ec_g1") - runBench("bench_ec_g2") - runBench("bench_pairing_bls12_377") - runBench("bench_pairing_bls12_381") - runBench("bench_pairing_bn254_nogami") - runBench("bench_pairing_bn254_snarks") - runBench("bench_sha256") + buildAllBenches() task test_no_gmp, "Run tests that don't require GMP": # -d:testingCurves is configured in a *.nim.cfg for convenience @@ -251,17 +288,7 @@ task test_no_gmp, "Run tests that don't require GMP": # Ensure benchmarks stay relevant. Ignore Windows 32-bit at the moment if not defined(windows) or not (existsEnv"UCPU" or getEnv"UCPU" == "i686"): - runBench("bench_fp") - runBench("bench_fp2") - runBench("bench_fp6") - runBench("bench_fp12") - runBench("bench_ec_g1") - runBench("bench_ec_g2") - runBench("bench_pairing_bls12_377") - runBench("bench_pairing_bls12_381") - runBench("bench_pairing_bn254_nogami") - runBench("bench_pairing_bn254_snarks") - runBench("bench_sha256") + buildAllBenches() task test_parallel, "Run all tests in parallel (via GNU parallel)": # -d:testingCurves is configured in a *.nim.cfg for convenience @@ -269,28 +296,18 @@ task test_parallel, "Run all tests in parallel (via GNU parallel)": runTests(requireGMP = true, dumpCmdFile = true) exec "parallel --keep-order --group < " & buildParallel - if sizeof(int) == 8: # 32-bit tests on 64-bit arch - clearParallelBuild() - runTests(requireGMP = true, dumpCmdFile = true, test32bit = true) - exec "parallel --keep-order --group < " & buildParallel + # if sizeof(int) == 8: # 32-bit tests on 64-bit arch + # clearParallelBuild() + # runTests(requireGMP = true, dumpCmdFile = true, test32bit = true) + # exec "parallel --keep-order --group < " & buildParallel # Now run the benchmarks # - # Benchmarks compile and run + # Benchmarks compile # ignore Windows 32-bit for the moment # Ensure benchmarks stay relevant. Ignore Windows 32-bit at the moment if not defined(windows) or not (existsEnv"UCPU" or getEnv"UCPU" == "i686"): - runBench("bench_fp") - runBench("bench_fp2") - runBench("bench_fp6") - runBench("bench_fp12") - runBench("bench_ec_g1") - runBench("bench_ec_g2") - runBench("bench_pairing_bls12_377") - runBench("bench_pairing_bls12_381") - runBench("bench_pairing_bn254_nogami") - runBench("bench_pairing_bn254_snarks") - runBench("bench_sha256") + buildAllBenches() task test_parallel_no_assembler, "Run all tests (without macro assembler) in parallel (via GNU parallel)": # -d:testingCurves is configured in a *.nim.cfg for convenience @@ -298,29 +315,18 @@ task test_parallel_no_assembler, "Run all tests (without macro assembler) in par runTests(requireGMP = true, dumpCmdFile = true, testASM = false) exec "parallel --keep-order --group < " & buildParallel - exec "> " & buildParallel - if sizeof(int) == 8: # 32-bit tests on 64-bit arch - clearParallelBuild() - runTests(requireGMP = true, dumpCmdFile = true, test32bit = true, testASM = false) - exec "parallel --keep-order --group < " & buildParallel + # if sizeof(int) == 8: # 32-bit tests on 64-bit arch + # clearParallelBuild() + # runTests(requireGMP = true, dumpCmdFile = true, test32bit = true, testASM = false) + # exec "parallel --keep-order --group < " & buildParallel # Now run the benchmarks # - # Benchmarks compile and run + # Benchmarks compile # ignore Windows 32-bit for the moment # Ensure benchmarks stay relevant. Ignore Windows 32-bit at the moment if not defined(windows) or not (existsEnv"UCPU" or getEnv"UCPU" == "i686"): - runBench("bench_fp") - runBench("bench_fp2") - runBench("bench_fp6") - runBench("bench_fp12") - runBench("bench_ec_g1") - runBench("bench_ec_g2") - runBench("bench_pairing_bls12_377") - runBench("bench_pairing_bls12_381") - runBench("bench_pairing_bn254_nogami") - runBench("bench_pairing_bn254_snarks") - runBench("bench_sha256") + buildAllBenches() task test_parallel_no_gmp, "Run all tests in parallel (via GNU parallel)": # -d:testingCurves is configured in a *.nim.cfg for convenience @@ -328,28 +334,18 @@ task test_parallel_no_gmp, "Run all tests in parallel (via GNU parallel)": runTests(requireGMP = false, dumpCmdFile = true) exec "parallel --keep-order --group < " & buildParallel - if sizeof(int) == 8: # 32-bit tests on 64-bit arch - clearParallelBuild() - runTests(requireGMP = false, dumpCmdFile = true, test32bit = true) - exec "parallel --keep-order --group < " & buildParallel + # if sizeof(int) == 8: # 32-bit tests on 64-bit arch + # clearParallelBuild() + # runTests(requireGMP = false, dumpCmdFile = true, test32bit = true) + # exec "parallel --keep-order --group < " & buildParallel # Now run the benchmarks # - # Benchmarks compile and run + # Benchmarks compile # ignore Windows 32-bit for the moment # Ensure benchmarks stay relevant. Ignore Windows 32-bit at the moment if not defined(windows) or not (existsEnv"UCPU" or getEnv"UCPU" == "i686"): - runBench("bench_fp") - runBench("bench_fp2") - runBench("bench_fp6") - runBench("bench_fp12") - runBench("bench_ec_g1") - runBench("bench_ec_g2") - runBench("bench_pairing_bls12_377") - runBench("bench_pairing_bls12_381") - runBench("bench_pairing_bn254_nogami") - runBench("bench_pairing_bn254_snarks") - runBench("bench_sha256") + buildAllBenches() task test_parallel_no_gmp_no_assembler, "Run all tests in parallel (via GNU parallel)": # -d:testingCurves is configured in a *.nim.cfg for convenience @@ -357,29 +353,18 @@ task test_parallel_no_gmp_no_assembler, "Run all tests in parallel (via GNU para runTests(requireGMP = false, dumpCmdFile = true, testASM = false) exec "parallel --keep-order --group < " & buildParallel - exec "> " & buildParallel - if sizeof(int) == 8: # 32-bit tests on 64-bit arch - clearParallelBuild() - runTests(requireGMP = false, dumpCmdFile = true, test32bit = true, testASM = false) - exec "parallel --keep-order --group < " & buildParallel + # if sizeof(int) == 8: # 32-bit tests on 64-bit arch + # clearParallelBuild() + # runTests(requireGMP = false, dumpCmdFile = true, test32bit = true, testASM = false) + # exec "parallel --keep-order --group < " & buildParallel # Now run the benchmarks # - # Benchmarks compile and run + # Benchmarks compile # ignore Windows 32-bit for the moment # Ensure benchmarks stay relevant. Ignore Windows 32-bit at the moment if not defined(windows) or not (existsEnv"UCPU" or getEnv"UCPU" == "i686"): - runBench("bench_fp") - runBench("bench_fp2") - runBench("bench_fp6") - runBench("bench_fp12") - runBench("bench_ec_g1") - runBench("bench_ec_g2") - runBench("bench_pairing_bls12_377") - runBench("bench_pairing_bls12_381") - runBench("bench_pairing_bn254_nogami") - runBench("bench_pairing_bn254_snarks") - runBench("bench_sha256") + buildAllBenches() task bench_fp, "Run benchmark 𝔽p with your default compiler": runBench("bench_fp")