Skip to content

Commit 6a2d754

Browse files
authored
Merge branch 'main' into prepare-3.15
2 parents f00d958 + f707a1f commit 6a2d754

52 files changed

Lines changed: 576 additions & 151 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎ci/tools/retry_lychee.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,17 @@ def attempt_report(report: Path, attempt: int) -> Path:
135135

136136
def finish(report: Path, data: Report, exit_codes: list[int], message: str, *, warning: bool = False) -> None:
137137
"""Publish the final result without presenting recovered failures as current."""
138+
details = render_report(data)
138139
summary = f"## Documentation links\n\n{message}\n\n| Attempt | Exit code |\n| --- | --- |\n"
139140
summary += "".join(f"| {attempt} | {code} |\n" for attempt, code in enumerate(exit_codes, start=1))
140-
summary += f"\n### Final attempt\n\n{render_report(data)}\n"
141+
summary += f"\n### Final attempt\n\n{details}\n"
141142
report.with_suffix(".md").write_text(summary, encoding="utf-8")
143+
# CI console logs previously showed only the short message when LYCHEE_REPORT_DIR
144+
# forced --format json. Echo the final failure table so broken URLs are visible
145+
# without opening the uploaded report artifact (Fixes #3204).
142146
print(f"::warning::{message}" if warning else message, flush=True)
147+
if data.failures:
148+
print(details, flush=True)
143149
if summary_path := os.environ.get("GITHUB_STEP_SUMMARY"):
144150
with Path(summary_path).open("a", encoding="utf-8") as stream:
145151
stream.write(summary)

‎ci/tools/tests/test_retry_lychee.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,17 @@ def test_http_timeout_map_entries_are_retryable(tmp_path, code):
133133
],
134134
)
135135
@pytest.mark.agent_authored(model="gpt-6")
136-
def test_permanent_or_unknown_failures_stop_without_sleep_or_retry(tmp_path, monkeypatch, failure):
136+
def test_permanent_or_unknown_failures_stop_without_sleep_or_retry(tmp_path, monkeypatch, capsys, failure):
137137
report = tmp_path / "lychee.json"
138138
write_report(report, report_data(errors=[failure]))
139139
monkeypatch.setattr(retry_lychee.time, "sleep", lambda _delay: pytest.fail("Unexpected sleep"))
140140

141141
assert retry_lychee.retry_lychee(2, report, run_attempt=unexpected_retry) == 2
142142
assert "permanent or unclassified" in report.with_suffix(".md").read_text(encoding="utf-8")
143+
out = capsys.readouterr().out
144+
assert "permanent or unclassified" in out
145+
assert "| Source | URL | Status |" in out
146+
assert retry_lychee.escape_markdown(failure["url"]) in out
143147

144148

145149
@pytest.mark.agent_authored(model="gpt-6")

‎cuda_bindings_12/build_hooks.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -352,12 +352,12 @@ def _parse_headers(header_dict, include_path_list, parser_caching):
352352
CUDA_VERSION = parser.defs["macros"].get("CUDA_VERSION", "Unknown")
353353
print(f"Found CUDA_VERSION: {CUDA_VERSION}", flush=True)
354354

355-
found_types += {key for key in parser.defs["types"]}
356-
found_types += {key for key in parser.defs["structs"]}
357-
found_types += {key for key in parser.defs["unions"]}
358-
found_types += {key for key in parser.defs["enums"]}
359-
found_functions += {key for key in parser.defs["functions"]}
360-
found_values += {key for key in parser.defs["values"]}
355+
found_types += {*parser.defs["types"]}
356+
found_types += {*parser.defs["structs"]}
357+
found_types += {*parser.defs["unions"]}
358+
found_types += {*parser.defs["enums"]}
359+
found_functions += {*parser.defs["functions"]}
360+
found_values += {*parser.defs["values"]}
361361

362362
for key, value in parser.defs["structs"].items():
363363
struct_list[key] = _Struct(key, value["members"])

‎cuda_bindings_12/cuda/bindings/utils/__init__.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
from typing import Any, Callable
4+
from typing import Any
5+
from collections.abc import Callable
56

67
from ._ptx_utils import get_minimal_required_cuda_ver_from_ptx_ver, get_ptx_ver
78

‎cuda_bindings_12/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,7 @@ def main():
12001200
if kernel_number < 8:
12011201
selected_kernel = kernels(kernel_number)
12021202
else:
1203-
print("Error: kernel number should be between 0 to 7, you have entered %d".format())
1203+
print(f"Error: kernel number should be between 0 to 7, you have entered {kernel_number}")
12041204
sys.exit(-1)
12051205

