feat(config): flip .backend = .wgpu to the extracted package by default (#386 step 4) - #428
Conversation
…lt (#386 step 4) builtinProvider(.wgpu) → labelle-wgpu 0.1.0, so `.backend = .wgpu` now fetches the OUT-OF-TREE backend by default — wgpu is the second default-external backend (after bgfx #419). Desktop-only, loop-style, no android/callback complications. Test rework (same class as the bgfx flip): - backend_registry enum-as-shorthand: wgpu joins bgfx as external (tag preserved). - build_zig "links wgpu glfw artifact": point at a local wgpu pkg + project_dir so the manifest splice resolves in-tree (it now resolves external by default). - build_zig no-backend_input-override loop: drop wgpu (now external, exercised by the external tests) — only the bundled null backend remains in that loop. The cache fetch-path (effectiveBackendPackage in validate/ensureCache) + the externalUsesEnumPath guard already landed with the bgfx flip, so wgpu inherits them.
📝 WalkthroughWalkthrough
wgpu External Backend Extraction
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Code Review
This pull request extracts the wgpu backend out-of-tree, transitioning it from a bundled backend to an external package. It updates the configuration to resolve .wgpu to its dedicated repository (github.com/labelle-toolkit/labelle-wgpu at version 0.1.0) and adapts the backend registry and build tests to handle wgpu as an external backend. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/backend_registry.zig (1)
231-247: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the concrete provider mapping here.
This only proves that
.bgfx/.wgpuresolve to some external package. A badrepoorversionwould still pass and miss the default-flip contract. Please also asserteffectiveBackendPackage().?.repoand.versionfor the extracted tags.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/backend_registry.zig` around lines 231 - 247, The enum-as-shorthand test in backend_registry.zig only checks that .bgfx and .wgpu map to some external package, so tighten the assertions in test "enum-as-shorthand: extracted backends resolve to their package; the rest stay bundled" by also verifying the concrete fields returned from effectiveBackendPackage() for those tags. Update the checks around ProjectConfig, isExternal(), and effectiveBackendPackage() to assert the expected repo and version values for each extracted backend, while keeping the bundled-backend assertions unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/config.zig`:
- Around line 615-620: The `.wgpu` backend mapping in
`effectiveBackendPackage()` is currently externalized for all targets, but it
should remain desktop-only. Update the backend selection logic in
`effectiveBackendPackage()` (or the equivalent mapping near the `.bgfx`/`.wgpu`
cases) to gate the `.wgpu` provider flip on `self.platform == .desktop`, while
leaving Android, wasm, and iOS on the bundled backend path. Keep the existing
`.raylib`, `.sokol`, `.sdl`, and `.null` behavior unchanged.
---
Nitpick comments:
In `@src/backend_registry.zig`:
- Around line 231-247: The enum-as-shorthand test in backend_registry.zig only
checks that .bgfx and .wgpu map to some external package, so tighten the
assertions in test "enum-as-shorthand: extracted backends resolve to their
package; the rest stay bundled" by also verifying the concrete fields returned
from effectiveBackendPackage() for those tags. Update the checks around
ProjectConfig, isExternal(), and effectiveBackendPackage() to assert the
expected repo and version values for each extracted backend, while keeping the
bundled-backend assertions unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 700c3616-e485-493a-9937-e8cd0b75e710
📒 Files selected for processing (3)
src/backend_registry.zigsrc/config.zigtest/build_zig_tests.zig
…hase 6c) (#429) wgpu is resolved out-of-tree now (`.backend = .wgpu` → the labelle-wgpu provider, flipped in #428), so the in-tree backends/wgpu/ slot is dead weight. Delete it + the assembler example + the coverage that built them in-tree: - Remove backends/wgpu/ (src/templates/build_fragments/manifest/build + example). - Remove examples/wgpu (the assembler-generated wgpu project) — its assembler-builds-a-wgpu-project coverage (incl. the Foundation/QuartzCore/Metal link-fragment regression guard) moved to labelle-wgpu's CI (PR #1). - CI: drop the `wgpu backend WAV parser tests` + `wgpu backend demo build (macOS)` steps and the `Generate + build the wgpu example` examples-integration step. - Tests: drop the desktop wgpu-artifacts unit test (no in-tree package to resolve) and the wgpu case from the in-tree-template preview regression list. Two backends now fully out of the assembler bundle (bgfx + wgpu). The agnostic external-fetch path stays covered by the `external-null` (nullfixture) step.
…step 2) (#430) * chore(slim): remove the bundled wgpu backend — it's extracted (#386 Phase 6c) wgpu is resolved out-of-tree now (`.backend = .wgpu` → the labelle-wgpu provider, flipped in #428), so the in-tree backends/wgpu/ slot is dead weight. Delete it + the assembler example + the coverage that built them in-tree: - Remove backends/wgpu/ (src/templates/build_fragments/manifest/build + example). - Remove examples/wgpu (the assembler-generated wgpu project) — its assembler-builds-a-wgpu-project coverage (incl. the Foundation/QuartzCore/Metal link-fragment regression guard) moved to labelle-wgpu's CI (PR #1). - CI: drop the `wgpu backend WAV parser tests` + `wgpu backend demo build (macOS)` steps and the `Generate + build the wgpu example` examples-integration step. - Tests: drop the desktop wgpu-artifacts unit test (no in-tree package to resolve) and the wgpu case from the in-tree-template preview regression list. Two backends now fully out of the assembler bundle (bgfx + wgpu). The agnostic external-fetch path stays covered by the `external-null` (nullfixture) step. * feat(null): add backend.manifest.zon — manifest-splice codegen (#386 step 2) null extraction step 2 (window conformance was done in #411). Presence of backends/null/backend.manifest.zon opts the null DESKTOP build into the manifest-splice path instead of the enum `switch (cfg.backend)` sections. Loop-style (the headless main drives a fixed-frame tick loop), pure-Zig, zero deps. The LINK fragment is EMPTY — null has no native artifact (the enum path's `.null => {}` emitted nothing). backend_dep.txt is the verbatim .backend_null section body. Output BYTE-IDENTICAL to the enum path (diffed a generated baseline → 0 diff), including the is_tests_target path (which forces .backend=.null on host). `zig build test` green.
…lt (#386 step 4) (#431) * feat(config): flip .backend = .null to the extracted package by default (#386 step 4) builtinProvider(.null) → labelle-null 0.1.0 — null is the third default-external backend (after bgfx #419, wgpu #428). Pure-Zig, zero deps, empty link fragment. Notable: generateTestsTarget (#83) forces .backend=.null for every project's `zig build test`, so that universal test target now fetches labelle-null (cached, pure-Zig — the no-system-libs property still holds). The null headless + plugin-controllers examples + the is_tests_target codegen now resolve external null. Test rework (same class as the bgfx/wgpu flips): backend_registry enum-shorthand (null joins bgfx/wgpu external), and the 4 build_zig `.backend=.null` tests (null-wires-modules, no-override, the two is_tests_target tests) now point at a local null pkg + project_dir so the manifest splice resolves. Inherited the cache fetch-path + externalUsesEnumPath from the earlier flips. * fix(cache): fetch the tests-target null backend for every project The flip surfaced this (CI: a raylib project's tests-target generate failed ExternalBackendNeedsManifest): generateTestsTarget (#83) forces .backend=.null for EVERY project's `zig build test`, but validateCache/ensureCache only considered the project's OWN backend — so external labelle-null was never reported missing or fetched for a non-null project. Account for the tests-target null in both (dedup when the project already IS null). No-op while null is bundled. * test(cache): account for the tests-target null in validateCache external tests The two external-backend validateCache tests now also see the tests-target's external null in the missing set (every project validates null post-flip). Assert the project backend specifically (local stub) + expect both fakebackend AND null for the remote case.
wgpu extraction step 4 — the flip.
builtinProvider(.wgpu)→ labelle-wgpu 0.1.0, so.backend = .wgpunow fetches the out-of-tree backend by default (second default-external backend after bgfx #419).Desktop-only, loop-style — no Android/callback complications, so cleaner than the bgfx flip. The cache fetch-path +
externalUsesEnumPathguard already landed with bgfx, so wgpu inherits them.Validated: labelle-wgpu builds standalone + its example (macOS Metal); the assembler fetches it and builds a full wgpu project end-to-end (verified locally with released framework pins). labelle-wgpu CI green (ubuntu+macOS build-test + Metal demo).
Test rework (same class as the bgfx flip): backend_registry enum-shorthand (wgpu joins bgfx as external), the build_zig artifacts test (local pkg + project_dir), and dropping wgpu from the bundled no-override loop.
Next: slim the bundled
backends/wgpu+ move its example/CI to labelle-wgpu (mirrors the bgfx slim #420 + #422).Summary by CodeRabbit
New Features
Tests