Skip to content

Use Script Host before PowerShell for Windows parent query fallback - #920

Merged
sds merged 1 commit into
mainfrom
perf/windows-script-host-fallback
Nov 5, 2026
Merged

sds merged 1 commit into
mainfrom
perf/windows-script-host-fallback

Conversation

@sds

@sds sds commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

When optional win32ole is unavailable, including Ruby 4.0, Windows hook contexts launch PowerShell to inspect their parent command. Query the same WMI field with Windows Script Host first, retaining PowerShell when the host is missing, disabled, fails, or produces invalid output. The helper validates the PID and decodes redirected UTF-16LE output, preserving complete Unicode command lines. Existing libexec/**/* gem packaging includes it; no dependency is added.

All five paired GitHub Windows/Ruby 4.0 shards improved: 7.1% aggregate and 9.4% median test-command reduction, with positive results in both execution orders. The slowest sampled shard fell from 55.9s to 50.7s. Benchmark.

Local verification: all 1,708 examples, RuboCop, JavaScript syntax, and gem packaging pass. New tests cover Unicode/BOM decoding, exited processes, missing Script Host, script failure, and malformed output. Full GitHub CI passed 10,248 executions across all six Ruby/OS pairs, lint, and required CI. Aggregate coverage increased to 92.442%. Two optional partial-shard comparisons shifted as five new tests redistributed later examples. The 138s workflow overlapped another run and is correctness evidence; final combined timing is measured separately on main.

@sds
sds merged commit a686a97 into main Nov 5, 2026
36 of 38 checks passed
@sds
sds deleted the perf/windows-script-host-fallback branch November 5, 2026 19:26
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.

1 participant