Skip to content

feat(ultrahonk): Added a simple filler table to minimize the amount of entries used to make UltraHonk polynomials non-zero#531

Merged
Rumata888 merged 7 commits intomasterfrom
is/simple_table
Jun 15, 2023
Merged

feat(ultrahonk): Added a simple filler table to minimize the amount of entries used to make UltraHonk polynomials non-zero#531
Rumata888 merged 7 commits intomasterfrom
is/simple_table

Conversation

@Rumata888
Copy link
Copy Markdown

@Rumata888 Rumata888 commented Jun 14, 2023

Description

In the past we used UINT32 XOR and ADD lookup tables to ensure that UltraHonk! polynomials are not zero. This made the minimum size of the circuit 2^14. This PR adds a dummy table which can be used for the same purpose but only has 2 basic tables each consisting of just 4 entries. In addition I got rid of s_randomness in UltraHonkComposerHelper, which produced bugs, since we don't randomise the polynomials in the same way in Honk!

Checklist:

  • I have reviewed my diff in github, line by line.
  • Every change is related to the PR description.
  • I have linked this pull request to the issue(s) that it resolves.
  • There are no unexpected formatting changes, superfluous debug logs, or commented-out code.
  • There are no circuit changes, OR specifications in /markdown/specs have been updated.
  • There are no circuit changes, OR a cryptographer has been assigned for review.
  • I've updated any terraform that needs updating (e.g. environment variables) for deployment.
  • The branch has been rebased against the head of its merge target.
  • I'm happy for the PR to be merged at the reviewer's next convenience.
  • New functions, classes, etc. have been documented according to the doxygen comment format. Classes and structs must have @brief describing the intended functionality.
  • If existing code has been modified, such documentation has been added or updated.

@Rumata888 Rumata888 changed the title fix(ultrahonk): Added a simple filler table to minimize the amount of entries used to make UltraHonk polynomials non-zero feat(ultrahonk): Added a simple filler table to minimize the amount of entries used to make UltraHonk polynomials non-zero Jun 14, 2023
@Rumata888 Rumata888 requested a review from maramihali June 15, 2023 13:20
polynomial poly_q_table_column_4(subgroup_size);

size_t offset = subgroup_size - tables_size - s_randomness - 1;
size_t offset = subgroup_size - tables_size;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was the -1 for previously?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We inserted a 1 at the end so that the polynomial would not be zero. Don't know why since we add randomness anyway

// start from 1 instead of 0?
uint32_t left_value = 3;
uint32_t right_value = 5;
uint32_t right_value = 3;
Copy link
Copy Markdown

@maramihali maramihali Jun 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you explain what this value is because the change looks arbitrary - maybe add comment as well

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is because the multitable only works on 2-bit values, so 5 is too big

namespace dummy_tables {

/**
* @brief Lookup the value corresponding to a sepcific key
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in specific

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

inline BasicTable generate_honk_dummy_table(const BasicTableId id, const size_t table_index)
{

ASSERT(table_id == static_cast<uint64_t>(id));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do this two have to be equal - i understand that id is static while table_id can change depending on function (?)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using the same function in 2 places by templating it, but the API already includes the id in arguments. This is just a simple bug check to ensure that we don't use the wrong instantiation

@Rumata888 Rumata888 marked this pull request as ready for review June 15, 2023 18:04
@Rumata888 Rumata888 merged commit b20b401 into master Jun 15, 2023
@Rumata888 Rumata888 deleted the is/simple_table branch June 15, 2023 18:05
@codygunton codygunton linked an issue Jun 20, 2023 that may be closed by this pull request
ludamad pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Jul 22, 2023
…f entries used to make UltraHonk polynomials non-zero (AztecProtocol/barretenberg#531)

feat(ultrahonk): Added a simple filler table to minimize the amount of entries used to make UltraHonk polynomials non-zero
ludamad pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Jul 24, 2023
…f entries used to make UltraHonk polynomials non-zero (AztecProtocol/barretenberg#531)

feat(ultrahonk): Added a simple filler table to minimize the amount of entries used to make UltraHonk polynomials non-zero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid zero-polynomials in Ultra Honk

2 participants