Skip to content

Windows fiber core is single-worker: fiber_worker_count > 1 panics at startup with a misleading message #2770

Closed

Description

@ehartford

Root cause (exact line): rt/fiber_core_windows.w:603 — with_runtime_configure_fibers returns -1 for any worker_count > 1. The Windows fiber core has no worker threads or stealing scheduler (contrast rt/fiber_core_darwin.w, which has configured_worker_count/active_worker_count and a steal loop).

Any program whose manifest sets [runtime] fiber_worker_count = 2 (or more) builds fine on Windows, then panics at startup:

panic: runtime fiber configuration cannot change after fibers exist

That message is emitted by src/Codegen.w:8052 (emit_runtime_fiber_config) for every nonzero configure rc, so on Windows it states the wrong reason: no fibers exist yet; the platform simply has one worker.

Repro: the runtime-workers case in build/selfhost.w (bs_check_runtime_workers, from the #809 un-skip): manifest fiber_worker_count = 2, program asserts with_fiber_worker_count() == 2, cross-thread cancel and steal events. Green on macOS; on win10 the binary exits 134 with the panic above before main runs.

Fix shape: port the multi-worker scheduler to rt/fiber_core_windows.w (worker threads via the Windows thread seam, per-worker queues, stealing, cross-thread cancel delivery). Until then, the refusal should at least name the real reason instead of borrowing the after-fibers-exist message.

Found during #809 (Windows green-battery un-skip); that work gates this single case on Windows pending this issue.

Activity

  1. added 4 commits that reference this issue on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions