Repository navigation
Work with pylibsparseir 0.10 as well as 0.8.3–0.9 - #88
Merged
Merged
Conversation
pylibsparseir >= 0.10 returns handles that own their C object, and its raw _lib.spir_*_release entry points refuse them (SpM-lab/sparse-ir-rs#282). The finalizers of the kernels, SVEResult and the function sets passed those handles to _lib, so every dropped object printed an unraisable TypeError. Release through close() when the handle has one and through the raw entry point otherwise: older releases, and handles created by direct _lib calls in any release, are raw pointers. An unraisable exception now fails the test suite, and a regression test drops each kind of handle. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
pylibsparseir >= 0.10 changed basis_get_default_matsus_ext from (basis, positive_only, points) to (basis, basis_size, positive_only, fence=False), returning the points (SpM-lab/sparse-ir-rs#274). The old call passed the output buffer as positive_only. Detect the new API from the signature, not the version, since development builds may report an older version, and keep the direct C calls for older releases. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The strict xfails of O2/O4 (sparse-ir-rs#265) and O6 (sparse-ir-rs#273) fail as XPASS on backends with the fixes. As in SparseIR.jl, xfail only when the result shows the defect (an error above 1e3 * tol for #265, exactly the wmax**-2 scaled result for #273) and require the tolerance otherwise. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merged
shinaoka
added a commit
that referenced
this pull request
Sep 27, 2026
The only change since 2.1.4 is #88, which makes the wrapper work against pylibsparseir 0.10 as well as 0.8.3–0.9. No public API changed. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pylibsparseir 0.10.0 (SpM-lab/sparse-ir-rs v0.10.0) is on PyPI. Three of its
changes reach this wrapper, and all three are handled so that one sparse-ir
works against every supported backend from 0.8.3 up.
Handle ownership (sparse-ir-rs#282).
kernel.py,sve.pyandpoly.pyfinalizers called
_lib.spir_*_releaseon handles that 0.10 owns itself; theraw entry point now refuses them, and the exception surfaced from
__del__asa flood of warnings.
_util.release_handlecallsclose()when the handle hasone and falls back to the release function otherwise.
basis_get_default_matsus_extarity (sparse-ir-rs#274). The function grewa
basis_sizeargument and now returns the points.augment.pyinspects thesignature once — not the reported version, since development builds report an
older one — and calls whichever form is present.
Known backend defects (#265, #273). The oracle tests were strict xfails,
so they failed as XPASS against a backend that fixed them. They are now the
same two states the Julia suite uses: xfail while the error is far above
tolerance, assert once it is not.
pylibsparseirmoves to>=0.8.3,<0.11.0inpyproject.tomland.conda/meta.yaml.filterwarningsturnsPytestUnraisableExceptionWarninginto an error, so an exception in a finalizer fails the suite instead of being
reported as a warning — that is what hid #282.
Verified against pylibsparseir 0.9.1 from PyPI and against 0.10.0 built from
sparse-ir-rs main: 356 passed on both.