Skip to content

refactor(pathfinder): replace spawned child runner with subprocess entrypoint#1777

Merged
cpcloud merged 3 commits intoNVIDIA:mainfrom
cpcloud:issue-1771-refactor-spawned-process-runner
Mar 17, 2026
Merged

refactor(pathfinder): replace spawned child runner with subprocess entrypoint#1777
cpcloud merged 3 commits intoNVIDIA:mainfrom
cpcloud:issue-1771-refactor-spawned-process-runner

Conversation

@cpcloud
Copy link
Contributor

@cpcloud cpcloud commented Mar 17, 2026

Summary

  • replace the remaining multiprocessing-based spawned child runner in cuda_pathfinder with a dedicated python -m subprocess entrypoint
  • move the real-loading tests onto that subprocess entrypoint so the test isolation model matches the canary probe path
  • add focused subprocess helper coverage and remove the old runner module plus its standalone test

Test plan

  • cd cuda_pathfinder && pixi run pytest tests/
  • pixi run ruff check cuda_pathfinder/cuda cuda_pathfinder/tests

Made with Cursor

@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Mar 17, 2026

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.

Copy link
Contributor

@mdboom mdboom left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -0,0 +1,75 @@
#!/usr/bin/env python
Copy link
Collaborator

Choose a reason for hiding this comment

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

Currently wondering: do we need this new subdirectory?

I'll play with this for a few minutes, hoping that we don't have to move the test-only code here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Gist of my exploration with Cursor:

We'll merge this PR now and plan a follow-on PR to unify the production and testing subprocess code paths.

Why unify later

  • Reduce duplication between the canary probe subprocess and the test-only
    load subprocess entrypoint.
  • Share a single JSON response protocol for success, not-found, and errors.
  • Centralize subprocess invocation, timeout handling, and stderr formatting.
  • Keep production and tests aligned as future behavior evolves.
  • Make it easier to reason about, test, and maintain subprocess behavior.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Here is the result of continuing the exploration with Cursor: #1779

@@ -0,0 +1,75 @@
#!/usr/bin/env python
Copy link
Collaborator

Choose a reason for hiding this comment

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

Gist of my exploration with Cursor:

We'll merge this PR now and plan a follow-on PR to unify the production and testing subprocess code paths.

Why unify later

  • Reduce duplication between the canary probe subprocess and the test-only
    load subprocess entrypoint.
  • Share a single JSON response protocol for success, not-found, and errors.
  • Centralize subprocess invocation, timeout handling, and stderr formatting.
  • Keep production and tests aligned as future behavior evolves.
  • Make it easier to reason about, test, and maintain subprocess behavior.

cpcloud added 2 commits March 17, 2026 12:26
…trypoint

Move the remaining load-isolation tests onto the same dedicated subprocess pattern as the canary probe so `cuda_pathfinder` only has one subprocess model to maintain. This removes the generic multiprocessing helper while preserving the existing real-loading coverage and failure reporting.

Made-with: Cursor
Validate and extract `LoadedDL.abs_path` through a typed helper so mypy can
see the subprocess test helper's non-optional path contract after the runner
refactor.

Made-with: Cursor
@github-actions
Copy link

Launch the subprocess helper from a neutral working directory so wheel-based CI imports the installed cuda-pathfinder package instead of the source tree and avoids missing generated _version.py failures.

Made-with: Cursor
@cpcloud cpcloud merged commit bffbeec into NVIDIA:main Mar 17, 2026
119 of 147 checks passed
@cpcloud cpcloud deleted the issue-1771-refactor-spawned-process-runner branch March 17, 2026 22:33
github-actions bot pushed a commit that referenced this pull request Mar 18, 2026
Removed preview folders for the following PRs:
- PR #1687
- PR #1777
- PR #1780
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants