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

collect_steps: code refactor based on Taiki's feedback #818

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 0 additions & 88 deletions 0001-CI-split-extra-step-into-two.patch

This file was deleted.

2 changes: 1 addition & 1 deletion pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ check "IPA benchmark" \
cargo bench --bench oneshot_ipa --no-default-features --features="enable-benches descriptive-gate" -- -n 62

check "IPA OPRF benchmark" \
cargo bench --bench oneshot_ipa --no-default-features --features="enable-benches descriptive-gate" -- -n 62 --oprf
cargo bench --bench oneshot_ipa --no-default-features --features="enable-benches descriptive-gate" -- -n 62 --oprf -c 16

check "Arithmetic circuit benchmark" \
cargo bench --bench oneshot_arithmetic --no-default-features --features "enable-benches descriptive-gate"
Expand Down
58 changes: 30 additions & 28 deletions scripts/collect_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ def extract_intermediate_steps(steps):

return steps

def ipa_steps(steps):
def ipa_steps():
output = set()
for c in PER_USER_CAP:
for w in ATTRIBUTION_WINDOW:
for b in BREAKDOWN_KEYS:
Expand All @@ -167,41 +168,42 @@ def ipa_steps(steps):
m,
]
print(" ".join(args), file=sys.stderr)
steps.update(collect_steps(args))
output.update(collect_steps(args))
return output

OPRF_BREAKDOWN_KEYS = [256]
OPRF_BREAKDOWN_KEY = 256
OPRF_USER_CAP = [16, 64, 128]
OPRF_SECURITY_MODEL = ["semi-honest"]
OPRF_TRIGGER_VALUE = [7]
OPRF_SECURITY_MODEL = "semi-honest"
OPRF_TRIGGER_VALUE = [6, 7]

def oprf_steps(steps):
def oprf_steps():
output = set()
for c in OPRF_USER_CAP:
for w in ATTRIBUTION_WINDOW:
for b in OPRF_BREAKDOWN_KEYS:
for m in OPRF_SECURITY_MODEL:
for tv in OPRF_TRIGGER_VALUE:
args = ARGS + [
"-n",
str(QUERY_SIZE),
"-c",
str(c),
"-w",
str(w),
"-b",
str(b),
"-m",
m,
"-t",
str(tv),
"-o"
]
print(" ".join(args), file=sys.stderr)
steps.update(collect_steps(args))
for tv in OPRF_TRIGGER_VALUE:
args = ARGS + [
"-n",
str(QUERY_SIZE),
"-c",
str(c),
"-w",
str(w),
"-b",
str(OPRF_BREAKDOWN_KEY),
"-m",
OPRF_SECURITY_MODEL,
"-t",
str(tv),
"-o"
]
print(" ".join(args), file=sys.stderr)
output.update(collect_steps(args))
return output

if __name__ == "__main__":
steps = set()
ipa_steps(steps)
oprf_steps(steps)
steps.update(ipa_steps())
steps.update(oprf_steps())

full_steps = extract_intermediate_steps(steps)
sorted_steps = sorted(full_steps)
Expand Down
4 changes: 4 additions & 0 deletions src/protocol/step/steps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9345,6 +9345,7 @@ ipa::protocol::prf_sharding::Step::binary_validator/ipa::protocol::prf_sharding:
ipa::protocol::prf_sharding::Step::binary_validator/ipa::protocol::prf_sharding::UserNthRowStep::row2/ipa::protocol::prf_sharding::Step::compute_saturating_sum/ipa::protocol::step::BitOpStep::bit4
ipa::protocol::prf_sharding::Step::binary_validator/ipa::protocol::prf_sharding::UserNthRowStep::row2/ipa::protocol::prf_sharding::Step::compute_saturating_sum/ipa::protocol::step::BitOpStep::bit5
ipa::protocol::prf_sharding::Step::binary_validator/ipa::protocol::prf_sharding::UserNthRowStep::row2/ipa::protocol::prf_sharding::Step::compute_saturating_sum/ipa::protocol::step::BitOpStep::bit6
ipa::protocol::prf_sharding::Step::binary_validator/ipa::protocol::prf_sharding::UserNthRowStep::row2/ipa::protocol::prf_sharding::Step::compute_saturating_sum/ipa::protocol::step::BitOpStep::bit7
ipa::protocol::prf_sharding::Step::binary_validator/ipa::protocol::prf_sharding::UserNthRowStep::row2/ipa::protocol::prf_sharding::Step::computed_capped_attributed_trigger_value_just_saturated_case
ipa::protocol::prf_sharding::Step::binary_validator/ipa::protocol::prf_sharding::UserNthRowStep::row2/ipa::protocol::prf_sharding::Step::computed_capped_attributed_trigger_value_just_saturated_case/ipa::protocol::step::BitOpStep::bit0
ipa::protocol::prf_sharding::Step::binary_validator/ipa::protocol::prf_sharding::UserNthRowStep::row2/ipa::protocol::prf_sharding::Step::computed_capped_attributed_trigger_value_just_saturated_case/ipa::protocol::step::BitOpStep::bit1
Expand Down Expand Up @@ -9446,6 +9447,9 @@ ipa::protocol::prf_sharding::Step::binary_validator/ipa::protocol::prf_sharding:
ipa::protocol::prf_sharding::Step::binary_validator/ipa::protocol::prf_sharding::UserNthRowStep::row3/ipa::protocol::prf_sharding::Step::compute_saturating_sum/ipa::protocol::step::BitOpStep::bit2
ipa::protocol::prf_sharding::Step::binary_validator/ipa::protocol::prf_sharding::UserNthRowStep::row3/ipa::protocol::prf_sharding::Step::compute_saturating_sum/ipa::protocol::step::BitOpStep::bit3
ipa::protocol::prf_sharding::Step::binary_validator/ipa::protocol::prf_sharding::UserNthRowStep::row3/ipa::protocol::prf_sharding::Step::compute_saturating_sum/ipa::protocol::step::BitOpStep::bit4
ipa::protocol::prf_sharding::Step::binary_validator/ipa::protocol::prf_sharding::UserNthRowStep::row3/ipa::protocol::prf_sharding::Step::compute_saturating_sum/ipa::protocol::step::BitOpStep::bit5
ipa::protocol::prf_sharding::Step::binary_validator/ipa::protocol::prf_sharding::UserNthRowStep::row3/ipa::protocol::prf_sharding::Step::compute_saturating_sum/ipa::protocol::step::BitOpStep::bit6
ipa::protocol::prf_sharding::Step::binary_validator/ipa::protocol::prf_sharding::UserNthRowStep::row3/ipa::protocol::prf_sharding::Step::compute_saturating_sum/ipa::protocol::step::BitOpStep::bit7
ipa::protocol::prf_sharding::Step::binary_validator/ipa::protocol::prf_sharding::UserNthRowStep::row3/ipa::protocol::prf_sharding::Step::computed_capped_attributed_trigger_value_just_saturated_case
ipa::protocol::prf_sharding::Step::binary_validator/ipa::protocol::prf_sharding::UserNthRowStep::row3/ipa::protocol::prf_sharding::Step::computed_capped_attributed_trigger_value_just_saturated_case/ipa::protocol::step::BitOpStep::bit0
ipa::protocol::prf_sharding::Step::binary_validator/ipa::protocol::prf_sharding::UserNthRowStep::row3/ipa::protocol::prf_sharding::Step::computed_capped_attributed_trigger_value_just_saturated_case/ipa::protocol::step::BitOpStep::bit1
Expand Down
1 change: 0 additions & 1 deletion steps1.txt

This file was deleted.