FFFF
Skip to content

fix(dspy): track completed None results in ParallelExecutor - #10142

Merged
isaacbmiller merged 1 commit into
mainfrom
port/drew-parallel-none-results
Aug 5, 2026
Merged

fix(dspy): track completed None results in ParallelExecutor#10142
isaacbmiller merged 1 commit into
mainfrom
port/drew-parallel-none-results

Conversation

@isaacbmiller
Copy link
Copy Markdown
Collaborator

Summary

Ports the completed-result tracking portion of dbreunig#4 as an independent upstream change.

  • use a private sentinel to distinguish unfinished slots from legitimate None results
  • count None-returning tasks as completed in sequential and threaded progress
  • prevent completed None slots from being accepted again after straggler resubmission
  • preserve the public result contract where failed or unfinished slots are returned as None

The original PR’s SIGINT-handler change is intentionally excluded because guarding with callable() does not define correct behavior for SIG_DFL versus SIG_IGN.

Original implementation authored by @dbreunig, with a progress-accounting regression assertion added during upstream review.

Test plan

  • pytest tests/utils/test_parallelizer.py -q (14 passed)
  • git diff --check
  • upstream CI

Lint note

A local whole-file Ruff run found two pre-existing RUF043 findings in test_parallelizer.py lines 62 and 147; this PR does not modify those assertions.

Co-authored-by: Isaac Miller <isaacbmiller@users.noreply.github.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019fcd6b-0068-752e-b9ce-2fd40b7f061b
Co-authored-by: Isaac Miller <isaac@cmpnd.ai>
@greptile-apps
greptile-apps Bot commented Aug 4, 2026
Copy link
Copy Markdown
Contributor

Greptile Summary

This update makes ParallelExecutor distinguish unfinished result slots from tasks that legitimately return None.

A focused executable check exercised serial and threaded execution, straggler resubmission, and comparison-result handling. The updated code reports completed None tasks correctly, accepts a resubmitted None result as completion before a late duplicate can replace it, and avoids indexing None in comparison mode. The focused parallelizer suite passed with 14 tests.

Confidence Score: 5/5

T-Rex T-Rex Logs

What T-Rex did

  • Ran a focused executable probe against the parent revision to validate the handling of None results and observed the old behavior where None results appeared as 0/3 and the late original execution completed after 1.351 seconds.
  • Ran the same probe after the change and observed the improved behavior: serial and threaded runs show 3/3, the resubmitted None completes the straggler at 1.002 seconds, and compare-results runs complete without indexing None.
  • Executed uv run --locked pytest -q tests/utils/test_parallelizer.py and confirmed all 14 focused tests passed.
  • Authored a regression probe source at trex-artifacts/parallelizer-none-regression.py to exercise serial, threaded, straggler, and comparison flows.
  • Collected and inspected the before- and after-output logs and suite results to document the post-PR behavior, including pr10142-none-results-01-before.log, pr10142-none-results-02-after.log, and pr10142-parallelizer-suite.log.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "fix(dspy): track completed None results ..." | Re-trigger Greptile

@isaacbmiller
isaacbmiller merged commit 485ce44 into main Aug 5, 2026
15 checks passed
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.

2 participants

0