Flaky: NativeLinAlg.inv ComplexFloat 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 `ComplexFloat` matrices produces incorrect inverse intermittently on Linux (Ubuntu 22.04.5 LTS, gcc-12 12.3.0, JDK 21 Temurin). The test generates an 84x84 random ComplexFloat matrix (seeded with `Random(42)`), computes its inverse, and verifies `A * A_inv = I` with epsilon `1e-4f`. Failed in 2 out of 4 CI runs.
### Reproducer
```kotlin
val a = data.getComplexFloatM(84) // deterministic 84x84 ComplexFloat matrix from Random(42)
val ainv = NativeLinAlg.inv(a)
assertComplexFloatingNDArray(mk.identity(84), NativeLinAlg.dot(a, ainv), 1e-4f) // Fails intermittently
```
### Additional information
```text
Flaky — failed in 2/4 CI runs.
AssertionFailedError at NativeLinAlgTest.kt:344.
CI runs: 22511673326, 22511861936.
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 failing case at NativeLinAlgTest.kt:344 and run the 84x84 seeded ComplexFloat inverse check in the reported Linux environment. Trace NativeLinAlg.inv and its OpenBLAS-backed path to identify why the result varies between runs. Done means the test consistently verifies A * A_inv = I within 1e-4f.
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
- 45/100