Base sum gate (#7)

* initial version of base_sum_gate

* add recursive circuit benchmark files

* added step circuit data and contant gate test

* moved step testing data into gate_testing_utils

* added test case for basesum gate

* added test for arithmetic_gate
This commit is contained in:
Kevin Jue
2023-05-16 11:13:42 -07:00
committed by GitHub
parent 11f5ee28c6
commit a0d5ad37de
16 changed files with 76099 additions and 3 deletions

View File

@@ -0,0 +1,173 @@
{
"config": {
"num_wires": 135,
"num_routed_wires": 80,
"num_constants": 2,
"use_base_arithmetic_gate": true,
"security_bits": 100,
"num_challenges": 2,
"zero_knowledge": false,
"max_quotient_degree_factor": 8,
"fri_config": {
"rate_bits": 3,
"cap_height": 4,
"proof_of_work_bits": 16,
"reduction_strategy": {
"ConstantArityBits": [
4,
5
]
},
"num_query_rounds": 28
}
},
"fri_params": {
"config": {
"rate_bits": 3,
"cap_height": 4,
"proof_of_work_bits": 16,
"reduction_strategy": {
"ConstantArityBits": [
4,
5
]
},
"num_query_rounds": 28
},
"hiding": false,
"degree_bits": 12,
"reduction_arity_bits": [
4,
4
]
},
"gates": [
"NoopGate",
"PublicInputGate",
"BaseSumGate { num_limbs: 63 } + Base: 2",
"ReducingExtensionGate { num_coeffs: 32 }",
"ReducingGate { num_coeffs: 43 }",
"ArithmeticExtensionGate { num_ops: 10 }",
"ArithmeticGate { num_ops: 20 }",
"MulExtensionGate { num_ops: 13 }",
"RandomAccessGate { bits: 4, num_copies: 4, num_extra_constants: 2, _phantom: PhantomData<plonky2_field::goldilocks_field::GoldilocksField> }<D=2>",
"CosetInterpolationGate { subgroup_bits: 4, degree: 6, barycentric_weights: [17293822565076172801, 18374686475376656385, 18446744069413535745, 281474976645120, 17592186044416, 256, 18446744000695107601, 18446744065119617025, 1152921504338411520, 72057594037927936, 1048576, 18446462594437939201, 18446726477228539905, 18446744069414584065, 68719476720, 4294967296], _phantom: PhantomData<plonky2_field::goldilocks_field::GoldilocksField> }<D=2>",
"PoseidonGate(PhantomData<plonky2_field::goldilocks_field::GoldilocksField>)<WIDTH=12>"
],
"selectors_info": {
"selector_indices": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
2,
2
],
"groups": [
{
"start": 0,
"end": 6
},
{
"start": 6,
"end": 9
},
{
"start": 9,
"end": 11
}
]
},
"quotient_degree_factor": 8,
"num_gate_constraints": 123,
"num_constants": 5,
"num_public_inputs": 0,
"k_is": [
1,
7,
49,
343,
2401,
16807,
117649,
823543,
5764801,
40353607,
282475249,
1977326743,
13841287201,
96889010407,
678223072849,
4747561509943,
33232930569601,
232630513987207,
1628413597910449,
11398895185373143,
79792266297612001,
558545864083284007,
3909821048582988049,
8922003270666332022,
7113790686420571191,
12903046666114829695,
16534350385145470581,
5059988279530788141,
16973173887300932666,
8131752794619022736,
1582037354089406189,
11074261478625843323,
3732854072722565977,
7683234439643377518,
16889152938674473984,
7543606154233811962,
15911754940807515092,
701820169165099718,
4912741184155698026,
15942444219675301861,
916645121239607101,
6416515848677249707,
8022122801911579307,
814627405137302186,
5702391835961115302,
3023254712898638472,
2716038920875884983,
565528376716610560,
3958698637016273920,
9264146389699333119,
9508792519651578870,
11221315429317299127,
4762231727562756605,
14888878023524711914,
11988425817600061793,
10132004445542095267,
15583798910550913906,
16852872026783475737,
7289639770996824233,
14133990258148600989,
6704211459967285318,
10035992080941828584,
14911712358349047125,
12148266161370408270,
11250886851934520606,
4969231685883306958,
16337877731768564385,
3684679705892444769,
7346013871832529062,
14528608963998534792,
9466542400916821939,
10925564598174000610,
2691975909559666986,
397087297503084581,
2779611082521592067,
1010533508236560148,
7073734557655921036,
12622653764762278610,
14571600075677612986,
9767480182670369297
],
"num_partial_products": 9
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,140 @@
{
"constants_sigmas_cap": [
{
"elements": [
5792880812518408658,
2007865592137458435,
5118679776640867091,
13069431186724985571
]
},
{
"elements": [
620745627896223750,
11689482378865345226,
515625484560203909,
6594700411046985771
]
},
{
"elements": [
4288547219194413000,
13137436527356415412,
12622945773280822587,
650627082873761457
]
},
{
"elements": [
13506996103707830465,
8679821128676565111,
4223042913738287628,
9099197279443824593
]
},
{
"elements": [
14449575924890308633,
8733833351673036584,
16541374894852431819,
9332074455551145433
]
},
{
"elements": [
10076928807302913775,
3821138534617469739,
1717959071597020718,
17760656161674093717
]
},
{
"elements": [
2599426417611084017,
13871968726722310950,
1516291378797220061,
13799666340648349967
]
},
{
"elements": [
12663813165492321869,
14876506856106059016,
1242723042851988831,
2875934737469787816
]
},
{
"elements": [
17378423119286703930,
11222598627075744078,
9488528583590922099,
14157718813638267686
]
},
{
"elements": [
1071412395592558182,
18101728088624707784,
3182026360229291426,
14227530413232734538
]
},
{
"elements": [
726974142246132532,
15153315199262507247,
17940113059510197877,
16772587044853202303
]
},
{
"elements": [
12231534358502296703,
10511512947619127431,
16590010230992836643,
12522924984185338479
]
},
{
"elements": [
8037124124878150231,
7299067373190351508,
6928393757878692343,
14665216450327743533
]
},
{
"elements": [
8476349181260794151,
2992858515573144844,
12544833538408559347,
12322593314271890822
]
},
{
"elements": [
17452538538131258483,
16559982778748471691,
7832234514212696397,
7687737265950783860
]
},
{
"elements": [
5386649132465675374,
15880918294706587722,
12305658309516685089,
1973473830101720437
]
}
],
"circuit_digest": {
"elements": [
7986243079228529757,
6431975618990554147,
3826625528654889031,
10807866526356205171
]
}
}

View File

@@ -0,0 +1,172 @@
{
"config": {
"num_wires": 135,
"num_routed_wires": 80,
"num_constants": 2,
"use_base_arithmetic_gate": true,
"security_bits": 100,
"num_challenges": 2,
"zero_knowledge": false,
"max_quotient_degree_factor": 8,
"fri_config": {
"rate_bits": 3,
"cap_height": 4,
"proof_of_work_bits": 16,
"reduction_strategy": {
"ConstantArityBits": [
4,
5
]
},
"num_query_rounds": 2
}
},
"fri_params": {
"config": {
"rate_bits": 3,
"cap_height": 4,
"proof_of_work_bits": 16,
"reduction_strategy": {
"ConstantArityBits": [
4,
5
]
},
"num_query_rounds": 2
},
"hiding": false,
"degree_bits": 9,
"reduction_arity_bits": [
4
]
},
"gates": [
"NoopGate",
"ConstantGate { num_consts: 2 }",
"PublicInputGate",
"BaseSumGate { num_limbs: 63 } + Base: 2",
"ReducingExtensionGate { num_coeffs: 32 }",
"ReducingGate { num_coeffs: 43 }",
"ArithmeticExtensionGate { num_ops: 10 }",
"ArithmeticGate { num_ops: 20 }",
"MulExtensionGate { num_ops: 13 }",
"RandomAccessGate { bits: 4, num_copies: 4, num_extra_constants: 2, _phantom: PhantomData<plonky2_field::goldilocks_field::GoldilocksField> }<D=2>",
"PoseidonGate(PhantomData<plonky2_field::goldilocks_field::GoldilocksField>)<WIDTH=12>"
],
"selectors_info": {
"selector_indices": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1,
2
],
"groups": [
{
"start": 0,
"end": 6
},
{
"start": 6,
"end": 10
},
{
"start": 10,
"end": 11
}
]
},
"quotient_degree_factor": 8,
"num_gate_constraints": 123,
"num_constants": 5,
"num_public_inputs": 0,
"k_is": [
1,
7,
49,
343,
2401,
16807,
117649,
823543,
5764801,
40353607,
282475249,
1977326743,
13841287201,
96889010407,
678223072849,
4747561509943,
33232930569601,
232630513987207,
1628413597910449,
11398895185373143,
79792266297612001,
558545864083284007,
3909821048582988049,
8922003270666332022,
7113790686420571191,
12903046666114829695,
16534350385145470581,
5059988279530788141,
16973173887300932666,
8131752794619022736,
1582037354089406189,
11074261478625843323,
3732854072722565977,
7683234439643377518,
16889152938674473984,
7543606154233811962,
15911754940807515092,
701820169165099718,
4912741184155698026,
15942444219675301861,
916645121239607101,
6416515848677249707,
8022122801911579307,
814627405137302186,
5702391835961115302,
3023254712898638472,
2716038920875884983,
565528376716610560,
3958698637016273920,
9264146389699333119,
9508792519651578870,
11221315429317299127,
4762231727562756605,
14888878023524711914,
11988425817600061793,
10132004445542095267,
15583798910550913906,
16852872026783475737,
7289639770996824233,
14133990258148600989,
6704211459967285318,
10035992080941828584,
14911712358349047125,
12148266161370408270,
11250886851934520606,
4969231685883306958,
16337877731768564385,
3684679705892444769,
7346013871832529062,
14528608963998534792,
9466542400916821939,
10925564598174000610,
2691975909559666986,
397087297503084581,
2779611082521592067,
1010533508236560148,
7073734557655921036,
12622653764762278610,
14571600075677612986,
9767480182670369297
],
"num_partial_products": 9
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,140 @@
{
"constants_sigmas_cap": [
{
"elements": [
158845205314874220,
9668380905015929998,
1411954196422652535,
16261560315091018602
]
},
{
"elements": [
10819768878069205512,
10806329121382974236,
4449962652936030991,
3437130958683867731
]
},
{
"elements": [
13409308832792573752,
5142428395608775971,
8304804561534366563,
3333782371953158323
]
},
{
"elements": [
18228625912291347825,
10166925566614695203,
18158685652491144528,
5812383934966268838
]
},
{
"elements": [
9826807818157299303,
16982355347088639655,
9164194217012055587,
2807644941373961188
]
},
{
"elements": [
14310741273297755831,
12981827714166111968,
4530737992662289685,
18335773668219568846
]
},
{
"elements": [
7917966912899515534,
17667717333057450416,
952641997971486450,
428804504796282154
]
},
{
"elements": [
6150969121154358920,
8533162538572915310,
13902780732405127329,
10048329503515769882
]
},
{
"elements": [
17799006350046251788,
10571037994954145577,
16382491710544403234,
8887053452984223370
]
},
{
"elements": [
3963886065503765705,
2739764768577488879,
5343505536176223500,
9151432391854309795
]
},
{
"elements": [
4165310799113686308,
10915634867031695254,
5813235613342911366,
17907275021812350449
]
},
{
"elements": [
12954911538188629834,
6738667513261916639,
12025960525821021496,
3765915660295958137
]
},
{
"elements": [
15699732256890621800,
14355912053969064032,
9559845752177194786,
6008684051170164157
]
},
{
"elements": [
5973104887002336129,
15822297470108300955,
1285855046140391788,
8567304882129939594
]
},
{
"elements": [
531701086966465293,
13988001761158611208,
10640541520023034000,
12368315472470450606
]
},
{
"elements": [
16726108137472169650,
9400941780708454743,
2656080070909638220,
10262921538692249992
]
}
],
"circuit_digest": {
"elements": [
7291397556757192596,
149044718719699113,
14214393601687894808,
15901190186686913364
]
}
}

View File

@@ -0,0 +1,205 @@
{
"config": {
"num_wires": 136,
"num_routed_wires": 80,
"num_constants": 2,
"use_base_arithmetic_gate": true,
"security_bits": 100,
"num_challenges": 2,
"zero_knowledge": false,
"max_quotient_degree_factor": 8,
"fri_config": {
"rate_bits": 3,
"cap_height": 4,
"proof_of_work_bits": 16,
"reduction_strategy": {
"ConstantArityBits": [
4,
5
]
},
"num_query_rounds": 28
}
},
"fri_params": {
"config": {
"rate_bits": 3,
"cap_height": 4,
"proof_of_work_bits": 16,
"reduction_strategy": {
"ConstantArityBits": [
4,
5
]
},
"num_query_rounds": 28
},
"hiding": false,
"degree_bits": 21,
"reduction_arity_bits": [
4,
4,
4,
4
]
},
"gates": [
"NoopGate",
"ConstantGate { num_consts: 2 }",
"PublicInputGate",
"BaseSumGate { num_limbs: 32 } + Base: 2",
"BaseSumGate { num_limbs: 63 } + Base: 2",
"ArithmeticGate { num_ops: 20 }",
"RandomAccessGate { bits: 2, num_copies: 13, num_extra_constants: 2, _phantom: PhantomData<plonky2_field::goldilocks_field::GoldilocksField> }<D=2>",
"XOR3Gate { num_xors: 16 }",
"BaseSumGate { num_limbs: 16 } + Base: 4",
"ComparisonGate { num_bits: 32, num_chunks: 16, _phantom: PhantomData<plonky2_field::goldilocks_field::GoldilocksField> }<D=2>",
"U32AddManyGate { num_addends: 11, num_ops: 4, _phantom: PhantomData<plonky2_field::goldilocks_field::GoldilocksField> }",
"U32AddManyGate { num_addends: 13, num_ops: 4, _phantom: PhantomData<plonky2_field::goldilocks_field::GoldilocksField> }",
"U32AddManyGate { num_addends: 15, num_ops: 3, _phantom: PhantomData<plonky2_field::goldilocks_field::GoldilocksField> }",
"U32AddManyGate { num_addends: 16, num_ops: 3, _phantom: PhantomData<plonky2_field::goldilocks_field::GoldilocksField> }",
"U32AddManyGate { num_addends: 3, num_ops: 5, _phantom: PhantomData<plonky2_field::goldilocks_field::GoldilocksField> }",
"U32AddManyGate { num_addends: 5, num_ops: 5, _phantom: PhantomData<plonky2_field::goldilocks_field::GoldilocksField> }",
"U32AddManyGate { num_addends: 7, num_ops: 4, _phantom: PhantomData<plonky2_field::goldilocks_field::GoldilocksField> }",
"U32AddManyGate { num_addends: 9, num_ops: 4, _phantom: PhantomData<plonky2_field::goldilocks_field::GoldilocksField> }",
"U32ArithmeticGate { num_ops: 3, _phantom: PhantomData<plonky2_field::goldilocks_field::GoldilocksField> }",
"U32RangeCheckGate { num_input_limbs: 8, _phantom: PhantomData<plonky2_field::goldilocks_field::GoldilocksField> }",
"U32SubtractionGate { num_ops: 6, _phantom: PhantomData<plonky2_field::goldilocks_field::GoldilocksField> }",
"RandomAccessGate { bits: 4, num_copies: 4, num_extra_constants: 2, _phantom: PhantomData<plonky2_field::goldilocks_field::GoldilocksField> }<D=2>"
],
"selectors_info": {
"selector_indices": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1,
1,
2,
2,
2,
2,
2,
3,
3,
3,
3,
3,
4
],
"groups": [
{
"start": 0,
"end": 6
},
{
"start": 6,
"end": 11
},
{
"start": 11,
"end": 16
},
{
"start": 16,
"end": 21
},
{
"start": 21,
"end": 22
}
]
},
"quotient_degree_factor": 8,
"num_gate_constraints": 136,
"num_constants": 7,
"num_public_inputs": 0,
"k_is": [
1,
7,
49,
343,
2401,
16807,
117649,
823543,
5764801,
40353607,
282475249,
1977326743,
13841287201,
96889010407,
678223072849,
4747561509943,
33232930569601,
232630513987207,
1628413597910449,
11398895185373143,
79792266297612001,
558545864083284007,
3909821048582988049,
8922003270666332022,
7113790686420571191,
12903046666114829695,
16534350385145470581,
5059988279530788141,
16973173887300932666,
8131752794619022736,
1582037354089406189,
11074261478625843323,
3732854072722565977,
7683234439643377518,
16889152938674473984,
7543606154233811962,
15911754940807515092,
701820169165099718,
4912741184155698026,
15942444219675301861,
916645121239607101,
6416515848677249707,
8022122801911579307,
814627405137302186,
5702391835961115302,
3023254712898638472,
2716038920875884983,
565528376716610560,
3958698637016273920,
9264146389699333119,
9508792519651578870,
11221315429317299127,
4762231727562756605,
14888878023524711914,
11988425817600061793,
10132004445542095267,
15583798910550913906,
16852872026783475737,
7289639770996824233,
14133990258148600989,
6704211459967285318,
10035992080941828584,
14911712358349047125,
12148266161370408270,
11250886851934520606,
4969231685883306958,
16337877731768564385,
3684679705892444769,
7346013871832529062,
14528608963998534792,
9466542400916821939,
10925564598174000610,
2691975909559666986,
397087297503084581,
2779611082521592067,
1010533508236560148,
7073734557655921036,
12622653764762278610,
14571600075677612986,
9767480182670369297
],
"num_partial_products": 9
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,140 @@
{
"constants_sigmas_cap": [
{
"elements": [
9037422181318074482,
13844553280258601189,
14013690396566737561,
14600533186953608428
]
},
{
"elements": [
3891365497285560518,
6785071445101560305,
7146616719154245281,
8484433928946731576
]
},
{
"elements": [
15935467950899360740,
1041659913562170406,
11898906592313038819,
7940456224436700998
]
},
{
"elements": [
17420135248456983,
10686061014804565544,
17782021355470763205,
12726022340820773339
]
},
{
"elements": [
13322967402317526249,
12119892482906381301,
1483851501277040422,
17519911664522741561
]
},
{
"elements": [
3901474702590233137,
16494478574194405372,
3644962804006307872,
7967195830112920768
]
},
{
"elements": [
15532816309418050992,
11198055639421810456,
7449000032233257165,
6080646728225911938
]
},
{
"elements": [
7944791944524511304,
15470849481646525511,
11102721978231118523,
10011467322465036320
]
},
{
"elements": [
14679375199524381062,
9219647684485300612,
8902882543708912876,
6737676211275058717
]
},
{
"elements": [
15215848762718399329,
9538467614418882672,
7337952705707955964,
17932579689749986997
]
},
{
"elements": [
3111383469397480110,
17276616486884637185,
10511216595022742027,
3343575652946909638
]
},
{
"elements": [
2417848701164748156,
7846191940051381446,
4363725272084187306,
3143323624098735830
]
},
{
"elements": [
7639597922146523429,
14015537888097194053,
10449936634441844342,
3897071524048579556
]
},
{
"elements": [
12445360068819311840,
4910166437012489060,
9670875686931891121,
5569206524147441284
]
},
{
"elements": [
6965775890897127688,
14853930701622190781,
2643689027677976461,
1883768007952536249
]
},
{
"elements": [
6771363979354677578,
6567107174924251028,
15758449129319031800,
6619880945043941329
]
}
],
"circuit_digest": {
"elements": [
8574090053162898339,
2808971464690312489,
14807704193989191909,
14951686172889873386
]
}
}