quarkslab / qbindiff

Quarkslab Bindiffer but not only !
https://diffing.quarkslab.com
Apache License 2.0
168 stars 7 forks source link

Belief propagation raised a RuntimeWarning #44

Open ebrocas opened 9 months ago

ebrocas commented 9 months ago

Hello,

Each time I used qbindiff, I have this warning which is raised, it appears with pip package but also when I have built qbindiff from sources.

As I do not know if this warning is important or note, I cannot propose a patch. But I suppose it should be handled by qbindiff.

[HOME]/.virtualenvs/qbindiff-dev/lib/python3.11/site-packages/qbindiff/matcher/belief_propagation.py:273: RuntimeWarning: overflow encountered in power
  x / (1 + x) for x in np.clip(np.power(math.e, curr_marginals.data), 0, 1e6)

Thanks!

patacca commented 8 months ago

Indeed this an annoying warning that arises from the operation e^x where x is too big. It doesn't cause any error or different behavior since the result of the operation is clipped in the range [0, 1'000'000] but it's still annoying to see every time. Maybe an idea could be to clip the curr_marginals.data as well to avoid overflowing the data type. Since this is a critical section it is important that we don't impact the performance in any way.