Skip to content

[libcu++] Skip __fp_set_exp fpclassify tests on denormals#9536

Merged
davebayer merged 1 commit into
NVIDIA:mainfrom
davebayer:disable_fp_set_exp_subnormal
Jun 23, 2026
Merged

[libcu++] Skip __fp_set_exp fpclassify tests on denormals#9536
davebayer merged 1 commit into
NVIDIA:mainfrom
davebayer:disable_fp_set_exp_subnormal

Conversation

@davebayer

Copy link
Copy Markdown
Contributor

Fixes nvbug 6303102

@davebayer davebayer marked this pull request as ready for review June 22, 2026 07:57
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Jun 22, 2026
@davebayer davebayer requested a review from a team as a code owner June 22, 2026 07:57
@davebayer davebayer requested a review from wmaxey June 22, 2026 07:57
@NVIDIA NVIDIA deleted a comment from copy-pr-bot Bot Jun 22, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Progress in CCCL Jun 22, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from In Progress to In Review in CCCL Jun 22, 2026
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 11f86303-62a5-446c-aae1-0414ece45df4

📥 Commits

Reviewing files that changed from the base of the PR and between 1c753b7 and ebe765c.

📒 Files selected for processing (1)
  • libcudacxx/test/libcudacxx/libcxx/numerics/floating.point/decompose/set_exp.pass.cpp

Note: CodeRabbit is enabled on this repository as a convenience for maintainers
and contributors. Use your best judgment when considering its review comments and
suggestions — a suggested change may be inadequate, unnecessary, or safe to ignore.
Contributors are not expected to address every comment. Human reviews are what
ultimately matter for merging.

Summary

This PR updates the __fp_set_exp test to skip fpclassify assertions that expect denormal/subnormal results to classify as FP_SUBNORMAL on NVHPC builds.

Changes

libcudacxx/test/libcudacxx/libcxx/numerics/floating.point/decompose/set_exp.pass.cpp

In the test_fp_set_exp denormal/subnormal coverage:

  • For the positive-denormal case (T{3}) and the signed-denormal case (T{-3}), the cuda::std::fpclassify(res) == FP_SUBNORMAL check is now guarded with #if !_CCCL_COMPILER(NVHPC).
  • The test keeps the other assertions unchanged (e.g., checks for isnormal, isnan, isinf, isfinite behavior).

Rationale

On some NVHPC configurations/architectures, subnormal values may be flushed to 0, and fpclassify is implemented via __builtin_fpclassify, which may therefore not reliably report FP_SUBNORMAL for denormal inputs. This targeted guard prevents spurious test failures while preserving the remaining correctness checks.

Walkthrough

Two fpclassify(res) == FP_SUBNORMAL assertions in the positive-denormal and negative-denormal subtests of test_fp_set_exp are wrapped with #if !TEST_COMPILER(NVHPC) guards. Comments explain that NVHPC flushes subnormals to zero via __builtin_fpclassify on some architectures.

Changes

Conditional FP_SUBNORMAL assertions for NVHPC compatibility

Layer / File(s) Summary
Disable FP_SUBNORMAL assertions for positive and negative denormal cases
libcudacxx/test/libcudacxx/libcxx/numerics/floating.point/decompose/set_exp.pass.cpp
Both fpclassify(res) == FP_SUBNORMAL assertions wrap with #if !TEST_COMPILER(NVHPC) guards and include notes that NVHPC flushes subnormals to zero via __builtin_fpclassify on some architectures.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
libcudacxx/test/libcudacxx/libcxx/numerics/floating.point/decompose/set_exp.pass.cpp (1)

68-70: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

suggestion: avoid disabling these checks for both targets; gate them so host skips the flaky fpclassify expectation while device still asserts FP_SUBNORMAL. This keeps coverage for __fp_set_exp denormal behavior without reintroducing host-compiler noise. As per coding guidelines, “Guard host-only or device-only behavior with NV_IF_TARGET(NV_IS_HOST, (...)) and NV_IF_TARGET(NV_IS_DEVICE, (...)) respectively.”

Also applies to: 80-82

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: bc450af0-5bd9-4e2f-a9b6-6c593e405120

📥 Commits

Reviewing files that changed from the base of the PR and between f52338f and 679576e.

📒 Files selected for processing (1)
  • libcudacxx/test/libcudacxx/libcxx/numerics/floating.point/decompose/set_exp.pass.cpp

@github-actions

This comment has been minimized.

@github-project-automation github-project-automation Bot moved this from In Review to In Progress in CCCL Jun 22, 2026
@davebayer davebayer force-pushed the disable_fp_set_exp_subnormal branch from 679576e to 1c753b7 Compare June 23, 2026 06:26
@davebayer davebayer requested a review from miscco June 23, 2026 06:26
@github-project-automation github-project-automation Bot moved this from In Progress to In Review in CCCL Jun 23, 2026
@davebayer davebayer force-pushed the disable_fp_set_exp_subnormal branch from 1c753b7 to ebe765c Compare June 23, 2026 06:37
@davebayer davebayer enabled auto-merge (squash) June 23, 2026 06:37
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 2h 48m: Pass: 100%/69 | Total: 1d 20h | Max: 1h 07m | Hits: 99%/312003

See results here.

@davebayer davebayer merged commit 18d62e4 into NVIDIA:main Jun 23, 2026
175 of 178 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Successfully created backport PR for branch/3.4.x:

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

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants