Skip to content

Let Windy own loadExtensions and build the CPU backend in CI - #68

Merged
treeform merged 2 commits into
masterfrom
fix/cpu-backend-loadextensions
Sep 9, 2026
Merged

treeform merged 2 commits into
masterfrom
fix/cpu-backend-loadextensions

Conversation

@treeform

@treeform treeform commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Problem

Every example fails to compile with -d:useCpu on Windows, on both Nim 2.2.10 and 2.2.12:

basicwindow.nim(20, 15) Error: ambiguous call; both platform.loadExtensions() [proc declared in windy/platforms/win32/platform.nim(1121, 8)] and silky.loadExtensions() [proc declared in silky/src/silky.nim(28, 10)] match for: ()

Silky defined its own no-op loadExtensions for the Metal and CPU backends. Windy already exports one on Win32 for DirectX, Vulkan and CPU. On a Windows CPU build the example imports both, and the compiler cannot choose between two exported procs with the same name and signature, so the call is ambiguous. CI never caught it because the CPU backend is not in the matrix.

Fix

Only Windy should export loadExtensions. Silky already does export windy, so removing Silky's copy leaves callers with exactly one symbol. Windy gains the matching no-op on macOS for Metal and CPU in a companion PR on treeform/windy.

CI gets a Windows CPU cell and runs the existing tests/test_cpu_backend.nim smoke test in every cell (it is a no-op unless -d:useCpu on Windows), so the CPU backend stays green.

Dependency

macOS with -d:useMetal4 or -d:useCpu needs the Windy PR merged and nimby.lock moved to that Windy commit, since the lock still pins Windy 0.4.4. Windows, Linux and Emscripten are unaffected by that. I did not bump the lock here so it can point at the merge commit rather than a branch SHA.

Testing

On Nim 2.2.12 with this change, all eight examples compile with OpenGL, DirectX, Vulkan and CPU backends (32 of 32), and test_cpu_backend passes with -d:useCpu and skips cleanly on the other backends.

🤖 Generated with Claude Code

treeform and others added 2 commits September 9, 2026 07:04
Silky defined its own no-op loadExtensions for the Metal and CPU
backends. Windy already exports one on Win32 for DirectX, Vulkan and
CPU, so on Windows CPU builds both were visible and every
loadExtensions() call in the examples was ambiguous:

  Error: ambiguous call; both platform.loadExtensions() and
  silky.loadExtensions() match for: ()

That broke all eight examples with -d:useCpu on Nim 2.2.10 and 2.2.12.
CI never noticed because the CPU backend was not in the matrix.

Silky already does `export windy`, so dropping the local copy leaves
callers with Windy's symbol and nothing else. Windy is gaining the
matching no-op on macOS for Metal and CPU (treeform/windy PR), and the
lock file should move to that Windy once it lands.

Add a Windows CPU cell to the CI matrix and run the existing CPU smoke
test in every cell so this stays fixed. The test is a no-op unless
-d:useCpu is set on Windows.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
treeform/windy#195 is merged, so the macOS Metal and CPU backends get
their no-op loadExtensions from Windy and the previous commit's removal
of Silky's copy no longer leaves macOS without one.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@treeform
treeform merged commit 2decea2 into master Sep 9, 2026
8 checks passed
@treeform
treeform deleted the fix/cpu-backend-loadextensions branch September 9, 2026 14:22
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