Kotlin / Kotlin/multik

Flaky: QR decomposition ComplexDouble returns wrong result on Linux

Open
#288 0 comments 0 reactions 0 assignees View on GitHub
ai-generated bug
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

`NativeLinAlgEx.qrC` for `ComplexDouble` matrices produces incorrect QR decomposition intermittently on Linux (Ubuntu 22.04.5 LTS, gcc-12 12.3.0, JDK 21 Temurin). The test generates a 4x3 random ComplexDouble matrix (seeded with `Random(42)`), decomposes it into Q and R, and verifies `Q*R = A` with epsilon `1e-6`. Failed in 2 out of 4 CI runs.

### Reproducer

```kotlin
val a = data.getComplexDoubleM(4, 3) // deterministic 4x3 ComplexDouble matrix from Random(42)
val (q, r) = NativeLinAlgEx.qrC(a)

assertComplexFloatingNDArray(a, NativeLinAlgEx.dotMMComplex(q, r), epsilon = 1e-6) // Fails intermittently
```

### Additional information

```text
Flaky — failed in 2/4 CI runs.
AssertionFailedError at NativeLinAlgTest.kt:382.
CI runs: 22511673326, 22511741037.
Environment: Ubuntu 22.04.5 LTS, gcc-12 (12.3.0), g++-12, JDK 21 Temurin, x86_64.
```

Contributor guide

Open the contributing guide

Research direction

Start with NativeLinAlgTest.kt:382 and the seeded 4x3 ComplexDouble reproducer, then inspect NativeLinAlgEx.qrC and dotMMComplex in the multik-openblas module. Run the test on the stated Linux/JDK environment and compare successful and failing runs. Done means QR reconstruction consistently satisfies epsilon 1e-6.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.