Skip to content

Run dpnp.tensor tests in coverage workflow - #3094

Open
antonwolfy wants to merge 2 commits into
masterfrom
coverage-include-tensor-tests
Open

antonwolfy wants to merge 2 commits into
masterfrom
coverage-include-tensor-tests

Conversation

@antonwolfy

@antonwolfy antonwolfy commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

This PR extends the coverage workflow to also run dpnp.tensor tests, which are currently excluded by SKIP_TENSOR_TESTS=1.

Because of that, dpnp/tensor code is measured only through what dpnp tests happen to reach, and some lines end up covered by chance.

For example, line 809 of dpnp/tensor/_elementwise_common.py is reached deterministically only by dpnp/tests/tensor/elementwise/test_add.py::test_add_order. In the coverage run it is reached only by TestDotFor0Dim in the third-party tests, and only when the random dtype-pair sampling of for_all_dtypes_combination happens to include a float32 x int32/int64 pair. The line is missed in about 1/3 of runs (251 of 744 Coveralls builds since dpnp.tensor was introduced in #2856), which shows up as ±0.003% coverage noise on PRs without any source changes.

Note, enabling --tensor-cpp-coverage in CI is left for a follow-up. It may also need -ignore-filename-regex rules for libtensor kernel headers, similar to the existing ones for backend/kernels.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

Run dpnp.tensor tests in a separate pytest session that appends to the
coverage data of the main dpnp session, and merge the LLVM profiles of
both sessions.

Add --skip-tensor-tests option to keep the previous behavior, and
--tensor-cpp-coverage option to build dpnp.tensor pybind11 extensions
with coverage instrumentation and include them into C++ coverage.

Raise coverage workflow timeouts to account for the extra session.
@antonwolfy antonwolfy added this to the 0.21.0 release milestone Oct 12, 2026
@antonwolfy antonwolfy self-assigned this Oct 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

View rendered docs @ https://intelpython.github.io/dpnp/pull/3094/index.html

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Array API standard conformance tests for dpnp=0.21.0dev13=np2py314h8d9cdd5_7 ran successfully.
Passed: 1376
Failed: 0
Skipped: 6

@coveralls

coveralls commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Status

No base build to compare — coverage-include-tensor-tests into master

@antonwolfy
antonwolfy marked this pull request as ready for review October 12, 2026 17:21

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants