Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integrating bounded l2 norm fixed point vector sum types. #893

Merged
merged 1 commit into from
Jan 25, 2023

Conversation

ooovi
Copy link
Contributor

@ooovi ooovi commented Jan 8, 2023

As discussed here, this PR enables using our prio3 type for aggregating vectors of fixed-point numbers with janus. It mainly adds the enum cases and match branches required to dispatch on the 16-, 32- and 64-bit variants of fixed-point vector aggregation.

One notable thing I did is adding a helper enum to enable tagging the JSON from the upload request with the fixedpoint type in the end-to-end interop test only for our vectors, as the standard string representation of fixedpoint numbers does not carry that information.

Looking forward to your comments :)

@ooovi ooovi requested a review from a team as a code owner January 8, 2023 13:56
Copy link
Contributor

@tgeoghegan tgeoghegan left a comment

Choose a reason for hiding this comment

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

This change looks sound to me, but the Janus team is debating how we want to handle this. For one thing, we may want to gate this VDAF behind a feature (much as the fixed point implementation in libprio-rs is gated behind feature experimental).

Copy link
Contributor

@branlwyd branlwyd left a comment

Choose a reason for hiding this comment

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

As Tim mentioned, let's gate this with crate features, disabled by default. (Tests can enable the features in order to allow testing this functionality by default.)

@@ -822,7 +823,7 @@ mod tests {
let collector = setup_collector(vdaf);

let batch_interval = Interval::new(
Time::from_seconds_since_epoch(1_000_000),
Time::from_seconds_since_epoch(2_000_000), // TODO why???
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure offhand -- if you don't know why this change is necessary, I think it's OK to just drop the TODO.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I saw a test flake in this module yesterday, so it was probably random chance, unconnected to this timestamp. (I suspect we may be running into a backoff timer we need to tweak, but I haven't had a chance to dig into it yet)

@ooovi
Copy link
Contributor Author

ooovi commented Jan 13, 2023

we are now hiding behind a feature.

Tests can enable the features in order to allow testing this functionality by default

we had to adjust the Dockerfile.interop and Dockerfile.interop_aggregator to enable the feature during tests. is that what you meant, or should we do something more?

Copy link
Contributor

@branlwyd branlwyd left a comment

Choose a reason for hiding this comment

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

we had to adjust the Dockerfile.interop and Dockerfile.interop_aggregator to enable the feature during tests. is that what you meant, or should we do something more?

I meant to modify the dependency in the dev-dependencies so that it enables the new feature, allowing the relevant tests to not be gated by the feature & thus tested by cargo test without additional flags. (My goal is to make a release binary not include these "experimental"/non-standardized VDAFs by default, but I think it is wise to test them by default.)

See

janus_aggregator = { workspace = true, features = ["kube-openssl", "test-util"] }
for an example of the change to Cargo.toml -- there are a number of dev-dependencies throughout the workspace that enable the test-util feature.

collector/examples/collect.rs Show resolved Hide resolved
@@ -998,6 +1000,73 @@ mod tests {
mocked_collect_complete.assert();
}

#[tokio::test]
#[cfg(feature = "fpvec_bounded_l2")]
async fn successful_collect_prio3_fixedpoint_boundedl2_vec_sum() {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test, for example, doesn't need to be gated by the feature if we enable the feature by default in tests.

@@ -656,6 +659,228 @@ async fn e2e_prio3_count_vec() {
}
}

#[tokio::test]
#[cfg(feature = "fpvec_bounded_l2")]
Copy link
Contributor

Choose a reason for hiding this comment

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

These tests also don't need to be gated by the feature if we enable the feature by default in tests.

@ooovi
Copy link
Contributor Author

ooovi commented Jan 17, 2023

I meant to modify the dependency in the dev-dependencies so that it enables the new feature, allowing the relevant tests to not be gated by the feature & thus tested by cargo test without additional flags. (My goal is to make a release binary not include these "experimental"/non-standardized VDAFs by default, but I think it is wise to test them by default.)

I did this (and the other changes you suggested) in the latest commit. Is there another way of enabling the feature on the containers used in the interop end-to-end test except passing the feature flag to the build command in the Dockerfile.interop and Dockerfile.interop_aggregator?

@@ -822,7 +824,7 @@ mod tests {
let collector = setup_collector(vdaf);

let batch_interval = Interval::new(
Time::from_seconds_since_epoch(1_000_000),
Time::from_seconds_since_epoch(2_000_000),
Copy link
Collaborator

Choose a reason for hiding this comment

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

This change can be backed out, #916 properly fixes this test.

@branlwyd
Copy link
Contributor

I did this (and the other changes you suggested) in the latest commit. Is there another way of enabling the feature on the containers used in the interop end-to-end test except passing the feature flag to the build command in the Dockerfile.interop and Dockerfile.interop_aggregator?

Enabling the features via flags in Dockerfile.interop and Dockerfile.interop_aggregator is fine.

@ooovi
Copy link
Contributor Author

ooovi commented Jan 24, 2023

I merged the current main branch, as there were conflicting changes. Also squashed into one commit. Could you run the workflow again? :)

@ooovi
Copy link
Contributor Author

ooovi commented Jan 24, 2023

the workflow cannot be run on forks because they have no access to your github secrets. there seems to be an event that gives them access:
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
but i don't know if that's what you want to be doing in general:
https://securitylab.github.com/research/github-actions-preventing-pwn-requests/

@branlwyd branlwyd merged commit 3dbc0af into divviup:main Jan 25, 2023
@branlwyd
Copy link
Contributor

I ran the tests locally; I am OK merging with that level of testing. I would prefer not to enable running with secrets against forks; perhaps if you will be creating many PRs, we can flip the appropriate bits so that you can create a branch on the main repository, and then we can enable you to run CI directly.

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.

4 participants