|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
Tests for DatabusLookupRelation to verify the relation arithmetic matches a simple reference implementation. More...
#include "barretenberg/ecc/curves/bn254/fr.hpp"#include "barretenberg/relations/databus_lookup_relation.hpp"#include "barretenberg/relations/relation_parameters.hpp"#include <gtest/gtest.h>Go to the source code of this file.
Classes | |
| struct | DatabusInputElements |
| Input elements for DatabusLookupRelation testing. More... | |
| class | DatabusLookupRelationConsistency |
Typedefs | |
| using | FF = fr |
Functions | |
| TEST_F (DatabusLookupRelationConsistency, RandomInputs) | |
| Test all subrelations with random inputs. | |
| TEST_F (DatabusLookupRelationConsistency, BooleanReadTagsPass) | |
| Test with boolean read tags (valid values) | |
| TEST_F (DatabusLookupRelationConsistency, NonBooleanReadTagsFail) | |
| Test with non-boolean read tags (invalid values) | |
| TEST_F (DatabusLookupRelationConsistency, InactiveGates) | |
| Test that inactive gates (all selectors = 0) produce expected behavior. | |
| TEST_F (DatabusLookupRelationConsistency, ValidInverseComputation) | |
| Test a valid read gate scenario where inverse is correctly computed. | |
| TEST_F (DatabusLookupRelationConsistency, MismatchedReadWriteTerms) | |
| Test that when read_term != write_term, inverse correctness fails with wrong inverse. | |
Tests for DatabusLookupRelation to verify the relation arithmetic matches a simple reference implementation.
Similar to ultra_relation_consistency.test.cpp, this test verifies that the optimized relation implementation produces the same results as a simpler, more readable reference implementation.
The DatabusLookupRelation implements a log-derivative lookup argument with 3 subrelations per bus column:
Definition in file databus_lookup_relation_consistency.test.cpp.
Definition at line 19 of file databus_lookup_relation_consistency.test.cpp.
| TEST_F | ( | DatabusLookupRelationConsistency | , |
| BooleanReadTagsPass | |||
| ) |
Test with boolean read tags (valid values)
When read_tag is 0 or 1, the boolean check subrelation should be 0
Definition at line 205 of file databus_lookup_relation_consistency.test.cpp.
| TEST_F | ( | DatabusLookupRelationConsistency | , |
| InactiveGates | |||
| ) |
Test that inactive gates (all selectors = 0) produce expected behavior.
Definition at line 273 of file databus_lookup_relation_consistency.test.cpp.
| TEST_F | ( | DatabusLookupRelationConsistency | , |
| MismatchedReadWriteTerms | |||
| ) |
Test that when read_term != write_term, inverse correctness fails with wrong inverse.
If the value in bus doesn't match what's being read, the relation should fail
Definition at line 386 of file databus_lookup_relation_consistency.test.cpp.
| TEST_F | ( | DatabusLookupRelationConsistency | , |
| NonBooleanReadTagsFail | |||
| ) |
Test with non-boolean read tags (invalid values)
When read_tag is not 0 or 1, the boolean check subrelation should be non-zero
Definition at line 247 of file databus_lookup_relation_consistency.test.cpp.
| TEST_F | ( | DatabusLookupRelationConsistency | , |
| RandomInputs | |||
| ) |
Test all subrelations with random inputs.
Verifies that the relation's accumulate function matches the simple reference implementation
Definition at line 185 of file databus_lookup_relation_consistency.test.cpp.
| TEST_F | ( | DatabusLookupRelationConsistency | , |
| ValidInverseComputation | |||
| ) |
Test a valid read gate scenario where inverse is correctly computed.
When the inverse is set correctly: I = 1/(read_term * write_term), the inverse correctness subrelation should be zero (satisfied)
Definition at line 322 of file databus_lookup_relation_consistency.test.cpp.