Skip to content

Version 3.0 - #44

Merged
HalRiveria merged 7 commits into
mainfrom
docs/3.0-docs-pass
Nov 17, 2026
Merged

HalRiveria merged 7 commits into
mainfrom
docs/3.0-docs-pass

Conversation

@HalRiveria-Bot

@HalRiveria-Bot HalRiveria-Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Sets the version to 3.0 and brings the docs and comments in line with what 3.0 does, plus two internal changes: callback warning names in one place, and a speed fix for the dispatcher on 5.1.

What changed

  • Version: the header of ParallelKit.ps1 now says Version 3.0 and names PowerShell 7 alongside 5.1. The README says it describes 3.0.
  • Get-Help text and README checked against the 3.0 code:
    • A bare program name only finds an .exe, so a .cmd wrapper must be written out (npm.cmd).
    • Inside a worker, a plain callback can also see the kit's pk-prefixed variables.
    • A tree kill counts even if part of the tree survives.
    • A third Ctrl+C still kills the engines' programs.
    • Callbacks should leave with return.
    • The dispatcher's "output is discarded" rule now notes its exceptions, the callbacks' return values.
    • Batch-file quoting only applies to the list form of Arguments.
    • A " passed to a .bat/.cmd shows up doubled in the batch file's own %1/%~1. A program it passes %* on to gets it back as one quote.
    • Examples pass Arguments as a list. The README's argument rules are split into a list.
  • American spelling throughout: canceled, canceling, signaled, license, behavior, "right away".
  • Comment prune: comments that restated the code, described behavior that no longer exists, or recounted bug history are removed, and the rest are shortened. Comments explaining a non-obvious why are kept. Only comment lines changed, apart from one trailing comment removed from a code line.
  • Callback warning names: each engine now sets its name once (ProcessDispatch: , Invoke-PkRunspaceJobs: , Invoke-PkProcessBatch: ), and each call site names only the parameter, where before about 20 call sites each spelled out the full name. The warnings read the same as before.
  • Dispatcher speed on 5.1: routing every callback through a wrapper function, which catches continue/break, more than doubled the dispatcher's own time per job on 5.1 (the harness's 20,000-job benchmark: 2.7 s before, 6.3 s after, locally). Callbacks that run per job, per pass or per result (-JobStarter, -JobPollCompleted, -JobFinalize, the dispatcher's -PollCallback, -ResultHandler, -OnComplete) now catch it inline, which brings the benchmark back to 2.8 s. The other callbacks still go through the wrapper.

How it was tested

The harness passes on Windows PowerShell 5.1 and PowerShell 7 (457 assertions each), including the check that every public function has help for itself and each parameter. The continue/break tests now also check that each warning names the right engine and parameter, and cover -JobPollCompleted and -JobFinalize in an abort's graceful wait, which has its own inlined copy. Removing the catch from that copy fails those new tests.

🤖 Generated with Claude Code

HalRiveria and others added 7 commits November 16, 2026 15:23
canceled, canceling, signaled, license, behavior, "right away" and "goes around again", in comments, test descriptions and the README. No public names change; the harness's local OwnCancelled key becomes OwnCanceled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drops comments that restated the code, described behavior that no longer exists, or explained a bug's history, and shortens the rest. Comments that explain a non-obvious why are kept. No code changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drops references to behavior and bugs that no longer exist ("used to", "before the fix") and shortens the rest. No test changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e pk variables

A bare FilePath only finds an .exe: Windows doesn't use PATHEXT there, so a .cmd wrapper such as npm has to be written as npm.cmd. And inside a worker runspace, a plain callback can also see the kit's own variables, all pk-prefixed, so the README no longer says it never sees the kit's internals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Header says Version 3.0 and names PowerShell 7. Help and README now cover what 3.0 changed: bare names only find .exe files, a tree kill counts even if part of the tree survives, a third Ctrl+C still kills the engines' programs, callbacks should leave with return, the dispatcher's output rule has its exceptions, and batch-file quoting needs the list form. Examples pass Arguments as a list. The README's argument rules are split into a list, and it now says it describes 3.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… quote doubled

Each engine sets its callback-warning prefix once, and call sites pass only the parameter name. The continue/break tests now check each warning names the right engine and parameter.

The README said a quote reaches a .bat/.cmd as one argument without noting that the batch file's own %1/%~1 sees it doubled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Calling the continue/break wrapper function for every per-job callback more than doubled the dispatcher's own time per job on Windows PowerShell 5.1. The callbacks that run per job, per pass or per result now do the do/while inline; the shared warning is Write-PkCallbackLoopWarning. Adds continue/break tests for -JobPollCompleted and -JobFinalize during an abort's graceful wait.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HalRiveria
HalRiveria merged commit 323f7ec into main Nov 17, 2026
2 checks passed
@HalRiveria
HalRiveria deleted the docs/3.0-docs-pass branch November 17, 2026 01:05
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