data61 / MP-SPDZ

Versatile framework for multi-party computation
Other
926 stars 279 forks source link

Bug in computing number of virtual rounds and number of triplets #1482

Closed Poppy22 closed 1 month ago

Poppy22 commented 2 months ago

Hello,

I noticed that sometimes the program output for the number of rounds and triplets is inf:

Program requires at most:
         inf integer triples
         inf virtual machine rounds

This happens in nested loops, when the second loop depends on the first one:

@for_range_opt(5)
def outer(i: cint) -> None:
    @for_range_opt(i + 1, 5)
    def inner(j: cint) -> None:
        x = sint(1) * sint(1)

The issue does not happen if both of them are independent, i.e. both loops being @for_range_opt(5)

I was wondering if this is a bug, or if it is by design because it is more difficult to compute the exact number of virtual rounds then?

I didn't check the code yet. But if it's a relatively easy fix, I can try to add it myself. For now I just wanted to communicate the issue.

mkskeller commented 1 month ago

This is more by design as it would be more difficult to compute.