You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tests that only verify a single chip's trace and proof, understandably but surprisingly, do not check for the correctness of lookups, since they are only checking an individual chip's trace for correctness.
This is particularly relevant for non-native field operation tests after the addition of range checking to the non-native field gadgets. That is, all of these tests: 1, 2, 3, 4, 5), are not actually checking that the range checks are correct and that the lookup arguments and send/receives are also correct. This is a minor issue, but can cover up existing issues if any of those gadgets are not used and tested by other existing precompiles. Right now, after merging #160, I believe only the QuadField Sqrt gadget falls under this under-tested criteria.
Any test that makes use of those operations in an actual RISC-V precompile (i.e. any of the tests under the tests/ directory) do not have this issue, since they emulate the entire machine and check the cumulative sum of the lookup arguments. However, some of the tests in the tests/ directory use only hard-coded test values, while the field gadget tests fill the trace with random values as well as hardcoded values, so the test coverage is not perfect.
I'm not sure of the best way to approach this: modifying those tests to make a "full" proof seems difficult since the test chips are not in the MachineAir enum. Adding a test-only method for checking the generated byte lookup events for correctness might be a good compromise, to ensure that at least none of the gadgets are emitting invalid byte lookups. Alternatively, proper documentation to highlight that this is the case might be enough, since the full end-to-end tests with RISC-V programs exist for all precompiles.
The text was updated successfully, but these errors were encountered:
Tests that only verify a single chip's trace and proof, understandably but surprisingly, do not check for the correctness of lookups, since they are only checking an individual chip's trace for correctness.
This is particularly relevant for non-native field operation tests after the addition of range checking to the non-native field gadgets. That is, all of these tests: 1, 2, 3, 4, 5), are not actually checking that the range checks are correct and that the lookup arguments and send/receives are also correct. This is a minor issue, but can cover up existing issues if any of those gadgets are not used and tested by other existing precompiles. Right now, after merging #160, I believe only the QuadField Sqrt gadget falls under this under-tested criteria.
Any test that makes use of those operations in an actual RISC-V precompile (i.e. any of the tests under the
tests/
directory) do not have this issue, since they emulate the entire machine and check the cumulative sum of the lookup arguments. However, some of the tests in thetests/
directory use only hard-coded test values, while the field gadget tests fill the trace with random values as well as hardcoded values, so the test coverage is not perfect.I'm not sure of the best way to approach this: modifying those tests to make a "full" proof seems difficult since the test chips are not in the
MachineAir
enum. Adding a test-only method for checking the generated byte lookup events for correctness might be a good compromise, to ensure that at least none of the gadgets are emitting invalid byte lookups. Alternatively, proper documentation to highlight that this is the case might be enough, since the full end-to-end tests with RISC-V programs exist for all precompiles.The text was updated successfully, but these errors were encountered: