Skip to content
Back to skills

Gum Runtime Topology

ASecurity

Map of Gum render-backend projects and every place that compiles shared Gum source. Triggers: moving/renaming/deleting runtime or GumCommon/RenderingLibrary files, AllLibraries.sln, SkiaGum.Wpf, FRB GumCoreShared/Forms shproj, duplicate same-FQN build errors, what must I rebuild after a runtime refactor. For the Forms/visual/Renderable layers see gum-architecture-layers.

  • 666 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 7, 2026
designgoc#awsgitapibackend

Works with

  • cursor
  • cli
  • api

Security analysis

A100/100

Scanned November 24, 2026

npx -y skills add vchelaru/Gum --skill gum-runtime-topology --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gum Runtime Topology?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gum Runtime Topology
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vchelaru-gum-runtime-topology/badge)](https://www.skillsdirectory.com/skills/vchelaru-gum-runtime-topology)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gum-runtime-topology
description: "Map of Gum render-backend projects and every place that compiles shared Gum source. Triggers: moving/renaming/deleting runtime or GumCommon/RenderingLibrary files, AllLibraries.sln, SkiaGum.Wpf, FRB GumCoreShared/Forms shproj, duplicate same-FQN build errors, what must I rebuild after a runtime refactor. For the Forms/visual/Renderable layers see gum-architecture-layers."
---

# Gum Runtime Topology

Gum has **no single "runtime" assembly**. The same `RenderingLibrary.*` / `GumCommon` source is compiled into many assemblies via three different source-sharing mechanisms, and is also consumed by FlatRedBall (FRB), a **separate repo**. A refactor that builds clean in `AllLibraries.sln` can still break the WPF runtime or FRB. Before moving/renaming/deleting any shared file, check it against every surface below.

> FRB is a separate git repo, but Gum and FRB are always checked out side by side (`GitHub/Gum` and `GitHub/FlatRedBall`), so `../FlatRedBall/...` reaches FRB from the Gum repo root.

## Compilation surfaces — rebuild/verify ALL for a runtime-level refactor

| Surface | What it is | Notes |
|---|---|---|
| `AllLibraries.sln` | All render backends + `GumCommon` + shapes + themes + CLI + ProjectServices + tests | **Must compile on Mac**, so it EXCLUDES Windows-only projects. The broad verify command — but not complete. |
| `Runtimes/SkiaGum.Wpf/SkiaGum.Wpf.csproj` | WPF host for the Skia runtime | **NOT in AllLibraries** (WPF can't build on Mac). Build separately on Windows. The single easiest runtime to forget. |
| `Gum.slnx` | The Gum tool (Avalonia head over a KNI SDL2/GL canvas) + its plugins | Tool work. |
| `Gum.Wpf.sln`, `GumFull.sln` | The frozen WPF tool (GumFull adds the CLI) | Only for an explicit WPF fix; its plugin post-builds need `$(SolutionDir)`, so build the solution, not a bare csproj. |
| `GumCoreShared.shproj` | Gum-side shared project (imports `GumCoreShared.projitems`) | Source-shares Gum core into FRB. The file lists live in the `.projitems`. |
| `../FlatRedBall/FRBDK/Glue/GumPlugin/GumPlugin/GumCoreShared.FlatRedBall.shproj` | FRB-side core consumer | FRB multi-targets down to **net6.0** — gate net7+ BCL APIs. |
| `../FlatRedBall/Engines/Forms/FlatRedBall.Forms/FlatRedBall.Forms.Shared/FlatRedBall.Forms.Shared.shproj` | FRB-side Forms consumer | Picks up `MonoGameGum/Forms/**` files individually; new/renamed Forms files must be registered here. |

## Render backends

XNA-family (`MonoGameGum`, `KniGum`, `FnaGum`), `RaylibGum`, `SkiaGum` (+ hosts `SkiaGum.Maui`, `SkiaGum.Wpf`), `SokolGum`. For the per-runtime file-sharing/unification pattern see [gum-cross-platform-unification](../gum-cross-platform-unification/SKILL.md).

### Shapes are NOT MonoGame/Skia-only — no backend is the outlier

Shape runtimes (`RectangleRuntime`/`CircleRuntime` — corner radius, two-slot fill/stroke, drop shadows, dashed strokes, gradients) are **unified across all backends, and every backend reaches full capability** via its recommended renderable; only the contained renderable differs:

| Backend | Contained renderable (recommended path) |
|---|---|
| raylib / Sokol | `LineRectangle` / `LineCircle` |
| Skia | `RoundedRectangle` (#2818) |
| XNA-family **+ Apos.Shapes** (`MonoGameGumShapes`/`KniGumShapes`, recommended) | Apos `RoundedRectangle` |
| XNA-family, no Apos | `SolidRectangle`+`LineRectangle` split — degraded fallback, no real radius/shadow |

The no-Apos XNA split is a **degraded fallback, not a separate tier or an outlier**. Two traps that produced wrong conclusions here:

- ⚠ **Don't infer capability from type names.** raylib's `LineRectangle`/`LineCircle` are full filled + rounded + drop-shadowed shapes (they mirror Apos/Skia — see the `<inheritdoc cref="SkiaGum...SkiaShapeRuntime">` in `Runtimes/RaylibGum/Renderables/`), despite the outline-suggesting names. A directory listing is not the API surface — read the renderable.
- ⚠ The `MonoGameGumShapes`/`KniGumShapes` ↔ `SkiaGum` **"pair"** (in [gum-cross-platform-unification](../gum-cross-platform-unification/SKILL.md)) is only a *source-sharing* link for the **Apos-specific** `RoundedRectangleRuntime`/`ColoredCircleRuntime` types — **not** a claim that shape support is MonoGame/Skia-only or that raylib lacks it.

Consequence for themes: a rounded/shadowed theme's visual code (`new RectangleRuntime { CornerRadius = …, HasDropshadow = … }`) is portable to raylib at the type level — the shape layer is a non-issue.

## Three source-sharing mechanisms (each is a separate landmine)

1. **GumCommon project reference.** `GumCommon` is the runtime-agnostic core (net8.0 and netstandard2.1, no XNA/WPF). It cherry-picks files from `RenderingLibrary/`, `GumDataTypes/`, `ToolsUtilities/` via `<Compile Include="..\X" Link="..."/>` **and globs its own folder**. MonoGame/Raylib/Skia/Sokol reference it as a project.
2. **Cross-project file links.** `GueDeriving` runtimes are canonical in `MonoGameGum/GueDeriving/` and `<Compile Include ... Link>`-ed into the Raylib/Skia/Sokol csprojs. These are **deliberately excluded** from `GumCoreShared.projitems` (FRB generates its own runtime classes).
3. **FRB shared projects** (the two `../FlatRedBall/...shproj` above) — source-sharing for an out-of-repo consumer on a net6 floor.

## Landmines

- **`RenderingLibrary` is not a built assembly.** It's a source directory distributed by links/projitems, so `RenderingLibrary.*` types exist in *several* compiled assemblies at once.
- **Same-FQN forks.** Because of the above, two files can define the same `RenderingLibrary.X` type for different consumers and silently diverge. Confirmed example: `GumCommon/Content/LoaderManager.cs` (XNA-free; used by every GumCommon-referencing runtime) vs `RenderingLibrary/Content/LoaderManager.cs` (XNA-coupled — `InvalidTexture`, `Initialize`, `LoadOrInvalid`; compiled only by `GumCoreShared.projitems` + FRB `GumPlugin.csproj`). Editing one does not touch the other; placing both in one compilation is a duplicate-type error.
- **Moving a file between a glob'd folder and a linked location requires a csproj edit.** GumCommon and the runtime projects glob their own folders; external shared files are explicit links. (E.g. relocating the shared `LoaderManager` into `GumCommon/Content/` meant dropping its explicit `<Compile Include>` link and removing SkiaGum's `<Compile Remove>`.)
- **projitems / Forms / net6 sync.** Adding/renaming/deleting files under `GumCommon/` or `MonoGameGum/` (and Forms files) has sync obligations to the FRB shared projects, with explicit exceptions (the LoaderManager fork, `GueDeriving`). These rules are authoritative in [frb-build-verification](../frb-build-verification/SKILL.md); follow them there.

## Adding a Skia-based host

`SkiaHostRegistrationTests` (`Tests/Gum.RepoHygiene.Tests`) fails with a list of what to add if a host is missing from `AllLibraries.sln`, `Tests/CiTestProjects.slnf`, the workflow, `windows-test-groups.txt`, `SkiaHost.TestsCommon`, or its docs page, card, `docs/SUMMARY.md` entry, root README row or `Samples/<Host>` (`KniSkiaGum` is exempt from the docs ones). `HostPlatformInfoDriftTests` (`Gum.ProjectServices.Tests`) fails until the host is in `Tools/Gum.ProjectServices/HostPlatformInfo.cs`. A host's tests derive the shared bases in `Tests/SkiaHost.TestsCommon` (`GumServiceContractTestsBase`, `InputSubscriptionTestsBase`, `CursorTestsBase`, `GamePadDriverTestsBase`) and supply a rig instead of copying tests. Resize-cursor mapping (`ApplyHostCustomCursor`) is optional. A host's canvas comes from SkiaGameRendering, GPU only; see [skia-game-rendering](../skia-game-rendering/SKILL.md) before choosing how a new engine gets one. Never add a CPU surface path.

Model it on `Runtimes/KniSkiaGum` or `Runtimes/SilkNetGum`: reference `GumCommon` and `SkiaGum`, set `GumSkiaHostSymbol` and import `Runtimes/SkiaHost.props`, `SkiaInputHost.props` and `SkiaPackages.props`, and derive `GumService` from `GumServiceSkiaInteractiveBase`, and have each `Initialize` overload call `InitializeWithDevices(..., attachDevices)`, assigning device fields and `Clipboard` inside the callback so the base controls the order. The host writes only its device translation: a `Cursor.<Host>.cs` partial (`GetMouseState`, optionally `ApplyHostCustomCursor`), a `Keyboard` deriving from `GumCommon/Input/TablePolledKeyboard.cs` (a Gum-key table plus one device query; derive from `PolledKeyboard.cs` directly for a push model; check the table with `KeyTableCoverage` in `Tests/SkiaHost.TestsCommon`), the `CreateHostCursor`/`CreateHostKeyboard` partial methods on its `GumService`, and a gamepad driver that fills `GamePadSnapshot`. The shared `GumService.SkiaHost.cs` owns what those create, so `Uninitialize` and a second `Initialize` dispose them; a device event subscription made when they are created registers its unsubscribe with `OnDispose` (`PolledKeyboard`, and `Cursor` in `Cursor.SkiaHost.cs`), or the old keyboard keeps receiving text from the engine's window. For GPU rendering, draw into a SkiaGameRendering canvas and hand it to the protected `Draw(SKCanvas)`, never a public member (the canvas `Initialize`, `HandleResize` and `Draw(SKCanvas)` are public only on `SkiaGum.Standalone`; `NoSkiaLeaksTestsBase` fails a host that exposes a Skia type); `KniSkiaGum` goes further and owns the target inside `Draw()` through `SkiaTargetHolder`, so its game never sees a Skia type. A host whose engine has no `Color` type of its own (BRUTAL, Silk.NET) links `Runtimes/SkiaHost/Color.cs`, the XNA-compatible `Gum.Color` that docs snippets assume, and links `Tests/BrutalGum.OGL.Tests/GumColorTests.cs` into its tests; a host whose engine has one (KNI, Stride) links it too, but adds a `Color.<Host>.cs` partial with implicit conversions to the engine's `Color` and compiles it into `Gum.XnaCompat` (symbol `GUM_COLOR_OPT_IN`), not `Gum`, because `using Gum;` plus the engine usings would make every existing `Color` ambiguous (CS0104, which CI caught); its docs page tells users to add `using Color = Gum.XnaCompat.Color;`. Conversions can't live anywhere else: C# allows an implicit operator only on one of the two types, an extension property loses to `SKColor` instance properties, and `SkiaGum` is one assembly typed `SKColor`.

- ⚠ **A host must not define `KNI`, `XNALIKE` or `MONOGAME`.** Those symbols switch the shared `Cursor.cs` to XNA types, which cannot compile next to SkiaGum. Alias the engine's types inside the host's own files instead.
- ⚠ **A host for an engine that has a native runtime mirrors that runtime's API, not Silk's.** `KniSkiaGum` takes `Initialize(game)` with no canvas (size from the game; `Draw()` creates, resizes, presents and, on `Game.Exiting`, disposes the render target), a public `GameTime` of the engine's `GameTime` type, and `Update(GameTime ...)`, like MonoGameGum. Differ only for a technical limit, so docs and ports carry over. `SilkNetGum` follows the same principle: `Initialize(IWindow, ...)` creates the input, GL interface, GRContext and surface, applies resizes at the next `Update`, and `Draw()` resets, draws and flushes, so a Silk game never touches a Skia type for Gum. A host takes what it needs from the engine as an `Initialize` argument.
- ⚠ **A new host is registered by hand in four places:** `AllLibraries.sln`, `Tests/CiTestProjects.slnf` (a missing entry fails the Windows `--no-build` test step), a line in `.github/scripts/macos-test-groups.txt` (the macOS leg's test list), and a test project that derives from `Tests/SkiaHost.TestsCommon` (`SkiaHostTestBase`, `SkiaHostTestFramework`).
- ⚠ **netstandard2.1 builds (Unity) compile out `OperatingSystem.Is*`.** The host sets `Cursor.IsMobile` and `TextBoxBase.ShowNativeKeyboardOnFocus` itself, and supplies files through `FileManager.CustomGetStreamFromFile` when it can't read from disk.
- `Runtimes/UnityGum` is the push-model example: the host pushes input in each frame rather than the runtime polling a device.
- ⚠ **Unity is a supported host (experimental, Unity 6+, Windows and macOS; docs: `docs/code/getting-started/setup/adding-initializing-gum/unity.md`).** It loads the netstandard2.1 `GumCommon` and `SkiaGum` builds, and compiles the game's scripts with its own compiler on an older C# language version than this repo's `LangVersion` 12 (not verified which). Public API that users call must not need newer C# syntax; C# 14 extension properties, for example, would not be usable from Unity.
- ⚠ **Unity IL2CPP needs a `link.xml` preserving `netstandard`.**

## Back-compat shims (`MonoGameGum.*`, `SkiaGum.GueDeriving`, `MonoGameAndGum.*`)

Old names stay as `[Obsolete]` derived classes (or forwarding static classes) in `Shims/` folders: `MonoGameGum/*/Shims`, `Runtimes/GumShapes/*/Shims`, `Runtimes/SkiaGum/GueDeriving/Shims`, `MonoGameGum/GumServiceCompat.cs`. Every one carries a comment above the attribute (`Obsoleted <date>. Warning now; error:true no earlier than May 2027; remove no earlier than November 2027.`) and the same dates in its message; `Tests/Shared/ShimRetention.cs` fails the test for a new shim that skips them. `MonoGameGum.GumService` is the one permanent shim, because `Gum.GumService.Default` returns it. Runtime factories keep constructing shim runtimes so old generated casts succeed.

## Cross-references
- [gum-cross-platform-unification](../gum-cross-platform-unification/SKILL.md) — per-runtime file unification (`#if`/links).
- [frb-build-verification](../frb-build-verification/SKILL.md) — projitems/Forms/net6 sync rules (authoritative).

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in design →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.