Path reorgs (#240)

* move tests

* move threadpool to root path

* fix hints and warnings, print nim versions for tests for debugging the new strange issue in CI

* print nim version

* mixup on branches

* mixup on branches reloaded
This commit is contained in:
Mamy Ratsimbazafy 2023-05-29 20:14:30 +02:00 committed by GitHub
parent 1c5341fd7e
commit d996ccd5d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
247 changed files with 177 additions and 165 deletions

View File

@ -213,6 +213,12 @@ jobs:
nimble refresh --verbose -y
nimble install --verbose -y gmp jsony asynctools
- name: Print Nim version
if: runner.os != 'Windows'
shell: bash
run: |
nim -v
- name: Run Constantine tests (UNIX with Assembly)
if: runner.os != 'Windows' && matrix.target.BACKEND == 'ASM'
shell: bash

View File

@ -21,7 +21,7 @@ import
ec_multi_scalar_mul_parallel],
../constantine/math/constants/zoo_subgroups,
# Threadpool
../constantine/platforms/threadpool/threadpool,
../constantine/threadpool/threadpool,
# Helpers
../helpers/prng_unsafe,
./bench_elliptic_template,

View File

@ -152,6 +152,7 @@ proc genHeaders(bindingsName: string) =
echo "Generating header: include/" & bindingsName & ".h"
exec "nim c -d:CttGenerateHeaders " &
" -d:release " &
" --verbosity:0 --hints:off --warnings:off " &
" --out:" & bindingsName & "_gen_header.exe --outdir:build " &
" --nimcache:nimcache/bindings_curves_headers/" & bindingsName & "_header" &
" bindings_generators/" & bindingsName & ".nim"
@ -253,187 +254,187 @@ const testDesc: seq[tuple[path: string, useGMP: bool]] = @[
# Primitives
# ----------------------------------------------------------
("tests/math/t_primitives.nim", false),
("tests/math/t_primitives_extended_precision.nim", false),
("tests/primitives/t_primitives.nim", false),
("tests/primitives/t_primitives_extended_precision.nim", false),
("tests/primitives/t_io_unsaturated.nim", false),
# Big ints
# ----------------------------------------------------------
("tests/math/t_io_bigints.nim", false),
("tests/math/t_io_unsaturated.nim", false),
# ("tests/math/t_bigints.nim", false),
# ("tests/math/t_bigints_multimod.nim", false),
# ("tests/math/t_bigints_mod_vs_gmp.nim", true),
# ("tests/math/t_bigints_mul_vs_gmp.nim", true),
# ("tests/math/t_bigints_mul_high_words_vs_gmp.nim", true),
("tests/math_bigints/t_io_bigints.nim", false),
# ("tests/math_bigints/t_bigints.nim", false),
# ("tests/math_bigints/t_bigints_multimod.nim", false),
# ("tests/math_bigints/t_bigints_mod_vs_gmp.nim", true),
# ("tests/math_bigints/t_bigints_mul_vs_gmp.nim", true),
# ("tests/math_bigints/t_bigints_mul_high_words_vs_gmp.nim", true),
# Field
# ----------------------------------------------------------
("tests/math/t_io_fields", false),
# ("tests/math/t_finite_fields.nim", false),
# ("tests/math/t_finite_fields_conditional_arithmetic.nim", false),
# ("tests/math/t_finite_fields_mulsquare.nim", false),
# ("tests/math/t_finite_fields_sqrt.nim", false),
# ("tests/math/t_finite_fields_powinv.nim", false),
# ("tests/math/t_finite_fields_vs_gmp.nim", true),
# ("tests/math/t_fp_cubic_root.nim", false),
("tests/math_fields/t_io_fields", false),
# ("tests/math_fields/t_finite_fields.nim", false),
# ("tests/math_fields/t_finite_fields_conditional_arithmetic.nim", false),
# ("tests/math_fields/t_finite_fields_mulsquare.nim", false),
# ("tests/math_fields/t_finite_fields_sqrt.nim", false),
# ("tests/math_fields/t_finite_fields_powinv.nim", false),
# ("tests/math_fields/t_finite_fields_vs_gmp.nim", true),
# ("tests/math_fields/t_fp_cubic_root.nim", false),
# Double-precision finite fields
# ----------------------------------------------------------
# ("tests/math/t_finite_fields_double_precision.nim", false),
# ("tests/math_fields/t_finite_fields_double_precision.nim", false),
# Towers of extension fields
# ----------------------------------------------------------
# ("tests/math/t_fp2.nim", false),
# ("tests/math/t_fp2_sqrt.nim", false),
# ("tests/math/t_fp4.nim", false),
# ("tests/math/t_fp6_bn254_nogami.nim", false),
# ("tests/math/t_fp6_bn254_snarks.nim", false),
# ("tests/math/t_fp6_bls12_377.nim", false),
# ("tests/math/t_fp6_bls12_381.nim", false),
# ("tests/math/t_fp6_bw6_761.nim", false),
# ("tests/math/t_fp12_bn254_nogami.nim", false),
# ("tests/math/t_fp12_bn254_snarks.nim", false),
# ("tests/math/t_fp12_bls12_377.nim", false),
# ("tests/math/t_fp12_bls12_381.nim", false),
# ("tests/math/t_fp12_exponentiation.nim", false),
("tests/math/t_fp12_anti_regression.nim", false),
# ("tests/math_extension_fields/t_fp2.nim", false),
# ("tests/math_extension_fields/t_fp2_sqrt.nim", false),
# ("tests/math_extension_fields/t_fp4.nim", false),
# ("tests/math_extension_fields/t_fp6_bn254_nogami.nim", false),
# ("tests/math_extension_fields/t_fp6_bn254_snarks.nim", false),
# ("tests/math_extension_fields/t_fp6_bls12_377.nim", false),
# ("tests/math_extension_fields/t_fp6_bls12_381.nim", false),
# ("tests/math_extension_fields/t_fp6_bw6_761.nim", false),
# ("tests/math_extension_fields/t_fp12_bn254_nogami.nim", false),
# ("tests/math_extension_fields/t_fp12_bn254_snarks.nim", false),
# ("tests/math_extension_fields/t_fp12_bls12_377.nim", false),
# ("tests/math_extension_fields/t_fp12_bls12_381.nim", false),
# ("tests/math_extension_fields/t_fp12_exponentiation.nim", false),
("tests/math_extension_fields/t_fp12_anti_regression.nim", false),
# ("tests/math/t_fp4_frobenius.nim", false),
# ("tests/math/t_fp6_frobenius.nim", false),
# ("tests/math/t_fp12_frobenius.nim", false),
# ("tests/math_extension_fields/t_fp4_frobenius.nim", false),
# ("tests/math_extension_fields/t_fp6_frobenius.nim", false),
# ("tests/math_extension_fields/t_fp12_frobenius.nim", false),
# Elliptic curve arithmetic
# ----------------------------------------------------------
# ("tests/math/t_ec_conversion.nim", false),
# ("tests/math_elliptic_curves/t_ec_conversion.nim", false),
# Elliptic curve arithmetic G1
# ----------------------------------------------------------
# ("tests/math/t_ec_shortw_prj_g1_add_double.nim", false),
# ("tests/math/t_ec_shortw_prj_g1_mul_sanity.nim", false),
# ("tests/math/t_ec_shortw_prj_g1_mul_distri.nim", false),
("tests/math/t_ec_shortw_prj_g1_mul_vs_ref.nim", false),
# ("tests/math/t_ec_shortw_prj_g1_mixed_add.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g1_add_double.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g1_mul_sanity.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g1_mul_distri.nim", false),
("tests/math_elliptic_curves/t_ec_shortw_prj_g1_mul_vs_ref.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g1_mixed_add.nim", false),
# ("tests/math/t_ec_shortw_jac_g1_add_double.nim", false),
# ("tests/math/t_ec_shortw_jac_g1_mul_sanity.nim", false),
# ("tests/math/t_ec_shortw_jac_g1_mul_distri.nim", false),
("tests/math/t_ec_shortw_jac_g1_mul_vs_ref.nim", false),
# ("tests/math/t_ec_shortw_jac_g1_mixed_add.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g1_add_double.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g1_mul_sanity.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g1_mul_distri.nim", false),
("tests/math_elliptic_curves/t_ec_shortw_jac_g1_mul_vs_ref.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g1_mixed_add.nim", false),
("tests/math/t_ec_shortw_jacext_g1_add_double.nim", false),
("tests/math/t_ec_shortw_jacext_g1_mixed_add.nim", false),
("tests/math_elliptic_curves/t_ec_shortw_jacext_g1_add_double.nim", false),
("tests/math_elliptic_curves/t_ec_shortw_jacext_g1_mixed_add.nim", false),
# ("tests/math/t_ec_twedwards_prj_add_double", false),
# ("tests/math/t_ec_twedwards_prj_mul_sanity", false),
# ("tests/math/t_ec_twedwards_prj_mul_distri", false),
# ("tests/math_elliptic_curves/t_ec_twedwards_prj_add_double", false),
# ("tests/math_elliptic_curves/t_ec_twedwards_prj_mul_sanity", false),
# ("tests/math_elliptic_curves/t_ec_twedwards_prj_mul_distri", false),
# Elliptic curve arithmetic G2
# ----------------------------------------------------------
# ("tests/math/t_ec_shortw_prj_g2_add_double_bn254_snarks.nim", false),
# ("tests/math/t_ec_shortw_prj_g2_mul_sanity_bn254_snarks.nim", false),
# ("tests/math/t_ec_shortw_prj_g2_mul_distri_bn254_snarks.nim", false),
("tests/math/t_ec_shortw_prj_g2_mul_vs_ref_bn254_snarks.nim", false),
# ("tests/math/t_ec_shortw_prj_g2_mixed_add_bn254_snarks.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_add_double_bn254_snarks.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_sanity_bn254_snarks.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_distri_bn254_snarks.nim", false),
("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_vs_ref_bn254_snarks.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mixed_add_bn254_snarks.nim", false),
# ("tests/math/t_ec_shortw_prj_g2_add_double_bls12_381.nim", false),
# ("tests/math/t_ec_shortw_prj_g2_mul_sanity_bls12_381.nim", false),
# ("tests/math/t_ec_shortw_prj_g2_mul_distri_bls12_381.nim", false),
("tests/math/t_ec_shortw_prj_g2_mul_vs_ref_bls12_381.nim", false),
# ("tests/math/t_ec_shortw_prj_g2_mixed_add_bls12_381.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_add_double_bls12_381.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_sanity_bls12_381.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_distri_bls12_381.nim", false),
("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_vs_ref_bls12_381.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mixed_add_bls12_381.nim", false),
# ("tests/math/t_ec_shortw_prj_g2_add_double_bls12_377.nim", false),
# ("tests/math/t_ec_shortw_prj_g2_mul_sanity_bls12_377.nim", false),
# ("tests/math/t_ec_shortw_prj_g2_mul_distri_bls12_377.nim", false),
("tests/math/t_ec_shortw_prj_g2_mul_vs_ref_bls12_377.nim", false),
# ("tests/math/t_ec_shortw_prj_g2_mixed_add_bls12_377.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_add_double_bls12_377.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_sanity_bls12_377.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_distri_bls12_377.nim", false),
("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_vs_ref_bls12_377.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mixed_add_bls12_377.nim", false),
# ("tests/math/t_ec_shortw_prj_g2_add_double_bw6_761.nim", false),
# ("tests/math/t_ec_shortw_prj_g2_mul_sanity_bw6_761.nim", false),
# ("tests/math/t_ec_shortw_prj_g2_mul_distri_bw6_761.nim", false),
("tests/math/t_ec_shortw_prj_g2_mul_vs_ref_bw6_761.nim", false),
# ("tests/math/t_ec_shortw_prj_g2_mixed_add_bw6_761.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_add_double_bw6_761.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_sanity_bw6_761.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_distri_bw6_761.nim", false),
("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mul_vs_ref_bw6_761.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_prj_g2_mixed_add_bw6_761.nim", false),
# ("tests/math/t_ec_shortw_jac_g2_add_double_bn254_snarks.nim", false),
# ("tests/math/t_ec_shortw_jac_g2_mul_sanity_bn254_snarks.nim", false),
# ("tests/math/t_ec_shortw_jac_g2_mul_distri_bn254_snarks.nim", false),
("tests/math/t_ec_shortw_jac_g2_mul_vs_ref_bn254_snarks.nim", false),
# ("tests/math/t_ec_shortw_jac_g2_mixed_add_bn254_snarks.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_add_double_bn254_snarks.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_sanity_bn254_snarks.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_distri_bn254_snarks.nim", false),
("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_vs_ref_bn254_snarks.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mixed_add_bn254_snarks.nim", false),
# ("tests/math/t_ec_shortw_jac_g2_add_double_bls12_381.nim", false),
# ("tests/math/t_ec_shortw_jac_g2_mul_sanity_bls12_381.nim", false),
# ("tests/math/t_ec_shortw_jac_g2_mul_distri_bls12_381.nim", false),
("tests/math/t_ec_shortw_jac_g2_mul_vs_ref_bls12_381.nim", false),
# ("tests/math/t_ec_shortw_jac_g2_mixed_add_bls12_381.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_add_double_bls12_381.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_sanity_bls12_381.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_distri_bls12_381.nim", false),
("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_vs_ref_bls12_381.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mixed_add_bls12_381.nim", false),
# ("tests/math/t_ec_shortw_jac_g2_add_double_bls12_377.nim", false),
# ("tests/math/t_ec_shortw_jac_g2_mul_sanity_bls12_377.nim", false),
# ("tests/math/t_ec_shortw_jac_g2_mul_distri_bls12_377.nim", false),
("tests/math/t_ec_shortw_jac_g2_mul_vs_ref_bls12_377.nim", false),
# ("tests/math/t_ec_shortw_jac_g2_mixed_add_bls12_377.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_add_double_bls12_377.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_sanity_bls12_377.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_distri_bls12_377.nim", false),
("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_vs_ref_bls12_377.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mixed_add_bls12_377.nim", false),
# ("tests/math/t_ec_shortw_jac_g2_add_double_bw6_761.nim", false),
# ("tests/math/t_ec_shortw_jac_g2_mul_sanity_bw6_761.nim", false),
# ("tests/math/t_ec_shortw_jac_g2_mul_distri_bw6_761.nim", false),
("tests/math/t_ec_shortw_jac_g2_mul_vs_ref_bw6_761.nim", false),
# ("tests/math/t_ec_shortw_jac_g2_mixed_add_bw6_761.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_add_double_bw6_761.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_sanity_bw6_761.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_distri_bw6_761.nim", false),
("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mul_vs_ref_bw6_761.nim", false),
# ("tests/math_elliptic_curves/t_ec_shortw_jac_g2_mixed_add_bw6_761.nim", false),
# Elliptic curve arithmetic vs Sagemath
# ----------------------------------------------------------
("tests/math/t_ec_frobenius.nim", false),
("tests/math/t_ec_sage_bn254_nogami.nim", false),
("tests/math/t_ec_sage_bn254_snarks.nim", false),
("tests/math/t_ec_sage_bls12_377.nim", false),
("tests/math/t_ec_sage_bls12_381.nim", false),
("tests/math/t_ec_sage_pallas.nim", false),
("tests/math/t_ec_sage_vesta.nim", false),
("tests/math_elliptic_curves/t_ec_frobenius.nim", false),
("tests/math_elliptic_curves/t_ec_sage_bn254_nogami.nim", false),
("tests/math_elliptic_curves/t_ec_sage_bn254_snarks.nim", false),
("tests/math_elliptic_curves/t_ec_sage_bls12_377.nim", false),
("tests/math_elliptic_curves/t_ec_sage_bls12_381.nim", false),
("tests/math_elliptic_curves/t_ec_sage_pallas.nim", false),
("tests/math_elliptic_curves/t_ec_sage_vesta.nim", false),
# Edge cases highlighted by past bugs
# ----------------------------------------------------------
("tests/math/t_ec_shortw_prj_edge_cases.nim", false),
("tests/math_elliptic_curves/t_ec_shortw_prj_edge_cases.nim", false),
# Elliptic curve arithmetic - batch computation
# ----------------------------------------------------------
("tests/math/t_ec_shortw_prj_g1_sum_reduce.nim", false),
("tests/math/t_ec_shortw_jac_g1_sum_reduce.nim", false),
("tests/math/t_ec_shortw_jacext_g1_sum_reduce.nim", false),
("tests/math/t_ec_shortw_prj_g1_msm.nim", false),
("tests/math/t_ec_shortw_jac_g1_msm.nim", false),
("tests/math_elliptic_curves/t_ec_shortw_prj_g1_sum_reduce.nim", false),
("tests/math_elliptic_curves/t_ec_shortw_jac_g1_sum_reduce.nim", false),
("tests/math_elliptic_curves/t_ec_shortw_jacext_g1_sum_reduce.nim", false),
("tests/math_elliptic_curves/t_ec_shortw_prj_g1_msm.nim", false),
("tests/math_elliptic_curves/t_ec_shortw_jac_g1_msm.nim", false),
# Subgroups and cofactors
# ----------------------------------------------------------
# ("tests/math/t_ec_subgroups_bn254_nogami.nim", false),
# ("tests/math/t_ec_subgroups_bn254_snarks.nim", false),
# ("tests/math/t_ec_subgroups_bls12_377.nim", false),
# ("tests/math/t_ec_subgroups_bls12_381.nim", false),
# ("tests/math_elliptic_curves/t_ec_subgroups_bn254_nogami.nim", false),
# ("tests/math_elliptic_curves/t_ec_subgroups_bn254_snarks.nim", false),
# ("tests/math_elliptic_curves/t_ec_subgroups_bls12_377.nim", false),
# ("tests/math_elliptic_curves/t_ec_subgroups_bls12_381.nim", false),
# ("tests/math/t_pairing_bn254_nogami_gt_subgroup.nim", false),
# ("tests/math/t_pairing_bn254_snarks_gt_subgroup.nim", false),
# ("tests/math/t_pairing_bls12_377_gt_subgroup.nim", false),
# ("tests/math/t_pairing_bls12_381_gt_subgroup.nim", false),
# ("tests/math/t_pairing_bw6_761_gt_subgroup.nim", false),
# ("tests/math_pairings/t_pairing_bn254_nogami_gt_subgroup.nim", false),
# ("tests/math_pairings/t_pairing_bn254_snarks_gt_subgroup.nim", false),
# ("tests/math_pairings/t_pairing_bls12_377_gt_subgroup.nim", false),
# ("tests/math_pairings/t_pairing_bls12_381_gt_subgroup.nim", false),
# ("tests/math_pairings/t_pairing_bw6_761_gt_subgroup.nim", false),
# Pairing
# ----------------------------------------------------------
# ("tests/math/t_pairing_bls12_377_line_functions.nim", false),
# ("tests/math/t_pairing_bls12_381_line_functions.nim", false),
# ("tests/math/t_pairing_mul_fp12_by_lines.nim", false),
("tests/math/t_pairing_cyclotomic_subgroup.nim", false),
("tests/math/t_pairing_bn254_nogami_optate.nim", false),
("tests/math/t_pairing_bn254_snarks_optate.nim", false),
("tests/math/t_pairing_bls12_377_optate.nim", false),
("tests/math/t_pairing_bls12_381_optate.nim", false),
# ("tests/math_pairings/t_pairing_bls12_377_line_functions.nim", false),
# ("tests/math_pairings/t_pairing_bls12_381_line_functions.nim", false),
# ("tests/math_pairings/t_pairing_mul_fp12_by_lines.nim", false),
("tests/math_pairings/t_pairing_cyclotomic_subgroup.nim", false),
("tests/math_pairings/t_pairing_bn254_nogami_optate.nim", false),
("tests/math_pairings/t_pairing_bn254_snarks_optate.nim", false),
("tests/math_pairings/t_pairing_bls12_377_optate.nim", false),
("tests/math_pairings/t_pairing_bls12_381_optate.nim", false),
# Multi-Pairing
# ----------------------------------------------------------
("tests/math/t_pairing_bn254_nogami_multi.nim", false),
("tests/math/t_pairing_bn254_snarks_multi.nim", false),
("tests/math/t_pairing_bls12_377_multi.nim", false),
("tests/math/t_pairing_bls12_381_multi.nim", false),
("tests/math_pairings/t_pairing_bn254_nogami_multi.nim", false),
("tests/math_pairings/t_pairing_bn254_snarks_multi.nim", false),
("tests/math_pairings/t_pairing_bls12_377_multi.nim", false),
("tests/math_pairings/t_pairing_bls12_381_multi.nim", false),
# Prime order fields
# ----------------------------------------------------------
("tests/math/t_fr.nim", false),
("tests/math_fields/t_fr.nim", false),
# Hashing to elliptic curves
# ----------------------------------------------------------
@ -453,21 +454,21 @@ const testDescNvidia: seq[string] = @[
]
const testDescThreadpool: seq[string] = @[
"constantine/platforms/threadpool/examples/e01_simple_tasks.nim",
"constantine/platforms/threadpool/examples/e02_parallel_pi.nim",
"constantine/platforms/threadpool/examples/e03_parallel_for.nim",
"constantine/platforms/threadpool/examples/e04_parallel_reduce.nim",
# "constantine/platforms/threadpool/benchmarks/bouncing_producer_consumer/threadpool_bpc.nim", # Need timing not implemented on Windows
"constantine/platforms/threadpool/benchmarks/dfs/threadpool_dfs.nim",
"constantine/platforms/threadpool/benchmarks/fibonacci/threadpool_fib.nim",
"constantine/platforms/threadpool/benchmarks/heat/threadpool_heat.nim",
# "constantine/platforms/threadpool/benchmarks/matmul_cache_oblivious/threadpool_matmul_co.nim",
"constantine/platforms/threadpool/benchmarks/nqueens/threadpool_nqueens.nim",
# "constantine/platforms/threadpool/benchmarks/single_task_producer/threadpool_spc.nim", # Need timing not implemented on Windows
# "constantine/platforms/threadpool/benchmarks/black_scholes/threadpool_black_scholes.nim", # Need input file
"constantine/platforms/threadpool/benchmarks/matrix_transposition/threadpool_transposes.nim",
"constantine/platforms/threadpool/benchmarks/histogram_2D/threadpool_histogram.nim",
"constantine/platforms/threadpool/benchmarks/logsumexp/threadpool_logsumexp.nim",
"constantine/threadpool/examples/e01_simple_tasks.nim",
"constantine/threadpool/examples/e02_parallel_pi.nim",
"constantine/threadpool/examples/e03_parallel_for.nim",
"constantine/threadpool/examples/e04_parallel_reduce.nim",
# "constantine/threadpool/benchmarks/bouncing_producer_consumer/threadpool_bpc.nim", # Need timing not implemented on Windows
"constantine/threadpool/benchmarks/dfs/threadpool_dfs.nim",
"constantine/threadpool/benchmarks/fibonacci/threadpool_fib.nim",
"constantine/threadpool/benchmarks/heat/threadpool_heat.nim",
# "constantine/threadpool/benchmarks/matmul_cache_oblivious/threadpool_matmul_co.nim",
"constantine/threadpool/benchmarks/nqueens/threadpool_nqueens.nim",
# "constantine/threadpool/benchmarks/single_task_producer/threadpool_spc.nim", # Need timing not implemented on Windows
# "constantine/threadpool/benchmarks/black_scholes/threadpool_black_scholes.nim", # Need input file
"constantine/threadpool/benchmarks/matrix_transposition/threadpool_transposes.nim",
"constantine/threadpool/benchmarks/histogram_2D/threadpool_histogram.nim",
"constantine/threadpool/benchmarks/logsumexp/threadpool_logsumexp.nim",
]
const testDescMultithreadedCrypto: seq[string] = @[
@ -508,8 +509,8 @@ const benchDesc = [
# For temporary (hopefully) investigation that can only be reproduced in CI
const useDebug = [
"tests/math/t_bigints.nim",
"tests/math/t_hash_sha256_vs_openssl.nim",
"tests/math_bigints/t_bigints.nim",
"tests/t_hash_sha256_vs_openssl.nim",
]
# Skip sanitizers for specific tests

View File

@ -11,7 +11,7 @@ import ./ec_multi_scalar_mul_scheduler,
./ec_endomorphism_accel,
../extension_fields,
../constants/zoo_endomorphisms,
../../platforms/threadpool/[threadpool, partitioners]
../../threadpool/[threadpool, partitioners]
export bestBucketBitSize
# No exceptions allowed in core cryptographic operations

View File

@ -8,7 +8,7 @@
import
../../platforms/abstractions,
../../platforms/threadpool/[threadpool, partitioners],
../../threadpool/[threadpool, partitioners],
./ec_shortweierstrass_affine,
./ec_shortweierstrass_jacobian,
./ec_shortweierstrass_projective,

View File

@ -157,7 +157,10 @@ template `<=`*[T: Ct](x, y: T): CTBool[T] =
not(y < x)
template `xor`*[T: Ct](x, y: CTBool[T]): CTBool[T] =
CTBool[T](noteq(T(x), T(y)))
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
let r = CTBool[T](noteq(T(x), T(y)))
{.pop.}
r
# ############################################################
#

View File

@ -6,6 +6,8 @@
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.push used.} # Some SIMDs are implemented but not exported.
static: doAssert defined(i386) or defined(amd64)
# SIMD throughput and latency:
@ -123,7 +125,7 @@ func mm_shuffle_epi8(a, b: m128i): m128i {.importc: "_mm_shuffle_epi8", x86.}
## if z is set, the corresponding d is set to zero.
## otherwise uvwx represents a binary number in 0..15,
## the corresponding d will be set to a(uvwx)
##
##
## for i in 0 ..< 16:
## if bitand(b[i], 0x80) != 0:
## dst[i] = 0
@ -139,7 +141,7 @@ func mm_shuffle_epi8(a, b: m128i): m128i {.importc: "_mm_shuffle_epi8", x86.}
func mm_blend_epi16(a, b: m128i, imm8: int32 or uint32): m128i {.importc: "_mm_blend_epi16", x86.}
## Blend packed 16-bit integers from a and b using control mask imm8,
## and store the results in dst.
##
##
## FOR j := 0 to 7
## i := j*16
## IF imm8[j]
@ -175,7 +177,7 @@ func mm_mask_add_epi32(src: m128i, mask: mmask8, a, b: m128i): m128i {.importc:
func mm_sha256msg1_epu32(a, b: m128i): m128i {.importc: "_mm_sha256msg1_epu32", x86.}
## Perform an intermediate calculation for the next four SHA256 message values (unsigned 32-bit integers)
## using previous message values from a and b, and store the result in dst.
##
##
## W4 := b[31:0]
## W3 := a[127:96]
## W2 := a[95:64]
@ -189,7 +191,7 @@ func mm_sha256msg1_epu32(a, b: m128i): m128i {.importc: "_mm_sha256msg1_epu32",
func mm_sha256msg2_epu32(a, b: m128i): m128i {.importc: "_mm_sha256msg2_epu32", x86.}
## Perform the final calculation for the next four SHA256 message values (unsigned 32-bit integers)
## using previous message values from a and b, and store the result in dst.
##
##
## W14 := b[95:64]
## W15 := b[127:96]
## W16 := a[31:0] + sigma1(W14)
@ -208,7 +210,7 @@ func mm_sha256rnds2_epu32(cdgh, abef, k: m128i): m128i {.importc: "_mm_sha256rnd
## and a pre-computed sum of the next 2 round message values (unsigned 32-bit integers)
## and the corresponding round constants from k,
## and store the updated SHA256 state (A,B,E,F) in dst.
##
##
## A[0] := b[127:96]
## B[0] := b[95:64]
## C[0] := a[127:96]
@ -269,9 +271,9 @@ template shuf_u32x4*(a: m128i, mask: int32 or uint32): m128i =
template blend_u16x8*(a, b: m128i, mask: int32 or uint32): m128i =
mm_blend_epi16(a, b, mask)
template sha256_msg1*(a, b: m128i): m128i =
template sha256_msg1*(a, b: m128i): m128i =
mm_sha256msg1_epu32(a, b)
template sha256_msg2*(a, b: m128i): m128i =
template sha256_msg2*(a, b: m128i): m128i =
mm_sha256msg2_epu32(a, b)
template sha256_2rounds*(cdgh, abef, k: m128i): m128i =
mm_sha256rnds2_epu32(cdgh, abef, k)

View File

@ -34,8 +34,8 @@
import
std/atomics,
../../platforms/allocs,
../instrumentation,
../../allocs,
./tasks_flowvars
type

View File

@ -8,10 +8,10 @@
import
std/atomics,
./scoped_barriers,
../../platforms/allocs,
../primitives/futexes,
../instrumentation,
../../allocs,
../primitives/futexes
./scoped_barriers
# Tasks have an efficient design so that a single heap allocation
# is required per `spawn`.

View File

@ -8,7 +8,7 @@
import
std/macros,
./crossthread/tasks_flowvars,
../ast_rebuilder
../platforms/ast_rebuilder
# Parallel offloading API
# -----------------------

View File

@ -21,14 +21,14 @@ import
./instrumentation,
./primitives/barriers,
./parallel_offloading,
../allocs, ../bithacks
../platforms/[allocs, bithacks]
export
# flowvars
Flowvar, isSpawned, isReady
when defined(TP_Metrics):
import ../static_for
import ../platforms/static_for
import system/ansi_c
# ############################################################

View File

@ -10,9 +10,9 @@ import
# Standard library
std/[unittest, times],
# Internals
../../constantine/math/config/[common, curves],
../../constantine/math/[arithmetic, primitives],
../../constantine/math/io/[io_bigints, io_fields, io_ec],
../../constantine/math/config/curves,
../../constantine/math/arithmetic,
../../constantine/math/io/io_fields,
../../constantine/math/elliptic/[ec_shortweierstrass_affine, ec_shortweierstrass_jacobian, ec_scalar_mul],
# Test utilities
../../helpers/prng_unsafe,

Some files were not shown because too many files have changed in this diff Show More