• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MinaProtocol / mina / 2903

15 Nov 2024 01:59PM UTC coverage: 36.723% (-25.0%) from 61.682%
2903

Pull #16342

buildkite

dkijania
Merge branch 'dkijania/remove_publish_job_from_pr_comp' into dkijania/remove_publish_job_from_pr_dev
Pull Request #16342: [DEV] Publish debians only on nightly and stable

15 of 40 new or added lines in 14 files covered. (37.5%)

15175 existing lines in 340 files now uncovered.

24554 of 66863 relevant lines covered (36.72%)

20704.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

37.5
/src/lib/pickles_types/pcs_batch.ml
1
open Core_kernel
22✔
2

3
type ('a, 'n, 'm) t =
4
  { without_degree_bound : 'n Nat.t; with_degree_bound : ('a, 'm) Vector.t }
5

6
let map t ~f = { t with with_degree_bound = Vector.map t.with_degree_bound ~f }
×
7

UNCOV
8
let num_bits n = Int.floor_log2 n + 1
×
9

10
let pow ~one ~mul x n =
11
  assert (n >= 0) ;
×
12
  let k = num_bits n in
13
  let rec go acc i =
×
14
    if i < 0 then acc
×
15
    else
16
      let acc = mul acc acc in
×
17
      let b = (n lsr i) land 1 = 1 in
×
18
      let acc = if b then mul x acc else acc in
×
19
      go acc (i - 1)
20
  in
21
  go one (k - 1)
22

23
let create ~without_degree_bound ~with_degree_bound =
24
  { without_degree_bound; with_degree_bound }
120✔
25

26
let combine_commitments _t ~scale ~add ~xi (type n)
×
27
    (without_degree_bound : (_, n) Vector.t) with_degree_bound =
28
  match without_degree_bound with
×
29
  | [] ->
×
30
      failwith "combine_commitments: empty list"
31
  | init :: without_degree_bound ->
×
32
      let polys =
33
        Vector.to_list without_degree_bound
×
34
        @ List.concat_map (Vector.to_list with_degree_bound)
×
35
            ~f:(fun (unshifted, shifted) -> [ unshifted; shifted ])
×
36
      in
37
      List.fold_left polys ~init ~f:(fun acc p -> add p (scale acc xi))
×
38

39
let combine_evaluations' (type a n m)
40
    ({ without_degree_bound = _; with_degree_bound } : (a, n Nat.s, m) t)
41
    ~shifted_pow ~mul ~add ~one:_ ~evaluation_point ~xi
42
    (init :: evals0 : (_, n Nat.s) Vector.t) (evals1 : (_, m) Vector.t) =
43
  let evals =
×
44
    Vector.to_list evals0
×
45
    @ List.concat
×
46
        (Vector.to_list
×
47
           (Vector.map2 with_degree_bound evals1 ~f:(fun deg fx ->
×
48
                [ fx; mul (shifted_pow deg evaluation_point) fx ] ) ) )
×
49
  in
50
  List.fold_left evals ~init ~f:(fun acc fx -> add fx (mul acc xi))
×
51

52
let[@warning "-45"] combine_evaluations' (type n) (t : (_, n, _) t) ~shifted_pow
53
    ~mul ~add ~one ~evaluation_point ~xi (evals0 : (_, n) Vector.t) evals1 =
54
  match evals0 with
×
55
  | Vector.[] ->
×
56
      failwith "Empty evals0"
57
  | _ :: _ ->
×
58
      combine_evaluations' t ~shifted_pow ~mul ~add ~one ~evaluation_point ~xi
59
        evals0 evals1
60

61
let combine_evaluations (type f) t ~crs_max_degree ~(mul : f -> f -> f) ~add
62
    ~one ~evaluation_point ~xi evals0 evals1 =
63
  let pow = pow ~one ~mul in
×
64
  combine_evaluations' t evals0 evals1
65
    ~shifted_pow:(fun deg x -> pow x (crs_max_degree - deg))
×
66
    ~mul ~add ~one ~evaluation_point ~xi
67

68
let combine_split_commitments _t ~scale_and_add ~init:i ~xi
69
    ~reduce_without_degree_bound ~reduce_with_degree_bound (type n)
120✔
70
    (without_degree_bound : (_, n) Vector.t) with_degree_bound =
71
  let flat =
120✔
72
    List.concat_map
120✔
73
      (Vector.to_list without_degree_bound)
120✔
74
      ~f:reduce_without_degree_bound
75
    @ List.concat_map
120✔
76
        (Vector.to_list with_degree_bound)
120✔
77
        ~f:reduce_with_degree_bound
78
  in
79
  let rec go = function
80
    | [] ->
×
81
        failwith "combine_split_commitments: empty"
82
    | init :: comms -> (
500✔
83
        match i init with
84
        | None ->
380✔
85
            go comms
86
        | Some init ->
120✔
87
            List.fold_left comms ~init ~f:(fun acc p ->
88
                scale_and_add ~acc ~xi p ) )
5,520✔
89
  in
90
  go (List.rev flat)
120✔
91

92
let combine_split_evaluations (type f f')
93
    ~(mul_and_add : acc:f' -> xi:f' -> f -> f') ~init:(i : f -> f') ~(xi : f')
94
    (evals0 : f array list) : f' =
95
  let flat = List.concat_map evals0 ~f:Array.to_list in
280✔
96
  match List.rev flat with
280✔
97
  | [] ->
×
98
      failwith "combine_split_evaluations: empty"
99
  | init :: es ->
280✔
100
      List.fold_left es ~init:(i init) ~f:(fun acc fx ->
280✔
101
          mul_and_add ~acc ~xi fx )
20✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc