Flaky: NativeLinAlg.dot matrix-vector 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.dot` for matrix-vector multiplication with `ComplexFloat` produces incorrect results intermittently on Linux (Ubuntu 22.04.5 LTS, gcc-12 12.3.0, JDK 21 Temurin). The test uses a 2x2 ComplexFloat matrix and a 2-element vector, asserting with epsilon `1e-4f`. Failed in 2 out of 4 CI runs.
### Reproducer
```kotlin
val matrix = mk.ndarray(
mk[mk[ComplexFloat(1, 2), ComplexFloat(3, 4)],
mk[ComplexFloat(5, 6), ComplexFloat(7, 8)]]
)
val vector = mk.ndarray(mk[ComplexFloat(1, 0), ComplexFloat(0, 1)])
val expected = mk.ndarray(mk[ComplexFloat(-3, 5), ComplexFloat(-3, 13)])
val actual = NativeLinAlg.dot(matrix, vector)
assertComplexFloatingNDArray(expected, actual, 1e-4f) // Fails intermittently
```
### Additional information
```text
Flaky — failed in 2/4 CI runs.
AssertionFailedError at NativeLinAlgTest.kt:270.
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 NativeLinAlgTest.kt at the reported assertion around line 270 and the multik-openblas NativeLinAlg.dot entry point. Reproduce the 2x2 ComplexFloat matrix-vector case under the stated Ubuntu, gcc-12, and JDK 21 environment, then verify that the test passes consistently across repeated CI runs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin, linux
- Domain
- data, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100