Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove Ultra Grumpkin flavor #2825

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@ UltraVerifier_<Flavor> UltraComposer_<Flavor>::create_verifier(std::shared_ptr<I
}

template class UltraComposer_<honk::flavor::Ultra>;
template class UltraComposer_<honk::flavor::UltraGrumpkin>;
template class UltraComposer_<honk::flavor::GoblinUltra>;
} // namespace proof_system::honk
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,8 @@ template <UltraFlavor Flavor> class UltraComposer_ {
};
};
extern template class UltraComposer_<honk::flavor::Ultra>;
// TODO: the UltraGrumpkin flavor still works on BN254 because plookup needs to be templated to be able to construct
// Grumpkin circuits.
extern template class UltraComposer_<honk::flavor::UltraGrumpkin>;
extern template class UltraComposer_<honk::flavor::GoblinUltra>;
// TODO(#532): this pattern is weird; is this not instantiating the templates?
using UltraComposer = UltraComposer_<honk::flavor::Ultra>;
using UltraGrumpkinComposer = UltraComposer_<honk::flavor::UltraGrumpkin>;
using GoblinUltraComposer = UltraComposer_<honk::flavor::GoblinUltra>;
} // namespace proof_system::honk
Original file line number Diff line number Diff line change
Expand Up @@ -922,35 +922,4 @@ TEST_F(UltraHonkComposerTests, range_constraint_small_variable)
prove_and_verify(circuit_builder, composer, /*expected_result=*/true);
}

TEST(UltraGrumpkinHonkComposer, XorConstraint)
{
using fr = barretenberg::fr;
// NOTE: as a WIP, this test may not actually use the Grumpkin SRS (just the IPA PCS).

auto circuit_builder = proof_system::UltraCircuitBuilder();

uint32_t left_value = engine.get_random_uint32();
uint32_t right_value = engine.get_random_uint32();

fr left_witness_value = fr{ left_value, 0, 0, 0 }.to_montgomery_form();
fr right_witness_value = fr{ right_value, 0, 0, 0 }.to_montgomery_form();

uint32_t left_witness_index = circuit_builder.add_variable(left_witness_value);
uint32_t right_witness_index = circuit_builder.add_variable(right_witness_value);

uint32_t xor_result_expected = left_value ^ right_value;

const auto lookup_accumulators = plookup::get_lookup_accumulators(
plookup::MultiTableId::UINT32_XOR, left_witness_value, right_witness_value, true);
auto xor_result = lookup_accumulators[plookup::ColumnIdx::C3]
[0]; // The zeroth index in the 3rd column is the fully accumulated xor

EXPECT_EQ(xor_result, xor_result_expected);
circuit_builder.create_gates_from_plookup_accumulators(
plookup::MultiTableId::UINT32_XOR, lookup_accumulators, left_witness_index, right_witness_index);

barretenberg::srs::init_crs_factory("../srs_db/ignition");
auto composer = UltraGrumpkinComposer();
prove_and_verify(circuit_builder, composer, /*expected_result=*/true);
}
} // namespace test_ultra_honk_composer
406 changes: 0 additions & 406 deletions barretenberg/cpp/src/barretenberg/honk/flavor/ultra_grumpkin.hpp

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,6 @@ std::shared_ptr<typename Flavor::VerificationKey> ProverInstance_<Flavor>::compu
}

template class ProverInstance_<honk::flavor::Ultra>;
template class ProverInstance_<honk::flavor::UltraGrumpkin>;
template class ProverInstance_<honk::flavor::GoblinUltra>;

} // namespace proof_system::honk
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once
#include "barretenberg/honk/flavor/goblin_ultra.hpp"
#include "barretenberg/honk/flavor/ultra.hpp"
#include "barretenberg/honk/flavor/ultra_grumpkin.hpp"
#include "barretenberg/honk/proof_system/folding_result.hpp"
#include "barretenberg/proof_system/composer/composer_lib.hpp"
#include "barretenberg/proof_system/flavor/flavor.hpp"
Expand Down Expand Up @@ -96,7 +95,6 @@ template <class Flavor> class ProverInstance_ {
};

