jax-ml / jax-ml/ml_dtypes

Test failures on RISC-V/musl [inverse trig functions, (b)complex32]

Open
#404 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
361
Forks
60
Avg merge
18h 41m
Merged PRs (30d)
3

Description

**Summary:**

```
=========================== short test summary info ============================
FAILED ml_dtypes/tests/custom_complex_test.py::test_unary_ufuncs[arcsin-complex32]
FAILED ml_dtypes/tests/custom_complex_test.py::test_unary_ufuncs[arcsin-bcomplex32]
FAILED ml_dtypes/tests/custom_complex_test.py::test_unary_ufuncs[arccos-complex32]
FAILED ml_dtypes/tests/custom_complex_test.py::test_unary_ufuncs[arccos-bcomplex32]
FAILED ml_dtypes/tests/custom_complex_test.py::test_unary_ufuncs[arctan-complex32]
FAILED ml_dtypes/tests/custom_complex_test.py::test_unary_ufuncs[arctan-bcomplex32]
FAILED ml_dtypes/tests/custom_complex_test.py::test_unary_ufuncs[arcsinh-complex32]
FAILED ml_dtypes/tests/custom_complex_test.py::test_unary_ufuncs[arcsinh-bcomplex32]
FAILED ml_dtypes/tests/custom_complex_test.py::test_unary_ufuncs[arccosh-complex32]
FAILED ml_dtypes/tests/custom_complex_test.py::test_unary_ufuncs[arccosh-bcomplex32]
FAILED ml_dtypes/tests/custom_complex_test.py::test_unary_ufuncs[arctanh-complex32]
FAILED ml_dtypes/tests/custom_complex_test.py::test_unary_ufuncs[arctanh-bcomplex32]
= 12 failed, 4892 passed, 19 skipped, 2804 subtests passed in 117.61s (0:01:57) =
```

Here are a few examples of what the diffs look like (I'm happy to post the others, but don't want to overwhelm the report).

**arcsin-complex32-**:

```
E AssertionError:
E Not equal to tolerance rtol=0.001, atol=0.001
E
E nan location mismatch:
E ACTUAL: array([ 0. -0.j , 1.570312-0.j , 0. +0.8
81348j,
E 0.666016+1.061523j, -0.666016-1.061523j, 0.452393+0.530762j,
E 0.570801-1.983398j, nan +nanj, nan -infj,..
.
E DESIRED: array([ 0. +0.j , 1.570312+0.j , 0. +0.
881348j,
E 0.666016+1.061523j, -0.666016-1.061523j, 0.452393+0.530762j,
E 0.570801-1.983398j, nan +nanj, 1.570312 +infj,..
.

ml_dtypes/tests/custom_complex_test.py:489: AssertionError
```

**arcsin-bcomplex32:**

```
E AssertionError:
E Not equal to tolerance rtol=0.01, atol=0.01
E
E nan location mismatch:
E ACTUAL: array([ 0. -0.j , 1.570312-0.j , 0. +0.8
82812j,
E 0.667969+1.0625j , -0.667969-1.0625j , 0.453125+0.53125j ,
E 0.570312-1.984375j, nan +nanj, nan -infj,..
.
E DESIRED: array([ 0. +0.j , 1.570312+0.j , 0. +0.
882812j,
E 0.667969+1.0625j , -0.667969-1.0625j , 0.453125+0.53125j ,
E 0.570312-1.984375j, nan +nanj, 1.570312 +infj,..
.
```

**arccos-complex32:**

```
E AssertionError:
E Not equal to tolerance rtol=0.001, atol=0.001
E
E nan location mismatch:
E ACTUAL: array([1.570312+0.j , 0. +0.j , 1.570312-0.8813
48j,
E 0.904785-1.061523j, 2.236328+1.061523j, 1.118164-0.530762j,
E 1. +1.983398j, nan +nanj, nan +infj,...
E DESIRED: array([1.570312-0.j , 0. -0.j , 1.570312-0.881
348j,
E 0.904785-1.061523j, 2.236328+1.061523j, 1.118164-0.530762j,
E 1. +1.983398j, nan +nanj, 0. -infj,...
```

If the libc is not involved here and if the architecture is the main suspect, I should mention that RISC-V does not propagate NaN payloads (see e.g. https://bugs.r-project.org/show_bug.cgi?id=18416 for a similar problem).

Contributor guide

Open the contributing guide

Research direction

Start by running the failing cases in ml_dtypes/tests/custom_complex_test.py, especially test_unary_ufuncs for the inverse trigonometric functions and complex32/bcomplex32. Compare the RISC-V/musl results with the expected arrays and investigate whether the discrepancy comes from the architecture or libc; done means the reported failures are resolved or their platform-specific behavior is covered appropriately.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
operating-systems, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.