Skip to content

[Testing] Split up scan tests#2676

Merged
danhoeflinger merged 15 commits into
mainfrom
dev/dhoeflin/split_scan_tests
May 6, 2026
Merged

[Testing] Split up scan tests#2676
danhoeflinger merged 15 commits into
mainfrom
dev/dhoeflin/split_scan_tests

Conversation

@danhoeflinger

@danhoeflinger danhoeflinger commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

This PR attempts to make the scan tests more manageable by breaking the current 2 tests into 8 tests.

The number of complicated kernels in individual tests is too large without this split causing issues with windows dpcpp debug tests. This also makes test results much more clear about what is failing when something does fail.

It should keep the same coverage with 3 caveats:

  1. fixes a bug in what used to be scan_2.pass (now utils_scan.h) where keys_last + n was used as the end of the sequence for a serial call (should be keys_first + n).
  2. Shifts the size of the "large" scan case down to 1M from 70M for debug cases. Its simply too large for our test suite.
  3. _PSTL_TEST_INCLUSIVE/EXCLUSIVE_SCAN ifdefs removed (each file tests one variant)

Here is a map of how things moved around:

  • scan.pass.cpp (deleted) -> split into:

    • test/support/utils_scan.h - helpers for both inclusive / exclusive tests
    • inclusive_scan.pass.cpp - test_with_plus (inclusive)
    • inclusive_scan_matrix.pass.cpp - test_matrix (inclusive binary_op)
    • inclusive_scan_multiplies.pass.cpp - test_with_multiplies (inclusive)
    • exclusive_scan.pass.cpp - test_with_plus (exclusive), added to existing file
    • exclusive_scan_matrix.pass.cpp - test_matrix (exclusive binary_op)
    • exclusive_scan_multiplies.pass.cpp - test_with_multiplies (exclusive)
  • scan_2.pass.cpp (renamed) -> split into:

    • test/support/utils_scan.h - helpers for both inclusive / exclusive tests
    • exclusive_scan_usm.pass.cpp - exclusive USM in-place/non-inplace tests (kept)
    • inclusive_scan_usm.pass.cpp - inclusive USM in-place/non-inplace tests (new)

Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the numeric scan tests to be more manageable by splitting the prior combined coverage into multiple focused test files (inclusive/exclusive, plus/binary-op/multiplies, and USM), while also fixing a serial-range bug and reducing the debug “large” test size.

Changes:

  • Split the former combined scan tests into separate inclusive/exclusive test executables (plus, matrix/binary-op, multiplies, and USM variants).
  • Extracted shared USM scan test helpers into test/support/utils_scan.h and fixed the serial expected-range end iterator (keys_first + n).
  • Reduced the debug large-case item count to 1M and removed inclusive/exclusive ifdef switching in favor of per-file variants.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/support/utils_scan.h Convert former USM scan test into reusable helper header; fix expected-range end iterator.
test/parallel_api/numeric/numeric.ops/scan.pass.cpp Delete old combined inclusive/exclusive scan test.
test/parallel_api/numeric/numeric.ops/inclusive_scan.pass.cpp New inclusive “plus” scan coverage (host + hetero large case).
test/parallel_api/numeric/numeric.ops/inclusive_scan_matrix.pass.cpp New inclusive binary-op “matrix” scan coverage (incl. in-place).
test/parallel_api/numeric/numeric.ops/inclusive_scan_multiplies.pass.cpp New inclusive multiplies scan coverage (hetero).
test/parallel_api/numeric/numeric.ops/inclusive_scan_usm.pass.cpp New inclusive USM scan coverage using shared helpers.
test/parallel_api/numeric/numeric.ops/exclusive_scan.pass.cpp Add exclusive “plus” scan coverage alongside existing USM tests.
test/parallel_api/numeric/numeric.ops/exclusive_scan_matrix.pass.cpp New exclusive binary-op “matrix” scan coverage (incl. in-place).
test/parallel_api/numeric/numeric.ops/exclusive_scan_multiplies.pass.cpp New exclusive multiplies scan coverage (hetero).
test/parallel_api/numeric/numeric.ops/exclusive_scan_usm.pass.cpp New exclusive USM scan coverage using shared helpers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/parallel_api/numeric/numeric.ops/inclusive_scan.pass.cpp
Comment thread test/parallel_api/numeric/numeric.ops/inclusive_scan_matrix.pass.cpp Outdated
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
@danhoeflinger danhoeflinger marked this pull request as ready for review May 4, 2026 19:56
@danhoeflinger danhoeflinger changed the title [Draft] Split up scan tests [Testing] Split up scan tests May 4, 2026
@SergeyKopienko

SergeyKopienko commented May 5, 2026

Copy link
Copy Markdown
Contributor

@danhoeflinger can you confirm that all large submitters will continue using with the new data size in debug mode?

@danhoeflinger

danhoeflinger commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

@danhoeflinger can you confirm that all large submitters will continue using with the new data size in debug mode?

@SergeyKopienko
Yes, for scan, the sizes for the large submitter are pretty small: either 2048 or 16k (depending on reduce_then_scan or not, or after my PRs ... CPU vs GPU). 1M elements will still hit the large submitters, as will some of the tests which are on the way to 100K in the main test search space.

SergeyKopienko
SergeyKopienko previously approved these changes May 6, 2026

@SergeyKopienko SergeyKopienko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SergeyKopienko SergeyKopienko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@danhoeflinger danhoeflinger merged commit fb97930 into main May 6, 2026
23 checks passed
@danhoeflinger danhoeflinger deleted the dev/dhoeflin/split_scan_tests branch May 6, 2026 13:22
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.

3 participants