private-attribution / ipa

A raw implementation of Interoperable Private Attribution
MIT License
41 stars 23 forks source link

Create test addition circuit #1154

Closed akoshelev closed 3 months ago

akoshelev commented 3 months ago

This change adds a new simple test circuit and integration tests for it. This circuit does not do anything sophisticated and the need for it is dictated by #1141 where I need to test that inputs of size > 2Gb can be handled by our MPC helpers.

I tried to use test-multiply but it just takes too long to process inputs of this size. I estimated ~300M field value pairs need to be submitted to exceed $2^{31}-1$ input size and that makes that circuit to run for 8+ mins.

This circuit is much faster for two reasons. First, it does not require communication. Second, it generates input and shares it using iterators. That makes a big difference - my experiments showed that it takes roughly 9 mins to get test-multiply inputs delivered and ~50 seconds for test-add. It can be further optimized because we collect everything. in .share, but this implementation is good enough for me.

My goal is to use this circuit in a integration test that we run only in CI and that checks inputs greater than $2^31-1$ can be sent via our report_collector client

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 92.67016% with 14 lines in your changes missing coverage. Please review.

Project coverage is 91.87%. Comparing base (02f5467) to head (9714c77). Report is 52 commits behind head on main.

Files Patch % Lines
ipa-core/src/query/executor.rs 0.00% 10 Missing :warning:
ipa-core/src/cli/playbook/input.rs 93.75% 2 Missing :warning:
ipa-core/src/bin/test_mpc.rs 96.29% 1 Missing :warning:
ipa-core/src/query/runner/add_in_prime_field.rs 98.18% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1154 +/- ## ========================================== + Coverage 91.66% 91.87% +0.21% ========================================== Files 190 195 +5 Lines 27990 28939 +949 ========================================== + Hits 25656 26589 +933 - Misses 2334 2350 +16 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.