extern template class ProverInstance_<honk::flavor::Ultra>;
extern template class ProverInstance_<honk::flavor::UltraGrumpkin>;
extern template class ProverInstance_<honk::flavor::GoblinUltra>;

} // namespace proof_system::honk
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ template <class Flavor> class InstanceTests : public testing::Test {
};
};

using FlavorTypes = testing::Types<flavor::Ultra, flavor::UltraGrumpkin, flavor::GoblinUltra>;
using FlavorTypes = testing::Types<flavor::Ultra, flavor::GoblinUltra>;
TYPED_TEST_SUITE(InstanceTests, FlavorTypes);

TYPED_TEST(InstanceTests, SortedListAccumulator)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ template <typename Flavor> plonk::proof& MergeProver_<Flavor>::construct_proof()
}

template class MergeProver_<honk::flavor::Ultra>;
template class MergeProver_<honk::flavor::UltraGrumpkin>;
template class MergeProver_<honk::flavor::GoblinUltra>;

} // namespace proof_system::honk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include "barretenberg/honk/flavor/goblin_ultra.hpp"
#include "barretenberg/honk/flavor/ultra.hpp"
#include "barretenberg/honk/flavor/ultra_grumpkin.hpp"
#include "barretenberg/honk/pcs/claim.hpp"
#include "barretenberg/honk/transcript/transcript.hpp"
#include "barretenberg/plonk/proof_system/types/proof.hpp"
Expand Down Expand Up @@ -38,7 +37,6 @@ template <typename Flavor> class MergeProver_ {
};

extern template class MergeProver_<honk::flavor::Ultra>;
extern template class MergeProver_<honk::flavor::UltraGrumpkin>;
extern template class MergeProver_<honk::flavor::GoblinUltra>;

} // namespace proof_system::honk
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ template <typename Flavor> bool MergeVerifier_<Flavor>::verify_proof(const plonk
}

template class MergeVerifier_<honk::flavor::Ultra>;
template class MergeVerifier_<honk::flavor::UltraGrumpkin>;
template class MergeVerifier_<honk::flavor::GoblinUltra>;

} // namespace proof_system::honk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include "barretenberg/honk/flavor/goblin_ultra.hpp"
#include "barretenberg/honk/flavor/ultra.hpp"
#include "barretenberg/honk/flavor/ultra_grumpkin.hpp"
#include "barretenberg/honk/pcs/claim.hpp"
#include "barretenberg/honk/transcript/transcript.hpp"
#include "barretenberg/plonk/proof_system/types/proof.hpp"
Expand Down Expand Up @@ -36,7 +35,6 @@ template <typename Flavor> class MergeVerifier_ {
};

extern template class MergeVerifier_<honk::flavor::Ultra>;
extern template class MergeVerifier_<honk::flavor::UltraGrumpkin>;
extern template class MergeVerifier_<honk::flavor::GoblinUltra>;

} // namespace proof_system::honk
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,5 @@ ProverFoldingResult<typename ProverInstances::Flavor> ProtoGalaxyProver_<ProverI
return res;
}
template class ProtoGalaxyProver_<ProverInstances_<honk::flavor::Ultra, 2>>;
template class ProtoGalaxyProver_<ProverInstances_<honk::flavor::UltraGrumpkin, 2>>;
template class ProtoGalaxyProver_<ProverInstances_<honk::flavor::GoblinUltra, 2>>;
} // namespace proof_system::honk
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once
#include "barretenberg/honk/flavor/goblin_ultra.hpp"
#include "barretenberg/honk/flavor/ultra.hpp"
#include "barretenberg/honk/flavor/ultra_grumpkin.hpp"
#include "barretenberg/honk/instance/instances.hpp"
#include "barretenberg/honk/proof_system/folding_result.hpp"
#include "barretenberg/proof_system/flavor/flavor.hpp"
Expand All @@ -26,6 +25,5 @@ template <class ProverInstances> class ProtoGalaxyProver_ {
};