12061206
major = checkCudaErrors(

‎cuda_bindings_12/setup.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ class TopLevelFinderWithRedirector(_TopLevelFinder):
9292
"""Include the redirector files in the editable wheel."""
9393

9494
def get_implementation(self):
95-
for item in super().get_implementation(): # noqa: UP028
96-
yield item
95+
yield from super().get_implementation()
9796

9897
with open(SITE_PACKAGES / REDIRECTOR_PTH) as f:
9998
yield (REDIRECTOR_PTH, f.read())

‎cuda_bindings_12/tests/nvml/test_init.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_devices_are_the_same_architecture(all_devices):
2525
# they won't be tested properly. This tests for the (hopefully rare) case
2626
# where a system has devices of different architectures and produces a warning.
2727

28-
all_arches = set(nvml.DeviceArch(nvml.device_get_architecture(device)) for device in all_devices)
28+
all_arches = {nvml.DeviceArch(nvml.device_get_architecture(device)) for device in all_devices}
2929

3030
if len(all_arches) > 1:
3131
warnings.warn( # noqa: B028

‎cuda_bindings_13/cuda/bindings/utils/__init__.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
3-
from typing import Any, Callable
3+
from collections.abc import Callable
4+
from typing import Any
45

56
from ._envvar import envvar_bool
67
from ._nvvm_utils import check_nvvm_compiler_options

‎cuda_bindings_13/cuda/bindings/utils/_nvvm_utils.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
from typing import Sequence
4+
from collections.abc import Sequence
55

66
_PRECHECK_NVVM_IR = """target triple = "nvptx64-unknown-cuda"
77
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-i128:128:128-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64"

‎cuda_core/.clang-tidy‎

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
# Layout is clang-format's job (see .clang-format), so clang-tidy does no
6+
# formatting of its own (FormatStyle: none below). Each enabled check is meant
7+
# to be adoptable on its own, so findings can be fixed one check at a time.
8+
#
9+
# Checks are opt-in (-*) by group, minus the ones below. They cannot be
10+
# commented inline because Checks is a single YAML string.
11+
#
12+
# Disabled because they conflict with the C-style CUDA driver API idioms:
13+
# bugprone-easily-swappable-parameters: wrappers of driver calls take many
14+
# adjacent parameters of the same type; the signatures mirror the API.
15+
# bugprone-assignment-in-if-condition: `if (CUDA_SUCCESS != (err = CALL(...)))`
16+
# is the standard error-handling pattern here.
17+
# performance-no-int-to-ptr: opaque handles and file descriptors are
18+
# converted to pointers with reinterpret_cast on purpose.
19+
# modernize-avoid-c-arrays: arrays are passed to and filled by C APIs.
20+
# modernize-return-braced-init-list: `return {};` vs. an explicit type is
21+
# left to the author; it adds noise for the driver-API result structs.
22+
# bugprone-throwing-static-initialization: the handle registries are
23+
# process-lifetime globals whose constructors allocate on some standard
24+
# libraries (MSVC); running out of memory while loading the module is
25+
# fatal either way.
26+
#
27+
# Disabled because they do not match the codebase style:
28+
# performance-enum-size: enum underlying types are left as they are.
29+
# misc-const-correctness: const on every local is not the convention here.
30+
# readability-function-cognitive-complexity: too disruptive.
31+
# readability-identifier-length: short names such as the handle parameter `h`
32+
# are used throughout.
33+
# readability-implicit-bool-conversion: `if (ptr)` and `if (handle)` are the
34+
# idiom for pointers and handles.
35+
# misc-include-cleaner: too noisy with the CUDA and CPython umbrella headers.
36+
# misc-no-recursion: recursion is used deliberately.
37+
# misc-use-anonymous-namespace: file-local functions use `static`.
38+
# modernize-use-trailing-return-type: the code uses `Type\nname()` layout.
39+
Checks: >
40+
-*,
41+
bugprone-*,
42+
-bugprone-easily-swappable-parameters,
43+
-bugprone-assignment-in-if-condition,
44+
-bugprone-throwing-static-initialization,
45+
clang-analyzer-*,
46+
misc-*,
47+
-misc-include-cleaner,
48+
-misc-const-correctness,
49+
-misc-no-recursion,
50+
-misc-use-anonymous-namespace,
51+
modernize-*,
52+
-modernize-use-trailing-return-type,
53+
-modernize-avoid-c-arrays,
54+
-modernize-return-braced-init-list,
55+
performance-*,
56+
-performance-enum-size,
57+
-performance-no-int-to-ptr,
58+
readability-*,
59+
-readability-function-cognitive-complexity,
60+
-readability-identifier-length,
61+
-readability-implicit-bool-conversion
62+
FormatStyle: none
63+
CheckOptions:
64+
# Records whose members are all public (the *Box and guard structs) are plain
65+
# data holders; only a mix of public and private members is flagged.
66+
misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic: true
67+
WarningsAsErrors: '*'
68+
# Only report diagnostics for our own headers, not CUDA/CPython/libstdc++.
69+
HeaderFilterRegex: 'cuda[/\\]core[/\\]_(cpp|include)[/\\]'
70+
ExcludeHeaderFilterRegex: 'cuda[/\\]core[/\\]_include[/\\](dlpack|aoti_shim)\.h'

0 commit comments

Comments
 (0)