Skip to content

Conversation

@alliepiper
Copy link
Contributor

@alliepiper alliepiper commented Nov 1, 2025

  • CUB's usages of XFAIL compilation are updated to use the new utility.
  • test_device_segment_reduce_offset_type_fail test is fixed; the regexes weren't detected and some cases were failing for unintended reasons.
  • test_param_general_fail is added to test edge case.

Supports CUB-style in-source error regex extraction as defined the docs:

# cccl_add_xfail_compile_target_test(
#   <target_name>
#   [TEST_NAME <test_name>]
#   [ERROR_REGEX <regex>]
#   [SOURCE_FILE <source_file>]
#   [ERROR_REGEX_LABEL <error_string>]
#   [ERROR_NUMBER <error_number>]
#   [ERROR_NUMBER_TARGET_NAME_REGEX <regex>]
# )
#
# Given a configured build target that is expected to fail to compile:
# - Mark the target as excluded from the `all` target.
# - Create a CTest test that compiles the target. If TEST_NAME is provided, it is used.
#   Otherwise, the target_name is used as the test name.
# - When the test runs, it passes if exactly one of the following conditions is met:
#   - A provided / detected error regex matches the compilation output, ignoring exit code.
#   - No error regex is provided / detected, and the compilation fails.
#
# An error regex may be explicitly provided via ERROR_REGEX, or it may be
# detected by scanning the SOURCE_FILE for a specially formatted comment.
#
# If ERROR_REGEX_LABEL is provided, the SOURCE_FILE will read, looking for a comment of the form:
#
# // <ERROR_REGEX_LABEL> {{"error_regex"}}
#
# An error number may be appended to the ERROR_REGEX_LABEL in the comment:
#
# // <ERROR_REGEX_LABEL>-<error_number> {{"error_regex"}}
#
# If ERROR_NUMBER_TARGET_NAME_REGEX is specified, the regex is used to capture
# the error_number from the target name. If target_name is
# "cccl.test.my_test.err_5.foo_3" and ERROR_NUMBER_TARGET_NAME_REGEX is
# "\\.err_([0-9]+)", the captured error number "5."
#
# // <ERROR_REGEX_LABEL>-<captured_error_number> {{"error_regex"}}
#
# If ERROR_NUMBER is provided, ERROR_NUMBER_TARGET_NAME_REGEX is ignored.
# If ERROR_NUMBER_TARGET_NAME_REGEX is provided but does not match, a plain ERROR_REGEX_LABEL is used.

@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Nov 1, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Progress in CCCL Nov 1, 2025
@alliepiper
Copy link
Contributor Author

/ok to test

- CUB's usages of XFAIL compilation are updated to use the new utility.
- test_device_segment_reduce_offset_type_fail test is fixed; the regexes weren't detected and some cases were failing for unintended reasons.
- test_param_general_fail is added to test edge case.
@alliepiper
Copy link
Contributor Author

/ok to test

@alliepiper alliepiper marked this pull request as ready for review November 1, 2025 19:47
@alliepiper alliepiper requested review from a team as code owners November 1, 2025 19:47
@alliepiper alliepiper requested review from fbusato and wmaxey November 1, 2025 19:47
@cccl-authenticator-app cccl-authenticator-app bot moved this from In Progress to In Review in CCCL Nov 1, 2025
@github-actions

This comment was marked as outdated.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

🥳 CI Workflow Results

🟩 Finished in 8h 20m: Pass: 100%/263 | Total: 1d 08h | Max: 30m 27s | Hits: 99%/380769

See results here.

Comment on lines 832 to +838
using OutputTupleT = detail::non_void_value_t<OutputIteratorT, KeyValuePair<OffsetT, InputValueT>>;
using OutputKeyT = typename OutputTupleT::Key;
using OutputValueT = typename OutputTupleT::Value;
using AccumT = OutputTupleT;
using InitT = detail::reduce::empty_problem_init_t<AccumT>;

static_assert(::cuda::std::is_same_v<int, OutputKeyT>, "Output key type must be int.");
Copy link
Contributor

Choose a reason for hiding this comment

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

@elstehle does the output iterator's value type's key really have to be int or can it be another integral type (a larger offset type)? The documentation for OutputIteratorT says int.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FWIW, I originally tried is_convertible to int, but the compilation fails farther in if this isn't exactly int. The new static assert just gives a nicer error message that we can consistently check with the fail test.

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

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants