Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix value range overflows in tests #3022

Merged
merged 1 commit into from
Dec 4, 2024
Merged

Conversation

Artem-B
Copy link
Contributor

@Artem-B Artem-B commented Dec 3, 2024

Description

closes #3021

random_integers<fp-type>() may generate values not representable as an integer type, which results in undefined behavior when we attempt to cast them to integer type later on.

To avoid that, generate random numbers using the integer type we'll cast to later on, so we're guaranteed to have representable values.

Checklist

  • New or existing tests cover these changes.
  • [n/a] The documentation is up to date with these changes.

@Artem-B Artem-B requested review from a team as code owners December 3, 2024 22:43
@Artem-B Artem-B requested review from alliepiper and fbusato December 3, 2024 22:43
Copy link

copy-pr-bot bot commented Dec 3, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@Artem-B
Copy link
Contributor Author

Artem-B commented Dec 3, 2024

@miscco FYI. This fixes another set of ubsan issues I'm still sorting through.

`random_integers<fp-type>()` may generate values not representable as an integer type,
which results in undefined behavior when we attempt to cast them to integer type later on.

To avoid that, generate random numbers using the integer type we'll cast to later on,
so we're guaranteed to have representable values.
@miscco
Copy link
Collaborator

miscco commented Dec 4, 2024

/ok to test

@miscco miscco enabled auto-merge (squash) December 4, 2024 08:24
Copy link
Contributor

github-actions bot commented Dec 4, 2024

🟩 CI finished in 2h 34m: Pass: 100%/224 | Total: 1d 19h | Avg: 11m 37s | Max: 41m 37s | Hits: 98%/12288
  • 🟩 thrust: Pass: 100%/111 | Total: 15h 32m | Avg: 8m 23s | Max: 23m 01s | Hits: 98%/9260

    🟩 cmake_options
      🟩 -DTHRUST_DISPATCH_TYPE=Force32bit Pass: 100%/2   | Total: 24m 35s | Avg: 12m 17s | Max: 17m 16s
    🟩 cpu
      🟩 amd64              Pass: 100%/103 | Total: 14h 37m | Avg:  8m 31s | Max: 23m 01s | Hits:  98%/9260  
      🟩 arm64              Pass: 100%/8   | Total: 54m 56s | Avg:  6m 52s | Max:  7m 53s
    🟩 ctk
      🟩 11.1               Pass: 100%/15  | Total:  1h 43m | Avg:  6m 54s | Max: 18m 30s | Hits:  98%/1852  
      🟩 11.8               Pass: 100%/3   | Total: 23m 10s | Avg:  7m 43s | Max:  8m 23s
      🟩 12.5               Pass: 100%/4   | Total:  1h 07m | Avg: 16m 54s | Max: 17m 28s
      🟩 12.6               Pass: 100%/89  | Total: 12h 17m | Avg:  8m 17s | Max: 23m 01s | Hits:  98%/7408  
    🟩 cudacxx
      🟩 ClangCUDA18        Pass: 100%/4   | Total: 27m 06s | Avg:  6m 46s | Max:  7m 13s
      🟩 nvcc11.1           Pass: 100%/15  | Total:  1h 43m | Avg:  6m 54s | Max: 18m 30s | Hits:  98%/1852  
      🟩 nvcc11.8           Pass: 100%/3   | Total: 23m 10s | Avg:  7m 43s | Max:  8m 23s
      🟩 nvcc12.5           Pass: 100%/4   | Total:  1h 07m | Avg: 16m 54s | Max: 17m 28s
      🟩 nvcc12.6           Pass: 100%/85  | Total: 11h 50m | Avg:  8m 21s | Max: 23m 01s | Hits:  98%/7408  
    🟩 cudacxx_family
      🟩 ClangCUDA          Pass: 100%/4   | Total: 27m 06s | Avg:  6m 46s | Max:  7m 13s
      🟩 nvcc               Pass: 100%/107 | Total: 15h 05m | Avg:  8m 27s | Max: 23m 01s | Hits:  98%/9260  
    🟩 cxx
      🟩 Clang9             Pass: 100%/6   | Total: 42m 37s | Avg:  7m 06s | Max:  8m 26s
      🟩 Clang10            Pass: 100%/3   | Total: 25m 12s | Avg:  8m 24s | Max:  8m 55s
      🟩 Clang11            Pass: 100%/4   | Total: 28m 24s | Avg:  7m 06s | Max:  7m 56s
      🟩 Clang12            Pass: 100%/4   | Total: 28m 29s | Avg:  7m 07s | Max:  7m 32s
      🟩 Clang13            Pass: 100%/4   | Total: 28m 46s | Avg:  7m 11s | Max:  7m 35s
      🟩 Clang14            Pass: 100%/4   | Total: 27m 39s | Avg:  6m 54s | Max:  7m 24s
      🟩 Clang15            Pass: 100%/4   | Total: 29m 47s | Avg:  7m 26s | Max:  8m 26s
      🟩 Clang16            Pass: 100%/4   | Total: 28m 46s | Avg:  7m 11s | Max:  7m 19s
      🟩 Clang17            Pass: 100%/4   | Total: 28m 05s | Avg:  7m 01s | Max:  7m 22s
      🟩 Clang18            Pass: 100%/11  | Total:  1h 27m | Avg:  7m 56s | Max: 18m 06s
      🟩 GCC6               Pass: 100%/2   | Total: 12m 09s | Avg:  6m 04s | Max:  6m 29s
      🟩 GCC7               Pass: 100%/6   | Total: 38m 43s | Avg:  6m 27s | Max:  7m 18s
      🟩 GCC8               Pass: 100%/6   | Total: 38m 27s | Avg:  6m 24s | Max:  7m 13s
      🟩 GCC9               Pass: 100%/6   | Total: 39m 23s | Avg:  6m 33s | Max:  7m 18s
      🟩 GCC10              Pass: 100%/4   | Total: 28m 24s | Avg:  7m 06s | Max:  7m 31s
      🟩 GCC11              Pass: 100%/7   | Total: 51m 42s | Avg:  7m 23s | Max:  8m 23s
      🟩 GCC12              Pass: 100%/4   | Total: 32m 22s | Avg:  8m 05s | Max:  8m 39s
      🟩 GCC13              Pass: 100%/16  | Total:  2h 18m | Avg:  8m 39s | Max: 17m 16s
      🟩 Intel2023.2.0      Pass: 100%/3   | Total: 28m 41s | Avg:  9m 33s | Max: 10m 09s
      🟩 MSVC14.16          Pass: 100%/1   | Total: 18m 30s | Avg: 18m 30s | Max: 18m 30s | Hits:  98%/1852  
      🟩 MSVC14.29          Pass: 100%/2   | Total: 37m 38s | Avg: 18m 49s | Max: 18m 51s | Hits:  98%/3704  
      🟩 MSVC14.39          Pass: 100%/2   | Total: 45m 04s | Avg: 22m 32s | Max: 23m 01s | Hits:  98%/3704  
      🟩 NVHPC24.7          Pass: 100%/4   | Total:  1h 07m | Avg: 16m 54s | Max: 17m 28s
    🟩 cxx_family
      🟩 Clang              Pass: 100%/48  | Total:  5h 55m | Avg:  7m 23s | Max: 18m 06s
      🟩 GCC                Pass: 100%/51  | Total:  6h 19m | Avg:  7m 26s | Max: 17m 16s
      🟩 Intel              Pass: 100%/3   | Total: 28m 41s | Avg:  9m 33s | Max: 10m 09s
      🟩 MSVC               Pass: 100%/5   | Total:  1h 41m | Avg: 20m 14s | Max: 23m 01s | Hits:  98%/9260  
      🟩 NVHPC              Pass: 100%/4   | Total:  1h 07m | Avg: 16m 54s | Max: 17m 28s
    🟩 gpu
      🟩 v100               Pass: 100%/111 | Total: 15h 32m | Avg:  8m 23s | Max: 23m 01s | Hits:  98%/9260  
    🟩 jobs
      🟩 Build              Pass: 100%/103 | Total: 13h 37m | Avg:  7m 56s | Max: 22m 03s | Hits:  98%/7408  
      🟩 TestCPU            Pass: 100%/4   | Total: 49m 55s | Avg: 12m 28s | Max: 23m 01s | Hits:  99%/1852  
      🟩 TestGPU            Pass: 100%/4   | Total:  1h 04m | Avg: 16m 12s | Max: 18m 06s
    🟩 sm
      🟩 60;70;80;90        Pass: 100%/3   | Total: 23m 10s | Avg:  7m 43s | Max:  8m 23s
      🟩 90a                Pass: 100%/4   | Total: 21m 42s | Avg:  5m 25s | Max:  6m 18s
    🟩 std
      🟩 11                 Pass: 100%/30  | Total:  3h 41m | Avg:  7m 22s | Max: 16m 36s
      🟩 14                 Pass: 100%/29  | Total:  3h 56m | Avg:  8m 09s | Max: 18m 51s | Hits:  98%/3704  
      🟩 17                 Pass: 100%/27  | Total:  3h 40m | Avg:  8m 09s | Max: 18m 47s | Hits:  98%/1852  
      🟩 20                 Pass: 100%/23  | Total:  3h 49m | Avg:  9m 58s | Max: 23m 01s | Hits:  98%/3704  
    
  • 🟩 cub: Pass: 100%/110 | Total: 1d 03h | Avg: 14m 58s | Max: 41m 37s | Hits: 99%/3028

    🟩 cpu
      🟩 amd64              Pass: 100%/102 | Total:  1d 01h | Avg: 15m 03s | Max: 39m 50s | Hits:  99%/3028  
      🟩 arm64              Pass: 100%/8   | Total:  1h 51m | Avg: 13m 55s | Max: 41m 37s
    🟩 ctk
      🟩 11.1               Pass: 100%/15  | Total:  1h 18m | Avg:  5m 13s | Max: 14m 27s | Hits:  99%/757   
      🟩 11.8               Pass: 100%/3   | Total: 17m 08s | Avg:  5m 42s | Max:  6m 14s
      🟩 12.5               Pass: 100%/4   | Total:  1h 33m | Avg: 23m 29s | Max: 39m 28s
      🟩 12.6               Pass: 100%/88  | Total:  1d 00h | Avg: 16m 34s | Max: 41m 37s | Hits:  99%/2271  
    🟩 cudacxx
      🟩 ClangCUDA18        Pass: 100%/4   | Total: 18m 23s | Avg:  4m 35s | Max:  4m 46s
      🟩 nvcc11.1           Pass: 100%/15  | Total:  1h 18m | Avg:  5m 13s | Max: 14m 27s | Hits:  99%/757   
      🟩 nvcc11.8           Pass: 100%/3   | Total: 17m 08s | Avg:  5m 42s | Max:  6m 14s
      🟩 nvcc12.5           Pass: 100%/4   | Total:  1h 33m | Avg: 23m 29s | Max: 39m 28s
      🟩 nvcc12.6           Pass: 100%/84  | Total: 23h 59m | Avg: 17m 08s | Max: 41m 37s | Hits:  99%/2271  
    🟩 cudacxx_family
      🟩 ClangCUDA          Pass: 100%/4   | Total: 18m 23s | Avg:  4m 35s | Max:  4m 46s
      🟩 nvcc               Pass: 100%/106 | Total:  1d 03h | Avg: 15m 22s | Max: 41m 37s | Hits:  99%/3028  
    🟩 cxx
      🟩 Clang9             Pass: 100%/6   | Total:  1h 02m | Avg: 10m 20s | Max: 34m 46s
      🟩 Clang10            Pass: 100%/3   | Total: 48m 03s | Avg: 16m 01s | Max: 34m 49s
      🟩 Clang11            Pass: 100%/4   | Total:  1h 22m | Avg: 20m 31s | Max: 37m 41s
      🟩 Clang12            Pass: 100%/4   | Total: 21m 48s | Avg:  5m 27s | Max:  5m 32s
      🟩 Clang13            Pass: 100%/4   | Total:  1h 54m | Avg: 28m 35s | Max: 39m 50s
      🟩 Clang14            Pass: 100%/4   | Total: 52m 42s | Avg: 13m 10s | Max: 35m 20s
      🟩 Clang15            Pass: 100%/4   | Total: 52m 34s | Avg: 13m 08s | Max: 35m 50s
      🟩 Clang16            Pass: 100%/4   | Total:  1h 19m | Avg: 19m 56s | Max: 35m 34s
      🟩 Clang17            Pass: 100%/4   | Total:  1h 51m | Avg: 27m 55s | Max: 36m 06s
      🟩 Clang18            Pass: 100%/11  | Total:  1h 29m | Avg:  8m 10s | Max: 23m 25s
      🟩 GCC6               Pass: 100%/2   | Total:  8m 59s | Avg:  4m 29s | Max:  4m 40s
      🟩 GCC7               Pass: 100%/6   | Total:  1h 31m | Avg: 15m 11s | Max: 37m 08s
      🟩 GCC8               Pass: 100%/6   | Total:  1h 30m | Avg: 15m 00s | Max: 36m 11s
      🟩 GCC9               Pass: 100%/6   | Total:  1h 27m | Avg: 14m 31s | Max: 34m 06s
      🟩 GCC10              Pass: 100%/4   | Total: 51m 00s | Avg: 12m 45s | Max: 33m 33s
      🟩 GCC11              Pass: 100%/7   | Total:  1h 07m | Avg:  9m 39s | Max: 33m 45s
      🟩 GCC12              Pass: 100%/4   | Total: 52m 10s | Avg: 13m 02s | Max: 34m 21s
      🟩 GCC13              Pass: 100%/16  | Total:  4h 47m | Avg: 17m 59s | Max: 41m 37s
      🟩 Intel2023.2.0      Pass: 100%/3   | Total: 48m 15s | Avg: 16m 05s | Max: 35m 12s
      🟩 MSVC14.16          Pass: 100%/1   | Total: 14m 27s | Avg: 14m 27s | Max: 14m 27s | Hits:  99%/757   
      🟩 MSVC14.29          Pass: 100%/2   | Total: 26m 22s | Avg: 13m 11s | Max: 13m 27s | Hits:  99%/1514  
      🟩 MSVC14.39          Pass: 100%/1   | Total: 13m 45s | Avg: 13m 45s | Max: 13m 45s | Hits:  99%/757   
      🟩 NVHPC24.7          Pass: 100%/4   | Total:  1h 33m | Avg: 23m 29s | Max: 39m 28s
    🟩 cxx_family
      🟩 Clang              Pass: 100%/48  | Total: 11h 54m | Avg: 14m 53s | Max: 39m 50s
      🟩 GCC                Pass: 100%/51  | Total: 12h 15m | Avg: 14m 25s | Max: 41m 37s
      🟩 Intel              Pass: 100%/3   | Total: 48m 15s | Avg: 16m 05s | Max: 35m 12s
      🟩 MSVC               Pass: 100%/4   | Total: 54m 34s | Avg: 13m 38s | Max: 14m 27s | Hits:  99%/3028  
      🟩 NVHPC              Pass: 100%/4   | Total:  1h 33m | Avg: 23m 29s | Max: 39m 28s
    🟩 gpu
      🟩 v100               Pass: 100%/110 | Total:  1d 03h | Avg: 14m 58s | Max: 41m 37s | Hits:  99%/3028  
    🟩 jobs
      🟩 Build              Pass: 100%/102 | Total:  1d 00h | Avg: 14m 22s | Max: 41m 37s | Hits:  99%/3028  
      🟩 DeviceLaunch       Pass: 100%/1   | Total: 25m 16s | Avg: 25m 16s | Max: 25m 16s
      🟩 GraphCapture       Pass: 100%/1   | Total: 17m 04s | Avg: 17m 04s | Max: 17m 04s
      🟩 HostLaunch         Pass: 100%/3   | Total:  1h 03m | Avg: 21m 13s | Max: 24m 58s
      🟩 TestGPU            Pass: 100%/3   | Total:  1h 16m | Avg: 25m 20s | Max: 30m 05s
    🟩 sm
      🟩 60;70;80;90        Pass: 100%/3   | Total: 17m 08s | Avg:  5m 42s | Max:  6m 14s
      🟩 90a                Pass: 100%/4   | Total: 47m 23s | Avg: 11m 50s | Max: 14m 42s
    🟩 std
      🟩 11                 Pass: 100%/30  | Total:  8h 47m | Avg: 17m 34s | Max: 40m 08s
      🟩 14                 Pass: 100%/29  | Total:  5h 53m | Avg: 12m 10s | Max: 37m 41s | Hits:  99%/1514  
      🟩 17                 Pass: 100%/27  | Total:  6h 19m | Avg: 14m 03s | Max: 39m 50s | Hits:  99%/757   
      🟩 20                 Pass: 100%/24  | Total:  6h 27m | Avg: 16m 09s | Max: 41m 37s | Hits:  99%/757   
    
  • 🟩 cccl_c_parallel: Pass: 100%/2 | Total: 9m 22s | Avg: 4m 41s | Max: 7m 16s

    🟩 cpu
      🟩 amd64              Pass: 100%/2   | Total:  9m 22s | Avg:  4m 41s | Max:  7m 16s
    🟩 ctk
      🟩 12.6               Pass: 100%/2   | Total:  9m 22s | Avg:  4m 41s | Max:  7m 16s
    🟩 cudacxx
      🟩 nvcc12.6           Pass: 100%/2   | Total:  9m 22s | Avg:  4m 41s | Max:  7m 16s
    🟩 cudacxx_family
      🟩 nvcc               Pass: 100%/2   | Total:  9m 22s | Avg:  4m 41s | Max:  7m 16s
    🟩 cxx
      🟩 GCC13              Pass: 100%/2   | Total:  9m 22s | Avg:  4m 41s | Max:  7m 16s
    🟩 cxx_family
      🟩 GCC                Pass: 100%/2   | Total:  9m 22s | Avg:  4m 41s | Max:  7m 16s
    🟩 gpu
      🟩 v100               Pass: 100%/2   | Total:  9m 22s | Avg:  4m 41s | Max:  7m 16s
    🟩 jobs
      🟩 Build              Pass: 100%/1   | Total:  2m 06s | Avg:  2m 06s | Max:  2m 06s
      🟩 Test               Pass: 100%/1   | Total:  7m 16s | Avg:  7m 16s | Max:  7m 16s
    
  • 🟩 python: Pass: 100%/1 | Total: 15m 17s | Avg: 15m 17s | Max: 15m 17s

    🟩 cpu
      🟩 amd64              Pass: 100%/1   | Total: 15m 17s | Avg: 15m 17s | Max: 15m 17s
    🟩 ctk
      🟩 12.6               Pass: 100%/1   | Total: 15m 17s | Avg: 15m 17s | Max: 15m 17s
    🟩 cudacxx
      🟩 nvcc12.6           Pass: 100%/1   | Total: 15m 17s | Avg: 15m 17s | Max: 15m 17s
    🟩 cudacxx_family
      🟩 nvcc               Pass: 100%/1   | Total: 15m 17s | Avg: 15m 17s | Max: 15m 17s
    🟩 cxx
      🟩 GCC13              Pass: 100%/1   | Total: 15m 17s | Avg: 15m 17s | Max: 15m 17s
    🟩 cxx_family
      🟩 GCC                Pass: 100%/1   | Total: 15m 17s | Avg: 15m 17s | Max: 15m 17s
    🟩 gpu
      🟩 v100               Pass: 100%/1   | Total: 15m 17s | Avg: 15m 17s | Max: 15m 17s
    🟩 jobs
      🟩 Test               Pass: 100%/1   | Total: 15m 17s | Avg: 15m 17s | Max: 15m 17s
    

👃 Inspect Changes

Modifications in project?

Project
CCCL Infrastructure
libcu++
CUB
+/- Thrust
CUDA Experimental
python
CCCL C Parallel Library
Catch2Helper

Modifications in project or dependencies?

Project
CCCL Infrastructure
libcu++
+/- CUB
+/- Thrust
CUDA Experimental
+/- python
+/- CCCL C Parallel Library
+/- Catch2Helper

🏃‍ Runner counts (total jobs: 224)

# Runner
185 linux-amd64-cpu16
16 linux-arm64-cpu16
14 linux-amd64-gpu-v100-latest-1
9 windows-amd64-cpu16

@miscco miscco merged commit 01310b3 into NVIDIA:main Dec 4, 2024
239 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[BUG]: UB in thrust tests caused by out-of range conversion from FP types to integers.
2 participants