Skip to content

test(ci): verify the extracted out-of-tree bgfx backend (#386 Phase 6c) - #413

Merged
apotema merged 1 commit into
mainfrom
feat/386-bgfx-external-verify
Jun 29, 2026
Merged

test(ci): verify the extracted out-of-tree bgfx backend (#386 Phase 6c)#413
apotema merged 1 commit into
mainfrom
feat/386-bgfx-external-verify

Conversation

@apotema

@apotema apotema commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

bgfx extracted out-of-tree — opt-in verification

bgfx is now its own repo: labelle-toolkit/labelle-bgfx (v0.1.0) — the first real backend to leave the assembler monorepo, building on the merged pipeline (6a fetch + 6b verify + Phase-5 enum-shorthand).

It's self-contained: it vendors the shared sdl_gamepad / android_gamepad sub-packages (an external backend can't reference the bundled ../ copies). De-duplicating those into standalone shared repos (so raylib/sokol can also consume them) is a follow-up.

This PR (assembler side)

Per the agreed plan — verify opt-in via CI, defer the default flip:

  • examples/bgfx-external/ — a bgfx game selected via .backend_package = .{ .name = "bgfx", .repo = "github.com/labelle-toolkit/labelle-bgfx", .version = "0.1.0" } (local framework pins, like examples/bgfx).
  • A CI step (in examples-integration) that drives the assembler directly to install (fetch the package from GitHub) → generate (stage + codegen), asserts the package staged self-contained (backend.manifest.zon + vendored sdl_gamepad/android_gamepad) and wired labelle_bgfx, then resolves the full build graph (zig build --help → zbgfx/zglfw + vendored sub-packages + url deps). It deliberately stops short of the heavy bgfx C++ compile — that's byte-identical to the bundled backend and is covered by the dedicated cached bgfx-build job.

The default .backend = .bgfx shorthand flip is NOT in this PR — that stays bundled until the extracted package is validated against a real game (Flying Platform). No existing project changes behavior.

Verified locally

Full install → stage → generate → graph-resolve chain is green: the package fetches/stages with the manifest + vendored sub-packages, codegen wires b.dependency("labelle_bgfx") with the manifest params + bgfx/glfw artifacts, and the complete generated dependency graph resolves. (Local env can't run the bgfx C++ build — pre-existing engine pin drift — so CI is the validator, matching the chosen plan.)

Follow-ups

  • Flip the .bgfx enum shorthand → the package, after FP validation (one-line config.builtinProvider entry).
  • De-duplicate the vendored gamepad sub-packages into standalone repos shared with raylib/sokol.

Summary by CodeRabbit

  • New Features

    • Added a new bgfx external example with its own project setup and scene content.
    • Introduced layered rendering for background, terrain, characters, effects, and HUD elements.
    • Added sample entities for a player object and title text in the example scene.
  • Bug Fixes

    • Improved CI coverage for the external bgfx example by validating dependency resolution and project generation.
    • Added a safer check to ensure the example can resolve its full build graph successfully.

bgfx is now extracted to its own repo, github.com/labelle-toolkit/labelle-bgfx
(v0.1.0) — the first real backend to leave the assembler monorepo. It vendors
the shared sdl_gamepad/android_gamepad sub-packages so the package is
self-contained (an external backend can't reference the bundled `../` ones).

This adds the OPT-IN verification (the default `.backend = .bgfx` shorthand flip
is deferred until the package is validated against real games like FP):

- examples/bgfx-external/: a bgfx game configured via
  `.backend_package = .{ .name="bgfx", .repo="github.com/labelle-toolkit/labelle-bgfx", .version="0.1.0" }`
  (local framework pins, like examples/bgfx).
- a CI step in examples-integration that drives the assembler binary directly
  to `install` (fetch the package from GitHub) + `generate` (stage + codegen),
  asserts the package staged self-contained (manifest + vendored gamepad
  sub-packages) and wired `labelle_bgfx`, then resolves the FULL build graph
  (`zig build --help` → zbgfx/zglfw + the vendored sub-packages + url deps).
  It deliberately stops short of the heavy bgfx C++ compile — that's identical
  to the bundled backend and is covered by the dedicated cached `bgfx-build` job.

Verified locally end-to-end (install→stage→generate→graph-resolve all green);
this lands the CI regression coverage.
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cbc08737-a1d1-45a8-a694-bcb7b6287e8e

📥 Commits

Reviewing files that changed from the base of the PR and between dcdd356 and 96526cd.

📒 Files selected for processing (5)
  • .github/workflows/ci.yml
  • examples/bgfx-external/.gitignore
  • examples/bgfx-external/project.labelle
  • examples/bgfx-external/scenes/main.jsonc
  • examples/bgfx-external/scripts/.gitkeep

📝 Walkthrough

Walkthrough

Adds an examples/bgfx-external project with a project.labelle config, scenes/main.jsonc scene, and .gitignore. Adds a CI step that installs the external bgfx backend, asserts staged artifacts and codegen wiring, resolves the Zig dependency graph via zig build --help, and patches an invalid fingerprint in build.zig.zon.

Changes

bgfx-external example and CI integration test

Layer / File(s) Summary
bgfx-external example project files
examples/bgfx-external/project.labelle, examples/bgfx-external/scenes/main.jsonc, examples/bgfx-external/.gitignore
Defines the example project config (backend package, layers, y-axis, mock ECS), scene with player and title-label entities, and ignores .labelle/.
CI integration test step
.github/workflows/ci.yml
Adds a bash CI step that installs the bgfx backend, asserts manifest and vendored subpackages, checks codegen-wired dependency, resolves the Zig dep graph via zig build --help, and patches an invalid fingerprint before re-running.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • labelle-toolkit/labelle-assembler#398: Implements the external backend flow (ProjectConfig.backend_package, isExternal(), requireManifestIfExternal) that the new CI step and project.labelle exercise.

Poem

🐇 A bgfx example hops into view,
With layers and scenes painted fresh and new.
The CI checks fingerprints, manifests too,
Zig builds resolve without hullabaloo.
All green, little rabbit gives a joyful "woo-hoo!" 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: CI verification for the extracted out-of-tree bgfx backend.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/386-bgfx-external-verify

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new external bgfx example project under examples/bgfx-external. It includes a .gitignore file to ignore local .labelle metadata, a project.labelle configuration file setting up the project metadata, backend package, and layers, and a main.jsonc scene file defining a player entity and a title label. 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.

@apotema
apotema merged commit 509c8d1 into main Jun 29, 2026
6 checks passed
@apotema
apotema deleted the feat/386-bgfx-external-verify branch June 29, 2026 20:25
apotema added a commit that referenced this pull request Jun 30, 2026
… (#418)

Pluggable-backends Phases 5+6 (epic #386): the assembler can now FETCH, verify,
and build out-of-tree backend packages, and bgfx is extracted to its own repo.

- #409 6a: remote .backend_package cache-fetch (fetched like a plugin)
- #410 6b: contract-verify an external backend (assertBackend/Window/Input)
- #411: conform raylib + null windows to the canonical window contract
- #412 Phase 5: enum-as-shorthand resolution (a built-in tag can resolve to a package)
- #413 6c: bgfx extracted -> github.com/labelle-toolkit/labelle-bgfx; opt-in CI-verified
- #414: select the GUI bridge by backend name, not the enum (external backends)
- #415: labelle-bgfx v0.2.0 — gamepad sources extracted to their own packages
- #416/#417: the two flip-blockers (callback-external guard; android enum-fallthrough)

Opt-in today via .backend_package; built-in .backend = .bgfx still ships bundled
(the default-flip is a follow-up gated on this release). Built-in backends are
byte-identical. External bgfx validated on-device (Galaxy Tab A7): builds, runs
crash-free, behaves identically to bundled.
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