You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Duel runs on Linux and macOS, but not on Windows. A maintainer reviewing the pg adoption PR asked whether it does (ged/ruby-pg#771 (comment)), since that's where they're least likely to notice a performance change themselves. Comparing two versions on a Windows runner would catch regressions in Windows-only code paths, such as a C extension's mingw build, which the Linux job can't see.
These are the parts that assume a Unix system:
Worker control. The runner talks to each worker over a Unix socket (UNIXServer in lib/duel/runner.rb, UNIXSocket in lib/duel/worker.rb). A TCP socket on localhost, or a pair of pipes as ProcessSample already uses for JRuby, would work everywhere.
Process groups.ProcessSample#start spawns with pgroup: true, and #kill kills the whole group with Process.kill("KILL", -pid). Windows has new_pgroup: and no group kill, so killing a sample and what it started needs something like a Job Object or taskkill /T.
Signals.Resource#end_process stops a resource's server with a signal, then KILL. Windows can't deliver TERM or INT to another process, so a server needs another way to be asked to stop.
Peak memory.Native::Child.wait calls wait4 through Fiddle for a child's peak resident memory. On Windows that's GetProcessMemoryInfo's PeakWorkingSetSize, or Duel could leave the peak out.
Available memory.Memory.available reads /proc/meminfo, a cgroup limit or vm_stat, so on Windows it says nothing and Runner#fit doesn't lower the workers. GlobalMemoryStatusEx would give it.
Paths.Runner.short_tmp falls back to /tmp when the temporary directory's path is too long for a socket.
Instructions. There's no instruction counter, so CPU time would judge alone, as it does on JRuby. That's fine to start with.
The plugins that start servers (postgresql, mysql, redis, memcached) would each need their own look, since they find and stop server programs the Unix way.
Duel's CI should run the tests on windows-latest once it works, and probably on macos-latest too, since macOS isn't tested in CI today either.
Worker control. The runner talks to each worker over a Unix socket (UNIXServer in lib/duel/runner.rb, UNIXSocket in lib/duel/worker.rb)
I implemented support for UnixSocket on Windows in ruby-3.2 some years ago. It works mostly the same way as on Unix. It has limited path length.
Signals. Resource#end_process stops a resource's server with a signal, then KILL.
This is similar possible on Windows. A trap can be defined in a Windows subprocess like so:
trap(:SIGINT)doputs"SIGINT received"end
And then this trap can be triggered by a kernel32.dll call like so:
require"fiddle"kernel32=Fiddle.dlopen('kernel32.dll')generateconsolectrlevent=Fiddle::Function.new(kernel32['GenerateConsoleCtrlEvent'],[Fiddle::TYPE_INT,Fiddle::TYPE_INT],Fiddle::TYPE_INT)# Send the Ctrl-C to all processes running on the same consolegenerateconsolectrlevent.call(0,0)
The plugins that start servers (postgresql, mysql, redis, memcached) would each need their own look, since they find and stop server programs the Unix way.
PostgreSQL should mostly work the same way as on Unix. It can be controlled by pg_ctl equally.
Windows support is in main as of 443f61a. Duel's tests and every plugin's pass on Windows (CRuby) and macOS in CI now, and those jobs are required. Two things are left, which have issues of their own: running the tests on JRuby on Windows (#4), and a shell command that exits at once hanging ProcessSample on Windows (#5).
Activity
larskanis commentedon Nov 11, 2026
Some related ideas:
I implemented support for UnixSocket on Windows in ruby-3.2 some years ago. It works mostly the same way as on Unix. It has limited path length.
This is similar possible on Windows. A trap can be defined in a Windows subprocess like so:
And then this trap can be triggered by a
kernel32.dllcall like so:PostgreSQL should mostly work the same way as on Unix. It can be controlled by
pg_ctlequally.Measure CPU time on Windows in cycles, and fix what Windows broke
Make the run's lock work on Windows, and the tests that remained
Read Windows's cycles as Floats, which it doesn't allocate
Fix two tests for Windows, and one that left no memory reader
Count macOS's thread's instructions, and run more on macOS and Windows
Run Redis and memcached on Windows over TCP, and fix the plugins there
Fix more of what kept the plugins from running on Windows
Use a memcached for Windows that Dalli can talk to, and fix two tests
Name a program's log by its whole path, and fetch Windows's memcached
Start PostgreSQL with pg_ctl on Windows, and drop JRuby there from CI
Give the MySQL plugin a client of its own, and a tcp: option
Start supporting Windows
Measure CPU time on Windows in cycles, and fix what Windows broke
5 remaining items
Fix more of what kept the plugins from running on Windows
Use a memcached for Windows that Dalli can talk to, and fix two tests
Name a program's log by its whole path, and fetch Windows's memcached
Start PostgreSQL with pg_ctl on Windows, and drop JRuby there from CI
Give the MySQL plugin a client of its own, and a tcp: option
Require the tests on macOS and Windows, and the plugins' there
sferik commentedon Nov 12, 2026
Windows support is in main as of 443f61a. Duel's tests and every plugin's pass on Windows (CRuby) and macOS in CI now, and those jobs are required. Two things are left, which have issues of their own: running the tests on JRuby on Windows (#4), and a shell command that exits at once hanging ProcessSample on Windows (#5).
Run Redis and memcached on Windows over TCP, and fix the plugins there
Fix more of what kept the plugins from running on Windows
Use a memcached for Windows that Dalli can talk to, and fix two tests
Name a program's log by its whole path, and fetch Windows's memcached
Start PostgreSQL with pg_ctl on Windows, and drop JRuby there from CI
Give the MySQL plugin a client of its own, and a tcp: option
Require the tests on macOS and Windows, and the plugins' there