@@ -542,48 +542,6 @@ impl<E: ExtensionField, PCS: PolynomialCommitmentScheme<E>> TowerProver<CpuBacke
542542impl < E : ExtensionField , PCS : PolynomialCommitmentScheme < E > > MainSumcheckProver < CpuBackend < E , PCS > >
543543 for CpuProver < CpuBackend < E , PCS > >
544544{
545- #[ allow( clippy:: type_complexity) ]
546- #[ tracing:: instrument( skip_all, name = "table_witness" , fields( profiling_3) , level = "trace" ) ]
547- fn table_witness < ' a > (
548- & self ,
549- input : & ProofInput < ' a , CpuBackend < <CpuBackend < E , PCS > as ProverBackend >:: E , PCS > > ,
550- cs : & ConstraintSystem < <CpuBackend < E , PCS > as ProverBackend >:: E > ,
551- challenges : & [ <CpuBackend < E , PCS > as ProverBackend >:: E ] ,
552- ) -> Vec < Arc < <CpuBackend < E , PCS > as ProverBackend >:: MultilinearPoly < ' a > > > {
553- // main constraint: lookup denominator and numerator record witness inference
554- let record_span = entered_span ! ( "record" ) ;
555- let records: Vec < ArcMultilinearExtension < ' _ , E > > = cs
556- . r_table_expressions
557- . par_iter ( )
558- . map ( |r| & r. expr )
559- . chain ( cs. r_expressions . par_iter ( ) )
560- . chain ( cs. w_table_expressions . par_iter ( ) . map ( |w| & w. expr ) )
561- . chain ( cs. w_expressions . par_iter ( ) )
562- . chain (
563- cs. lk_table_expressions
564- . par_iter ( )
565- . map ( |lk| & lk. multiplicity ) ,
566- )
567- . chain ( cs. lk_table_expressions . par_iter ( ) . map ( |lk| & lk. values ) )
568- . chain ( cs. lk_expressions . par_iter ( ) )
569- . map ( |expr| {
570- wit_infer_by_expr (
571- expr,
572- cs. num_witin ,
573- cs. num_structural_witin ,
574- cs. num_fixed as WitnessId ,
575- & input. fixed ,
576- & input. witness ,
577- & input. structural_witness ,
578- & input. public_input ,
579- challenges,
580- )
581- } )
582- . collect ( ) ;
583- exit_span ! ( record_span) ;
584- records
585- }
586-
587545 #[ allow( clippy:: type_complexity) ]
588546 #[ tracing:: instrument(
589547 skip_all,
@@ -637,24 +595,20 @@ impl<E: ExtensionField, PCS: PolynomialCommitmentScheme<E>> MainSumcheckProver<C
637595 // }
638596 // })
639597 // .collect_vec();
640- let pub_io_evals = // get public io evaluations
641- input. public_input
642- . iter ( ) . map ( |mle| {
643- match mle. evaluations ( ) {
644- FieldType :: Base ( smart_slice) => E :: from ( smart_slice[ 0 ] ) ,
645- FieldType :: Ext ( smart_slice) => smart_slice[ 0 ] ,
646- _ => unreachable ! ( ) ,
647- }
648- } )
649- . collect_vec ( ) ;
650- let filtered_pub_io_mle = cs
598+ let pub_io_mles = cs
651599 . instance_openings
652600 . iter ( )
653- . map ( |( id , _ ) | input. public_input [ id . 0 ] . clone ( ) )
601+ . map ( |instance | input. public_input [ instance . 0 ] . clone ( ) )
654602 . collect_vec ( ) ;
603+ println ! (
604+ "filtered_pub_io_mle len {} input.structural_witness {}" ,
605+ pub_io_mles. len( ) ,
606+ input. structural_witness. len( )
607+ ) ;
655608 let GKRProverOutput {
656609 gkr_proof,
657610 opening_evaluations,
611+ mut rt,
658612 } = gkr_circuit. prove :: < CpuBackend < E , PCS > , CpuProver < _ > > (
659613 num_threads,
660614 num_var_with_rotation,
@@ -664,21 +618,26 @@ impl<E: ExtensionField, PCS: PolynomialCommitmentScheme<E>> MainSumcheckProver<C
664618 & input. witness,
665619 & input. structural_witness,
666620 & input. fixed,
667- & filtered_pub_io_mle ,
621+ & pub_io_mles ,
668622 )
669623 . cloned( )
670624 . collect_vec( ) ,
671625 ) ] ,
672626 } ,
673627 // eval value doesnt matter as it wont be used by prover
674628 & vec ! [ PointAndEval :: new( rt_tower, E :: ZERO ) ; gkr_circuit. final_out_evals. len( ) ] ,
675- & pub_io_evals,
629+ & input
630+ . pub_io_evals
631+ . iter ( )
632+ . map ( |v| v. map_either ( E :: from, |v| v) . into_inner ( ) )
633+ . collect_vec ( ) ,
676634 challenges,
677635 transcript,
678636 num_instances,
679637 ) ?;
638+ assert_eq ! ( rt. len( ) , 1 , "TODO support multi-layer gkr iop" ) ;
680639 Ok ( (
681- opening_evaluations [ 0 ] . point . clone ( ) ,
640+ rt . remove ( 0 ) ,
682641 MainSumcheckEvals {
683642 wits_in_evals : opening_evaluations
684643 . iter ( )
@@ -688,7 +647,7 @@ impl<E: ExtensionField, PCS: PolynomialCommitmentScheme<E>> MainSumcheckProver<C
688647 . collect_vec ( ) ,
689648 fixed_in_evals : opening_evaluations
690649 . iter ( )
691- . skip ( ( cs. num_witin + cs . num_structural_witin ) as usize )
650+ . skip ( cs. num_witin as usize )
692651 . take ( cs. num_fixed )
693652 . map ( |Evaluation { value, .. } | value)
694653 . copied ( )
0 commit comments