Repository navigation
Conversation
|
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. |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 27 minutes. View limit details
No actionable comments were generated in the recent review. Summary
Change: Other Merge Risk:
|
|
pre-commit runs mypy from the repository root with only a config file, so mypy could not resolve `cuda.pathfinder.*` imports and typed every name imported from another module in the package as `Any`. Type errors that cross a module boundary went unreported, and `cast()` calls were needed to quiet "returning Any" warnings. `mypy_path = "$MYPY_CONFIG_FILE_DIR"` points mypy at this directory whatever the working directory is. It works without the generated `_version.py`, as in CI. With imports resolved, mypy reports four things: - Two `cast()` calls in `header_descriptor.py` are no longer needed; removed. - Two real mismatches that were hidden: `load_with_abs_path` accepts `found_via: str | None` and passes it to `LoadedDL`, which declares `found_via: str`. Fixing that means changing a public annotation or a signature, so this change only marks both lines with a targeted `type: ignore` and a comment. Nothing else needed attention. No runtime change. 1293 passed, 6 skipped. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Rob Parolin <rparolin@nvidia.com>
With the package's imports visible, mypy on Windows reports one more real mismatch: `LoadedDL.abs_path` is typed `str | None`, and it is passed to the Windows driver loader, which is declared to take `str`. Linux does not analyse that branch, so only the Windows pre-commit job caught it. Like the other two, it is marked with a targeted `type: ignore` and a comment rather than fixed, because fixing it changes a declared type. `unused-ignore` is listed too, since the ignore is only needed on Windows. No runtime change. mypy passes for both `--platform linux` and `--platform win32`. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Rob Parolin <rparolin@nvidia.com>
`load_with_abs_path` took `found_via: str | None = None`, but `LoadedDL` declares `found_via` as `str`. This change had papered over the mismatch with two `# type: ignore[arg-type]` lines. Every caller passes `found_via`: three calls in `load_nvidia_dynamic_lib.py` and two in tests. So the parameter is now a required `str` in the Linux loader, the Windows loader and the `PlatformLoader` protocol, and both ignore lines are gone. mypy passes for Linux and for `--platform win32`. Risk: `load_with_abs_path` is a private function. A caller outside this repository that omits `found_via` would now get a `TypeError` instead of a `LoadedDL` whose `found_via` is `None`. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Rob Parolin <rparolin@nvidia.com>
Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
474f5a4 to
2a4b60c
Compare
— codex on behalf of Ralf —
Description
Part 17 of 23 of a readability stack for
cuda.pathfinder(stack: #3623 → #3602 → #3603 → #3604 → #3605 → #3606 → #3607 → #3608 → #3609 → #3610 → #3611 → #3613 → #3618 → #3619 → #3620 → #3621 → #3622 → #3627 → #3628 → #3629 → #3630 → #3631 → #3632). No behavior change.pre-commit runs mypy from the repository root with only a config file, so mypy could not resolve
cuda.pathfinder.*imports and typed every name imported from another module in the package asAny. Type errors that cross a module boundary went unreported, andcast()calls were needed to quiet "returning Any" warnings.mypy_path = "$MYPY_CONFIG_FILE_DIR"points mypy at this directory whatever the working directory is. It works without the generated_version.py, as in CI.With imports resolved, mypy reports three things:
cast()calls inheader_descriptor.pyare no longer needed; removed.load_with_abs_pathacceptedfound_via: str | None = Noneand passed it toLoadedDL, which declaresfound_via: str. Every caller passesfound_via(three calls in the loader, two in tests), so it is now a requiredstrin both loaders and in thePlatformLoaderprotocol. Notype: ignoreis needed.LoadedDL.abs_pathis typedstr | None, and it is passed to the Windows driver loader, which is declared to takestr. Linux does not analyse that branch, so only the Windows pre-commit job caught it. Fixing it changes a declared type, so it is marked with a targetedtype: ignoreand a comment.unused-ignoreis listed too, since the ignore is only needed on Windows.Risk:
load_with_abs_pathis a private function. A caller outside this repository that omitsfound_viawould now get aTypeErrorinstead of aLoadedDLwhosefound_viaisNone.No runtime change for any caller in this repository. 1294 passed, 6 skipped. mypy passes for both
--platform linuxand--platform win32.Testing
cuda_pathfindertest suite at this commit: 1294 passed, 6 skipped (Linux, Python 3.14).mypy-pathfinder.PLC Local Security Evidence (Advisory)
Local advisory checks only, run over the whole stack. Not release-gate results.
subprocess.runcall in the canary probe, now incanary_probe.pyChecklist
🤖 Generated with Claude Code