Skip to content

Conversation

@Poppy22
Copy link

@Poppy22 Poppy22 commented Mar 22, 2025

No description provided.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

assert self.m == other.m
self.v.update(other.v)


Copy link
Author

Choose a reason for hiding this comment

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

This class will be removed from types.py as it's not needed. The rabbit comparison logic is added in non_linear.py

dest="edabit",
help="mixing arithmetic and binary computation using edaBits",
)
parser.add_option(
Copy link
Author

Choose a reason for hiding this comment

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

I tried setting the flag for comparison_rabbit with program.use_comparison_rabbit(True) in the .mpc file (similar to use_edabits), but it always remained false, and I only managed to set it true by adding --comparison_rabit in the compilation instruction. Do you see what I am doing wrong there?

"""
print_str(str(s) + '\n', *args, **kwargs)


Copy link
Author

Choose a reason for hiding this comment

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

will also be deleted

z = floatingpoint.PreOpL(floatingpoint.or_op, y[::-1])[::-1] + [0]
w = [z[i] - z[i + 1] for i in range(BIT_SIZE)]

return types.sintbit(1) - types.sintbit(sum((R_bits[i] & w[i]) for i in range(BIT_SIZE)))
Copy link
Author

Choose a reason for hiding this comment

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

This line was initially 1 - sum(...) but I was getting the error below, and it only worked when I converted 1 and the value of the sum. Could you explain this part?

File "/benchmarks/MP-SPDZ/Compiler/comparison.py", line 85, in LTZ
    movs(s, program.non_linear.ltz(a, k))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/benchmarks/MP-SPDZ/Compiler/non_linear.py", line 81, in ltz
    return self.rabbitLTZ(a, k)
           ^^^^^^^^^^^^^^^^^^^^
  File "/benchmarks/MP-SPDZ/Compiler/non_linear.py", line 71, in rabbitLTZ
    w[1] = self.LTBits(masked_a, r_bits, BIT_SIZE)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/benchmarks/MP-SPDZ/Compiler/non_linear.py", line 54, in LTBits
    return_value = 1 - sum((R_bits[i] & w[i]) for i in range(BIT_SIZE))
                   ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  File "/benchmarks/MP-SPDZ/Compiler/types.py", line 229, in read_mem_operation
    return operation(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/benchmarks/MP-SPDZ/Compiler/GC/types.py", line 523, in __add__
    return self.xor_int(other)
           ^^^^^^^^^^^^^^^^^^^
  File "/benchmarks/MP-SPDZ/Compiler/GC/types.py", line 585, in xor_int
    self_bits = self.bit_decompose()
                ^^^^^^^^^^^^^^^^^^^^
  File "/benchmarks/MP-SPDZ/Compiler/GC/types.py", line 86, in bit_decompose
    suffix = [0] * (n - self.n)
                    ~~^~~~~~~~
TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'

Copy link
Author

Choose a reason for hiding this comment

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

Also, now the result of the comparison is no longer 0 or 1, but I had values like -1 and 2, so I think that there might be something wrong with the typing there.

Copy link
Member

Choose a reason for hiding this comment

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

It might be unintuitive, but the description for variables needs to come after the variable to make the documentation work: https://mp-spdz.readthedocs.io/en/latest/Compiler.html#Compiler.program.Program.use_edabit

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.

3 participants