extern template class ProtoGalaxyProver_<ProverInstances_<honk::flavor::Ultra, 2>>;
extern template class ProtoGalaxyProver_<ProverInstances_<honk::flavor::UltraGrumpkin, 2>>;
extern template class ProtoGalaxyProver_<ProverInstances_<honk::flavor::GoblinUltra, 2>>;
} // namespace proof_system::honk
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@ VerifierFoldingResult<typename VerifierInstances::Flavor> ProtoGalaxyVerifier_<
}

template class ProtoGalaxyVerifier_<VerifierInstances_<honk::flavor::Ultra, 2>>;
template class ProtoGalaxyVerifier_<VerifierInstances_<honk::flavor::UltraGrumpkin, 2>>;
template class ProtoGalaxyVerifier_<VerifierInstances_<honk::flavor::GoblinUltra, 2>>;
} // namespace proof_system::honk
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once
#include "barretenberg/honk/flavor/goblin_ultra.hpp"
#include "barretenberg/honk/flavor/ultra.hpp"
#include "barretenberg/honk/flavor/ultra_grumpkin.hpp"
#include "barretenberg/honk/instance/instances.hpp"
#include "barretenberg/honk/proof_system/folding_result.hpp"
#include "barretenberg/honk/transcript/transcript.hpp"
Expand All @@ -25,6 +24,5 @@ template <class VerifierInstances> class ProtoGalaxyVerifier_ {
};

extern template class ProtoGalaxyVerifier_<VerifierInstances_<honk::flavor::Ultra, 2>>;
extern template class ProtoGalaxyVerifier_<VerifierInstances_<honk::flavor::UltraGrumpkin, 2>>;
extern template class ProtoGalaxyVerifier_<VerifierInstances_<honk::flavor::GoblinUltra, 2>>;
} // namespace proof_system::honk
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ template <UltraFlavor Flavor> plonk::proof& UltraProver_<Flavor>::construct_proo
}

template class UltraProver_<honk::flavor::Ultra>;
template class UltraProver_<honk::flavor::UltraGrumpkin>;
template class UltraProver_<honk::flavor::GoblinUltra>;

} // namespace proof_system::honk
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once
#include "barretenberg/honk/flavor/goblin_ultra.hpp"
#include "barretenberg/honk/flavor/ultra.hpp"
#include "barretenberg/honk/flavor/ultra_grumpkin.hpp"
#include "barretenberg/honk/instance/prover_instance.hpp"
#include "barretenberg/honk/pcs/zeromorph/zeromorph.hpp"
#include "barretenberg/honk/sumcheck/sumcheck_output.hpp"
Expand Down Expand Up @@ -56,7 +55,6 @@ template <UltraFlavor Flavor> class UltraProver_ {
};

extern template class UltraProver_<honk::flavor::Ultra>;
extern template class UltraProver_<honk::flavor::UltraGrumpkin>;
extern template class UltraProver_<honk::flavor::GoblinUltra>;

using UltraProver = UltraProver_<honk::flavor::Ultra>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ template <typename Flavor> bool UltraVerifier_<Flavor>::verify_proof(const plonk
}

template class UltraVerifier_<honk::flavor::Ultra>;
template class UltraVerifier_<honk::flavor::UltraGrumpkin>;
template class UltraVerifier_<honk::flavor::GoblinUltra>;

} // namespace proof_system::honk
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once
#include "barretenberg/honk/flavor/goblin_ultra.hpp"
#include "barretenberg/honk/flavor/ultra.hpp"
#include "barretenberg/honk/flavor/ultra_grumpkin.hpp"
#include "barretenberg/honk/sumcheck/sumcheck.hpp"
#include "barretenberg/plonk/proof_system/types/proof.hpp"

