Skip to content

Fix Jacobi eigensolver convergence and improve ArrayFire bindings#71

Draft
dmjio wants to merge 2 commits into
masterfrom
af-api-updates
Draft

Fix Jacobi eigensolver convergence and improve ArrayFire bindings#71
dmjio wants to merge 2 commits into
masterfrom
af-api-updates

Conversation

@dmjio

@dmjio dmjio commented Jun 12, 2026

Copy link
Copy Markdown
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
@dmjio dmjio marked this pull request as draft June 13, 2026 00:24
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant