feat: merge-train/barretenberg#15963
Merged
Merged
Conversation
Continuing the vertical slice of doing CIVC API with the new BBAPI end-to-end, this adds: - revives a schema compiler that we were using with the circuits C++ code, adapting it for the unified bbapi - adds code to bb.js, currently unused, to wrap a process and seamlessly have bb.js use the native implementations via a process that spits in and out msgpack - implements gates and ivc verify in CIVC, uses them in api_client_ivc.cpp (backs the CLI) - move AztecBackend to the new API, using generated bindings - refactor bb.js to adapt to new generation source --------- Co-authored-by: Claude <noreply@anthropic.com>
The `stdlib::uint` module was only being tested for `uint32_ct`. This PR makes the tests also run for `uint8_ct, uint16_ct, uint64_ct`. The tests were failing for `uint64_ct` because the XOR and AND lookup tables only supported 32-bit inputs. If we attempted to input more than 32-bits, it naturally led to the error message[^1]: ```bash 'C++ exception with description "Last key slice greater than 4" thrown in the test body."' ``` We slice the 64-bit number in 6-bit slices, starting from the least significant slice: <img width="704" alt="image" src="https://github.com/user-attachments/assets/85b8feac-8913-44a8-bb3d-9538513c762a" /> such that the most-significant slice is 4 bits. Since we allowed only 32-bit XOR and AND lookup tables, it read the first 5 slices $(a_0, \dots, a_4)$, i.e., 30 bits, and when it needs to read $a_5$ slice, obviously the remainder $r = (a \gg 30)$ is greater than the allowed value of the last slice (i.e., $r > 4$). [^1]: Side note: the comment in the code noted the error message as `C++ exception with description "Last key slice greater than 64" thrown in the test body` because it was referring to an error before the bug in uint32 table was [fixed](#11651). Solution: simply added a 64-bit multi-table for XOR and AND operation of two 64-bit numbers. Note that we still use the 6-bit basic table repeated 10-times and a new 4-bit table for the last slice. Hence, one 64-bit XOR and AND operation would cost 11 lookup gates. resolves AztecProtocol/barretenberg#1229
Collaborator
Author
|
🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See merge-train-readme.md.
BEGIN_COMMIT_OVERRIDE
feat(bbapi): CIVC end to end (#15777)
fix:
uint64_cttests in stdlib (#15582)END_COMMIT_OVERRIDE