Fix Jacobi eigensolver convergence and improve ArrayFire bindings#71
Draft
dmjio wants to merge 2 commits into
Draft
Fix Jacobi eigensolver convergence and improve ArrayFire bindings#71dmjio wants to merge 2 commits into
dmjio wants to merge 2 commits into
Conversation
dmjio
commented
Jun 12, 2026
Member
- Replace sweep-based iteration with bounded rotation count and scale-invariant convergence detection (tol = 1e-14 * max|A|)
- Return error code 2 on non-convergence instead of silent inaccurate results
- Add input validation in af_eigsh: reject non-square or non-2D inputs
- Fix type signatures: add Fractional constraints to trigonometric functions, correct matcher return types to (Array Word32, Array a)
- Fix constant array creation for b8 and non-fp64 OpenCL devices
- Fix memory leaks in getInfoString and arrayToString (free af_alloc_host strings)
- Fix momentsAll to return variable-length list based on moment bitmask
- Guard createSparseArrayFromDense against all-zero matrices (prevents segfault)
- Add vision test skips for broken OpenCL backend on AF 3.8.2
- Replace sweep-based iteration with bounded rotation count and scale-invariant convergence detection (tol = 1e-14 * max|A|) - Return error code 2 on non-convergence instead of silent inaccurate results - Add input validation in af_eigsh: reject non-square or non-2D inputs - Fix type signatures: add Fractional constraints to trigonometric functions, correct matcher return types to (Array Word32, Array a) - Fix constant array creation for b8 and non-fp64 OpenCL devices - Fix memory leaks in getInfoString and arrayToString (free af_alloc_host strings) - Fix momentsAll to return variable-length list based on moment bitmask - Guard createSparseArrayFromDense against all-zero matrices (prevents segfault) - Add vision test skips for broken OpenCL backend on AF 3.8.2
AF's af_abs promotes through f64 internally, which makes the `abs x * signum x == x` law fail for signed-type minBound (overflow) and for 64-bit integers with |x| > 2^53 (precision loss). The ring structure is fully covered by semiringLaws + ringLaws, so numLaws is skipped for all integral element types. Also re-enables the hspec suite (586 examples, 0 failures, 17 platform- specific pendings) that was previously commented out. Co-Authored-By: Claude Sonnet 4.6 <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.