├── .gitignore ├── Cargo.lock ├── Cargo.toml └── src ├── lib.rs ├── main.rs ├── poly ├── gpu.rs ├── mod.rs └── plain.rs └── sumcheck ├── gpu.rs ├── mod.rs ├── plain.rs └── simd.rs /.gitignore: -------------------------------------------------------------------------------- 1 | cache 2 | target 3 | sync.sh 4 | rsync_log.txt 5 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "ahash" 7 | version = "0.8.11" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" 10 | dependencies = [ 11 | "cfg-if", 12 | "once_cell", 13 | "version_check", 14 | "zerocopy", 15 | ] 16 | 17 | [[package]] 18 | name = "aho-corasick" 19 | version = "1.1.3" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 22 | dependencies = [ 23 | "memchr", 24 | ] 25 | 26 | [[package]] 27 | name = "ark-bn254" 28 | version = "0.4.0" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" 31 | dependencies = [ 32 | "ark-ec", 33 | "ark-ff", 34 | "ark-std", 35 | ] 36 | 37 | [[package]] 38 | name = "ark-ec" 39 | version = "0.4.2" 40 | source = "registry+https://github.com/rust-lang/crates.io-index" 41 | checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" 42 | dependencies = [ 43 | "ark-ff", 44 | "ark-poly", 45 | "ark-serialize", 46 | "ark-std", 47 | "derivative", 48 | "hashbrown", 49 | "itertools 0.10.5", 50 | "num-traits", 51 | "rayon", 52 | "zeroize", 53 | ] 54 | 55 | [[package]] 56 | name = "ark-ff" 57 | version = "0.4.2" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" 60 | dependencies = [ 61 | "ark-ff-asm", 62 | "ark-ff-macros", 63 | "ark-serialize", 64 | "ark-std", 65 | "derivative", 66 | "digest", 67 | "itertools 0.10.5", 68 | "num-bigint", 69 | "num-traits", 70 | "paste", 71 | "rustc_version", 72 | "zeroize", 73 | ] 74 | 75 | [[package]] 76 | name = "ark-ff-asm" 77 | version = "0.4.2" 78 | source = "registry+https://github.com/rust-lang/crates.io-index" 79 | checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" 80 | dependencies = [ 81 | "quote", 82 | "syn 1.0.109", 83 | ] 84 | 85 | [[package]] 86 | name = "ark-ff-macros" 87 | version = "0.4.2" 88 | source = "registry+https://github.com/rust-lang/crates.io-index" 89 | checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" 90 | dependencies = [ 91 | "num-bigint", 92 | "num-traits", 93 | "proc-macro2", 94 | "quote", 95 | "syn 1.0.109", 96 | ] 97 | 98 | [[package]] 99 | name = "ark-poly" 100 | version = "0.4.2" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" 103 | dependencies = [ 104 | "ark-ff", 105 | "ark-serialize", 106 | "ark-std", 107 | "derivative", 108 | "hashbrown", 109 | ] 110 | 111 | [[package]] 112 | name = "ark-serialize" 113 | version = "0.4.2" 114 | source = "registry+https://github.com/rust-lang/crates.io-index" 115 | checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" 116 | dependencies = [ 117 | "ark-serialize-derive", 118 | "ark-std", 119 | "digest", 120 | "num-bigint", 121 | ] 122 | 123 | [[package]] 124 | name = "ark-serialize-derive" 125 | version = "0.4.2" 126 | source = "registry+https://github.com/rust-lang/crates.io-index" 127 | checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" 128 | dependencies = [ 129 | "proc-macro2", 130 | "quote", 131 | "syn 1.0.109", 132 | ] 133 | 134 | [[package]] 135 | name = "ark-std" 136 | version = "0.4.0" 137 | source = "registry+https://github.com/rust-lang/crates.io-index" 138 | checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" 139 | dependencies = [ 140 | "num-traits", 141 | "rand", 142 | "rayon", 143 | ] 144 | 145 | [[package]] 146 | name = "atty" 147 | version = "0.2.14" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 150 | dependencies = [ 151 | "hermit-abi", 152 | "libc", 153 | "winapi", 154 | ] 155 | 156 | [[package]] 157 | name = "autocfg" 158 | version = "1.3.0" 159 | source = "registry+https://github.com/rust-lang/crates.io-index" 160 | checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" 161 | 162 | [[package]] 163 | name = "bincode" 164 | version = "1.3.3" 165 | source = "registry+https://github.com/rust-lang/crates.io-index" 166 | checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" 167 | dependencies = [ 168 | "serde", 169 | ] 170 | 171 | [[package]] 172 | name = "bindgen" 173 | version = "0.69.4" 174 | source = "registry+https://github.com/rust-lang/crates.io-index" 175 | checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" 176 | dependencies = [ 177 | "bitflags 2.6.0", 178 | "cexpr", 179 | "clang-sys", 180 | "itertools 0.12.1", 181 | "lazy_static", 182 | "lazycell", 183 | "log", 184 | "prettyplease", 185 | "proc-macro2", 186 | "quote", 187 | "regex", 188 | "rustc-hash", 189 | "shlex", 190 | "syn 2.0.72", 191 | "which", 192 | ] 193 | 194 | [[package]] 195 | name = "bitflags" 196 | version = "1.3.2" 197 | source = "registry+https://github.com/rust-lang/crates.io-index" 198 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 199 | 200 | [[package]] 201 | name = "bitflags" 202 | version = "2.6.0" 203 | source = "registry+https://github.com/rust-lang/crates.io-index" 204 | checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" 205 | 206 | [[package]] 207 | name = "bumpalo" 208 | version = "3.16.0" 209 | source = "registry+https://github.com/rust-lang/crates.io-index" 210 | checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" 211 | 212 | [[package]] 213 | name = "byteorder" 214 | version = "1.5.0" 215 | source = "registry+https://github.com/rust-lang/crates.io-index" 216 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 217 | 218 | [[package]] 219 | name = "cast" 220 | version = "0.3.0" 221 | source = "registry+https://github.com/rust-lang/crates.io-index" 222 | checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" 223 | 224 | [[package]] 225 | name = "cc" 226 | version = "1.1.7" 227 | source = "registry+https://github.com/rust-lang/crates.io-index" 228 | checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" 229 | 230 | [[package]] 231 | name = "cexpr" 232 | version = "0.6.0" 233 | source = "registry+https://github.com/rust-lang/crates.io-index" 234 | checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" 235 | dependencies = [ 236 | "nom", 237 | ] 238 | 239 | [[package]] 240 | name = "cfg-if" 241 | version = "1.0.0" 242 | source = "registry+https://github.com/rust-lang/crates.io-index" 243 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 244 | 245 | [[package]] 246 | name = "clang-sys" 247 | version = "1.8.1" 248 | source = "registry+https://github.com/rust-lang/crates.io-index" 249 | checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" 250 | dependencies = [ 251 | "glob", 252 | "libc", 253 | "libloading", 254 | ] 255 | 256 | [[package]] 257 | name = "clap" 258 | version = "2.34.0" 259 | source = "registry+https://github.com/rust-lang/crates.io-index" 260 | checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" 261 | dependencies = [ 262 | "bitflags 1.3.2", 263 | "textwrap", 264 | "unicode-width", 265 | ] 266 | 267 | [[package]] 268 | name = "cmake" 269 | version = "0.1.50" 270 | source = "registry+https://github.com/rust-lang/crates.io-index" 271 | checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" 272 | dependencies = [ 273 | "cc", 274 | ] 275 | 276 | [[package]] 277 | name = "criterion" 278 | version = "0.3.6" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f" 281 | dependencies = [ 282 | "atty", 283 | "cast", 284 | "clap", 285 | "criterion-plot", 286 | "csv", 287 | "itertools 0.10.5", 288 | "lazy_static", 289 | "num-traits", 290 | "oorandom", 291 | "plotters", 292 | "rayon", 293 | "regex", 294 | "serde", 295 | "serde_cbor", 296 | "serde_derive", 297 | "serde_json", 298 | "tinytemplate", 299 | "walkdir", 300 | ] 301 | 302 | [[package]] 303 | name = "criterion-plot" 304 | version = "0.4.5" 305 | source = "registry+https://github.com/rust-lang/crates.io-index" 306 | checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876" 307 | dependencies = [ 308 | "cast", 309 | "itertools 0.10.5", 310 | ] 311 | 312 | [[package]] 313 | name = "crossbeam-deque" 314 | version = "0.8.5" 315 | source = "registry+https://github.com/rust-lang/crates.io-index" 316 | checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" 317 | dependencies = [ 318 | "crossbeam-epoch", 319 | "crossbeam-utils", 320 | ] 321 | 322 | [[package]] 323 | name = "crossbeam-epoch" 324 | version = "0.9.18" 325 | source = "registry+https://github.com/rust-lang/crates.io-index" 326 | checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" 327 | dependencies = [ 328 | "crossbeam-utils", 329 | ] 330 | 331 | [[package]] 332 | name = "crossbeam-utils" 333 | version = "0.8.20" 334 | source = "registry+https://github.com/rust-lang/crates.io-index" 335 | checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" 336 | 337 | [[package]] 338 | name = "crypto-common" 339 | version = "0.1.6" 340 | source = "registry+https://github.com/rust-lang/crates.io-index" 341 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 342 | dependencies = [ 343 | "generic-array", 344 | "typenum", 345 | ] 346 | 347 | [[package]] 348 | name = "csv" 349 | version = "1.3.0" 350 | source = "registry+https://github.com/rust-lang/crates.io-index" 351 | checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" 352 | dependencies = [ 353 | "csv-core", 354 | "itoa", 355 | "ryu", 356 | "serde", 357 | ] 358 | 359 | [[package]] 360 | name = "csv-core" 361 | version = "0.1.11" 362 | source = "registry+https://github.com/rust-lang/crates.io-index" 363 | checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" 364 | dependencies = [ 365 | "memchr", 366 | ] 367 | 368 | [[package]] 369 | name = "derivative" 370 | version = "2.2.0" 371 | source = "registry+https://github.com/rust-lang/crates.io-index" 372 | checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" 373 | dependencies = [ 374 | "proc-macro2", 375 | "quote", 376 | "syn 1.0.109", 377 | ] 378 | 379 | [[package]] 380 | name = "digest" 381 | version = "0.10.7" 382 | source = "registry+https://github.com/rust-lang/crates.io-index" 383 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 384 | dependencies = [ 385 | "crypto-common", 386 | ] 387 | 388 | [[package]] 389 | name = "either" 390 | version = "1.13.0" 391 | source = "registry+https://github.com/rust-lang/crates.io-index" 392 | checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" 393 | 394 | [[package]] 395 | name = "errno" 396 | version = "0.3.9" 397 | source = "registry+https://github.com/rust-lang/crates.io-index" 398 | checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" 399 | dependencies = [ 400 | "libc", 401 | "windows-sys 0.52.0", 402 | ] 403 | 404 | [[package]] 405 | name = "generic-array" 406 | version = "0.14.7" 407 | source = "registry+https://github.com/rust-lang/crates.io-index" 408 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 409 | dependencies = [ 410 | "typenum", 411 | "version_check", 412 | ] 413 | 414 | [[package]] 415 | name = "getrandom" 416 | version = "0.2.15" 417 | source = "registry+https://github.com/rust-lang/crates.io-index" 418 | checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" 419 | dependencies = [ 420 | "cfg-if", 421 | "libc", 422 | "wasi", 423 | ] 424 | 425 | [[package]] 426 | name = "glob" 427 | version = "0.3.1" 428 | source = "registry+https://github.com/rust-lang/crates.io-index" 429 | checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" 430 | 431 | [[package]] 432 | name = "half" 433 | version = "1.8.3" 434 | source = "registry+https://github.com/rust-lang/crates.io-index" 435 | checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" 436 | 437 | [[package]] 438 | name = "hashbrown" 439 | version = "0.13.2" 440 | source = "registry+https://github.com/rust-lang/crates.io-index" 441 | checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" 442 | dependencies = [ 443 | "ahash", 444 | ] 445 | 446 | [[package]] 447 | name = "hermit-abi" 448 | version = "0.1.19" 449 | source = "registry+https://github.com/rust-lang/crates.io-index" 450 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 451 | dependencies = [ 452 | "libc", 453 | ] 454 | 455 | [[package]] 456 | name = "hex" 457 | version = "0.4.3" 458 | source = "registry+https://github.com/rust-lang/crates.io-index" 459 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 460 | 461 | [[package]] 462 | name = "home" 463 | version = "0.5.9" 464 | source = "registry+https://github.com/rust-lang/crates.io-index" 465 | checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" 466 | dependencies = [ 467 | "windows-sys 0.52.0", 468 | ] 469 | 470 | [[package]] 471 | name = "icicle-bn254" 472 | version = "2.8.0" 473 | source = "git+https://github.com/ingonyama-zk/icicle.git?tag=v2.8.0#aacec3f72f14f53dd96d835698d2c87cde3a68b8" 474 | dependencies = [ 475 | "ark-bn254", 476 | "cmake", 477 | "criterion", 478 | "icicle-core", 479 | "icicle-cuda-runtime", 480 | ] 481 | 482 | [[package]] 483 | name = "icicle-core" 484 | version = "2.8.0" 485 | source = "git+https://github.com/ingonyama-zk/icicle.git?tag=v2.8.0#aacec3f72f14f53dd96d835698d2c87cde3a68b8" 486 | dependencies = [ 487 | "ark-ec", 488 | "ark-ff", 489 | "ark-poly", 490 | "ark-std", 491 | "criterion", 492 | "hex", 493 | "icicle-cuda-runtime", 494 | "rayon", 495 | ] 496 | 497 | [[package]] 498 | name = "icicle-cuda-runtime" 499 | version = "2.8.0" 500 | source = "git+https://github.com/ingonyama-zk/icicle.git?tag=v2.8.0#aacec3f72f14f53dd96d835698d2c87cde3a68b8" 501 | dependencies = [ 502 | "bindgen", 503 | "bitflags 1.3.2", 504 | ] 505 | 506 | [[package]] 507 | name = "itertools" 508 | version = "0.10.5" 509 | source = "registry+https://github.com/rust-lang/crates.io-index" 510 | checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" 511 | dependencies = [ 512 | "either", 513 | ] 514 | 515 | [[package]] 516 | name = "itertools" 517 | version = "0.12.1" 518 | source = "registry+https://github.com/rust-lang/crates.io-index" 519 | checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" 520 | dependencies = [ 521 | "either", 522 | ] 523 | 524 | [[package]] 525 | name = "itoa" 526 | version = "1.0.11" 527 | source = "registry+https://github.com/rust-lang/crates.io-index" 528 | checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" 529 | 530 | [[package]] 531 | name = "js-sys" 532 | version = "0.3.69" 533 | source = "registry+https://github.com/rust-lang/crates.io-index" 534 | checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" 535 | dependencies = [ 536 | "wasm-bindgen", 537 | ] 538 | 539 | [[package]] 540 | name = "lazy_static" 541 | version = "1.5.0" 542 | source = "registry+https://github.com/rust-lang/crates.io-index" 543 | checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" 544 | 545 | [[package]] 546 | name = "lazycell" 547 | version = "1.3.0" 548 | source = "registry+https://github.com/rust-lang/crates.io-index" 549 | checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" 550 | 551 | [[package]] 552 | name = "libc" 553 | version = "0.2.155" 554 | source = "registry+https://github.com/rust-lang/crates.io-index" 555 | checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" 556 | 557 | [[package]] 558 | name = "libloading" 559 | version = "0.8.5" 560 | source = "registry+https://github.com/rust-lang/crates.io-index" 561 | checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" 562 | dependencies = [ 563 | "cfg-if", 564 | "windows-targets", 565 | ] 566 | 567 | [[package]] 568 | name = "linux-raw-sys" 569 | version = "0.4.14" 570 | source = "registry+https://github.com/rust-lang/crates.io-index" 571 | checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" 572 | 573 | [[package]] 574 | name = "lock_api" 575 | version = "0.4.12" 576 | source = "registry+https://github.com/rust-lang/crates.io-index" 577 | checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" 578 | dependencies = [ 579 | "autocfg", 580 | "scopeguard", 581 | ] 582 | 583 | [[package]] 584 | name = "log" 585 | version = "0.4.22" 586 | source = "registry+https://github.com/rust-lang/crates.io-index" 587 | checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" 588 | 589 | [[package]] 590 | name = "memchr" 591 | version = "2.7.4" 592 | source = "registry+https://github.com/rust-lang/crates.io-index" 593 | checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" 594 | 595 | [[package]] 596 | name = "minimal-lexical" 597 | version = "0.2.1" 598 | source = "registry+https://github.com/rust-lang/crates.io-index" 599 | checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 600 | 601 | [[package]] 602 | name = "nom" 603 | version = "7.1.3" 604 | source = "registry+https://github.com/rust-lang/crates.io-index" 605 | checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" 606 | dependencies = [ 607 | "memchr", 608 | "minimal-lexical", 609 | ] 610 | 611 | [[package]] 612 | name = "nu-ansi-term" 613 | version = "0.46.0" 614 | source = "registry+https://github.com/rust-lang/crates.io-index" 615 | checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" 616 | dependencies = [ 617 | "overload", 618 | "winapi", 619 | ] 620 | 621 | [[package]] 622 | name = "num-bigint" 623 | version = "0.4.6" 624 | source = "registry+https://github.com/rust-lang/crates.io-index" 625 | checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" 626 | dependencies = [ 627 | "num-integer", 628 | "num-traits", 629 | ] 630 | 631 | [[package]] 632 | name = "num-integer" 633 | version = "0.1.46" 634 | source = "registry+https://github.com/rust-lang/crates.io-index" 635 | checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" 636 | dependencies = [ 637 | "num-traits", 638 | ] 639 | 640 | [[package]] 641 | name = "num-traits" 642 | version = "0.2.19" 643 | source = "registry+https://github.com/rust-lang/crates.io-index" 644 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 645 | dependencies = [ 646 | "autocfg", 647 | ] 648 | 649 | [[package]] 650 | name = "once_cell" 651 | version = "1.19.0" 652 | source = "registry+https://github.com/rust-lang/crates.io-index" 653 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 654 | 655 | [[package]] 656 | name = "oorandom" 657 | version = "11.1.4" 658 | source = "registry+https://github.com/rust-lang/crates.io-index" 659 | checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" 660 | 661 | [[package]] 662 | name = "overload" 663 | version = "0.1.1" 664 | source = "registry+https://github.com/rust-lang/crates.io-index" 665 | checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" 666 | 667 | [[package]] 668 | name = "parking_lot" 669 | version = "0.12.3" 670 | source = "registry+https://github.com/rust-lang/crates.io-index" 671 | checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" 672 | dependencies = [ 673 | "lock_api", 674 | "parking_lot_core", 675 | ] 676 | 677 | [[package]] 678 | name = "parking_lot_core" 679 | version = "0.9.10" 680 | source = "registry+https://github.com/rust-lang/crates.io-index" 681 | checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" 682 | dependencies = [ 683 | "cfg-if", 684 | "libc", 685 | "redox_syscall", 686 | "smallvec", 687 | "windows-targets", 688 | ] 689 | 690 | [[package]] 691 | name = "paste" 692 | version = "1.0.15" 693 | source = "registry+https://github.com/rust-lang/crates.io-index" 694 | checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" 695 | 696 | [[package]] 697 | name = "pin-project-lite" 698 | version = "0.2.14" 699 | source = "registry+https://github.com/rust-lang/crates.io-index" 700 | checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" 701 | 702 | [[package]] 703 | name = "plotters" 704 | version = "0.3.6" 705 | source = "registry+https://github.com/rust-lang/crates.io-index" 706 | checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" 707 | dependencies = [ 708 | "num-traits", 709 | "plotters-backend", 710 | "plotters-svg", 711 | "wasm-bindgen", 712 | "web-sys", 713 | ] 714 | 715 | [[package]] 716 | name = "plotters-backend" 717 | version = "0.3.6" 718 | source = "registry+https://github.com/rust-lang/crates.io-index" 719 | checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" 720 | 721 | [[package]] 722 | name = "plotters-svg" 723 | version = "0.3.6" 724 | source = "registry+https://github.com/rust-lang/crates.io-index" 725 | checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" 726 | dependencies = [ 727 | "plotters-backend", 728 | ] 729 | 730 | [[package]] 731 | name = "poly-bind-bench" 732 | version = "0.1.0" 733 | dependencies = [ 734 | "ark-bn254", 735 | "ark-ff", 736 | "ark-std", 737 | "icicle-bn254", 738 | "icicle-core", 739 | "icicle-cuda-runtime", 740 | "rayon", 741 | "tracing", 742 | "tracing-subscriber", 743 | "tracing-texray", 744 | "vectorized-fields", 745 | ] 746 | 747 | [[package]] 748 | name = "ppv-lite86" 749 | version = "0.2.20" 750 | source = "registry+https://github.com/rust-lang/crates.io-index" 751 | checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" 752 | dependencies = [ 753 | "zerocopy", 754 | ] 755 | 756 | [[package]] 757 | name = "prettyplease" 758 | version = "0.2.20" 759 | source = "registry+https://github.com/rust-lang/crates.io-index" 760 | checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" 761 | dependencies = [ 762 | "proc-macro2", 763 | "syn 2.0.72", 764 | ] 765 | 766 | [[package]] 767 | name = "proc-macro2" 768 | version = "1.0.86" 769 | source = "registry+https://github.com/rust-lang/crates.io-index" 770 | checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" 771 | dependencies = [ 772 | "unicode-ident", 773 | ] 774 | 775 | [[package]] 776 | name = "quote" 777 | version = "1.0.36" 778 | source = "registry+https://github.com/rust-lang/crates.io-index" 779 | checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" 780 | dependencies = [ 781 | "proc-macro2", 782 | ] 783 | 784 | [[package]] 785 | name = "rand" 786 | version = "0.8.5" 787 | source = "registry+https://github.com/rust-lang/crates.io-index" 788 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 789 | dependencies = [ 790 | "libc", 791 | "rand_chacha", 792 | "rand_core", 793 | ] 794 | 795 | [[package]] 796 | name = "rand_chacha" 797 | version = "0.3.1" 798 | source = "registry+https://github.com/rust-lang/crates.io-index" 799 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 800 | dependencies = [ 801 | "ppv-lite86", 802 | "rand_core", 803 | ] 804 | 805 | [[package]] 806 | name = "rand_core" 807 | version = "0.6.4" 808 | source = "registry+https://github.com/rust-lang/crates.io-index" 809 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 810 | dependencies = [ 811 | "getrandom", 812 | ] 813 | 814 | [[package]] 815 | name = "rayon" 816 | version = "1.10.0" 817 | source = "registry+https://github.com/rust-lang/crates.io-index" 818 | checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" 819 | dependencies = [ 820 | "either", 821 | "rayon-core", 822 | ] 823 | 824 | [[package]] 825 | name = "rayon-core" 826 | version = "1.12.1" 827 | source = "registry+https://github.com/rust-lang/crates.io-index" 828 | checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" 829 | dependencies = [ 830 | "crossbeam-deque", 831 | "crossbeam-utils", 832 | ] 833 | 834 | [[package]] 835 | name = "redox_syscall" 836 | version = "0.5.3" 837 | source = "registry+https://github.com/rust-lang/crates.io-index" 838 | checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" 839 | dependencies = [ 840 | "bitflags 2.6.0", 841 | ] 842 | 843 | [[package]] 844 | name = "regex" 845 | version = "1.10.6" 846 | source = "registry+https://github.com/rust-lang/crates.io-index" 847 | checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" 848 | dependencies = [ 849 | "aho-corasick", 850 | "memchr", 851 | "regex-automata", 852 | "regex-syntax", 853 | ] 854 | 855 | [[package]] 856 | name = "regex-automata" 857 | version = "0.4.7" 858 | source = "registry+https://github.com/rust-lang/crates.io-index" 859 | checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" 860 | dependencies = [ 861 | "aho-corasick", 862 | "memchr", 863 | "regex-syntax", 864 | ] 865 | 866 | [[package]] 867 | name = "regex-syntax" 868 | version = "0.8.4" 869 | source = "registry+https://github.com/rust-lang/crates.io-index" 870 | checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" 871 | 872 | [[package]] 873 | name = "rustc-hash" 874 | version = "1.1.0" 875 | source = "registry+https://github.com/rust-lang/crates.io-index" 876 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" 877 | 878 | [[package]] 879 | name = "rustc_version" 880 | version = "0.4.0" 881 | source = "registry+https://github.com/rust-lang/crates.io-index" 882 | checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" 883 | dependencies = [ 884 | "semver", 885 | ] 886 | 887 | [[package]] 888 | name = "rustix" 889 | version = "0.38.34" 890 | source = "registry+https://github.com/rust-lang/crates.io-index" 891 | checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" 892 | dependencies = [ 893 | "bitflags 2.6.0", 894 | "errno", 895 | "libc", 896 | "linux-raw-sys", 897 | "windows-sys 0.52.0", 898 | ] 899 | 900 | [[package]] 901 | name = "ryu" 902 | version = "1.0.18" 903 | source = "registry+https://github.com/rust-lang/crates.io-index" 904 | checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" 905 | 906 | [[package]] 907 | name = "same-file" 908 | version = "1.0.6" 909 | source = "registry+https://github.com/rust-lang/crates.io-index" 910 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 911 | dependencies = [ 912 | "winapi-util", 913 | ] 914 | 915 | [[package]] 916 | name = "scopeguard" 917 | version = "1.2.0" 918 | source = "registry+https://github.com/rust-lang/crates.io-index" 919 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 920 | 921 | [[package]] 922 | name = "semver" 923 | version = "1.0.23" 924 | source = "registry+https://github.com/rust-lang/crates.io-index" 925 | checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" 926 | 927 | [[package]] 928 | name = "serde" 929 | version = "1.0.204" 930 | source = "registry+https://github.com/rust-lang/crates.io-index" 931 | checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" 932 | dependencies = [ 933 | "serde_derive", 934 | ] 935 | 936 | [[package]] 937 | name = "serde_cbor" 938 | version = "0.11.2" 939 | source = "registry+https://github.com/rust-lang/crates.io-index" 940 | checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" 941 | dependencies = [ 942 | "half", 943 | "serde", 944 | ] 945 | 946 | [[package]] 947 | name = "serde_derive" 948 | version = "1.0.204" 949 | source = "registry+https://github.com/rust-lang/crates.io-index" 950 | checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" 951 | dependencies = [ 952 | "proc-macro2", 953 | "quote", 954 | "syn 2.0.72", 955 | ] 956 | 957 | [[package]] 958 | name = "serde_json" 959 | version = "1.0.122" 960 | source = "registry+https://github.com/rust-lang/crates.io-index" 961 | checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" 962 | dependencies = [ 963 | "itoa", 964 | "memchr", 965 | "ryu", 966 | "serde", 967 | ] 968 | 969 | [[package]] 970 | name = "sharded-slab" 971 | version = "0.1.7" 972 | source = "registry+https://github.com/rust-lang/crates.io-index" 973 | checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" 974 | dependencies = [ 975 | "lazy_static", 976 | ] 977 | 978 | [[package]] 979 | name = "shlex" 980 | version = "1.3.0" 981 | source = "registry+https://github.com/rust-lang/crates.io-index" 982 | checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 983 | 984 | [[package]] 985 | name = "smallvec" 986 | version = "1.13.2" 987 | source = "registry+https://github.com/rust-lang/crates.io-index" 988 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 989 | 990 | [[package]] 991 | name = "syn" 992 | version = "1.0.109" 993 | source = "registry+https://github.com/rust-lang/crates.io-index" 994 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 995 | dependencies = [ 996 | "proc-macro2", 997 | "quote", 998 | "unicode-ident", 999 | ] 1000 | 1001 | [[package]] 1002 | name = "syn" 1003 | version = "2.0.72" 1004 | source = "registry+https://github.com/rust-lang/crates.io-index" 1005 | checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" 1006 | dependencies = [ 1007 | "proc-macro2", 1008 | "quote", 1009 | "unicode-ident", 1010 | ] 1011 | 1012 | [[package]] 1013 | name = "term_size" 1014 | version = "0.3.2" 1015 | source = "registry+https://github.com/rust-lang/crates.io-index" 1016 | checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9" 1017 | dependencies = [ 1018 | "libc", 1019 | "winapi", 1020 | ] 1021 | 1022 | [[package]] 1023 | name = "textwrap" 1024 | version = "0.11.0" 1025 | source = "registry+https://github.com/rust-lang/crates.io-index" 1026 | checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" 1027 | dependencies = [ 1028 | "unicode-width", 1029 | ] 1030 | 1031 | [[package]] 1032 | name = "thread_local" 1033 | version = "1.1.8" 1034 | source = "registry+https://github.com/rust-lang/crates.io-index" 1035 | checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" 1036 | dependencies = [ 1037 | "cfg-if", 1038 | "once_cell", 1039 | ] 1040 | 1041 | [[package]] 1042 | name = "tinytemplate" 1043 | version = "1.2.1" 1044 | source = "registry+https://github.com/rust-lang/crates.io-index" 1045 | checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" 1046 | dependencies = [ 1047 | "serde", 1048 | "serde_json", 1049 | ] 1050 | 1051 | [[package]] 1052 | name = "tracing" 1053 | version = "0.1.40" 1054 | source = "registry+https://github.com/rust-lang/crates.io-index" 1055 | checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 1056 | dependencies = [ 1057 | "pin-project-lite", 1058 | "tracing-attributes", 1059 | "tracing-core", 1060 | ] 1061 | 1062 | [[package]] 1063 | name = "tracing-attributes" 1064 | version = "0.1.27" 1065 | source = "registry+https://github.com/rust-lang/crates.io-index" 1066 | checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" 1067 | dependencies = [ 1068 | "proc-macro2", 1069 | "quote", 1070 | "syn 2.0.72", 1071 | ] 1072 | 1073 | [[package]] 1074 | name = "tracing-core" 1075 | version = "0.1.32" 1076 | source = "registry+https://github.com/rust-lang/crates.io-index" 1077 | checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 1078 | dependencies = [ 1079 | "once_cell", 1080 | "valuable", 1081 | ] 1082 | 1083 | [[package]] 1084 | name = "tracing-log" 1085 | version = "0.2.0" 1086 | source = "registry+https://github.com/rust-lang/crates.io-index" 1087 | checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" 1088 | dependencies = [ 1089 | "log", 1090 | "once_cell", 1091 | "tracing-core", 1092 | ] 1093 | 1094 | [[package]] 1095 | name = "tracing-subscriber" 1096 | version = "0.3.18" 1097 | source = "registry+https://github.com/rust-lang/crates.io-index" 1098 | checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" 1099 | dependencies = [ 1100 | "nu-ansi-term", 1101 | "sharded-slab", 1102 | "smallvec", 1103 | "thread_local", 1104 | "tracing-core", 1105 | "tracing-log", 1106 | ] 1107 | 1108 | [[package]] 1109 | name = "tracing-texray" 1110 | version = "0.2.0" 1111 | source = "registry+https://github.com/rust-lang/crates.io-index" 1112 | checksum = "07b7943a21ef76920e7250b59946b0068221c323bf1077baab36164477d63efc" 1113 | dependencies = [ 1114 | "lazy_static", 1115 | "parking_lot", 1116 | "term_size", 1117 | "tracing", 1118 | "tracing-subscriber", 1119 | ] 1120 | 1121 | [[package]] 1122 | name = "typenum" 1123 | version = "1.17.0" 1124 | source = "registry+https://github.com/rust-lang/crates.io-index" 1125 | checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" 1126 | 1127 | [[package]] 1128 | name = "unicode-ident" 1129 | version = "1.0.12" 1130 | source = "registry+https://github.com/rust-lang/crates.io-index" 1131 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 1132 | 1133 | [[package]] 1134 | name = "unicode-width" 1135 | version = "0.1.13" 1136 | source = "registry+https://github.com/rust-lang/crates.io-index" 1137 | checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" 1138 | 1139 | [[package]] 1140 | name = "valuable" 1141 | version = "0.1.0" 1142 | source = "registry+https://github.com/rust-lang/crates.io-index" 1143 | checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" 1144 | 1145 | [[package]] 1146 | name = "vectorized-fields" 1147 | version = "0.1.0" 1148 | source = "git+https://github.com/a16z/vectorized-fields.git#49fc13c2e4b0a4f3e38b692669fc7320880fd8dd" 1149 | dependencies = [ 1150 | "ark-bn254", 1151 | "ark-ff", 1152 | "ark-std", 1153 | "bincode", 1154 | "cc", 1155 | "rand", 1156 | "rand_chacha", 1157 | "rayon", 1158 | "serde", 1159 | ] 1160 | 1161 | [[package]] 1162 | name = "version_check" 1163 | version = "0.9.5" 1164 | source = "registry+https://github.com/rust-lang/crates.io-index" 1165 | checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" 1166 | 1167 | [[package]] 1168 | name = "walkdir" 1169 | version = "2.5.0" 1170 | source = "registry+https://github.com/rust-lang/crates.io-index" 1171 | checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" 1172 | dependencies = [ 1173 | "same-file", 1174 | "winapi-util", 1175 | ] 1176 | 1177 | [[package]] 1178 | name = "wasi" 1179 | version = "0.11.0+wasi-snapshot-preview1" 1180 | source = "registry+https://github.com/rust-lang/crates.io-index" 1181 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1182 | 1183 | [[package]] 1184 | name = "wasm-bindgen" 1185 | version = "0.2.92" 1186 | source = "registry+https://github.com/rust-lang/crates.io-index" 1187 | checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" 1188 | dependencies = [ 1189 | "cfg-if", 1190 | "wasm-bindgen-macro", 1191 | ] 1192 | 1193 | [[package]] 1194 | name = "wasm-bindgen-backend" 1195 | version = "0.2.92" 1196 | source = "registry+https://github.com/rust-lang/crates.io-index" 1197 | checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" 1198 | dependencies = [ 1199 | "bumpalo", 1200 | "log", 1201 | "once_cell", 1202 | "proc-macro2", 1203 | "quote", 1204 | "syn 2.0.72", 1205 | "wasm-bindgen-shared", 1206 | ] 1207 | 1208 | [[package]] 1209 | name = "wasm-bindgen-macro" 1210 | version = "0.2.92" 1211 | source = "registry+https://github.com/rust-lang/crates.io-index" 1212 | checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" 1213 | dependencies = [ 1214 | "quote", 1215 | "wasm-bindgen-macro-support", 1216 | ] 1217 | 1218 | [[package]] 1219 | name = "wasm-bindgen-macro-support" 1220 | version = "0.2.92" 1221 | source = "registry+https://github.com/rust-lang/crates.io-index" 1222 | checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" 1223 | dependencies = [ 1224 | "proc-macro2", 1225 | "quote", 1226 | "syn 2.0.72", 1227 | "wasm-bindgen-backend", 1228 | "wasm-bindgen-shared", 1229 | ] 1230 | 1231 | [[package]] 1232 | name = "wasm-bindgen-shared" 1233 | version = "0.2.92" 1234 | source = "registry+https://github.com/rust-lang/crates.io-index" 1235 | checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" 1236 | 1237 | [[package]] 1238 | name = "web-sys" 1239 | version = "0.3.69" 1240 | source = "registry+https://github.com/rust-lang/crates.io-index" 1241 | checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" 1242 | dependencies = [ 1243 | "js-sys", 1244 | "wasm-bindgen", 1245 | ] 1246 | 1247 | [[package]] 1248 | name = "which" 1249 | version = "4.4.2" 1250 | source = "registry+https://github.com/rust-lang/crates.io-index" 1251 | checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" 1252 | dependencies = [ 1253 | "either", 1254 | "home", 1255 | "once_cell", 1256 | "rustix", 1257 | ] 1258 | 1259 | [[package]] 1260 | name = "winapi" 1261 | version = "0.3.9" 1262 | source = "registry+https://github.com/rust-lang/crates.io-index" 1263 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1264 | dependencies = [ 1265 | "winapi-i686-pc-windows-gnu", 1266 | "winapi-x86_64-pc-windows-gnu", 1267 | ] 1268 | 1269 | [[package]] 1270 | name = "winapi-i686-pc-windows-gnu" 1271 | version = "0.4.0" 1272 | source = "registry+https://github.com/rust-lang/crates.io-index" 1273 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1274 | 1275 | [[package]] 1276 | name = "winapi-util" 1277 | version = "0.1.9" 1278 | source = "registry+https://github.com/rust-lang/crates.io-index" 1279 | checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" 1280 | dependencies = [ 1281 | "windows-sys 0.59.0", 1282 | ] 1283 | 1284 | [[package]] 1285 | name = "winapi-x86_64-pc-windows-gnu" 1286 | version = "0.4.0" 1287 | source = "registry+https://github.com/rust-lang/crates.io-index" 1288 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1289 | 1290 | [[package]] 1291 | name = "windows-sys" 1292 | version = "0.52.0" 1293 | source = "registry+https://github.com/rust-lang/crates.io-index" 1294 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1295 | dependencies = [ 1296 | "windows-targets", 1297 | ] 1298 | 1299 | [[package]] 1300 | name = "windows-sys" 1301 | version = "0.59.0" 1302 | source = "registry+https://github.com/rust-lang/crates.io-index" 1303 | checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" 1304 | dependencies = [ 1305 | "windows-targets", 1306 | ] 1307 | 1308 | [[package]] 1309 | name = "windows-targets" 1310 | version = "0.52.6" 1311 | source = "registry+https://github.com/rust-lang/crates.io-index" 1312 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 1313 | dependencies = [ 1314 | "windows_aarch64_gnullvm", 1315 | "windows_aarch64_msvc", 1316 | "windows_i686_gnu", 1317 | "windows_i686_gnullvm", 1318 | "windows_i686_msvc", 1319 | "windows_x86_64_gnu", 1320 | "windows_x86_64_gnullvm", 1321 | "windows_x86_64_msvc", 1322 | ] 1323 | 1324 | [[package]] 1325 | name = "windows_aarch64_gnullvm" 1326 | version = "0.52.6" 1327 | source = "registry+https://github.com/rust-lang/crates.io-index" 1328 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 1329 | 1330 | [[package]] 1331 | name = "windows_aarch64_msvc" 1332 | version = "0.52.6" 1333 | source = "registry+https://github.com/rust-lang/crates.io-index" 1334 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 1335 | 1336 | [[package]] 1337 | name = "windows_i686_gnu" 1338 | version = "0.52.6" 1339 | source = "registry+https://github.com/rust-lang/crates.io-index" 1340 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 1341 | 1342 | [[package]] 1343 | name = "windows_i686_gnullvm" 1344 | version = "0.52.6" 1345 | source = "registry+https://github.com/rust-lang/crates.io-index" 1346 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 1347 | 1348 | [[package]] 1349 | name = "windows_i686_msvc" 1350 | version = "0.52.6" 1351 | source = "registry+https://github.com/rust-lang/crates.io-index" 1352 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 1353 | 1354 | [[package]] 1355 | name = "windows_x86_64_gnu" 1356 | version = "0.52.6" 1357 | source = "registry+https://github.com/rust-lang/crates.io-index" 1358 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 1359 | 1360 | [[package]] 1361 | name = "windows_x86_64_gnullvm" 1362 | version = "0.52.6" 1363 | source = "registry+https://github.com/rust-lang/crates.io-index" 1364 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 1365 | 1366 | [[package]] 1367 | name = "windows_x86_64_msvc" 1368 | version = "0.52.6" 1369 | source = "registry+https://github.com/rust-lang/crates.io-index" 1370 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 1371 | 1372 | [[package]] 1373 | name = "zerocopy" 1374 | version = "0.7.35" 1375 | source = "registry+https://github.com/rust-lang/crates.io-index" 1376 | checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" 1377 | dependencies = [ 1378 | "byteorder", 1379 | "zerocopy-derive", 1380 | ] 1381 | 1382 | [[package]] 1383 | name = "zerocopy-derive" 1384 | version = "0.7.35" 1385 | source = "registry+https://github.com/rust-lang/crates.io-index" 1386 | checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" 1387 | dependencies = [ 1388 | "proc-macro2", 1389 | "quote", 1390 | "syn 2.0.72", 1391 | ] 1392 | 1393 | [[package]] 1394 | name = "zeroize" 1395 | version = "1.8.1" 1396 | source = "registry+https://github.com/rust-lang/crates.io-index" 1397 | checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" 1398 | dependencies = [ 1399 | "zeroize_derive", 1400 | ] 1401 | 1402 | [[package]] 1403 | name = "zeroize_derive" 1404 | version = "1.4.2" 1405 | source = "registry+https://github.com/rust-lang/crates.io-index" 1406 | checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" 1407 | dependencies = [ 1408 | "proc-macro2", 1409 | "quote", 1410 | "syn 2.0.72", 1411 | ] 1412 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "poly-bind-bench" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | ark-bn254 = "0.4.0" 8 | ark-ff = "0.4.2" 9 | ark-std = "0.4.0" 10 | rayon = "1.10.0" 11 | tracing-subscriber = "0.3.18" 12 | tracing-texray = "0.2.0" 13 | tracing = "0.1.40" 14 | vectorized-fields = { git = "https://github.com/a16z/vectorized-fields.git" } 15 | 16 | [target.'cfg(feature = "gpu")'.dependencies] 17 | icicle-cuda-runtime = { git = "https://github.com/ingonyama-zk/icicle.git", tag = "v2.8.0" } 18 | icicle-core = { git = "https://github.com/ingonyama-zk/icicle.git", tag = "v2.8.0", features = ["arkworks"] } 19 | icicle-bn254 = { git = "https://github.com/ingonyama-zk/icicle.git", tag = "v2.8.0", features = ["arkworks"] } 20 | 21 | 22 | [features] 23 | gpu = [] 24 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod poly; 2 | pub mod sumcheck; 3 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | tracing_texray::init(); 3 | 4 | poly_bind_bench::sumcheck::bench::main(); 5 | } 6 | -------------------------------------------------------------------------------- /src/poly/gpu.rs: -------------------------------------------------------------------------------- 1 | use crate::poly::plain::DensePolynomial; 2 | use ark_bn254::Fr; 3 | use icicle_bn254::curve::ScalarField as GPUScalar; 4 | use icicle_bn254::polynomials::DensePolynomial as IngoPoly; 5 | use icicle_core::ntt::FieldImpl; 6 | use icicle_core::polynomials::UnivariatePolynomial; 7 | use icicle_core::traits::ArkConvertible; 8 | use icicle_cuda_runtime::memory::HostSlice; 9 | 10 | pub struct GPUPoly { 11 | pub poly: IngoPoly, 12 | pub len: usize, 13 | } 14 | 15 | impl GPUPoly { 16 | pub fn new(z: Vec) -> Self { 17 | IngoPoly::init_cuda_backend(); 18 | let z: Vec<_> = z 19 | .into_iter() 20 | .map(|item| GPUScalar::from_ark(item)) 21 | .collect(); 22 | let slice = HostSlice::from_slice(&z); 23 | let poly = IngoPoly::from_coeffs(slice, z.len()); 24 | Self { poly, len: z.len() } 25 | } 26 | 27 | pub fn bound_poly_var_bot(&mut self, r: &Fr) { 28 | self.len /= 2; 29 | 30 | let even = self.poly.even(); 31 | let odd = self.poly.odd(); 32 | let mut m_poly = &odd - &even; 33 | let r_gpu = GPUScalar::from_ark(r.to_owned()); 34 | m_poly = &r_gpu * &m_poly; 35 | let result = &even + &m_poly; 36 | self.poly = result; 37 | } 38 | 39 | pub fn bound_poly_var_top(&mut self, r: &Fr) { 40 | self.len /= 2; 41 | 42 | let low = self.poly.slice(0, 1, self.len as u64); 43 | let high = self.poly.slice(self.len as u64, 1, self.len as u64); 44 | let mut m_poly = &high - &low; 45 | let r_gpu = GPUScalar::from_ark(r.to_owned()); 46 | m_poly = &r_gpu * &m_poly; 47 | let result = &low + &m_poly; 48 | self.poly = result; 49 | } 50 | 51 | pub fn to_ark(self) -> DensePolynomial { 52 | let mut host_vals: Vec = vec![GPUScalar::zero(); self.len]; 53 | let host_slice = HostSlice::from_mut_slice(&mut host_vals); 54 | self.poly.copy_coeffs(0, host_slice); 55 | DensePolynomial::new(host_vals.into_iter().map(|item| item.to_ark()).collect()) 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/poly/mod.rs: -------------------------------------------------------------------------------- 1 | #[cfg(feature = "gpu")] 2 | pub mod gpu; 3 | pub mod plain; 4 | -------------------------------------------------------------------------------- /src/poly/plain.rs: -------------------------------------------------------------------------------- 1 | use ark_ff::PrimeField; 2 | use ark_std::test_rng; 3 | use rayon::prelude::*; 4 | 5 | #[derive(Clone, Debug, PartialEq, Eq)] 6 | pub struct DensePolynomial { 7 | pub Z: Vec, 8 | } 9 | 10 | impl DensePolynomial { 11 | pub fn new(z: Vec) -> Self { 12 | assert!( 13 | is_power_of_two(z.len()), 14 | "Dense multi-linear polynomials must be made from a power of 2 (not {})", 15 | z.len() 16 | ); 17 | 18 | DensePolynomial { Z: z } 19 | } 20 | 21 | pub fn bound_poly_var_top(&mut self, r: &F) { 22 | let n = self.Z.len() / 2; 23 | let (left, right) = self.Z.split_at_mut(n); 24 | 25 | left.par_iter_mut() 26 | .zip(right.par_iter()) 27 | .for_each(|(a, b)| { 28 | *a += *r * (*b - *a); 29 | }); 30 | 31 | self.Z.truncate(n); 32 | } 33 | 34 | pub fn bound_poly_var_top_par(&mut self, r: &F) { 35 | let n = self.Z.len() / 2; 36 | let (left, right) = self.Z.split_at_mut(n); 37 | 38 | left.par_iter_mut() 39 | .zip(right.par_iter()) 40 | .for_each(|(a, b)| { 41 | *a += *r * (*b - *a); 42 | }); 43 | 44 | self.Z.truncate(n); 45 | } 46 | 47 | pub fn bound_poly_var_bot(&mut self, r: &F) { 48 | let n = self.Z.len() / 2; 49 | for i in 0..n { 50 | self.Z[i] = self.Z[2 * i] + *r * (self.Z[2 * i + 1] - self.Z[2 * i]); 51 | } 52 | self.Z.truncate(n); 53 | } 54 | } 55 | 56 | impl std::ops::Index for DensePolynomial { 57 | type Output = F; 58 | 59 | #[inline(always)] 60 | fn index(&self, _index: usize) -> &F { 61 | &(self.Z[_index]) 62 | } 63 | } 64 | 65 | pub fn rand_vec(n: usize) -> Vec { 66 | assert!(is_power_of_two(n)); 67 | 68 | let mut result: Vec = Vec::with_capacity(n); 69 | let mut rng = test_rng(); 70 | for _ in 0..n { 71 | result.push(F::rand(&mut rng)); 72 | } 73 | 74 | result 75 | } 76 | 77 | pub fn rand_fr() -> F { 78 | let mut rng = test_rng(); 79 | F::rand(&mut rng) 80 | } 81 | 82 | /// Checks if `num` is a power of 2. 83 | pub fn is_power_of_two(num: usize) -> bool { 84 | num != 0 && (num & (num - 1)) == 0 85 | } 86 | -------------------------------------------------------------------------------- /src/sumcheck/gpu.rs: -------------------------------------------------------------------------------- 1 | use crate::poly::gpu::GPUPoly; 2 | use crate::sumcheck::CubicSumcheck; 3 | use ark_bn254::Fr; 4 | use icicle_bn254::polynomials::DensePolynomial as IngoPoly; 5 | use icicle_core::polynomials::UnivariatePolynomial; 6 | use icicle_core::traits::ArkConvertible; 7 | use icicle_core::vec_ops::mul_scalars; 8 | use icicle_core::vec_ops::VecOpsConfig; 9 | use icicle_cuda_runtime::memory::DeviceVec; 10 | 11 | pub struct GPUSumcheck { 12 | eq: GPUPoly, 13 | a: GPUPoly, 14 | b: GPUPoly, 15 | } 16 | 17 | // #[tracing::instrument(skip_all)] 18 | fn split(poly: &IngoPoly, len: usize) -> (IngoPoly, IngoPoly) { 19 | let n = len / 2; 20 | let low = poly.slice(0, 1, n as u64); 21 | let high = poly.slice(n as u64, 1, n as u64); 22 | (low, high) 23 | } 24 | 25 | // #[tracing::instrument(skip_all)] 26 | fn sum_poly(poly: &IngoPoly, len: usize) -> Fr { 27 | if len == 1 { 28 | let gpu_scalar = poly.get_coeff(0); 29 | gpu_scalar.to_ark() 30 | } else { 31 | let (low, high) = split(poly, len); 32 | let len = len / 2; 33 | let half = &low + &high; 34 | return sum_poly(&half, len); 35 | } 36 | } 37 | 38 | impl CubicSumcheck for GPUSumcheck { 39 | fn new(eq: Vec, a: Vec, b: Vec) -> Self { 40 | let eq = GPUPoly::new(eq); 41 | let a = GPUPoly::new(a); 42 | let b = GPUPoly::new(b); 43 | 44 | Self { eq, a, b } 45 | } 46 | 47 | // TODO(sragss): This is likely going to be slow as shit depending on how .even and .odd are implemented. 48 | // low + r * (high - low) 49 | #[tracing::instrument(skip_all)] 50 | fn eval_cubic_top(&mut self) -> (Fr, Fr, Fr, Fr) { 51 | assert_eq!(self.eq.len, self.a.len); 52 | assert_eq!(self.a.len, self.b.len); 53 | let n = self.eq.len / 2; 54 | 55 | let (mut eq_low, mut eq_high) = split(&self.eq.poly, self.eq.len); 56 | let (mut a_low, mut a_high) = split(&self.a.poly, self.a.len); 57 | let (mut b_low, mut b_high) = split(&self.b.poly, self.b.len); 58 | 59 | let cfg = VecOpsConfig::default(); 60 | 61 | let mut buff = DeviceVec::cuda_malloc(n).unwrap(); 62 | let mut buff_2 = DeviceVec::cuda_malloc(n).unwrap(); 63 | 64 | let mut prod_3_sum = |a: &mut IngoPoly, b: &mut IngoPoly, c: &mut IngoPoly| -> Fr { 65 | let span = tracing::info_span!("prod_3_sum"); 66 | let _enter = span.enter(); 67 | let span_mul1 = tracing::info_span!("mul_scalars_1"); 68 | let _enter_mul1 = span_mul1.enter(); 69 | mul_scalars( 70 | a.coeffs_mut_slice(), 71 | b.coeffs_mut_slice(), 72 | &mut buff[..], 73 | &cfg, 74 | ) 75 | .unwrap(); 76 | drop(_enter_mul1); 77 | drop(span_mul1); 78 | 79 | let span_mul2 = tracing::info_span!("mul_scalars_2"); 80 | let _enter_mul2 = span_mul2.enter(); 81 | mul_scalars(&buff[..], c.coeffs_mut_slice(), &mut buff_2[..], &cfg).unwrap(); 82 | drop(_enter_mul2); 83 | drop(span_mul2); 84 | 85 | let poly = IngoPoly::from_coeffs(&buff_2[..], n); 86 | 87 | let span_sum = tracing::info_span!("sum_poly"); 88 | let _enter_sum = span_sum.enter(); 89 | let result = sum_poly(&poly, n); 90 | drop(_enter_sum); 91 | result 92 | }; 93 | 94 | let eval_0 = prod_3_sum(&mut eq_low, &mut a_low, &mut b_low); 95 | let eval_1 = prod_3_sum(&mut eq_high, &mut a_high, &mut b_high); 96 | 97 | let eq_m = &eq_high - &eq_low; 98 | let a_m = &a_high - &a_low; 99 | let b_m = &b_high - &b_low; 100 | 101 | let mut eq_2 = &eq_high + &eq_m; 102 | let mut a_2 = &a_high + &a_m; 103 | let mut b_2 = &b_high + &b_m; 104 | 105 | let eval_2 = prod_3_sum(&mut eq_2, &mut a_2, &mut b_2); 106 | 107 | let mut eq_3 = &eq_2 + &eq_m; 108 | let mut a_3 = &a_2 + &a_m; 109 | let mut b_3 = &b_2 + &b_m; 110 | 111 | let eval_3 = prod_3_sum(&mut eq_3, &mut a_3, &mut b_3); 112 | 113 | (eval_0, eval_1, eval_2, eval_3) 114 | } 115 | 116 | #[tracing::instrument(skip_all)] 117 | fn bind_top(&mut self, r: &Fr) { 118 | self.eq.bound_poly_var_top(&r); 119 | self.a.bound_poly_var_top(&r); 120 | self.b.bound_poly_var_top(&r); 121 | } 122 | } 123 | 124 | #[cfg(test)] 125 | mod tests { 126 | use super::*; 127 | use ark_bn254::Fr; 128 | 129 | #[test] 130 | fn sum() { 131 | let evals = vec![Fr::from(12), Fr::from(13), Fr::from(14), Fr::from(15)]; 132 | let poly = GPUPoly::new(evals); 133 | let result = sum_poly(&poly.poly, 4); 134 | 135 | assert_eq!(result, Fr::from(54)); 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /src/sumcheck/mod.rs: -------------------------------------------------------------------------------- 1 | use ark_bn254::Fr; 2 | use rayon::prelude::*; 3 | 4 | #[cfg(feature = "gpu")] 5 | pub mod gpu; 6 | pub mod plain; 7 | pub mod simd; 8 | 9 | #[derive(Clone, Debug, PartialEq, Eq)] 10 | struct CubicSumcheckProof { 11 | round_polys: Vec<(Fr, Fr, Fr, Fr)>, 12 | rs: Vec, 13 | } 14 | 15 | impl CubicSumcheckProof { 16 | fn fiat_shamir(round_poly: (Fr, Fr, Fr, Fr)) -> Fr { 17 | (round_poly.0 * round_poly.1 * round_poly.2 * round_poly.3 + Fr::from(13)) * Fr::from(29) 18 | } 19 | 20 | /// Evaluates the univariate polynomial as specified by its evaluations over [0, ... 3] 21 | /// at a new point 'r' using Lagrange interpolation. 22 | /// 23 | /// evals: f(0), f(1), f(2), f(3) 24 | /// r: f(r) 25 | fn eval_uni(evals: (Fr, Fr, Fr, Fr), r: &Fr) -> Fr { 26 | let (f0, f1, f2, f3) = evals; 27 | 28 | let l0 = (*r - Fr::from(1)) * (*r - Fr::from(2)) * (*r - Fr::from(3)) 29 | / ((Fr::from(0) - Fr::from(1)) 30 | * (Fr::from(0) - Fr::from(2)) 31 | * (Fr::from(0) - Fr::from(3))); 32 | let l1 = (*r - Fr::from(0)) * (*r - Fr::from(2)) * (*r - Fr::from(3)) 33 | / ((Fr::from(1) - Fr::from(0)) 34 | * (Fr::from(1) - Fr::from(2)) 35 | * (Fr::from(1) - Fr::from(3))); 36 | let l2 = (*r - Fr::from(0)) * (*r - Fr::from(1)) * (*r - Fr::from(3)) 37 | / ((Fr::from(2) - Fr::from(0)) 38 | * (Fr::from(2) - Fr::from(1)) 39 | * (Fr::from(2) - Fr::from(3))); 40 | let l3 = (*r - Fr::from(0)) * (*r - Fr::from(1)) * (*r - Fr::from(2)) 41 | / ((Fr::from(3) - Fr::from(0)) 42 | * (Fr::from(3) - Fr::from(1)) 43 | * (Fr::from(3) - Fr::from(2))); 44 | 45 | f0 * l0 + f1 * l1 + f2 * l2 + f3 * l3 46 | } 47 | 48 | /// returns a claim 49 | fn verify(&self, claim: &Fr) -> Fr { 50 | let num_rounds = self.round_polys.len(); 51 | assert_eq!(self.rs.len(), num_rounds); 52 | 53 | let mut prev_claim: Fr = claim.to_owned(); 54 | 55 | let mut v_rs = Vec::with_capacity(num_rounds); 56 | 57 | for i in 0..num_rounds { 58 | let round_poly = self.round_polys[i]; 59 | assert_eq!(round_poly.0 + round_poly.1, prev_claim, "Round {i}"); 60 | let r = Self::fiat_shamir(round_poly); 61 | v_rs.push(r); 62 | prev_claim = Self::eval_uni(round_poly, &r); 63 | } 64 | 65 | assert_eq!(v_rs, self.rs); 66 | 67 | prev_claim 68 | } 69 | } 70 | 71 | trait CubicSumcheck { 72 | fn new(eq: Vec, a: Vec, b: Vec) -> Self; 73 | fn eval_cubic_top(&mut self) -> (Fr, Fr, Fr, Fr); 74 | fn bind_top(&mut self, r: &Fr); 75 | 76 | #[tracing::instrument(skip_all)] 77 | fn sumcheck_top(&mut self, num_rounds: usize) -> CubicSumcheckProof { 78 | let mut round_polys = Vec::with_capacity(num_rounds); 79 | let mut rs = Vec::with_capacity(num_rounds); 80 | 81 | for round in 0..num_rounds { 82 | let start_time = std::time::Instant::now(); 83 | 84 | let evals = self.eval_cubic_top(); 85 | 86 | round_polys.push(evals); 87 | let r = CubicSumcheckProof::fiat_shamir(evals); 88 | rs.push(r); 89 | 90 | self.bind_top(&r); 91 | 92 | let duration = start_time.elapsed(); 93 | println!("Round {}: {:?}", round, duration); 94 | } 95 | 96 | CubicSumcheckProof { round_polys, rs } 97 | } 98 | } 99 | 100 | pub mod bench { 101 | use bench::simd::SIMDSumcheck; 102 | 103 | use super::*; 104 | #[cfg(feature = "gpu")] 105 | use crate::sumcheck::gpu::GPUSumcheck; 106 | use crate::sumcheck::plain::PlainSumcheck; 107 | use std::time::Instant; 108 | 109 | pub fn main() { 110 | let log_size = 28; 111 | let size = 1 << log_size; 112 | let mut evals = Vec::with_capacity(size); 113 | 114 | for i in 0..size { 115 | evals.push(Fr::from(i as u64)); 116 | } 117 | 118 | let claim: Fr = evals.par_iter().map(|eval| eval * eval * eval).sum(); 119 | 120 | let mut plain = PlainSumcheck::new(evals.clone(), evals.clone(), evals.clone()); 121 | let start_plain = Instant::now(); 122 | let plain_proof = plain.sumcheck_top(log_size); 123 | let duration_plain = start_plain.elapsed(); 124 | println!("PlainSumcheck: {:?}\n\n", duration_plain); 125 | 126 | // SIMD 127 | let mut simd = SIMDSumcheck::new(evals.clone(), evals.clone(), evals.clone()); 128 | let start_simd = Instant::now(); 129 | tracing_texray::examine(tracing::info_span!("simd_sumcheck")).in_scope(|| { 130 | let simd_proof = simd.sumcheck_top(log_size); 131 | 132 | assert_eq!(plain_proof, simd_proof); 133 | }); 134 | let duration_simd = start_simd.elapsed(); 135 | println!("SIMDSumcheck: {:?}", duration_simd); 136 | 137 | #[cfg(feature = "gpu")] 138 | { 139 | let mut gpu = GPUSumcheck::new(evals.clone(), evals.clone(), evals.clone()); 140 | let start_gpu = Instant::now(); 141 | tracing_texray::examine(tracing::info_span!("gpu_sumcheck")).in_scope(|| { 142 | let gpu_proof = gpu.sumcheck_top(log_size); 143 | 144 | assert_eq!(plain_proof, gpu_proof); 145 | }); 146 | let duration_gpu = start_gpu.elapsed(); 147 | println!("GPUSumcheck: {:?}", duration_gpu); 148 | } 149 | 150 | plain_proof.verify(&claim); 151 | } 152 | } 153 | 154 | #[cfg(test)] 155 | mod tests { 156 | use super::*; 157 | #[cfg(feature = "gpu")] 158 | use crate::poly::gpu::GPUPoly; 159 | use crate::poly::plain::DensePolynomial; 160 | #[cfg(feature = "gpu")] 161 | use crate::sumcheck::gpu::GPUSumcheck; 162 | use crate::sumcheck::plain::PlainSumcheck; 163 | 164 | #[test] 165 | fn plain_sumcheck() { 166 | let eq = vec![Fr::from(12), Fr::from(13), Fr::from(14), Fr::from(15)]; 167 | let a = eq.clone(); 168 | let b = eq.clone(); 169 | 170 | let claim: Fr = (0..eq.len()).into_iter().map(|i| eq[i] * a[i] * b[i]).sum(); 171 | 172 | let mut plain = PlainSumcheck::new(eq, a, b); 173 | let proof = plain.sumcheck_top(2); 174 | proof.verify(&claim); 175 | } 176 | 177 | #[cfg(feature = "gpu")] 178 | #[test] 179 | fn gpu_sumcheck() { 180 | let eq = vec![Fr::from(12), Fr::from(13), Fr::from(14), Fr::from(15)]; 181 | let a = eq.clone(); 182 | let b = eq.clone(); 183 | 184 | let claim: Fr = (0..eq.len()).into_iter().map(|i| eq[i] * a[i] * b[i]).sum(); 185 | 186 | let mut sumcheck = GPUSumcheck::new(eq, a, b); 187 | let proof = sumcheck.sumcheck_top(2); 188 | proof.verify(&claim); 189 | } 190 | 191 | #[cfg(feature = "gpu")] 192 | #[test] 193 | fn gpu_bind_bot() { 194 | let evals = vec![ 195 | Fr::from(11), 196 | Fr::from(12), 197 | Fr::from(13), 198 | Fr::from(14), 199 | Fr::from(15), 200 | Fr::from(16), 201 | Fr::from(17), 202 | Fr::from(18), 203 | ]; 204 | let mut poly = DensePolynomial::new(evals.clone()); 205 | let mut gpu_poly = GPUPoly::new(evals); 206 | 207 | let r = Fr::from(20); 208 | 209 | poly.bound_poly_var_bot(&r); 210 | gpu_poly.bound_poly_var_bot(&r); 211 | assert_eq!(poly, gpu_poly.to_ark()); 212 | } 213 | 214 | #[cfg(feature = "gpu")] 215 | #[test] 216 | fn gpu_bind_top() { 217 | let evals = vec![ 218 | Fr::from(11), 219 | Fr::from(12), 220 | Fr::from(13), 221 | Fr::from(14), 222 | Fr::from(15), 223 | Fr::from(16), 224 | Fr::from(17), 225 | Fr::from(18), 226 | ]; 227 | let mut poly = DensePolynomial::new(evals.clone()); 228 | let mut gpu_poly = GPUPoly::new(evals); 229 | 230 | let r = Fr::from(20); 231 | 232 | poly.bound_poly_var_top(&r); 233 | gpu_poly.bound_poly_var_top(&r); 234 | assert_eq!(poly, gpu_poly.to_ark()); 235 | } 236 | 237 | #[cfg(feature = "gpu")] 238 | #[test] 239 | fn eval_cubic_top_parity() { 240 | let evals = vec![ 241 | Fr::from(11), 242 | Fr::from(12), 243 | Fr::from(13), 244 | Fr::from(14), 245 | Fr::from(15), 246 | Fr::from(16), 247 | Fr::from(17), 248 | Fr::from(18), 249 | ]; 250 | let mut plain_sumcheck = PlainSumcheck::new(evals.clone(), evals.clone(), evals.clone()); 251 | let mut gpu_sumcheck = GPUSumcheck::new(evals.clone(), evals.clone(), evals.clone()); 252 | 253 | let plain_res = plain_sumcheck.eval_cubic_top(); 254 | let gpu_res = gpu_sumcheck.eval_cubic_top(); 255 | 256 | assert_eq!(plain_res, gpu_res); 257 | } 258 | } 259 | -------------------------------------------------------------------------------- /src/sumcheck/plain.rs: -------------------------------------------------------------------------------- 1 | use crate::poly::plain::DensePolynomial; 2 | use crate::sumcheck::CubicSumcheck; 3 | use ark_bn254::Fr; 4 | use ark_std::Zero; 5 | use rayon::prelude::*; 6 | 7 | pub struct PlainSumcheck { 8 | eq: DensePolynomial, 9 | a: DensePolynomial, 10 | b: DensePolynomial, 11 | } 12 | 13 | impl CubicSumcheck for PlainSumcheck { 14 | fn new(eq: Vec, a: Vec, b: Vec) -> Self { 15 | let eq = DensePolynomial::new(eq); 16 | let a = DensePolynomial::new(a); 17 | let b = DensePolynomial::new(b); 18 | 19 | Self { eq, a, b } 20 | } 21 | 22 | fn eval_cubic_top(&mut self) -> (Fr, Fr, Fr, Fr) { 23 | let len = self.eq.Z.len(); 24 | assert_eq!(self.a.Z.len(), len); 25 | assert_eq!(self.b.Z.len(), len); 26 | let n = len / 2; 27 | 28 | // low + r * (high - low) 29 | let (eval_0, eval_1, eval_2, eval_3) = (0..n) 30 | .into_par_iter() 31 | .map(|i| { 32 | let low = i; 33 | let high = n + i; 34 | 35 | let eval_0: Fr = self.eq[low] * self.a[low] * self.b[low]; 36 | let eval_1: Fr = self.eq[high] * self.a[high] * self.b[high]; 37 | 38 | let eq_m: Fr = self.eq[high] - self.eq[low]; 39 | let a_m: Fr = self.a[high] - self.a[low]; 40 | let b_m: Fr = self.b[high] - self.b[low]; 41 | 42 | let eq_2 = self.eq[high] + eq_m; 43 | let a_2 = self.a[high] + a_m; 44 | let b_2 = self.b[high] + b_m; 45 | let eval_2 = eq_2 * a_2 * b_2; 46 | 47 | let eq_3 = eq_2 + eq_m; 48 | let a_3 = a_2 + a_m; 49 | let b_3 = b_2 + b_m; 50 | let eval_3 = eq_3 * a_3 * b_3; 51 | 52 | (eval_0, eval_1, eval_2, eval_3) 53 | }) 54 | .reduce( 55 | || (Fr::zero(), Fr::zero(), Fr::zero(), Fr::zero()), 56 | |a, b| (a.0 + b.0, a.1 + b.1, a.2 + b.2, a.3 + b.3), 57 | ); 58 | 59 | (eval_0, eval_1, eval_2, eval_3) 60 | } 61 | 62 | fn bind_top(&mut self, r: &Fr) { 63 | self.eq.bound_poly_var_top_par(r); 64 | self.a.bound_poly_var_top_par(r); 65 | self.b.bound_poly_var_top_par(r); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/sumcheck/simd.rs: -------------------------------------------------------------------------------- 1 | use crate::poly::plain::DensePolynomial; 2 | use crate::sumcheck::CubicSumcheck; 3 | use ark_bn254::Fr; 4 | use ark_ff::PrimeField; 5 | use ark_std::Zero; 6 | use rayon::prelude::*; 7 | 8 | pub struct SIMDPolynomial { 9 | pub Z: Vec, 10 | } 11 | 12 | impl SIMDPolynomial { 13 | pub fn bound_poly_var_top_par(&mut self, r: &Fr) { 14 | let n = self.Z.len() / 2; 15 | let (left, right) = self.Z.split_at_mut(n); 16 | 17 | use vectorized_fields::*; 18 | 19 | let rayon_threads = rayon::current_num_threads(); 20 | let chunk_size = (n / rayon_threads / 16) + 2; // Non-zero + better work-stealing 21 | let chunk_size = std::cmp::min(chunk_size, 512); 22 | 23 | let r = vec![r.clone(); chunk_size]; 24 | left.par_chunks_mut(chunk_size) 25 | .zip(right.par_chunks_mut(chunk_size)) 26 | .for_each(|(left_chunk, right_chunk)| { 27 | let chunk_size = left_chunk.len(); 28 | 29 | sub_vec_inplace_bn254(right_chunk, left_chunk); 30 | mul_vec_inplace_bn254(right_chunk, &r[..chunk_size]); 31 | add_vec_inplace_bn254(left_chunk, right_chunk); 32 | }); 33 | 34 | self.Z.truncate(n); 35 | } 36 | } 37 | 38 | pub struct SIMDSumcheck { 39 | eq: SIMDPolynomial, 40 | a: SIMDPolynomial, 41 | b: SIMDPolynomial, 42 | } 43 | 44 | impl CubicSumcheck for SIMDSumcheck { 45 | fn new(eq: Vec, a: Vec, b: Vec) -> Self { 46 | let eq = SIMDPolynomial { Z: eq }; 47 | let a = SIMDPolynomial { Z: a }; 48 | let b = SIMDPolynomial { Z: b }; 49 | 50 | Self { eq, a, b } 51 | } 52 | 53 | #[tracing::instrument(skip_all)] 54 | fn eval_cubic_top(&mut self) -> (Fr, Fr, Fr, Fr) { 55 | let len = self.eq.Z.len(); 56 | assert_eq!(self.a.Z.len(), len); 57 | assert_eq!(self.b.Z.len(), len); 58 | let n = len / 2; 59 | 60 | use vectorized_fields::*; 61 | 62 | let rayon_threads = rayon::current_num_threads(); 63 | let chunk_size = (n / rayon_threads / 32) + 2; // Non-zero + better work-stealing 64 | let chunk_size = std::cmp::min(chunk_size, 512); 65 | let (eq_low, eq_high) = self.eq.Z.split_at(n); 66 | let (a_low, a_high) = self.a.Z.split_at(n); 67 | let (b_low, b_high) = self.b.Z.split_at(n); 68 | 69 | let (eval_0, eval_1, eval_2, eval_3) = eq_low 70 | .par_chunks(chunk_size) 71 | .zip(eq_high.par_chunks(chunk_size)) 72 | .zip(a_low.par_chunks(chunk_size)) 73 | .zip(a_high.par_chunks(chunk_size)) 74 | .zip(b_low.par_chunks(chunk_size)) 75 | .zip(b_high.par_chunks(chunk_size)) 76 | .map(|(((((eq_low, eq_high), a_low), a_high), b_low), b_high)| { 77 | let chunk_size = eq_low.len(); 78 | let mut buff = unsafe_alloc_vec(chunk_size); 79 | mul_vec_bn254(eq_low, a_low, &mut buff); 80 | let eval_0 = inner_product_bn254(&buff, b_low); 81 | mul_vec_bn254(eq_high, a_high, &mut buff); 82 | let eval_1 = inner_product_bn254(&buff, b_high); 83 | 84 | let mut eq_m = unsafe_alloc_vec(chunk_size); 85 | let mut a_m = unsafe_alloc_vec(chunk_size); 86 | let mut b_m = unsafe_alloc_vec(chunk_size); 87 | sub_vec_bn254(eq_high, eq_low, &mut eq_m); 88 | sub_vec_bn254(a_high, a_low, &mut a_m); 89 | sub_vec_bn254(b_high, b_low, &mut b_m); 90 | 91 | // 2 92 | let mut eq_2 = unsafe_alloc_vec(chunk_size); 93 | let mut a_2 = unsafe_alloc_vec(chunk_size); 94 | let mut b_2 = unsafe_alloc_vec(chunk_size); 95 | add_vec_bn254(&eq_high, &eq_m, &mut eq_2); 96 | add_vec_bn254(&a_high, &a_m, &mut a_2); 97 | add_vec_bn254(&b_high, &b_m, &mut b_2); 98 | mul_vec_bn254(&eq_2, &a_2, &mut buff); 99 | let eval_2 = inner_product_bn254(&buff, &b_2); 100 | 101 | // 3 102 | add_vec_inplace_bn254(&mut eq_2, &eq_m); 103 | add_vec_inplace_bn254(&mut a_2, &a_m); 104 | add_vec_inplace_bn254(&mut b_2, &b_m); 105 | mul_vec_inplace_bn254(&mut eq_2, &a_2); 106 | let eval_3 = inner_product_bn254(&eq_2, &b_2); 107 | 108 | (eval_0, eval_1, eval_2, eval_3) 109 | }) 110 | .reduce( 111 | || (Fr::zero(), Fr::zero(), Fr::zero(), Fr::zero()), 112 | |a, b| (a.0 + b.0, a.1 + b.1, a.2 + b.2, a.3 + b.3), 113 | ); 114 | 115 | (eval_0, eval_1, eval_2, eval_3) 116 | } 117 | 118 | #[tracing::instrument(skip_all)] 119 | fn bind_top(&mut self, r: &Fr) { 120 | rayon::join( 121 | || self.eq.bound_poly_var_top_par(r), 122 | || { 123 | rayon::join( 124 | || self.a.bound_poly_var_top_par(r), 125 | || self.b.bound_poly_var_top_par(r), 126 | ) 127 | }, 128 | ); 129 | } 130 | } 131 | 132 | #[tracing::instrument(skip_all)] 133 | pub fn unsafe_alloc_vec(size: usize) -> Vec { 134 | let mut vec = Vec::with_capacity(size); 135 | unsafe { 136 | vec.set_len(size); 137 | } 138 | vec 139 | } 140 | 141 | #[tracing::instrument(skip_all)] 142 | pub fn unsafe_allocate_zero_vec(size: usize) -> Vec { 143 | // https://stackoverflow.com/questions/59314686/how-to-efficiently-create-a-large-vector-of-items-initialized-to-the-same-value 144 | // Bulk allocate zeros, unsafely 145 | let result: Vec; 146 | unsafe { 147 | let layout = std::alloc::Layout::array::(size).unwrap(); 148 | let ptr = std::alloc::alloc_zeroed(layout) as *mut Fr; 149 | 150 | if ptr.is_null() { 151 | panic!("Zero vec allocation failed"); 152 | } 153 | 154 | result = Vec::from_raw_parts(ptr, size, size); 155 | } 156 | result 157 | } 158 | --------------------------------------------------------------------------------