Exception messages not propagated under OSX

Hi - I’m exploring concrete-numpy, and have found that exception messages aren’t propagated under OSX, while they are under Linux - for example, when trying to serialise arguments for a function I defined as having one encrypted argument and one clear, under Linux I get:
RuntimeError: PublicArguments::serialize: Clear arguments are not yet supported. Argument 1
whereas under OSX I get:
RuntimeError: Caught an unknown exception!
which makes debugging tricky (especially since concrete-compiler isn’t open source yet, so you can’t manually trace the error into it)

Thanks for all the work getting things this far!

Hi Andrew,

Since concrete-compiler isn’t yet open source (but it will soon be), I will try to explain what’s happening in here. So the compiler is a C++ project, that has Python bindings built using Pybind11. Pybind11 has a mechanism for translating C++ exceptions into Python, which is apparently failing in your case (for a reason I can’t see for the moment).

Can you give more info about your environment? What version of OSX/CNP? Are you using packages installed via pip directly, or using other mechanisms?

Hi Ayoub - this is OSX 12.5, with packages install via pip, with these versions:
% pip3 list | grep concrete
concrete-compiler 0.23.1
concrete-numpy 0.9.0

We’ve ended up using Pyfhel instead for the moment, as we’re deploying a project where the use of a third-party binary package isn’t viable. It’s probably easiest if we pick up debugging when the open source version is out, as then it’ll be easier for us to help!

Hi Andrew,

Tests regarding raised errors do pass in our CI, which is the same environment where the python packages are built. So we also tried in a different environment and it does fail similarly. So it’s probably something related to the environment, where pybind11 depends on some standard library to do the conversion of Cpp exceptions to Python. We will try to investigate further and see if we can provide a fix on our side in a future release.

1 Like