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

fpylll might not find system-wide fplll's strategies json #33302

Closed
dimpase opened this issue Feb 6, 2022 · 13 comments
Closed

fpylll might not find system-wide fplll's strategies json #33302

dimpase opened this issue Feb 6, 2022 · 13 comments

Comments

@dimpase
Copy link
Member

dimpase commented Feb 6, 2022

This in particular is observed on Debian 11, see
fplll/fpylll#221

sage: from sage.modules.free_module_integer import IntegerLattice
sage: L = IntegerLattice(sage.crypto.gen_lattice(type='modular', m=10, seed=1337, dual=True))
sage: L.shortest_vector()
terminate called after throwing an instance of 'std::runtime_error'
  what():  Cannot open strategies file.
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
~/work/sage/local/var/lib/sage/venv-python3.9/lib/python3.9/site-packages/sage/misc/cachefunc.pyx in sage.misc.cachefunc.CachedMethodCaller.__call__ (build/cythonized/sage/misc/cachefunc.c:10347)()
   1942             try:
-> 1943                 return cache[k]
   1944             except TypeError:  # k is not hashable

KeyError: ((True, 'fplll'), ())
...

The latter is an extract from a failing doctest.

While it's fixed in fplll's master, we need a fix for the current fpylll.

Upstream: Fixed upstream, in a later stable release.

Component: packages: standard

Author: Dima Pasechnik

Branch: 20ca9f7

Reviewer: Martin Albrecht

Issue created by migration from https://trac.sagemath.org/ticket/33302

@dimpase dimpase added this to the sage-9.6 milestone Feb 6, 2022
@malb
Copy link
Member

malb commented Feb 7, 2022

comment:1

I think it should be enough to update FPLLL to fix this, no? I can cut a new release (for both).

@dimpase
Copy link
Member Author

dimpase commented Feb 7, 2022

comment:2

We are allowing system-wide versions of fplll. I.e. we are stuck with this little bug for some time.

@dimpase
Copy link
Member Author

dimpase commented Feb 9, 2022

Branch: u/dimpase/fpylll/stategies_path_fix

@dimpase
Copy link
Member Author

dimpase commented Feb 9, 2022

Upstream: Fixed upstream, in a later stable release.

@dimpase
Copy link
Member Author

dimpase commented Feb 9, 2022

Author: Dima Pasechnik

@dimpase
Copy link
Member Author

dimpase commented Feb 9, 2022

Commit: 20ca9f7

@dimpase
Copy link
Member Author

dimpase commented Feb 9, 2022

New commits:

20ca9f7compose the path to strategies/default.json

@malb
Copy link
Member

malb commented Feb 11, 2022

Reviewer: Martin Albrecht

@malb
Copy link
Member

malb commented Feb 11, 2022

comment:4

I am a bit puzzled how this situation can arise but the fix doesn't make it wrong, so thumbs up from me. I didn't run doctests, though.

@dimpase
Copy link
Member Author

dimpase commented Feb 11, 2022

comment:5

Replying to @malb:

I am a bit puzzled how this situation can arise but the fix doesn't make it wrong, so thumbs up from me. I didn't run doctests, though.

Thanks. On Debian 11 BKZ.DEFAULT_STRATEGY is not full path, it's just default.json. So the path has to be prepended.
In some other cases it's full path, so either nothing should be prepended, or it can be done as in the patch.

@vbraun
Copy link
Member

vbraun commented Feb 16, 2022

Changed branch from u/dimpase/fpylll/stategies_path_fix to 20ca9f7

@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 2, 2022

Changed commit from 20ca9f7 to none

@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 2, 2022

comment:7

Again on opensuse-tumbleweed - #33448

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants