-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: databus allows arbitrarily many reads per index (#6524)
TLDR: Up until now we were limited to only 1 read per entry of a databus column (see explanation of why below). This PR removes this limitation so that we can read from any row arbitrarily many times at the cost of adding one polynomial/commitment per databus column. Note: this PR also cleans up some of the handling of ecc op wires and databus polys in various places by making better use of Flavor style getters. Explanation: The log derivative lookup relation involves a polynomial that contains inverses, i.e. I_i = (read_term_i*write_term_i)^{-1}. These inverses only need to be computed when the relation is "active", i.e. when the row in question either contains a databus read gate or data that is being read. At all other rows, we simply set the value of the inverse polynomial to 0. This allows a subrelation of the form: `read_term * write_term * inverses - inverse_exists` Where `inverse_exists` is a polynomial that takes 1 if the relation is active (or equivalently, if the inverse has been computed) and 0 otherwise. Therefore, if the inverse has been computed, we check that it is indeed equal to the inverse of `read_term * write_term`, otherwise, the subrelation contribution is trivially 0. If we only allow a single read from each row of a bus column, the term `inverse_exists` can be computed as an algebraic OR of the form: `is_read_gate + read_counts - (is_read_gate * read_counts)` since both `is_read_gate` and `read_counts` are both boolean. If `read_counts` is no longer boolean, no such algebraic expression exists. The solution is to introduce a dedicated boolean polynomial `read_tag` whose values are given by `min(1, read_counts)`, i.e. 1 if one or more reads have been performed at that row, and 0 otherwise. Closes AztecProtocol/barretenberg#937
- Loading branch information
1 parent
c6734f9
commit f07200c
Showing
11 changed files
with
172 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
f07200c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark 'C++ Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
1.05
.nativeClientIVCBench/Full/6
13689.154826999982
ms/iter12345.950076000008
ms/iter1.11
wasmClientIVCBench/Full/6
41131.715008
ms/iter37411.339618
ms/iter1.10
commit(t)
4511729274
ns/iter4208533894
ns/iter1.07
This comment was automatically generated by workflow using github-action-benchmark.
CC: @ludamad @codygunton