Expand All @@ -28,7 +27,6 @@ template <typename Flavor> class UltraVerifier_ {
};

extern template class UltraVerifier_<honk::flavor::Ultra>;
extern template class UltraVerifier_<honk::flavor::UltraGrumpkin>;
extern template class UltraVerifier_<honk::flavor::GoblinUltra>;

using UltraVerifier = UltraVerifier_<honk::flavor::Ultra>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1040,8 +1040,5 @@ template <typename FF> class UltraCircuitBuilder_ : public CircuitBuilderBase<ar
bool check_circuit();
};
extern template class UltraCircuitBuilder_<barretenberg::fr>;
// TODO: template plookup to be able to be able to have UltraCircuitBuilder on Grumpkin
// extern template class UltraCircuitBuilder_<grumpkin::fr>;
using UltraCircuitBuilder = UltraCircuitBuilder_<barretenberg::fr>;
// using UltraGrumpkinCircuitBuilder = UltraCircuitBuilder_<grumpkin::fr>;
} // namespace proof_system
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ namespace proof_system::honk::flavor {
class Standard;
class StandardGrumpkin;
class Ultra;
class UltraGrumpkin;
class ECCVM;
class ECCVMGrumpkin;
class GoblinUltra;
Expand Down Expand Up @@ -283,10 +282,10 @@ template <typename T>
concept IsPlonkFlavor = IsAnyOf<T, plonk::flavor::Standard, plonk::flavor::Ultra>;

template <typename T>
concept IsHonkFlavor = IsAnyOf<T, honk::flavor::Ultra, honk::flavor::UltraGrumpkin, honk::flavor::GoblinUltra>;
concept IsHonkFlavor = IsAnyOf<T, honk::flavor::Ultra, honk::flavor::GoblinUltra>;

template <typename T>
concept IsUltraFlavor = IsAnyOf<T, honk::flavor::Ultra, honk::flavor::UltraGrumpkin, honk::flavor::GoblinUltra>;
concept IsUltraFlavor = IsAnyOf<T, honk::flavor::Ultra, honk::flavor::GoblinUltra>;

template <typename T>
concept IsGoblinFlavor = IsAnyOf<T, honk::flavor::GoblinUltra,
Expand All @@ -299,9 +298,9 @@ concept IsRecursiveFlavor = IsAnyOf<T, honk::flavor::UltraRecursive_<UltraCircui
honk::flavor::GoblinUltraRecursive_<UltraCircuitBuilder>,
honk::flavor::GoblinUltraRecursive_<GoblinUltraCircuitBuilder>>;

template <typename T> concept IsGrumpkinFlavor = IsAnyOf<T, honk::flavor::UltraGrumpkin>;
template <typename T> concept IsGrumpkinFlavor = IsAnyOf<T, honk::flavor::ECCVMGrumpkin>;

template <typename T> concept UltraFlavor = IsAnyOf<T, honk::flavor::Ultra, honk::flavor::UltraGrumpkin, honk::flavor::GoblinUltra>;
template <typename T> concept UltraFlavor = IsAnyOf<T, honk::flavor::Ultra, honk::flavor::GoblinUltra>;

template <typename T> concept ECCVMFlavor = IsAnyOf<T, honk::flavor::ECCVM, honk::flavor::ECCVMGrumpkin>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include "barretenberg/honk/flavor/goblin_ultra.hpp"
#include "barretenberg/honk/flavor/goblin_ultra_recursive.hpp"
#include "barretenberg/honk/flavor/ultra.hpp"
#include "barretenberg/honk/flavor/ultra_grumpkin.hpp"
#include "barretenberg/honk/flavor/ultra_recursive.hpp"
#include "barretenberg/honk/sumcheck/sumcheck.hpp"
#include "barretenberg/plonk/proof_system/types/proof.hpp"
Expand Down