Flaky: NativeLinAlg.inv ComplexDouble returns wrong result on Linux
- Dominant language
- Kotlin
- Stars
- 734
- Forks
- 51
- Avg merge
- 9h 52m
- Merged PRs (30d)
- 6
Description
### Multik version
0.3.0
### Module
multik-openblas
### Platform
JVM
### Operating System
Linux
### Description
`NativeLinAlg.inv` for `ComplexDouble` matrices produces incorrect inverse intermittently on Linux (Ubuntu 22.04.5 LTS, gcc-12 12.3.0, JDK 21 Temurin). The test generates an 83x83 random ComplexDouble matrix (seeded with `Random(42)`), computes its inverse, and verifies `A * A_inv = I` with default epsilon. Failed in 2 out of 4 CI runs.
### Reproducer
```kotlin
val a = data.getComplexDoubleM(83) // deterministic 83x83 ComplexDouble matrix from Random(42)
val ainv = NativeLinAlg.inv(a)
assertComplexFloatingNDArray(mk.identity(83), NativeLinAlg.dot(a, ainv)) // Fails intermittently
```
### Additional information
```text
Flaky — failed in 2/4 CI runs.
AssertionFailedError at NativeLinAlgTest.kt:352.
CI runs: 22511673326, 22511741037.
Environment: Ubuntu 22.04.5 LTS, gcc-12 (12.3.0), g++-12, JDK 21 Temurin, x86_64.
```
Contributor guide
Research direction
Start with the multik-openblas implementation and NativeLinAlgTest.kt:352, then run the seeded 83x83 ComplexDouble reproducer on Linux. Investigate why NativeLinAlg.inv intermittently produces an incorrect result and confirm that NativeLinAlg.dot(a, ainv) satisfies the identity assertion consistently in the reported environment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100